You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2013/05/16 11:51:11 UTC
svn commit: r1483283 - in /openoffice/trunk/main/sfx2/source/sidebar:
SidebarController.cxx SidebarDockingWindow.cxx SidebarDockingWindow.hxx
Author: af
Date: Thu May 16 09:51:11 2013
New Revision: 1483283
URL: http://svn.apache.org/r1483283
Log:
122320: Show closer after docking sidebar. Prevent sidebar from being docked above or below edit view.
Modified:
openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx
openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.cxx
openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.hxx
Modified: openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx?rev=1483283&r1=1483282&r2=1483283&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx Thu May 16 09:51:11 2013
@@ -1022,11 +1022,13 @@ bool SidebarController::CanModifyChildWi
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 (v
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;
}
Modified: openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.cxx?rev=1483283&r1=1483282&r2=1483283&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.cxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.cxx Thu May 16 09:51:11 2013
@@ -108,4 +108,34 @@ sal_Bool SidebarDockingWindow::Close (vo
}
+
+
+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
Modified: openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.hxx?rev=1483283&r1=1483282&r2=1483283&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.hxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/SidebarDockingWindow.hxx Thu May 16 09:51:11 2013
@@ -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;