[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 3 commits - sal/inc sd/source sfx2/source

Oliver-Rainer Wittmann orw at apache.org
Tue May 21 07:07:26 PDT 2013


 sal/inc/sal/mathconf.h                    |    9 ++++++++-
 sd/source/ui/dlg/navigatr.cxx             |   17 ++++++++++++++---
 sfx2/source/sidebar/DeckDescriptor.cxx    |    6 ++++++
 sfx2/source/sidebar/DeckLayouter.cxx      |    2 +-
 sfx2/source/sidebar/PanelDescriptor.cxx   |    6 ++++++
 sfx2/source/sidebar/ResourceManager.cxx   |   11 +++++++++--
 sfx2/source/sidebar/SidebarController.cxx |    2 ++
 7 files changed, 46 insertions(+), 7 deletions(-)

New commits:
commit 1aead9f230e3953f6049e1700d912d6c14c62e7f
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Tue May 21 13:31:56 2013 +0000

    122260: Calc Navigator - assure that tool box is at least as wide as the tree list box to avoid 'bad' layout when the Navigator is resized.

diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 390726a..ced4e75 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -106,7 +106,8 @@ SdNavigatorWin::SdNavigatorWin(
     maToolbox.SetItemBits( TBI_DRAGTYPE, maToolbox.GetItemBits( TBI_DRAGTYPE ) | TIB_DROPDOWNONLY );
 
     // Shape filter drop down menu.
-    maToolbox.SetItemBits(TBI_SHAPE_FILTER,
+    maToolbox.SetItemBits(
+        TBI_SHAPE_FILTER,
         maToolbox.GetItemBits(TBI_SHAPE_FILTER) | TIB_DROPDOWNONLY);
 
     // TreeListBox
@@ -125,8 +126,18 @@ SdNavigatorWin::SdNavigatorWin(
     nListboxYPos = maTlbObjects.GetPosPixel().Y() + maTlbObjects.GetSizePixel().Height() + 4;
     maLbDocs.SetPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
 
+    // assure that tool box is at least as wide as the tree list box
+    {
+        const Size aTlbSize( maTlbObjects.GetOutputSizePixel() );
+        if ( aTlbSize.Width() > aTbxSize.Width() )
+        {
+            maToolbox.SetPosSizePixel( 0, 0, aTlbSize.Width(), 0, WINDOW_POSSIZE_WIDTH );
+            aTbxSize = maToolbox.GetOutputSizePixel();
+        }
+    }
+
     // set min outputsize after all sizes are known
-    long nFullHeight = nListboxYPos + maLbDocs.GetSizePixel().Height() + 4;
+    const long nFullHeight = nListboxYPos + maLbDocs.GetSizePixel().Height() + 4;
     maSize = GetOutputSizePixel();
     if( maSize.Height() < nFullHeight )
     {
@@ -134,7 +145,7 @@ SdNavigatorWin::SdNavigatorWin(
         SetOutputSizePixel( maSize );
     }
     maMinSize = maSize;
-    long nMinWidth = 2*maToolbox.GetPosPixel().X() + aTbxSize.Width(); // never clip the toolbox
+    const long nMinWidth = 2*maToolbox.GetPosPixel().X() + aTbxSize.Width(); // never clip the toolbox
     if( nMinWidth > maMinSize.Width() )
         maMinSize.Width() = nMinWidth;
     maMinSize.Height() -= 40;
commit ff4875ae18c417a74621559bd2d2e9ad05929a82
Author: Andre Fischer <af at apache.org>
Date:   Tue May 21 13:29:49 2013 +0000

    i122057: Fixed layouting of legacy sidebar panels.

diff --git a/sfx2/source/sidebar/DeckDescriptor.cxx b/sfx2/source/sidebar/DeckDescriptor.cxx
index 8727402..2fa2823 100644
--- a/sfx2/source/sidebar/DeckDescriptor.cxx
+++ b/sfx2/source/sidebar/DeckDescriptor.cxx
@@ -30,9 +30,12 @@ DeckDescriptor::DeckDescriptor (void)
       msId(),
       msIconURL(),
       msHighContrastIconURL(),
+      msTitleBarIconURL(),
+      msHighContrastTitleBarIconURL(),
       msHelpURL(),
       msHelpText(),
       maContextList(),
+      mbIsEnabled(true),
       mnOrderIndex(10000) // Default value as defined in Sidebar.xcs
 {
 }
@@ -45,9 +48,12 @@ DeckDescriptor::DeckDescriptor (const DeckDescriptor& rOther)
       msId(rOther.msId),
       msIconURL(rOther.msIconURL),
       msHighContrastIconURL(rOther.msHighContrastIconURL),
+      msTitleBarIconURL(rOther.msTitleBarIconURL),
+      msHighContrastTitleBarIconURL(rOther.msHighContrastTitleBarIconURL),
       msHelpURL(rOther.msHelpURL),
       msHelpText(rOther.msHelpText),
       maContextList(rOther.maContextList),
+          mbIsEnabled(rOther.mbIsEnabled),
       mnOrderIndex(rOther.mnOrderIndex)
 {
 }
diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx
index 4b2fc18..7154b52 100644
--- a/sfx2/source/sidebar/DeckLayouter.cxx
+++ b/sfx2/source/sidebar/DeckLayouter.cxx
@@ -328,7 +328,7 @@ void DeckLayouter::GetRequestedSizes (
                 if (xPanel.is())
                     aLayoutSize = xPanel->getHeightForWidth(rContentBox.GetWidth());
                 else
-                    aLayoutSize = ui::LayoutSize(MinimalPanelHeight, 0, -1);
+                    aLayoutSize = ui::LayoutSize(MinimalPanelHeight, -1, 0);
             }
         }
         iItem->maLayoutSize = aLayoutSize;
diff --git a/sfx2/source/sidebar/PanelDescriptor.cxx b/sfx2/source/sidebar/PanelDescriptor.cxx
index 20a460f..a602fa0 100644
--- a/sfx2/source/sidebar/PanelDescriptor.cxx
+++ b/sfx2/source/sidebar/PanelDescriptor.cxx
@@ -31,10 +31,13 @@ PanelDescriptor::PanelDescriptor (void)
       mbIsTitleBarOptional(false),
       msId(),
       msDeckId(),
+      msTitleBarIconURL(),
+      msHighContrastTitleBarIconURL(),
       msHelpURL(),
       maContextList(),
       msImplementationURL(),
       mnOrderIndex(10000), // Default value as defined in Sidebar.xcs
+      mbShowForReadOnlyDocuments(false),
       mbWantsCanvas(false)
 {
 }
@@ -47,10 +50,13 @@ PanelDescriptor::PanelDescriptor (const PanelDescriptor& rOther)
       mbIsTitleBarOptional(rOther.mbIsTitleBarOptional),
       msId(rOther.msId),
       msDeckId(rOther.msDeckId),
+      msTitleBarIconURL(rOther.msTitleBarIconURL),
+      msHighContrastTitleBarIconURL(rOther.msHighContrastTitleBarIconURL),
       msHelpURL(rOther.msHelpURL),
       maContextList(rOther.maContextList),
       msImplementationURL(rOther.msImplementationURL),
       mnOrderIndex(rOther.mnOrderIndex),
+      mbShowForReadOnlyDocuments(rOther.mbShowForReadOnlyDocuments),
       mbWantsCanvas(rOther.mbWantsCanvas)
 {
 }
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index b83fa03..8328319 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -546,20 +546,27 @@ void ResourceManager::ReadLegacyAddons (const Reference<frame::XFrame>& rxFrame)
         rDeckDescriptor.msId = rsNodeName;
         rDeckDescriptor.msIconURL = ::comphelper::getString(aChildNode.getNodeValue("ImageURL"));
         rDeckDescriptor.msHighContrastIconURL = rDeckDescriptor.msIconURL;
+        rDeckDescriptor.msTitleBarIconURL = OUString();
+        rDeckDescriptor.msHighContrastTitleBarIconURL = OUString();
         rDeckDescriptor.msHelpURL = ::comphelper::getString(aChildNode.getNodeValue("HelpURL"));
         rDeckDescriptor.msHelpText = rDeckDescriptor.msTitle;
-        rDeckDescriptor.maContextList.AddContextDescription(Context(sModuleName, A2S("any")), true, OUString());
         rDeckDescriptor.mbIsEnabled = true;
+        rDeckDescriptor.mnOrderIndex = 100000 + nReadIndex;
+        rDeckDescriptor.maContextList.AddContextDescription(Context(sModuleName, A2S("any")), true, OUString());
 
         PanelDescriptor& rPanelDescriptor (maPanels[nPanelWriteIndex++]);
         rPanelDescriptor.msTitle = ::comphelper::getString(aChildNode.getNodeValue("UIName"));
         rPanelDescriptor.mbIsTitleBarOptional = true;
         rPanelDescriptor.msId = rsNodeName;
         rPanelDescriptor.msDeckId = rsNodeName;
+        rPanelDescriptor.msTitleBarIconURL = OUString();
+        rPanelDescriptor.msHighContrastTitleBarIconURL = OUString();
         rPanelDescriptor.msHelpURL = ::comphelper::getString(aChildNode.getNodeValue("HelpURL"));
-        rPanelDescriptor.maContextList.AddContextDescription(Context(sModuleName, A2S("any")), true, OUString());
         rPanelDescriptor.msImplementationURL = rsNodeName;
+        rPanelDescriptor.mnOrderIndex = 100000 + nReadIndex;
         rPanelDescriptor.mbShowForReadOnlyDocuments = false;
+        rPanelDescriptor.mbWantsCanvas = false;
+        rPanelDescriptor.maContextList.AddContextDescription(Context(sModuleName, A2S("any")), true, OUString());
     }
 
     // When there where invalid nodes then we have to adapt the size
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 0078418..e49ba24 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -209,6 +209,8 @@ void SAL_CALL SidebarController::disposing (void)
     Theme::GetPropertySet()->removePropertyChangeListener(
         A2S(""),
         static_cast<css::beans::XPropertyChangeListener*>(this));
+
+    maContextChangeUpdate.CancelRequest();
 }
 
 
commit 73365ce29e3fcb5db039da8ce989e99aa6c3eba5
Author: Herbert Dürr <hdu at apache.org>
Date:   Tue May 21 12:45:44 2013 +0000

    prefer standard isfinite()
    
    which should be available in math.h according to C99, C++99, SUSv3, etc.
    unless GCC bug 14608 hits us where cmath undefines isfinite as macro

diff --git a/sal/inc/sal/mathconf.h b/sal/inc/sal/mathconf.h
index aae1470..f60d757 100644
--- a/sal/inc/sal/mathconf.h
+++ b/sal/inc/sal/mathconf.h
@@ -27,6 +27,7 @@
 #include "osl/endian.h"
 
 #include <float.h>
+#include <math.h>
 
 #if defined SOLARIS
 #include <ieeefp.h>
@@ -54,7 +55,13 @@ extern "C" {
 
 
 /* SAL_MATH_FINITE(d): test double d on INFINITY, NaN et al. */
-#if defined( WNT)
+#if defined(__GNUC__)
+    #define SAL_MATH_FINITE(d) __builtin_isfinite(d) // gcc bug 14608
+#elif defined(__STDC__)
+    // isfinite() should be available in math.h according to C99,C++99,SUSv3,etc.
+    // unless GCC bug 14608 hits us where cmath undefines isfinite as macro
+    #define SAL_MATH_FINITE(d) isfinite(d)
+#elif defined( WNT)
 #define SAL_MATH_FINITE(d) _finite(d)
 #elif defined OS2
 #define SAL_MATH_FINITE(d) finite(d)


More information about the Libreoffice-commits mailing list