[Libreoffice-commits] .: 4 commits - cui/source jvmfwk/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 8 01:47:52 PDT 2012


 cui/source/dialogs/scriptdlg.cxx |   10 +++----
 cui/source/factory/dlgfact.cxx   |   46 +++++++++++++++++------------------
 cui/source/factory/dlgfact.hxx   |    8 +++---
 cui/source/inc/scriptdlg.hxx     |    6 ++--
 cui/source/tabpages/border.cxx   |    2 -
 jvmfwk/source/framework.cxx      |   50 ++++++++++++++++++++++++++++++++++-----
 6 files changed, 80 insertions(+), 42 deletions(-)

New commits:
commit 29b8f729d910f604c0a1be0413bf916a23107d8f
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Oct 8 11:40:09 2012 +0300

    Deduplicate lcl_mediumColor
    
    Change-Id: I11556fc7dc2013ce66627e8ab41c91d0742d6866

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index a798682..89bd14f 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1011,7 +1011,7 @@ void SvxBorderTabPage::FillValueSets()
 }
 
 // ============================================================================
-Color lcl_mediumColor( Color aMain, Color /*aDefault*/ )
+static Color lcl_mediumColor( Color aMain, Color /*aDefault*/ )
 {
     return SvxBorderLine::threeDMediumColor( aMain );
 }
commit 39d45c1f55fe71e15aa93a24323972225eaafd86
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Oct 8 11:35:37 2012 +0300

    Deduplication of AbstractTabDialog_Impl and VclAbstractDialog_Impl
    
    Change-Id: Ifda222d842312d084496bc17d3ae6eaf83c13d25

diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 2c9bd96..a97e658 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -101,9 +101,9 @@ using ::com::sun::star::uno::Reference;
 using namespace svx;
 // AbstractTabDialog implementations just forwards everything to the dialog
 IMPL_ABSTDLG_BASE(AbstractSfxDialog_Impl)
-IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl)
+IMPL_ABSTDLG_BASE(CuiVclAbstractDialog_Impl)
 IMPL_ABSTDLG_BASE(VclAbstractRefreshableDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl);
+IMPL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractSvxDistributeDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl);
@@ -191,31 +191,31 @@ IMPL_LINK( VclAbstractDialog2_Impl, EndDialogHdl, Dialog*, pDlg )
 
 //////////////////////////////////////////////////////////////////////////
 
-void AbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId )
+void CuiAbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId )
 {
     pDlg->SetCurPageId( nId );
 }
 
-const SfxItemSet* AbstractTabDialog_Impl::GetOutputItemSet() const
+const SfxItemSet* CuiAbstractTabDialog_Impl::GetOutputItemSet() const
 {
     return pDlg->GetOutputItemSet();
 }
 
-const sal_uInt16* AbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
+const sal_uInt16* CuiAbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
 {
     return pDlg->GetInputRanges( pItem );
 }
 
-void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
+void CuiAbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
 {
      pDlg->SetInputSet( pInSet );
 }
 //From class Window.
-void AbstractTabDialog_Impl::SetText( const XubString& rStr )
+void CuiAbstractTabDialog_Impl::SetText( const XubString& rStr )
 {
     pDlg->SetText( rStr );
 }
-String AbstractTabDialog_Impl::GetText() const
+String CuiAbstractTabDialog_Impl::GetText() const
 {
     return pDlg->GetText();
 }
@@ -1017,7 +1017,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateVclDialog( Window* pParent,
     }
 
     if ( pDlg )
-        return new VclAbstractDialog_Impl( pDlg );
+        return new CuiVclAbstractDialog_Impl( pDlg );
     return 0;
 }
 
@@ -1045,7 +1045,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateFrameDialog(
     }
 
     if ( pDlg )
-        return new VclAbstractDialog_Impl( pDlg );
+        return new CuiVclAbstractDialog_Impl( pDlg );
     else
         return NULL;
 }
@@ -1072,7 +1072,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabDialog( sal_uInt32 nR
     }
 
     if ( pDlg )
-        return new AbstractTabDialog_Impl( pDlg );
+        return new CuiAbstractTabDialog_Impl( pDlg );
     return 0;
 }
 
@@ -1101,7 +1101,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabDialog( sal_uInt32 nR
     }
 
     if ( pDlg )
-        return new AbstractTabDialog_Impl( pDlg );
+        return new CuiAbstractTabDialog_Impl( pDlg );
     return 0;
 }
 
@@ -1112,7 +1112,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTextTabDialog( Window* p
                                             SdrModel* )
 {
     SfxTabDialog* pDlg = new SvxTextTabDialog( pParent, pAttrSet, pView );
-    return new AbstractTabDialog_Impl( pDlg );
+    return new CuiAbstractTabDialog_Impl( pDlg );
 }
 
 // TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog
@@ -1241,7 +1241,7 @@ VclAbstractDialog * AbstractDialogFactory_Impl::CreateSvxScriptOrgDialog( Window
     pDlg = new SvxScriptOrgDialog( pParent, rLanguage);
 
     if ( pDlg )
-        return new VclAbstractDialog_Impl( pDlg );
+        return new CuiVclAbstractDialog_Impl( pDlg );
     return 0;
 }
 
@@ -1317,7 +1317,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabItemDialog( Window* p
     }
 
     if ( pDlg )
-        return new AbstractTabDialog_Impl( pDlg );
+        return new CuiAbstractTabDialog_Impl( pDlg );
     return 0;
 }
 
@@ -1326,7 +1326,7 @@ VclAbstractDialog*      AbstractDialogFactory_Impl::CreateSvxSearchAttributeDial
                                             const sal_uInt16* pWhRanges )
 {
     Dialog* pDlg = new SvxSearchAttributeDialog( pParent, rLst, pWhRanges);
-    return new VclAbstractDialog_Impl( pDlg );
+    return new CuiVclAbstractDialog_Impl( pDlg );
 }
 
 AbstractSvxSearchSimilarityDialog * AbstractDialogFactory_Impl::CreateSvxSearchSimilarityDialog( Window* pParent,
@@ -1346,7 +1346,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg(
                                             sal_Bool bEnableSelector)
 {
     SfxTabDialog* pDlg = new SvxBorderBackgroundDlg( pParent, rCoreSet, bEnableSelector);
-    return new AbstractTabDialog_Impl( pDlg );
+    return new CuiAbstractTabDialog_Impl( pDlg );
 }
 
 AbstractSvxTransformTabDialog* AbstractDialogFactory_Impl::CreateSvxTransformTabDialog( Window* pParent,
@@ -1386,7 +1386,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( W
     }
 
     if ( pDlg )
-        return new AbstractTabDialog_Impl( pDlg );
+        return new CuiAbstractTabDialog_Impl( pDlg );
     return 0;
 }
 
@@ -1439,7 +1439,7 @@ VclAbstractDialog*      AbstractDialogFactory_Impl::CreateSvxEditDictionaryDialo
     }
 
     if ( pDlg )
-        return new VclAbstractDialog_Impl( pDlg );
+        return new CuiVclAbstractDialog_Impl( pDlg );
     return 0;
 }
 
@@ -1602,7 +1602,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxLineTabDialog( Window
                                                                 sal_Bool bHasObj)
 {
     SfxTabDialog* pDlg = new SvxLineTabDialog( pParent, pAttr, pModel,pObj,bHasObj );
-    return new AbstractTabDialog_Impl( pDlg );
+    return new CuiAbstractTabDialog_Impl( pDlg );
 }
 
 SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent,
@@ -1889,7 +1889,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateEditObjectDialog( Window* p
     {
         pDlg = new SfxInsertFloatingFrameDialog( pParent, xObj );
         pDlg->SetHelpId( rtl::OUStringToOString( rCommand, RTL_TEXTENCODING_UTF8 ) );
-        return new VclAbstractDialog_Impl( pDlg );
+        return new CuiVclAbstractDialog_Impl( pDlg );
     }
     return 0;
 }
@@ -1911,7 +1911,7 @@ SfxAbstractLinksDialog* AbstractDialogFactory_Impl::CreateLinksDialog( Window* p
 
 SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* /*pObj*/ )
 {
-    return new AbstractTabDialog_Impl( new SvxFormatCellsDialog( pParent, pAttr, pModel ) );
+    return new CuiAbstractTabDialog_Impl( new SvxFormatCellsDialog( pParent, pAttr, pModel ) );
 }
 
 SvxAbstractSplittTableDialog* AbstractDialogFactory_Impl::CreateSvxSplittTableDialog( Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )
@@ -1927,7 +1927,7 @@ SvxAbstractNewTableDialog* AbstractDialogFactory_Impl::CreateSvxNewTableDialog(
 VclAbstractDialog* AbstractDialogFactory_Impl::CreateOptionsDialog(
     Window* pParent, const rtl::OUString& rExtensionId, const rtl::OUString& /*rApplicationContext*/ )
 {
-    return new VclAbstractDialog_Impl( new OfaTreeOptionsDialog( pParent, rExtensionId ) );
+    return new CuiVclAbstractDialog_Impl( new OfaTreeOptionsDialog( pParent, rExtensionId ) );
 }
 
 SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( Window* pParent, bool bCol, const rtl::OString& sHelpId )
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 83d6e8e..d90e809 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -95,9 +95,9 @@ private:
 };
 //for GalleryThemeProperties end
 
-class VclAbstractDialog_Impl : public VclAbstractDialog
+class CuiVclAbstractDialog_Impl : public VclAbstractDialog
 {
-    DECL_ABSTDLG_BASE(VclAbstractDialog_Impl,Dialog)
+    DECL_ABSTDLG_BASE(CuiVclAbstractDialog_Impl,Dialog)
 };
 
 //for ActualizeProgress begin
@@ -119,9 +119,9 @@ class AbstractSfxDialog_Impl : public SfxAbstractDialog
     virtual String      GetText() const ;
 };
 
-class AbstractTabDialog_Impl : public SfxAbstractTabDialog
+class CuiAbstractTabDialog_Impl : public SfxAbstractTabDialog
 {
-    DECL_ABSTDLG_BASE(AbstractTabDialog_Impl,SfxTabDialog)
+    DECL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl,SfxTabDialog)
     virtual void                SetCurPageId( sal_uInt16 nId );
     virtual const SfxItemSet*   GetOutputItemSet() const;
     virtual const sal_uInt16*       GetInputRanges( const SfxItemPool& pItem );
commit 0a6be648dbe084625e72f91d4c906e88776bf77f
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Oct 8 11:20:56 2012 +0300

    Deduplicate InputDialog (for disable-dynloading)
    
    Change-Id: Id1522e1874ed2b65f7bd8d379b93c35941a7d0b5

diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index f9b0f09..c1faf05 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -427,9 +427,9 @@ void SFTreeListBox::ExpandedHdl()
 }
 
 // ----------------------------------------------------------------------------
-// InputDialog ------------------------------------------------------------
+// CuiInputDialog ------------------------------------------------------------
 // ----------------------------------------------------------------------------
-InputDialog::InputDialog(Window * pParent, sal_uInt16 nMode )
+CuiInputDialog::CuiInputDialog(Window * pParent, sal_uInt16 nMode )
     : ModalDialog( pParent, CUI_RES( RID_DLG_NEWLIB ) ),
         aText( this, CUI_RES( FT_NEWLIB ) ),
         aEdit( this, CUI_RES( ED_LIBNAME ) ),
@@ -484,7 +484,7 @@ InputDialog::InputDialog(Window * pParent, sal_uInt16 nMode )
 
 }
 
-InputDialog::~InputDialog()
+CuiInputDialog::~CuiInputDialog()
 {
 }
 // ----------------------------------------------------------------------------
@@ -933,7 +933,7 @@ void SvxScriptOrgDialog::createEntry( SvLBoxEntry* pEntry )
         }
 
         SAL_WNODEPRECATED_DECLARATIONS_PUSH
-        std::auto_ptr< InputDialog > xNewDlg( new InputDialog( static_cast<Window*>(this), nMode ) );
+        std::auto_ptr< CuiInputDialog > xNewDlg( new CuiInputDialog( static_cast<Window*>(this), nMode ) );
         SAL_WNODEPRECATED_DECLARATIONS_POP
         xNewDlg->SetObjectName( aNewName );
 
@@ -1065,7 +1065,7 @@ void SvxScriptOrgDialog::renameEntry( SvLBoxEntry* pEntry )
         sal_uInt16 nMode = INPUTMODE_RENAME;
 
         SAL_WNODEPRECATED_DECLARATIONS_PUSH
-        std::auto_ptr< InputDialog > xNewDlg( new InputDialog( static_cast<Window*>(this), nMode ) );
+        std::auto_ptr< CuiInputDialog > xNewDlg( new CuiInputDialog( static_cast<Window*>(this), nMode ) );
         SAL_WNODEPRECATED_DECLARATIONS_POP
         xNewDlg->SetObjectName( aNewName );
 
diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx
index 9b0a868..514089c 100644
--- a/cui/source/inc/scriptdlg.hxx
+++ b/cui/source/inc/scriptdlg.hxx
@@ -98,7 +98,7 @@ public:
     void deleteAllTree( );
 };
 
-class InputDialog : public ModalDialog
+class CuiInputDialog : public ModalDialog
 {
 private:
     FixedText       aText;
@@ -107,8 +107,8 @@ private:
     CancelButton    aCancelButton;
 
 public:
-    InputDialog( Window * pParent, sal_uInt16 nMode );
-                ~InputDialog();
+    CuiInputDialog( Window * pParent, sal_uInt16 nMode );
+    ~CuiInputDialog();
 
     String      GetObjectName() const { return aEdit.GetText(); }
     void        SetObjectName( const String& rName ) { aEdit.SetText( rName ); aEdit.SetSelection( Selection( 0, rName.Len() ) );}
commit ce3ac48c3a7c609503eca8560fa050ff097a3e72
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Oct 8 11:04:57 2012 +0300

    Fix for !SOLAR_JAVA
    
    Change-Id: I43d8680304ef11f2b5f5e3edafcc6af6eca8d601

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 4694bf6..b975c0c 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -42,15 +42,20 @@
 
 #define UNO_JAVA_JFW_JREHOME "UNO_JAVA_JFW_JREHOME"
 namespace {
-JavaVM * g_pJavaVM = NULL;
 
-bool g_bEnabledSwitchedOn = false;
+static bool g_bEnabledSwitchedOn = false;
+
+#ifdef SOLAAR_JAVA
+
+static JavaVM * g_pJavaVM = NULL;
 
 sal_Bool areEqualJavaInfo(
     JavaInfo const * pInfoA,JavaInfo const * pInfoB)
 {
     return jfw_areEqualJavaInfo(pInfoA, pInfoB);
 }
+
+#endif
 }
 
 #ifdef DISABLE_DYNLOADING
@@ -90,6 +95,12 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
 
 javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSize)
 {
+#ifndef SOLAR_JAVA
+    (void) pparInfo;
+    (void) pSize;
+
+    return JFW_E_JAVA_DISABLED;
+#else
     javaFrameworkError retVal = JFW_E_NONE;
     try
     {
@@ -182,13 +193,13 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi
             jfw_plugin_getJavaInfoByPath_ptr jfw_plugin_getJavaInfoByPathFunc =
                 (jfw_plugin_getJavaInfoByPath_ptr) pluginLib.getFunctionSymbol(
                     rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_getJavaInfoByPath")));
+            OSL_ASSERT(jfw_plugin_getJavaInfoByPathFunc);
+            if (jfw_plugin_getJavaInfoByPathFunc == NULL)
+                return JFW_E_ERROR;
 #else
             jfw_plugin_getJavaInfoByPath_ptr jfw_plugin_getJavaInfoByPathFunc =
                 jfw_plugin_getJavaInfoByPath;
 #endif
-            OSL_ASSERT(jfw_plugin_getJavaInfoByPathFunc);
-            if (jfw_plugin_getJavaInfoByPathFunc == NULL)
-                return JFW_E_ERROR;
 
             typedef std::vector<rtl::OUString>::const_iterator citLoc;
             //Check every manually added location
@@ -276,6 +287,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi
         OSL_FAIL(e.message.getStr());
     }
     return retVal;
+#endif
 }
 
 javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOptions,
@@ -287,7 +299,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti
     (void) ppVM;
     (void) ppEnv;
 
-    return JFW_E_ERROR;
+    return JFW_E_JAVA_DISABLED;
 #else
     javaFrameworkError errcode = JFW_E_NONE;
     if (cOptions > 0 && arOptions == NULL)
@@ -477,6 +489,11 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti
  */
 javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
 {
+#ifndef SOLAR_JAVA
+    (void) pInfo;
+
+    return JFW_E_JAVA_DISABLED;
+#else
     javaFrameworkError errcode = JFW_E_NONE;
     try
     {
@@ -682,7 +699,9 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
     }
 
     return errcode;
+#endif
 }
+
 sal_Bool SAL_CALL jfw_areEqualJavaInfo(
     JavaInfo const * pInfoA,JavaInfo const * pInfoB)
 {
@@ -774,6 +793,10 @@ javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo)
 
 javaFrameworkError SAL_CALL jfw_isVMRunning(sal_Bool *bRunning)
 {
+#ifndef SOLAR_JAVA
+    (void) bRunning;
+    return JFW_E_JAVA_DISABLED;
+#else
     osl::MutexGuard guard(jfw::FwkMutex::get());
     if (bRunning == NULL)
         return JFW_E_INVALID_ARG;
@@ -782,11 +805,18 @@ javaFrameworkError SAL_CALL jfw_isVMRunning(sal_Bool *bRunning)
     else
         *bRunning = sal_True;
     return JFW_E_NONE;
+#endif
 }
 
 javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
     rtl_uString *pPath, JavaInfo **ppInfo)
 {
+#ifndef SOLAR_JAVA
+    (void) pPath;
+    (void) ppInfo;
+
+    return JFW_E_JAVA_DISABLED;
+#else
     javaFrameworkError errcode = JFW_E_NONE;
     try
     {
@@ -905,6 +935,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
     }
 
     return errcode;
+#endif
 }
 
 
@@ -1170,6 +1201,12 @@ javaFrameworkError SAL_CALL jfw_getJRELocations(
 
 javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
 {
+#ifndef SOLAR_JAVA
+    (void) pInfo;
+    (void) exist;
+
+    return JFW_E_JAVA_DISABLED;
+#else
     //get the function jfw_plugin_existJRE
     jfw::VendorSettings aVendorSettings;
     jfw::CJavaInfo aInfo;
@@ -1208,6 +1245,7 @@ javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
         ret = JFW_E_ERROR;
     }
     return ret;
+#endif
 }
 
 void SAL_CALL jfw_lock()


More information about the Libreoffice-commits mailing list