[Libreoffice-commits] .: 3 commits - automation/source forms/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Jun 2 03:43:15 PDT 2011


 automation/source/server/statemnt.cxx |   50 +++++++++++++++++-----------------
 automation/source/server/statemnt.hxx |    8 ++++-
 forms/source/component/Columns.cxx    |   21 ++++----------
 3 files changed, 40 insertions(+), 39 deletions(-)

New commits:
commit 2e0e77a1c2fecffd2dbf2a5759c9b63fb8274fc1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 2 00:08:44 2011 +0100

    use standard template here

diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index 339bf65..c30c0a0 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -47,10 +47,10 @@
 #include <comphelper/property.hxx>
 #include <comphelper/basicio.hxx>
 #include <comphelper/types.hxx>
+#include <comphelper/servicehelper.hxx>
 #include "services.hxx"
 #include "frm_resource.hrc"
 #include <tools/debug.hxx>
-#include <rtl/uuid.h>
 #include <rtl/memory.h>
 
 //.........................................................................
@@ -124,21 +124,14 @@ sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName)
 
 /*************************************************************************/
 
-//------------------------------------------------------------------
+namespace
+{
+    class theOGridColumnImplementationId : public rtl::Static< UnoTunnelIdInit, theOGridColumnImplementationId > {};
+}
+
 const Sequence<sal_Int8>& OGridColumn::getUnoTunnelImplementationId()
 {
-    static Sequence< sal_Int8 > * pSeq = 0;
-    if( !pSeq )
-    {
-        ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theOGridColumnImplementationId::get().getSeq();
 }
 
 //------------------------------------------------------------------
commit 1b5358a1124101d0e2e02a7ce229f278eace9c18
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 16:49:19 2011 +0100

    WaE: single value used to multiplex two different things

diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
index e2a12f8..c34915b 100644
--- a/automation/source/server/statemnt.cxx
+++ b/automation/source/server/statemnt.cxx
@@ -674,12 +674,13 @@ StatementCommand::StatementCommand( StatementList *pAfterThis, sal_uInt16 Method
 , nNr2(0)
 , nNr3(0)
 , nNr4(0)
-, nLNr1(0)
 , aString1()
 , aString2()
 , bBool1(sal_False)
 , bBool2(sal_False)
 {
+    nLNr1_and_Pointer.pWindow = 0;
+
     QueStatement( pAfterThis );
 
 #if OSL_DEBUG_LEVEL > 1
@@ -708,12 +709,13 @@ StatementCommand::StatementCommand( SCmdStream *pCmdIn )
 , nNr2(0)
 , nNr3(0)
 , nNr4(0)
-, nLNr1(0)
 , aString1()
 , aString2()
 , bBool1(sal_False)
 , bBool2(sal_False)
 {
+    nLNr1_and_Pointer.pWindow = 0;
+
     QueStatement( NULL );
     pCmdIn->Read( nMethodId );
     pCmdIn->Read( nParams );
@@ -722,7 +724,7 @@ StatementCommand::StatementCommand( SCmdStream *pCmdIn )
     if( nParams & PARAM_UINT16_2 )	pCmdIn->Read( nNr2 );
     if( nParams & PARAM_UINT16_3 )	pCmdIn->Read( nNr3 );
     if( nParams & PARAM_UINT16_4 )	pCmdIn->Read( nNr4 );
-    if( nParams & PARAM_UINT32_1 )	pCmdIn->Read( nLNr1 );
+    if( nParams & PARAM_UINT32_1 )	pCmdIn->Read( nLNr1_and_Pointer.nLNr1 );
     if( nParams & PARAM_STR_1 )		pCmdIn->Read( aString1 );
     if( nParams & PARAM_STR_2 )		pCmdIn->Read( aString2 );
     if( nParams & PARAM_BOOL_1 )	pCmdIn->Read( bBool1 );
@@ -1368,18 +1370,18 @@ sal_Bool StatementCommand::DisplayHID()
         if ( !(nParams & PARAM_UINT32_1) )
         {
             if( GetTTSettings()->pDisplayHidWin )	// Nichts ver�ndern
-                nLNr1 = GetTTSettings()->pDisplayHidWin->GetConfig();
+                nLNr1_and_Pointer.nLNr1 = GetTTSettings()->pDisplayHidWin->GetConfig();
             else	// Beim ersten Aufruf wollen wir alles richtig einstellen
-                nLNr1 = DH_MODE_KURZNAME | DH_MODE_LANGNAME;
+                nLNr1_and_Pointer.nLNr1 = DH_MODE_KURZNAME | DH_MODE_LANGNAME;
 
             if( ((nParams & PARAM_BOOL_1) && bBool1) )
-                nLNr1 |= DH_MODE_SEND_DATA;
+                nLNr1_and_Pointer.nLNr1 |= DH_MODE_SEND_DATA;
             else
-                nLNr1 &= ( ~DH_MODE_SEND_DATA );
+                nLNr1_and_Pointer.nLNr1 &= ( ~DH_MODE_SEND_DATA );
         }
 
         if ( GetTTSettings()->pDisplayHidWin )
-            GetTTSettings()->pDisplayHidWin->SetConfig( nLNr1 );
+            GetTTSettings()->pDisplayHidWin->SetConfig( nLNr1_and_Pointer.nLNr1 );
     }
 
     if ( GetTTSettings()->pDisplayInstance && GetTTSettings()->pDisplayInstance != this )
@@ -1394,8 +1396,8 @@ sal_Bool StatementCommand::DisplayHID()
         GetTTSettings()->aOriginalCaption = GetTTSettings()->pDisplayHidWin->GetText();
         GetTTSettings()->pDisplayHidWin->Show();
         if ( bBool1 )
-            nLNr1 |= DH_MODE_SEND_DATA;
-        GetTTSettings()->pDisplayHidWin->SetConfig( nLNr1 );
+            nLNr1_and_Pointer.nLNr1 |= DH_MODE_SEND_DATA;
+        GetTTSettings()->pDisplayHidWin->SetConfig( nLNr1_and_Pointer.nLNr1 );
 
         GetTTSettings()->Old = NULL;
         GetTTSettings()->Act = NULL;
@@ -1996,7 +1998,7 @@ void TranslateWin::EnableTranslation()
 void StatementCommand::Translate()
 {
     // Es wurde eine initale UniqueId mitgegeben. Dann nur die dopelten Shortcuts liefern
-    if( (nParams & PARAM_STR_1) && nLNr1 )
+    if( (nParams & PARAM_STR_1) && nLNr1_and_Pointer.nLNr1 )
     {
         String aDouble;
         Window *pWin = SearchTree( Str2Id( aString1 ) ,sal_False );
@@ -2244,10 +2246,10 @@ sal_Bool StatementCommand::Execute()
         case RC_AppDelay:
             if ( !bBool1 )
             {
-                nLNr1 = Time().GetTime() + nNr1/10;
+                nLNr1_and_Pointer.nLNr1 = Time().GetTime() + nNr1/10;
                 bBool1 = sal_True;
             }
-            if ( Time().GetTime() < sal_Int32(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
+            if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) )	// Aktuelle Zeit kleiner Endzeit
                 return sal_False;
             break;
         case RC_DisplayHid:
@@ -2261,7 +2263,7 @@ sal_Bool StatementCommand::Execute()
                     nRetryCount = 150;		// das sollte reichen.
                     bBool1 = sal_True;			// Nur beim ersten mal!
                     nNr1 = 1;				// Welcher Button ist dran?
-                    nLNr1 = 0;				// Speichern des AppWin
+                    nLNr1_and_Pointer.pWindow = 0;				// Speichern des AppWin
                     aString1 = UniString();	// Liste der geschlossenen Fenster
 
                     // So da� nacher auch wieder alles auf Default steht
@@ -2396,9 +2398,9 @@ sal_Bool StatementCommand::Execute()
                                 ((DockingWindow*)pControl)->Close();
 
                                 // Eigentlich nur bei TaskWindows! Hoffen wir mal, da� keine anderen DockingWindows dazwischen hauen.
-                                if ( (Window*)nLNr1 != pControl )
+                                if ( nLNr1_and_Pointer.pWindow != pControl )
                                     nNr1 = 1;		// Zum durchprobieren der Buttons beim Schlie�en
-                                nLNr1 = (sal_uLong)pControl;
+                                nLNr1_and_Pointer.pWindow = pControl;
 
                                 return sal_False;
                             }
@@ -2425,9 +2427,9 @@ sal_Bool StatementCommand::Execute()
                                             pMenu->GetCloserHdl().Call( pMenu );
 
                                             // nur bei TaskWindows!
-                                            if ( (Window*)nLNr1 != pControl )
+                                            if ( nLNr1_and_Pointer.pWindow != pControl )
                                                 nNr1 = 1;		// Zum durchprobieren der Buttons beim Schlie�en
-                                            nLNr1 = (sal_uLong)pControl;
+                                            nLNr1_and_Pointer.pWindow = pControl;
 
                                             return sal_False;
                                         }
@@ -2441,9 +2443,9 @@ sal_Bool StatementCommand::Execute()
                                 ((SystemWindow*)pControl)->Close();
 
                                 // Eigentlich nur bei TaskWindows!
-                                if ( (Window*)nLNr1 != pControl )
+                                if ( nLNr1_and_Pointer.pWindow != pControl )
                                     nNr1 = 1;		// Zum durchprobieren der Buttons beim Schlie�en
-                                nLNr1 = (sal_uLong)pControl;
+                                nLNr1_and_Pointer.pWindow = pControl;
 
                                 return sal_False;
                             }
@@ -2454,10 +2456,10 @@ sal_Bool StatementCommand::Execute()
                 // E.g.: Floating toolbars on a Task which was hidden by another Task before
                 if ( !bBool2 )
                 {
-                    nLNr1 = Time().GetTime() + 100; // 100 = 1 Second
+                    nLNr1_and_Pointer.nLNr1 = Time().GetTime() + 100; // 100 = 1 Second
                     bBool2 = sal_True;
                 }
-                if ( Time().GetTime() < sal_Int32(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
+                if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) )	// Aktuelle Zeit kleiner Endzeit
                     return sal_False;
                 else
                     pRet->GenReturn ( RET_Value, nMethodId, aString1);
@@ -2469,7 +2471,7 @@ sal_Bool StatementCommand::Execute()
                     nNr1 = 1000;    // defaults to 1000 = 1 Sec.
                 if ( !bBool1 )
                 {
-                    nLNr1 = Time().GetTime() + nNr1/10;
+                    nLNr1_and_Pointer.nLNr1 = Time().GetTime() + nNr1/10;
                     bBool1 = sal_True;
                 }
 
@@ -2477,7 +2479,7 @@ sal_Bool StatementCommand::Execute()
                     pRet->GenReturn ( RET_Value, nMethodId, comm_UINT16(CONST_WSFinished) );
                 else
                 {
-                    if ( Time().GetTime() < sal_Int32(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
+                    if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) )	// Aktuelle Zeit kleiner Endzeit
                         return sal_False;
                     pRet->GenReturn ( RET_Value, nMethodId, comm_UINT16(CONST_WSTimeout) );
                 }
diff --git a/automation/source/server/statemnt.hxx b/automation/source/server/statemnt.hxx
index 9fcdd2a..fa8f0ff 100644
--- a/automation/source/server/statemnt.hxx
+++ b/automation/source/server/statemnt.hxx
@@ -330,6 +330,12 @@ public:
     StatementUnoSlot(SCmdStream *pIn);
 };
 
+union munge
+{
+    comm_UINT32 nLNr1;
+    Window *pWindow;
+};
+
 class StatementCommand : public StatementList	// Befehl ausf�hren (wintree, resetaplication ...)
 {
     friend class ImplRemoteControl;
@@ -337,7 +343,7 @@ protected:
     sal_uInt16 nMethodId;
     sal_uInt16 nParams;
     comm_UINT16 nNr1,nNr2,nNr3,nNr4;
-    comm_UINT32 nLNr1;
+    munge nLNr1_and_Pointer;
     String aString1,aString2;
     sal_Bool bBool1,bBool2;
 
commit afd143d0c00533aace836804efa45f59141b8a75
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 16:36:12 2011 +0100

    those times were sal_Int32s

diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
index 2c99aaa..e2a12f8 100644
--- a/automation/source/server/statemnt.cxx
+++ b/automation/source/server/statemnt.cxx
@@ -2247,7 +2247,7 @@ sal_Bool StatementCommand::Execute()
                 nLNr1 = Time().GetTime() + nNr1/10;
                 bBool1 = sal_True;
             }
-            if ( Time().GetTime() < long(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
+            if ( Time().GetTime() < sal_Int32(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
                 return sal_False;
             break;
         case RC_DisplayHid:
@@ -2457,7 +2457,7 @@ sal_Bool StatementCommand::Execute()
                     nLNr1 = Time().GetTime() + 100; // 100 = 1 Second
                     bBool2 = sal_True;
                 }
-                if ( Time().GetTime() < long(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
+                if ( Time().GetTime() < sal_Int32(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
                     return sal_False;
                 else
                     pRet->GenReturn ( RET_Value, nMethodId, aString1);
@@ -2477,7 +2477,7 @@ sal_Bool StatementCommand::Execute()
                     pRet->GenReturn ( RET_Value, nMethodId, comm_UINT16(CONST_WSFinished) );
                 else
                 {
-                    if ( Time().GetTime() < long(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
+                    if ( Time().GetTime() < sal_Int32(nLNr1) )	// Aktuelle Zeit kleiner Endzeit
                         return sal_False;
                     pRet->GenReturn ( RET_Value, nMethodId, comm_UINT16(CONST_WSTimeout) );
                 }


More information about the Libreoffice-commits mailing list