Commit Graph

757 Commits

Author SHA1 Message Date
582ef22d3e fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.

Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-16 17:44:44 +02:00
ad9498f8b8 More -Werror,-Wunused-private-field
...detected with a modified trunk Clang with

> Index: lib/Sema/SemaDeclCXX.cpp
> ===================================================================
> --- lib/Sema/SemaDeclCXX.cpp	(revision 219190)
> +++ lib/Sema/SemaDeclCXX.cpp	(working copy)
> @@ -1917,9 +1917,10 @@
>    const Type *T = FD.getType()->getBaseElementTypeUnsafe();
>    // FIXME: Destruction of ObjC lifetime types has side-effects.
>    if (const CXXRecordDecl *RD = T->getAsCXXRecordDecl())
> -    return !RD->isCompleteDefinition() ||
> -           !RD->hasTrivialDefaultConstructor() ||
> -           !RD->hasTrivialDestructor();
> +    return !RD->hasAttr<WarnUnusedAttr>() &&
> +           (!RD->isCompleteDefinition() ||
> +            !RD->hasTrivialDefaultConstructor() ||
> +            !RD->hasTrivialDestructor());
>    return false;
>  }
>
> @@ -3517,9 +3518,11 @@
>    bool addFieldInitializer(CXXCtorInitializer *Init) {
>      AllToInit.push_back(Init);
>
> +#if 0
>      // Check whether this initializer makes the field "used".
>      if (Init->getInit()->HasSideEffects(S.Context))
>        S.UnusedPrivateFields.remove(Init->getAnyMember());
> +#endif
>
>      return false;
>    }

to warn about members of SAL_WARN_UNUSED-annotated class types, and warn about
initializations with side effects (cf.
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039602.html>
"-Wunused-private-field distracted by side effects").

Change-Id: I3f3181c4eb8180ca28e1fa3dffc9dbe1002c6628
2014-10-15 15:58:56 +02:00
d9fa1247be fdo#84938: replace SYMBOL_TYPE constants with enum
Change-Id: Ib3763f20d74c22e28d519a9ac47f6f3ab4e31f51
Reviewed-on: https://gerrit.libreoffice.org/11983
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-15 10:13:04 +00:00
a1a83ceb8b Remove commented out code
Change-Id: I1ebcffc9f1b77b9491335c13ca99090385882ec3
2014-10-14 13:01:43 +02:00
2e57092d6f No apparent reason to fix underlying type of PushFlags
Change-Id: I7d578b135c7a1e681a70484bba30ff1e8b33e04d
2014-10-14 13:01:42 +02:00
4be799fc82 build error: specialization in different namespace
Change-Id: Ic1730a49576a663a2e04a2386bd3962a21b6fc48
2014-10-13 17:21:28 +01:00
af5ebbf783 create a macro library for implementing bit-flags types
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
changed from a macro- to a template-based solution.  (Unfortunately MSVC 2012
does not support explicit conversion operators.  Worked around that with
explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and
SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a
baseline that requires unconditional support for them.)

Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
2014-10-13 17:45:57 +02:00
f6d61562d4 vcl: Make ImplFontCharMap a pImpl and move functions to FontCharMap
To do this, I've made FontCharMap a friend class for ImplFontCharMap,
and have moved the functions directly into FontCharMap. In this patch,
I am attempting to stop the direct use of ImplFontCharMap by anything
other than FontCharMap. However, FontCharMap itself requires a
refcounter, so we will use FontCharMapPtr to access the font character
map.

Change-Id: I509b990a8cbd911c5cc1572c7d24fc5348ca06d9
Reviewed-on: https://gerrit.libreoffice.org/11823
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-10-13 09:19:04 +00:00
cb7ede2d99 convert vcl StateChangedType to enum class
Change-Id: Ifa46523619ae7fb8d112525b8df594836e51bb8f
Reviewed-on: https://gerrit.libreoffice.org/11843
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-11 15:14:32 +00:00
47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
4b7b013491 Resolves: fdo#44998 crash when opening context menu of a field
If you right click on a field in an inactive text box, then a mouse down,
context command, mouse up sequence is sent. The mouse up is supposed to be
captured by the context menu here. But it doesn't because the mouse down in
draw sends an artificial mouse down to the editengine which eventually sets up
a MouseCapture window so the context menu doesn't get considered (because it
occurs before the capture window is released) so the mouse up gets send to sd
while the context menu is up and that causes all sorts of havoc.

Change-Id: If3b7c501586f8561be484d0828c630d84644f770
2014-10-07 16:55:08 +01:00
445336074c Remove pointless commented-out 'virtual' keywords
Nobody knows any more what such a metacomment was supposed to mean, if
it had any deeper meaning at all.

Change-Id: Iefb4fedc7b833c09ee0e39b3eb28202229323ef2
2014-10-06 22:39:18 +03:00
a8c9f6bc85 error: 'UCS4' does not name a type
Change-Id: I5f3c5d55d04747c15cdf8aa34b27ceb0cc3f3a92
2014-10-06 07:33:49 +02:00
1bc6b366f7 vcl: document FontCharMap class
Change-Id: I3020c0979ff8ab6b9e959f32d25af9f51857d821
2014-10-06 12:17:28 +11:00
9177329a42 vcl: FontCharMap to use intrusive_ptr ImplFontCharMap
ImplFontCharMap was using it's own reference counting mechanism,
however we can use intrusive_ptr more effectively.

Added a unit test around FontCharMap.

Change-Id: Ifab6ce002fd1df8feb7e017dea3012ff9ea7f18a
Reviewed-on: https://gerrit.libreoffice.org/11804
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-10-06 00:13:38 +00:00
f33002aa5d vcl: tab cleanup of metric.hxx
Change-Id: I7d168f89fc8cb1b5b85c78e260a9ed786a437265
2014-10-04 13:29:56 +10:00
0c2b43b707 Improved striped rows implementation
Some renaming, use variable for row background when not striped

Change-Id: I5b36fc751aa163dbb127406d7aefad01974fa371
2014-10-02 00:59:24 +02:00
fc04f76336 fdo#82577: Handle Time
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11
Time typedef.

Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866
Reviewed-on: https://gerrit.libreoffice.org/11684
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-01 07:34:23 +00:00
0ada00bd9b Improve SvTreeListBox class
It is possible to set alternating rows. Expert Configuration
dialog use it.

Change-Id: Ie43a87ca05be73fdb345fa4866f31c2c36b7cdf1
Reviewed-on: https://gerrit.libreoffice.org/11663
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-09-30 21:00:59 +00:00
d59e33500a fdo#62081 Improve split menu on style dropdown
* Remove "Apply style"
* Add "Update Style Based on Selection"
* A11y:
  * Context menu key: Open submenu
  * Return key: Apply style

Change-Id: Ib2960baa1412a05ea00b0e214d1af0a3d119e852
2014-09-30 20:41:21 +02:00
78f7b8f67a vcl: use DBG_UTIL for additional members in SolarMutexTryAndBuyGuard
... for consistency, and to keep the ODR police away.

Change-Id: Id4bf23be1e57cc29dfed9331d75034a33c2910f8
2014-09-30 17:34:27 +02:00
c9d4a2887c fdo#82577: Handle PolyPolygon
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows
PolyPolygon typedef.

Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-30 11:47:41 +02:00
8dbde0845a fdo#82577: Handle Region
Put the VCL Region class in the vcl namespace. Avoids clash with the X11
Region typedef.

Change-Id: I6e008111df7cf37121fbc3eaabd44a8306338291
2014-09-30 09:58:23 +02:00
0ed0974298 fdo#59299 Personas for bottom toolbars
Change-Id: If823964bf3bb67563504db61b6c5d557cab89243
Reviewed-on: https://gerrit.libreoffice.org/11609
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-09-29 17:44:07 +00:00
b48e90799d vcl: std::auto_ptr -> std::unique_ptr
Change-Id: I5a08186b465b15311c63784506a0ca0e119286e2
2014-09-29 18:37:51 +02:00
c353caee1c loplugin: cstylecast
Change-Id: I53b69a488c70769cbb841db519bc28fd211dc087
2014-09-29 12:50:35 +02:00
26f2da07b1 loplugin: cstylecast
Change-Id: I58ec00d6f8a4cc6188877db1330c5e32c9db12e5
2014-09-29 12:50:34 +02:00
8730974f3d vcl: cleanup headers - remove comments, tabify
Change-Id: I718832960abe07450bc9fdda15297cb5e56f84e4
Reviewed-on: https://gerrit.libreoffice.org/11674
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-09-28 22:57:00 +00:00
423142538e add a RAII class that tries to acquire the SolarMutex and releases it
Motivated by ScCompiler::IsMacro() which has an error return that does
not release the SolarMutex.

Change-Id: I064219bb3c0d68839a133101491d5f8828a26c7a
2014-09-26 23:24:32 +02:00
d61fc0b894 Related: fdo#83010 implement wrapping on reaching NumericFormatter limits
Change-Id: Ia88671cb71a0bcf8cb55ae0d88625b0f28092615
2014-09-25 17:20:31 +01:00
e1a5ae3975 Related: fdo#83010 move NumericFormatter clipping to min/max into one place
Change-Id: I60cfe651a6ec25fc7e482192d908acca25c1ad8b
2014-09-25 17:20:30 +01:00
48e1675ca2 vcl: comment timer classes at least minimally.
Change-Id: Iabc76b3e78afa491a38fa04d648f48f15ac3870e
2014-09-25 16:39:12 +01:00
2162041fab nHighlightedItem only ever set, never read
Change-Id: Ie4b1517e41e09df3c243b6d4ff124f50777e8bc0
2014-09-25 11:17:25 +01:00
0a56da5b11 vcl button: Allow automatic handling of UNO commands (like .uno:Something).
Change-Id: I71c00286dde2e5a01a7a592305c1790f1ed63a93
2014-09-24 09:13:08 +02:00
827c46e7d7 fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.

Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-23 14:11:39 +03:00
8da21eca45 vcl: Allow creation of button content from action name (.uno: commands).
Change-Id: If4b2aef59d45a848fb77de9e1b7bf80d49548a75
2014-09-22 11:57:00 +02:00
2113c50b45 fdo#62104 Optimize thumbnail size by using PNG8 and other tricks
Change-Id: I54ece4a1977fe93c0e7bbb11774bd8657912c6bb
2014-09-22 00:31:49 +02:00
3a7e54f5d2 Convenient function to compress a Graphic to PNG image
Change-Id: I3d30dd4337b6bd3b5b0c7cdf97a8787c4bc37fa3
2014-09-22 00:31:48 +02:00
60e78fbb80 fdo#82577: Handle Font
Put the VCL Font class in the vcl namespace. Avoids clash with the X11
Font typedef.

Change-Id: I1a84f7cad8b31697b9860a3418f7dff794ff6537
2014-09-18 08:54:37 +02:00
079c861f08 fdo#81237: 2D OpenGL charts was upside-down
The problem is that LO drawinglayer uses a coordinate system
with an origin at the top-left corner of the screen, while
OpenGL uses a complete coordinate system (with all four
quarters, e.g.: allows negative values). The points in
LO are always positive values which means they are drawn
in the first quarter of the OpenGL coordinate system which
also means that the origin is at the bottom-left corner
of the scene. This difference causes the flipped scene.

* To solve that problem scale the projection matrix with -1.0f
along the y axis.
* glDisable(GL_CULL_FACE) is necessary to avoid dropping primitives
after scaling with -1.0.
* Since projection matrix mirrors also the textures we don't need to
do that inside the ConvertBitmapExToRGBATextureBuffer() method.

Change-Id: Ieba642f3e665778a12368fe50a20865ec8f73514
2014-09-17 09:59:50 +02:00
fdffaef6ea vcl menu: More abstraction around MenuBar to get dynamic_cast to one place.
Change-Id: Idbefee0e4230a3c75646e87143f5c3042221aee9
2014-09-16 10:14:08 +02:00
d2d8cda6c2 vcl menu: Make SelectItem() virtual to eliminate IsMenuBar() call.
Award for the sickiest usage of IsMenuBar().

Change-Id: I194b983b61d0106b3628d364f08b261a03c0c42c
2014-09-16 10:14:08 +02:00
2636ab883a vcl menu: Rename CloseStartedFrom() to ClosePopup() + adapt code.
Fixes a regression from fcc49e118c9da28309dce3389d111a546cba19cd (clicking
outside of an opened menubar's menu did not close the menubar).

Change-Id: Ib6efddd6c250b173469772c7b2ae642b5ef609aa
2014-09-15 20:16:26 +02:00
44c3943446 vcl menu: Move ImplLoadRes()'s body to PopupMenu constructor.
No MenuBar is read via ResId any more.

Change-Id: I7aa9ada7fb8ce1b272c6c92b5429812708027162
2014-09-15 20:16:26 +02:00
58d0b8f1b2 vcl menu: Make MenuBarKeyInput() virtual to eliminate IsMenuBar() call.
Change-Id: I180450b60200bae9e570e6d05d8650660c772661
2014-09-15 20:16:26 +02:00
5ac2c503c0 vcl menu: Make DeactivateMenuBar() virtual to eliminate IsMenuBar() call.
Change-Id: I33ba324a13e2addb678fb801222bd25a21c3ef1b
2014-09-15 12:07:18 +02:00
fcc49e118c vcl menu: Make CloseStartedFrom() virtual to eliminate IsMenuBar() call.
Change-Id: Ifd89b7a9264075b166dd621fcb2c55225e25ea87
2014-09-15 12:07:17 +02:00
051b29e102 convert Edit autocomplete Hdl to boost signals2
Here it also keep track of the connection, as it needs to be explicitly
disconnected in one place.

Change-Id: Id3e2882106ae55c2d880898956a36f84d3ce70ef
2014-09-14 22:07:17 +02:00
d6a83d3f91 convert UserDrawHdl to boost signals2
Note that ImplListBox::userDrawSignal is connected to
ImplListBoxWindow::userDrawSignal to forward the signal, just like
the Link was previously forwarded.

Change-Id: Ic8fc6f51e309bc34fb4e39c13745302649991d0a
2014-09-14 22:07:14 +02:00
96369e97a0 convert ListBox's ImplBtn to use boost signal2
Change-Id: I18680e47688da02c9e211bf7f8d861622735e749
2014-09-14 22:07:11 +02:00