Author: af
Date: Fri Mar 22 15:59:04 2013
New Revision: 1459857

URL: http://svn.apache.org/r1459857
Log:
i121941: Fixed and activated the gallery panel.

Removed:
    
openoffice/branches/sidebar/main/svx/source/sidebar/gallery/GalleryControl.hxx
Modified:
    
openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
    openoffice/branches/sidebar/main/svx/inc/GalleryControl.hxx
    openoffice/branches/sidebar/main/svx/source/gallery2/GalleryControl.cxx
    openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx

Modified: 
openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu?rev=1459857&r1=1459856&r2=1459857&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
 (original)
+++ 
openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
 Fri Mar 22 15:59:04 2013
@@ -43,32 +43,27 @@
           <value>100</value>
         </prop>
       </node>
-      <!--
-          <node oor:name="GalleryDeck" oor:op="replace">
-          <prop oor:name="Title" oor:type="xs:string">
+
+      <node oor:name="GalleryDeck" oor:op="replace">
+       <prop oor:name="Title" oor:type="xs:string">
           <value xml:lang="en-US">Gallery</value>
-          </prop>
-          <prop oor:name="Id" oor:type="xs:string">
+       </prop>
+       <prop oor:name="Id" oor:type="xs:string">
           <value>GalleryDeck</value>
-          </prop>
-          <prop oor:name="IconURL" oor:type="xs:string">
+       </prop>
+       <prop oor:name="IconURL" oor:type="xs:string">
           
<value>private:graphicrepository/sfx2/res/symphony/hpaneldock04_sd.png</value>
-          </prop>
-          <node oor:name="ContextMatchers">
-          <node oor:name="matcher1"  oor:op="replace">
-          <prop oor:name="Application" oor:type="xs:string">
-          <value>any</value>
-          </prop>
-          <prop oor:name="ContextList">
-          <value>any</value>
-          </prop>
-          </node>
-          </node>
-          <prop oor:name="OrderIndex" oor:type="xs:int">
+       </prop>
+        <prop oor:name="ContextList">
+          <value oor:separator=";">
+            any, any, visible ;
+          </value>
+        </prop>
+       <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>150</value>
-          </prop>
-          </node>
-      -->
+       </prop>
+      </node>
+
       <node oor:name="ImpressMasterPagesDeck" oor:op="replace">
         <prop oor:name="Title" oor:type="xs:string">
           <value xml:lang="en-US">MasterPages</value>
@@ -311,35 +306,29 @@
         </prop>
       </node>
 
-      <!--
-          <node oor:name="GalleryPanel" oor:op="replace">
-          <prop oor:name="Title" oor:type="xs:string">
+      <node oor:name="GalleryPanel" oor:op="replace">
+       <prop oor:name="Title" oor:type="xs:string">
           <value xml:lang="en-US">Gallery</value>
-          </prop>
-          <prop oor:name="Id" oor:type="xs:string">
+       </prop>
+       <prop oor:name="Id" oor:type="xs:string">
           <value>GalleryPanel</value>
-          </prop>
-          <prop oor:name="DeckId" oor:type="xs:string">
+       </prop>
+       <prop oor:name="DeckId" oor:type="xs:string">
           <value>GalleryDeck</value>
-          </prop>
-          <node oor:name="ContextMatchers">
-          <node oor:name="matcher1"  oor:op="replace">
-          <prop oor:name="Application" oor:type="xs:string">
-          <value>any</value>
-          </prop>
-          <prop oor:name="ContextList">
-          <value>any</value>
-          </prop>
-          </node>
-          </node>
-          <prop oor:name="ImplementationURL" oor:type="xs:string">
+       </prop>
+        <prop oor:name="ContextList">
+          <value oor:separator=";">
+            any, any, visible ;
+          </value>
+        </prop>
+       <prop oor:name="ImplementationURL" oor:type="xs:string">
           
<value>private:resource/toolpanel/SvxPanelFactory/GalleryPanel</value>
-          </prop>
-          <prop oor:name="OrderIndex" oor:type="xs:int">
+       </prop>
+       <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
-          </prop>
-          </node>
-      -->
+       </prop>
+      </node>
+
       <node oor:name="PosSizePropertyPanel" oor:op="replace">
         <prop oor:name="Title" oor:type="xs:string">
           <value xml:lang="en-US">Position and Size</value>

Modified: openoffice/branches/sidebar/main/svx/inc/GalleryControl.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/inc/GalleryControl.hxx?rev=1459857&r1=1459856&r2=1459857&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/inc/GalleryControl.hxx (original)
+++ openoffice/branches/sidebar/main/svx/inc/GalleryControl.hxx Fri Mar 22 
15:59:04 2013
@@ -54,6 +54,7 @@ private:
     ::boost::scoped_ptr<GalleryBrowser1> mpBrowser1;
     ::boost::scoped_ptr<GalleryBrowser2> mpBrowser2;
        Size maLastSize;
+    bool mbIsInitialResize;
 
     void InitSettings (void);
 

Modified: 
openoffice/branches/sidebar/main/svx/source/gallery2/GalleryControl.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/gallery2/GalleryControl.cxx?rev=1459857&r1=1459856&r2=1459857&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/gallery2/GalleryControl.cxx 
(original)
+++ openoffice/branches/sidebar/main/svx/source/gallery2/GalleryControl.cxx Fri 
Mar 22 15:59:04 2013
@@ -35,6 +35,9 @@
 
 namespace svx { namespace sidebar {
 
+static const sal_Int32 gnInitialVerticalSplitPosition (150);
+
+
 GalleryControl::GalleryControl (
     SfxBindings* pBindings,
     Window* pParentWindow)
@@ -51,17 +54,19 @@ GalleryControl::GalleryControl (
               GAL_RESID(GALLERY_SPLITTER),
               ::boost::bind(&GalleryControl::InitSettings, this))),
       mpBrowser2(new GalleryBrowser2(this, GAL_RESID(GALLERY_BROWSER2), 
mpGallery)),
-      maLastSize(0,0)
+      maLastSize(GetOutputSizePixel()),
+      mbIsInitialResize(true)
 {
     FreeResource();
-    //    SetMinOutputSizePixel(maLastSize);
-    SetSizePixel(Size(300,300));
+
+    //    SetSizePixel(Size(300,600));
     
     mpBrowser1->SelectTheme(0);
     mpBrowser1->Show(sal_True);
+
     mpBrowser2->Show(sal_True);
 
-    mpSplitter->SetHorizontal(true);
+    mpSplitter->SetHorizontal(false);
        mpSplitter->SetSplitHdl( LINK( this, GalleryControl, SplitHdl ) );
        mpSplitter->Show( sal_True );
 
@@ -107,15 +112,28 @@ void GalleryControl::Resize (void)
 
     // update hor/ver
     const Size aNewSize( GetOutputSizePixel() );
+    if (aNewSize.Width()<=0 || aNewSize.Height()<=0)
+        return;
+    
     const bool bNewLayoutHorizontal(aNewSize.Width() > aNewSize.Height());
     const bool bOldLayoutHorizontal(mpSplitter->IsHorizontal());
-    const long nSplitPos( bOldLayoutHorizontal ? mpSplitter->GetPosPixel().X() 
: mpSplitter->GetPosPixel().Y());
+    long nSplitPos( bOldLayoutHorizontal ? mpSplitter->GetPosPixel().X() : 
mpSplitter->GetPosPixel().Y());
     const long nSplitSize( bOldLayoutHorizontal ? 
mpSplitter->GetOutputSizePixel().Width() : 
mpSplitter->GetOutputSizePixel().Height());
 
     if(bNewLayoutHorizontal != bOldLayoutHorizontal)
     {
         mpSplitter->SetHorizontal(bNewLayoutHorizontal);
     }
+    else
+    {
+        if (mbIsInitialResize)
+        {
+            nSplitPos = gnInitialVerticalSplitPosition;
+            if (nSplitPos > aNewSize.Height()/2)
+                nSplitPos = aNewSize.Height()/2;
+        }
+    }
+    mbIsInitialResize = false;
 
     const long nFrameLen = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
     const long nFrameLen2 = nFrameLen << 1;

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx?rev=1459857&r1=1459856&r2=1459857&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx 
(original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx Fri 
Mar 22 15:59:04 2013
@@ -26,7 +26,7 @@
 #include "graphic/GraphicPropertyPanel.hxx"
 #include "line/LinePropertyPanel.hxx"
 #include "possize/PosSizePropertyPanel.hxx"
-#include "gallery/GalleryControl.hxx"
+#include "GalleryControl.hxx"
 #include "debug/ColorPanel.hxx"
 #include "debug/ContextPanel.hxx"
 #include "debug/NotYetImplementedPanel.hxx"


Reply via email to