[Libreoffice-commits] core.git: 2 commits - include/tools rsc/inc rsc/source vcl/source

Michael Stahl mstahl at redhat.com
Fri May 27 12:18:33 UTC 2016


 include/tools/rc.h            |    6 ++++++
 rsc/inc/rscdb.hxx             |    3 ++-
 rsc/source/parser/rscicpx.cxx |   17 ++++++++++++++++-
 rsc/source/parser/rscinit.cxx |    3 ++-
 rsc/source/parser/rscyacc.y   |   13 +++++++++++++
 vcl/source/window/dockwin.cxx |   33 ++++++++++++++++++++++++++++++++-
 6 files changed, 71 insertions(+), 4 deletions(-)

New commits:
commit 6c974272423ca19c94d8d5e182fec46836309d60
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri May 27 14:10:46 2016 +0200

    Revert "Remove more RSC_DOCKWINDOW related stuff"
    
    This reverts commit 538a217263230765961f6cabbc8d8e168b3eaac0.
    
    Depends on the previous reverted commit
    
    Change-Id: Ie3cdef43e746712beab31af2abaaede4e53d5506

diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 0cec6cb72..eb02f71 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -105,6 +105,7 @@ void RscTypCont::Init()
     aNmTb.Put( "POS",                POSITION,       (sal_IntPtr)0     );
     aNmTb.Put( "SIZE",               DIMENSION,      (sal_IntPtr)0     );
     aNmTb.Put( "ZoomInOutputSize",   INZOOMOUTPUTSIZE,(sal_IntPtr)0    );
+    aNmTb.Put( "FloatingPos",        FLOATINGPOS,    (sal_IntPtr)0     );
 }
 {
     aShort.SetRange( -32768, 32767 );
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y
index bf96621..43272f2 100644
--- a/rsc/source/parser/rscyacc.y
+++ b/rsc/source/parser/rscyacc.y
@@ -307,6 +307,7 @@ RSCINST GetFirstTupelEle( const RSCINST & rTop )
 %token POSITION
 %token DIMENSION
 %token INZOOMOUTPUTSIZE
+%token FLOATINGPOS
 %token DEFINE
 %token INCLUDE
 %token MACROTARGET
@@ -755,6 +756,18 @@ var_definition
       SetNumber( S.Top(), "_ZOOMINWIDTH", $4 );
       SetNumber( S.Top(), "_ZOOMINHEIGHT", $6 );
   }
+  | FLOATINGPOS '=' CONSTNAME '(' long_expression ',' long_expression
+                                                         ')' ';'
+  {
+      SetConst( S.Top(),      "_FLOATINGPOSMAPMODE", $3.hashid, $3.nValue );
+      SetNumber( S.Top(), "_FLOATINGPOSX", $5 );
+      SetNumber( S.Top(), "_FLOATINGPOSY", $7 );
+  }
+  | FLOATINGPOS '=' '(' long_expression ',' long_expression ')' ';'
+  {
+      SetNumber( S.Top(), "_FLOATINGPOSX", $4 );
+      SetNumber( S.Top(), "_FLOATINGPOSY", $6 );
+  }
 ;
 
 var_header_class
commit ff5ce47439a32d3fe3b6f5461a8e10441d54a8c9
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri May 27 14:08:53 2016 +0200

    Revert "remove unused RSC_DOCKWINDOW flags"
    
    This reverts commit c8754b38ce205845aad5cde3c5ad4070ce38f7d5.
    
    This causes toolkit.AccessibleDropDownListBox to fail with:
     LOG> ImplementationName Unknown, does not implement XServiceInfo
     Exception while getting Environment Couldn't create a test object

diff --git a/include/tools/rc.h b/include/tools/rc.h
index bb6cb3b..cd09254 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -137,6 +137,12 @@ namespace o3tl {
 #define RSC_TOOLBOX_ITEMIMAGELIST       0x40
 #define RSC_TOOLBOX_ITEMLIST            0x80
 
+// For "DockingWindow" resources:
+#define RSC_DOCKINGWINDOW_XYMAPMODE     0x01
+#define RSC_DOCKINGWINDOW_X             0x02
+#define RSC_DOCKINGWINDOW_Y             0x04
+#define RSC_DOCKINGWINDOW_FLOATING      0x08
+
 // For "ImageButtons":
 enum class RscImageButtonFlags {
     Image           = 0x01,
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index adf801f..1fbbb18 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -205,7 +205,8 @@ class RscTypCont
     RscTop *    InitClassNumericField( RscTop * pSuper );
     RscTop *    InitClassMetricField( RscTop * pSuper );
 
-    RscTop *    InitClassDockingWindow( RscTop * pSuper );
+    RscTop *    InitClassDockingWindow( RscTop * pSuper,
+                                        RscEnum * pMapUnit );
     RscTop *    InitClassToolBoxItem( RscTop * pSuper, RscTop * pClassBitmap,
                                       RscTop * pClassImage,
                                       RscEnum * pTriState );
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 30a56b4..ae3b865 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -897,7 +897,8 @@ RscTop * RscTypCont::InitClassMetricField( RscTop * pSuper )
     return pClassMetricField;
 }
 
-RscTop * RscTypCont::InitClassDockingWindow( RscTop * pSuper )
+RscTop * RscTypCont::InitClassDockingWindow( RscTop * pSuper,
+                                             RscEnum * pMapUnit )
 {
     Atom        nId;
     RscTop *    pClassDockWindow;
@@ -908,6 +909,20 @@ RscTop * RscTypCont::InitClassDockingWindow( RscTop * pSuper )
     pClassDockWindow->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType );
     aNmTb.Put( nId, CLASSNAME, pClassDockWindow );
 
+    // initialize variables
+    nId = aNmTb.Put( "_FloatingPosMapMode", VARNAME );
+    pClassDockWindow->SetVariable( nId, pMapUnit, nullptr, 0,
+                                   RSC_DOCKINGWINDOW_XYMAPMODE  );
+    nId = aNmTb.Put( "_FloatingPosX", VARNAME );
+    pClassDockWindow->SetVariable( nId, &aShort, nullptr, 0,
+                                   RSC_DOCKINGWINDOW_X );
+    nId = aNmTb.Put( "_FloatingPosY", VARNAME );
+    pClassDockWindow->SetVariable( nId, &aShort, nullptr, 0,
+                                   RSC_DOCKINGWINDOW_Y );
+    nId = aNmTb.Put( "FloatingMode", VARNAME );
+    pClassDockWindow->SetVariable( nId, &aBool, nullptr, 0,
+                                   RSC_DOCKINGWINDOW_FLOATING );
+
     INS_WINBIT(pClassDockWindow,Moveable)
     INS_WINBIT(pClassDockWindow,Sizeable)
     INS_WINBIT(pClassDockWindow,EnableResizing)
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 10b5f31..0cec6cb72 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -409,7 +409,7 @@ void RscTypCont::Init()
     }
 }
 {
-    RscTop* pClassDockingWindow = InitClassDockingWindow( pClassWindow );
+    RscTop* pClassDockingWindow = InitClassDockingWindow( pClassWindow, pMapUnit );
     pRoot->Insert( pClassDockingWindow );
 
     RscTop* pClassToolBoxItem = InitClassToolBoxItem( pClassMgr, pClassBitmap,
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index ddcd079..984d713 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -380,7 +380,38 @@ void DockingWindow::ImplLoadRes( const ResId& rResId )
 {
     Window::ImplLoadRes( rResId );
 
-    ReadLongRes();
+    const sal_uInt32 nMask = ReadLongRes();
+
+    if ( (RSC_DOCKINGWINDOW_XYMAPMODE | RSC_DOCKINGWINDOW_X |
+          RSC_DOCKINGWINDOW_Y) & nMask )
+    {
+        // use Sizes of the Resource
+        Point   aPos;
+        MapUnit ePosMap = MAP_PIXEL;
+
+        if ( RSC_DOCKINGWINDOW_XYMAPMODE & nMask )
+            ePosMap = (MapUnit)ReadLongRes();
+
+        if ( RSC_DOCKINGWINDOW_X & nMask )
+        {
+            aPos.X() = ReadShortRes();
+            aPos.X() = ImplLogicUnitToPixelX( aPos.X(), ePosMap );
+        }
+
+        if ( RSC_DOCKINGWINDOW_Y & nMask )
+        {
+            aPos.Y() = ReadShortRes();
+            aPos.Y() = ImplLogicUnitToPixelY( aPos.Y(), ePosMap );
+        }
+
+        SetFloatingPos( aPos );
+    }
+
+    if ( nMask & RSC_DOCKINGWINDOW_FLOATING )
+    {
+        if ( ReadShortRes() != 0 )
+            SetFloatingMode( true );
+    }
 }
 
 DockingWindow::DockingWindow( WindowType nType ) :


More information about the Libreoffice-commits mailing list