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

Pavel Janík paveljanik at apache.org
Mon May 13 09:07:51 PDT 2013


 sd/source/ui/view/drviewsa.cxx            |    8 ++------
 sfx2/source/sidebar/DeckTitleBar.cxx      |   15 +++++++++------
 sfx2/source/sidebar/FocusManager.cxx      |    6 +++---
 sfx2/source/sidebar/PanelTitleBar.cxx     |    5 +++++
 sfx2/source/sidebar/Sidebar.hrc           |    3 +++
 sfx2/source/sidebar/Sidebar.src           |    9 +++++++++
 svx/inc/svx/sidebar/SelectionAnalyzer.hxx |    5 +++++
 svx/source/sidebar/SelectionAnalyzer.cxx  |   12 ++++++++++--
 8 files changed, 46 insertions(+), 17 deletions(-)

New commits:
commit d22d2bb3621602a4e2154123976423365d54f552
Author: Pavel Janík <paveljanik at apache.org>
Date:   Mon May 13 15:50:20 2013 +0000

    Retype values properly to prevent compiler warnings.

diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx
index 13f6e37..b1e6dd0 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -282,7 +282,7 @@ bool FocusManager::IsDeckTitleVisible (void) const
 
 void FocusManager::FocusPanel (const sal_Int32 nPanelIndex)
 {
-    if (nPanelIndex<0 || nPanelIndex>=maPanels.size())
+    if (nPanelIndex<0 || nPanelIndex>=static_cast<sal_Int32>(maPanels.size()))
         return;
     Panel& rPanel (*maPanels[nPanelIndex]);
     TitleBar* pTitleBar = rPanel.GetTitleBar();
@@ -496,7 +496,7 @@ void FocusManager::HandleKeyEvent (
                 case PC_PanelToolBox:
                 case PC_PanelContent:
                     // Go to next panel.
-                    if (aLocation.mnIndex < maPanels.size()-1)
+                    if (aLocation.mnIndex < static_cast<sal_Int32>(maPanels.size())-1)
                         FocusPanel(aLocation.mnIndex+1);
                     else
                         FocusButton(0);
@@ -510,7 +510,7 @@ void FocusManager::HandleKeyEvent (
 
                 case PC_TabBar:
                     // Go to next tab bar item.
-                    if (aLocation.mnIndex < maButtons.size()-1)
+                    if (aLocation.mnIndex < static_cast<sal_Int32>(maButtons.size())-1)
                         FocusButton(aLocation.mnIndex + 1);
                     else if (IsDeckTitleVisible())
                         FocusDeckTitle();
commit a97c4ca2c235a4654243cbbdf970800454b5aa56
Author: Andre Fischer <af at apache.org>
Date:   Mon May 13 15:25:51 2013 +0000

    121981: Don't change sidebar context while in Impress table.

diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 211907c..1410116 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -871,14 +871,10 @@ void DrawViewShell::GetAnnotationState (SfxItemSet& rItemSet )
 }
 
 
+
+
 EnumContext::Context DrawViewShell::GetContextForSelection (void) const
 {
-    if (mpDrawView->GetMarkedObjectList().GetMarkCount() == 1)
-        if (mpDrawView->GetTextEditObject() != NULL)
-            if (mpDrawView->GetTextEditOutlinerView() != NULL)
-                return EnumContext::Context_DrawText;
-
-    // All other cases are handled by the SelectionAnalyzer.
     return ::svx::sidebar::SelectionAnalyzer::GetContextForSelection_SD(
         mpDrawView->GetMarkedObjectList(),
         meEditMode == EM_MASTERPAGE,
diff --git a/svx/inc/svx/sidebar/SelectionAnalyzer.hxx b/svx/inc/svx/sidebar/SelectionAnalyzer.hxx
index 3f4fa14..0702a0a 100644
--- a/svx/inc/svx/sidebar/SelectionAnalyzer.hxx
+++ b/svx/inc/svx/sidebar/SelectionAnalyzer.hxx
@@ -31,6 +31,11 @@ class SdrObject;
 
 namespace svx { namespace sidebar {
 
+/** Analyze the current selection of Calc or Draw/Impress documents
+    and return the associated sidebar context.
+
+    The decision is based on heuristics.  Do not expect pretty code.
+*/
 class SVX_DLLPUBLIC SelectionAnalyzer
 {
 public :
diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx b/svx/source/sidebar/SelectionAnalyzer.cxx
index 233ba37..52e1b9f 100644
--- a/svx/source/sidebar/SelectionAnalyzer.cxx
+++ b/svx/source/sidebar/SelectionAnalyzer.cxx
@@ -122,9 +122,17 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD (
         case 1:
         {
             SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-            if ( pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsInEditMode() )
+            if (pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsInEditMode())
             {
-                eContext = EnumContext::Context_DrawText;
+                if (pObj->GetObjIdentifier() == OBJ_TABLE)
+                {
+                    // Let a table object take precedence over text
+                    // edit mode.  The panels for text editing are
+                    // present for table context as well, anyway.
+                    eContext = EnumContext::Context_Table;
+                }
+                else
+                    eContext = EnumContext::Context_DrawText;
             }
             else
             {
commit 2f18055a153f4e66ec72b0c20673032d6edeebab
Author: Andre Fischer <af at apache.org>
Date:   Mon May 13 14:41:07 2013 +0000

    122298: Added quick help texts to title bar buttons of sidebar panels and deck.

diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx
index e0f5e70..8e0c450 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -23,6 +23,8 @@
 
 #include "DeckTitleBar.hxx"
 #include "sfx2/sidebar/Theme.hxx"
+#include "sfx2/sfxresid.hxx"
+#include "Sidebar.hrc"
 
 #include <vcl/image.hxx>
 
@@ -44,16 +46,12 @@ DeckTitleBar::DeckTitleBar (
     : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()),
       mnCloserItemIndex(1),
       maCloserAction(rCloserAction),
-      mbIsCloserVisible(rCloserAction)
+      mbIsCloserVisible(false)
 {
     OSL_ASSERT(pParentWindow != NULL);
 
     if (maCloserAction)
-    {
-        maToolBox.InsertItem(
-            mnCloserItemIndex,
-            Theme::GetImage(Theme::Image_Closer));
-    }
+        SetCloserVisible(true);
 
 #ifdef DEBUG
     SetText(A2S("DeckTitleBar"));
@@ -77,9 +75,14 @@ void DeckTitleBar::SetCloserVisible (const bool bIsCloserVisible)
         mbIsCloserVisible = bIsCloserVisible;
 
         if (mbIsCloserVisible)
+        {
             maToolBox.InsertItem(
                 mnCloserItemIndex,
                 Theme::GetImage(Theme::Image_Closer));
+            maToolBox.SetQuickHelpText(
+                mnCloserItemIndex,
+                String(SfxResId(SFX_STR_SIDEBAR_CLOSE_DECK)));
+        }
         else
             maToolBox.RemoveItem(
                 maToolBox.GetItemPos(mnCloserItemIndex));
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx
index 4327d84..d8bfb25 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -22,6 +22,8 @@
 #include "precompiled_sfx2.hxx"
 
 #include "PanelTitleBar.hxx"
+#include "sfx2/sfxresid.hxx"
+#include "Sidebar.hrc"
 
 #include "Paint.hxx"
 #include "Panel.hxx"
@@ -78,6 +80,9 @@ void PanelTitleBar::SetMenuAction ( const ::boost::function<void(void)>& rMenuAc
             mnMenuItemIndex,
             Theme::GetImage(Theme::Image_PanelMenu));
         maToolBox.SetOutStyle(TOOLBOX_STYLE_FLAT);
+        maToolBox.SetQuickHelpText(
+            mnMenuItemIndex,
+            String(SfxResId(SFX_STR_SIDEBAR_MORE_OPTIONS)));
     }
     else if ( maMenuAction && !rMenuAction )
     {
diff --git a/sfx2/source/sidebar/Sidebar.hrc b/sfx2/source/sidebar/Sidebar.hrc
index 16d868f..4be956c 100644
--- a/sfx2/source/sidebar/Sidebar.hrc
+++ b/sfx2/source/sidebar/Sidebar.hrc
@@ -85,3 +85,6 @@
 #define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL_HC   133
 #define STRING_CUSTOMIZATION                    200
 #define STRING_RESTORE                          201
+
+#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START +  1)
+#define SFX_STR_SIDEBAR_CLOSE_DECK   (RID_SFX_SIDEBAR_START +  2)
diff --git a/sfx2/source/sidebar/Sidebar.src b/sfx2/source/sidebar/Sidebar.src
index 6beb91e..e6b6b6d 100644
--- a/sfx2/source/sidebar/Sidebar.src
+++ b/sfx2/source/sidebar/Sidebar.src
@@ -292,4 +292,13 @@ Resource RID_SIDEBAR_RESOURCE
     };
 };
 
+String SFX_STR_SIDEBAR_MORE_OPTIONS
+{
+    Text [en-US] = "More Options";
+};
+
+String SFX_STR_SIDEBAR_CLOSE_DECK
+{
+    Text [en-US] = "Close Sidebar Deck";
+};
 


More information about the Libreoffice-commits mailing list