[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - sfx2/source
Andre Fischer
af at apache.org
Thu May 16 03:07:33 PDT 2013
sfx2/source/sidebar/PanelTitleBar.cxx | 8 ++++++-
sfx2/source/sidebar/Sidebar.hrc | 5 ++--
sfx2/source/sidebar/Sidebar.src | 5 ++++
sfx2/source/sidebar/SidebarController.cxx | 28 ++++++++++++++++---------
sfx2/source/sidebar/SidebarDockingWindow.cxx | 30 +++++++++++++++++++++++++++
sfx2/source/sidebar/SidebarDockingWindow.hxx | 4 +++
6 files changed, 67 insertions(+), 13 deletions(-)
New commits:
commit ca7264d7ab7e8b70693362d60227c7dd7626df8b
Author: Andre Fischer <af at apache.org>
Date: Thu May 16 09:51:11 2013 +0000
122320: Show closer after docking sidebar. Prevent sidebar from being docked above or below edit view.
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 910e6dd..f2f9a4d 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1022,11 +1022,13 @@ bool SidebarController::CanModifyChildWindowWidth (void)
sal_uInt16 nRow (0xffff);
sal_uInt16 nColumn (0xffff);
- pSplitWindow->GetWindowPos(mpParentWindow, nColumn, nRow);
-
- sal_uInt16 nRowCount (pSplitWindow->GetWindowCount(nColumn));
-
- return nRowCount==1;
+ if (pSplitWindow->GetWindowPos(mpParentWindow, nColumn, nRow))
+ {
+ sal_uInt16 nRowCount (pSplitWindow->GetWindowCount(nColumn));
+ return nRowCount==1;
+ }
+ else
+ return false;
}
@@ -1078,17 +1080,23 @@ void SidebarController::RestrictWidth (void)
SfxSplitWindow* SidebarController::GetSplitWindow (void)
{
- if (mpSplitWindow == NULL)
+ if (mpParentWindow != NULL)
{
- if (mpParentWindow != NULL)
+ SfxSplitWindow* pSplitWindow = dynamic_cast<SfxSplitWindow*>(mpParentWindow->GetParent());
+ if (pSplitWindow != mpSplitWindow)
{
- mpSplitWindow = dynamic_cast<SfxSplitWindow*>(mpParentWindow->GetParent());
+ if (mpSplitWindow != NULL)
+ mpSplitWindow->RemoveEventListener(LINK(this, SidebarController, WindowEventHandler));
+
+ mpSplitWindow = pSplitWindow;
+
if (mpSplitWindow != NULL)
mpSplitWindow->AddEventListener(LINK(this, SidebarController, WindowEventHandler));
}
+ return mpSplitWindow;
}
-
- return mpSplitWindow;
+ else
+ return NULL;
}
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index a119613..1b6dcd8 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -108,4 +108,34 @@ sal_Bool SidebarDockingWindow::Close (void)
}
+
+
+SfxChildAlignment SidebarDockingWindow::CheckAlignment (
+ SfxChildAlignment eCurrentAlignment,
+ SfxChildAlignment eRequestedAlignment)
+{
+ switch (eRequestedAlignment)
+ {
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ return eCurrentAlignment;
+
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ return eRequestedAlignment;
+
+ default:
+ return eRequestedAlignment;
+ }
+}
+
+
} } // end of namespace sfx2::sidebar
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.hxx b/sfx2/source/sidebar/SidebarDockingWindow.hxx
index 55347be..338e31e 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.hxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.hxx
@@ -53,6 +53,10 @@ protected:
// Window overridables
virtual void GetFocus (void);
+ virtual SfxChildAlignment CheckAlignment (
+ SfxChildAlignment eCurrentAlignment,
+ SfxChildAlignment eRequestedAlignment);
+
private:
::rtl::Reference<sfx2::sidebar::SidebarController> mpSidebarController;
commit e785c5125994bbfdb4e69108b5a73a184b3ced49
Author: Andre Fischer <af at apache.org>
Date: Thu May 16 08:49:36 2013 +0000
122271: Provide accessible for panels that includes the panel title.
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx
index d8bfb25..7a5191e 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -48,7 +48,7 @@ static const sal_Int32 gaRightIconPadding (5);
PanelTitleBar::PanelTitleBar (
const ::rtl::OUString& rsTitle,
Window* pParentWindow,
- Panel* pPanel )
+ Panel* pPanel)
: TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()),
mbIsLeftButtonDown(false),
mpPanel(pPanel),
@@ -57,6 +57,12 @@ PanelTitleBar::PanelTitleBar (
{
OSL_ASSERT(mpPanel != NULL);
+ const ::rtl::OUString sAccessibleName(
+ String(SfxResId(SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX))
+ + rsTitle);
+ SetAccessibleName(sAccessibleName);
+ SetAccessibleDescription(sAccessibleName);
+
#ifdef DEBUG
SetText(A2S("PanelTitleBar"));
#endif
diff --git a/sfx2/source/sidebar/Sidebar.hrc b/sfx2/source/sidebar/Sidebar.hrc
index 4be956c..51388fc 100644
--- a/sfx2/source/sidebar/Sidebar.hrc
+++ b/sfx2/source/sidebar/Sidebar.hrc
@@ -86,5 +86,6 @@
#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)
+#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1)
+#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2)
+#define SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX (RID_SFX_SIDEBAR_START + 3)
diff --git a/sfx2/source/sidebar/Sidebar.src b/sfx2/source/sidebar/Sidebar.src
index e6b6b6d..aa0c348 100644
--- a/sfx2/source/sidebar/Sidebar.src
+++ b/sfx2/source/sidebar/Sidebar.src
@@ -302,3 +302,8 @@ String SFX_STR_SIDEBAR_CLOSE_DECK
Text [en-US] = "Close Sidebar Deck";
};
+String SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX
+{
+ Text [en-US] = "Panel: ";
+};
+
More information about the Libreoffice-commits
mailing list