[Libreoffice-commits] core.git: chart2/source dbaccess/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 31 16:12:13 UTC 2019


 chart2/source/controller/main/ChartController.cxx          |    3 -
 chart2/source/controller/main/ChartController_Position.cxx |    3 -
 chart2/source/controller/main/ChartController_TextEdit.cxx |    3 -
 chart2/source/controller/main/ShapeController.cxx          |   34 ++++++-------
 dbaccess/source/ui/browser/sbagrid.cxx                     |    2 
 dbaccess/source/ui/inc/TokenWriter.hxx                     |   12 ++--
 dbaccess/source/ui/misc/RowSetDrop.cxx                     |   21 +++-----
 7 files changed, 37 insertions(+), 41 deletions(-)

New commits:
commit 36022becbe25c412460411ab50ecaf7740933dca
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 30 11:07:04 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 31 17:11:14 2019 +0100

    avoid intermediate vcl::Windows
    
    Change-Id: I5d6a03baed2af5801132f3e3a0411867ba60186e
    Reviewed-on: https://gerrit.libreoffice.org/81760
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 9a5917915187..96ec317defa6 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1347,8 +1347,7 @@ void ChartController::executeDispatch_SourceData()
 
         SolarMutexGuard aSolarGuard;
 
-        VclPtr<ChartWindow> xChartWindow(GetChartWindow());
-        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(xChartWindow ? xChartWindow->GetFrameWeld() : nullptr,
+        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetChartFrame(),
                                                        VclMessageType::Question, VclButtonsType::YesNo, SchResId(STR_DLG_REMOVE_DATA_TABLE)));
         // If "No" then just return
         if (xQueryBox->run() == RET_NO)
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 410d67461118..66884dfb2fa8 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -141,9 +141,8 @@ void ChartController::executeDispatch_PositionAndSize(const ::css::uno::Sequence
 
             SolarMutexGuard aGuard;
             SvxAbstractDialogFactory * pFact = SvxAbstractDialogFactory::Create();
-            vcl::Window* pWin = GetChartWindow();
             ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSchTransformTabDialog(
-               pWin ? pWin->GetFrameWeld() : nullptr, &aItemSet, pSdrView, bResizePossible));
+               GetChartFrame(), &aItemSet, pSdrView, bResizePossible));
 
             if( pDlg->Execute() == RET_OK )
             {
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index 9357da198834..57a687467fd6 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -167,8 +167,7 @@ void ChartController::executeDispatch_InsertSpecialCharacter()
     vcl::Font aCurFont = m_pDrawViewWrapper->getOutliner()->GetRefDevice()->GetFont();
     aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), SID_ATTR_CHAR_FONT ) );
 
-    vcl::Window* pWin = GetChartWindow();
-    ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog(pWin ? pWin->GetFrameWeld() : nullptr, aSet, nullptr));
+    ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog(GetChartFrame(), aSet, nullptr));
     if( pDlg->Execute() == RET_OK )
     {
         const SfxItemSet* pSet = pDlg->GetOutputItemSet();
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 7f0eb271fc94..1b8f6613c6b5 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -239,7 +239,7 @@ void ShapeController::executeDispatch_FormatLine()
     SolarMutexGuard aGuard;
     if ( m_pChartController )
     {
-        VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
+        weld::Window* pChartWindow(m_pChartController->GetChartFrame());
         DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
         DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
         if ( pChartWindow && pDrawModelWrapper && pDrawViewWrapper )
@@ -253,7 +253,7 @@ void ShapeController::executeDispatch_FormatLine()
             }
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
             ScopedVclPtr< SfxAbstractTabDialog > pDlg(
-                pFact->CreateSvxLineTabDialog(pChartWindow->GetFrameWeld(), &aAttr, &pDrawModelWrapper->getSdrModel(),
+                pFact->CreateSvxLineTabDialog(pChartWindow, &aAttr, &pDrawModelWrapper->getSdrModel(),
                     pSelectedObj, bHasMarked));
             if ( pDlg->Execute() == RET_OK )
             {
@@ -276,7 +276,7 @@ void ShapeController::executeDispatch_FormatArea()
     SolarMutexGuard aGuard;
     if ( m_pChartController )
     {
-        VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
+        weld::Window* pChartWindow(m_pChartController->GetChartFrame());
         DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
         DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
         if ( pChartWindow && pDrawModelWrapper && pDrawViewWrapper )
@@ -289,7 +289,7 @@ void ShapeController::executeDispatch_FormatArea()
             }
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
             ScopedVclPtr< AbstractSvxAreaTabDialog > pDlg(
-                    pFact->CreateSvxAreaTabDialog(pChartWindow->GetFrameWeld(), &aAttr, &pDrawModelWrapper->getSdrModel(), true));
+                    pFact->CreateSvxAreaTabDialog(pChartWindow, &aAttr, &pDrawModelWrapper->getSdrModel(), true));
             if ( pDlg->Execute() == RET_OK )
             {
                 const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
@@ -311,7 +311,7 @@ void ShapeController::executeDispatch_TextAttributes()
     SolarMutexGuard aGuard;
     if ( m_pChartController )
     {
-        VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
+        weld::Window* pChartWindow(m_pChartController->GetChartFrame());
         DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
         if ( pChartWindow && pDrawViewWrapper )
         {
@@ -323,7 +323,7 @@ void ShapeController::executeDispatch_TextAttributes()
             }
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
             ScopedVclPtr< SfxAbstractTabDialog > pDlg(
-                pFact->CreateTextTabDialog(pChartWindow->GetFrameWeld(), &aAttr, pDrawViewWrapper));
+                pFact->CreateTextTabDialog(pChartWindow, &aAttr, pDrawViewWrapper));
             if ( pDlg->Execute() == RET_OK )
             {
                 const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
@@ -345,7 +345,7 @@ void ShapeController::executeDispatch_TransformDialog()
     SolarMutexGuard aGuard;
     if ( m_pChartController )
     {
-        VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
+        weld::Window* pChartWindow(m_pChartController->GetChartFrame());
         DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
         if ( pChartWindow && pDrawViewWrapper )
         {
@@ -359,7 +359,7 @@ void ShapeController::executeDispatch_TransformDialog()
                 SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 ScopedVclPtr< SfxAbstractTabDialog > pDlg(
-                    pFact->CreateCaptionDialog(pChartWindow->GetFrameWeld(), pDrawViewWrapper));
+                    pFact->CreateCaptionDialog(pChartWindow, pDrawViewWrapper));
                 const sal_uInt16* pRange = pDlg->GetInputRanges( *aAttr.GetPool() );
                 SfxItemSet aCombAttr( *aAttr.GetPool(), pRange );
                 aCombAttr.Put( aAttr );
@@ -377,7 +377,7 @@ void ShapeController::executeDispatch_TransformDialog()
                 SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 ScopedVclPtr< SfxAbstractTabDialog > pDlg(
-                    pFact->CreateSvxTransformTabDialog(pChartWindow->GetFrameWeld(), &aGeoAttr, pDrawViewWrapper));
+                    pFact->CreateSvxTransformTabDialog(pChartWindow, &aGeoAttr, pDrawViewWrapper));
                 if ( pDlg->Execute() == RET_OK )
                 {
                     const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
@@ -402,9 +402,9 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
                 OUString aTitle( pSelectedObj->GetTitle() );
                 OUString aDescription( pSelectedObj->GetDescription() );
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
+                weld::Window* pChartWindow(m_pChartController->GetChartFrame());
                 ScopedVclPtr< AbstractSvxObjectTitleDescDialog > pDlg(
-                    pFact->CreateSvxObjectTitleDescDialog(pChartWindow ? pChartWindow->GetFrameWeld() : nullptr, aTitle, aDescription ) );
+                    pFact->CreateSvxObjectTitleDescDialog(pChartWindow, aTitle, aDescription));
                 if ( pDlg->Execute() == RET_OK )
                 {
                     pDlg->GetTitle( aTitle );
@@ -430,9 +430,9 @@ void ShapeController::executeDispatch_RenameObject()
             {
                 OUString aName = pSelectedObj->GetName();
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
+                weld::Window* pChartWindow(m_pChartController->GetChartFrame());
                 ScopedVclPtr< AbstractSvxObjectNameDialog > pDlg(
-                    pFact->CreateSvxObjectNameDialog(pChartWindow ? pChartWindow->GetFrameWeld() : nullptr, aName));
+                    pFact->CreateSvxObjectNameDialog(pChartWindow, aName));
                 pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
                 if ( pDlg->Execute() == RET_OK )
                 {
@@ -501,7 +501,7 @@ void ShapeController::executeDispatch_FontDialog()
     SolarMutexGuard aGuard;
     if ( m_pChartController )
     {
-        VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
+        weld::Window* pChartWindow(m_pChartController->GetChartFrame());
         DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
         DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
         if ( pChartWindow && pDrawModelWrapper && pDrawViewWrapper )
@@ -509,7 +509,7 @@ void ShapeController::executeDispatch_FontDialog()
             SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
             pDrawViewWrapper->GetAttributes( aAttr );
             ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
-            ShapeFontDialog aDlg(pChartWindow->GetFrameWeld(), &aAttr, &aViewElementListProvider);
+            ShapeFontDialog aDlg(pChartWindow, &aAttr, &aViewElementListProvider);
             if (aDlg.run() == RET_OK)
             {
                 const SfxItemSet* pOutAttr = aDlg.GetOutputItemSet();
@@ -524,7 +524,7 @@ void ShapeController::executeDispatch_ParagraphDialog()
     SolarMutexGuard aGuard;
     if ( m_pChartController )
     {
-        VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
+        weld::Window* pChartWindow(m_pChartController->GetChartFrame());
         DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
         if ( pChartWindow && pDrawViewWrapper )
         {
@@ -544,7 +544,7 @@ void ShapeController::executeDispatch_ParagraphDialog()
             aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
             aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
 
-            ShapeParagraphDialog aDlg(pChartWindow->GetFrameWeld(), &aNewAttr);
+            ShapeParagraphDialog aDlg(pChartWindow, &aNewAttr);
             if (aDlg.run() == RET_OK)
             {
                 const SfxItemSet* pOutAttr = aDlg.GetOutputItemSet();
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 32562da141e7..42ed0377446c 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -1390,7 +1390,7 @@ IMPL_LINK_NOARG(SbaGridControl, AsynchDropEvent, void*, void)
         if ( !bCountFinal )
             setDataSource(nullptr); // detach from grid control
         Reference< XResultSetUpdate > xResultSetUpdate(xDataSource,UNO_QUERY);
-        rtl::Reference<ODatabaseImportExport> pImExport = new ORowSetImportExport(this,xResultSetUpdate,m_aDataDescriptor, getContext());
+        rtl::Reference<ODatabaseImportExport> pImExport = new ORowSetImportExport(GetFrameWeld(),xResultSetUpdate,m_aDataDescriptor, getContext());
         Hide();
         try
         {
diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx
index bebbcff2803f..ca03617b052f 100644
--- a/dbaccess/source/ui/inc/TokenWriter.hxx
+++ b/dbaccess/source/ui/inc/TokenWriter.hxx
@@ -184,8 +184,8 @@ namespace dbaui
         css::uno::Reference< css::sdbc::XResultSetUpdate >    m_xTargetResultSetUpdate;
         css::uno::Reference< css::sdbc::XRowUpdate >          m_xTargetRowUpdate;
         css::uno::Reference< css::sdbc::XResultSetMetaData >  m_xTargetResultSetMetaData;
-        VclPtr<vcl::Window>         m_pParent;
-        bool                        m_bAlreadyAsked;
+        weld::Window*             m_pParent;
+        bool                      m_bAlreadyAsked;
 
         bool insertNewRow();
     protected:
@@ -193,10 +193,10 @@ namespace dbaui
 
     public:
         // export data
-        ORowSetImportExport(vcl::Window* _pParent,
-                            const css::uno::Reference< css::sdbc::XResultSetUpdate >& _xResultSetUpdate,
-                            const svx::ODataAccessDescriptor& _aDataDescriptor,
-                            const css::uno::Reference< css::uno::XComponentContext >& _rM);
+        ORowSetImportExport(weld::Window* pParent,
+                            const css::uno::Reference< css::sdbc::XResultSetUpdate >& xResultSetUpdate,
+                            const svx::ODataAccessDescriptor& aDataDescriptor,
+                            const css::uno::Reference< css::uno::XComponentContext >& rM);
 
         virtual bool Write() override;
         virtual bool Read() override;
diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx
index c402ff3e9f4a..4d67664e011a 100644
--- a/dbaccess/source/ui/misc/RowSetDrop.cxx
+++ b/dbaccess/source/ui/misc/RowSetDrop.cxx
@@ -40,18 +40,17 @@ using namespace ::com::sun::star::sdb;
 using namespace ::com::sun::star::lang;
 
 // export data
-ORowSetImportExport::ORowSetImportExport(   vcl::Window* _pParent,
-                                            const Reference< XResultSetUpdate >& _xResultSetUpdate,
-                                            const svx::ODataAccessDescriptor& _aDataDescriptor,
-                                            const Reference< XComponentContext >& _rM
-                                            )
-                                            : ODatabaseImportExport(_aDataDescriptor,_rM,nullptr)
-                                            ,m_xTargetResultSetUpdate(_xResultSetUpdate)
-                                            ,m_xTargetRowUpdate(_xResultSetUpdate,UNO_QUERY)
-                                            ,m_pParent(_pParent)
+ORowSetImportExport::ORowSetImportExport(weld::Window* pParent,
+                                         const Reference< XResultSetUpdate >& xResultSetUpdate,
+                                         const svx::ODataAccessDescriptor& aDataDescriptor,
+                                         const Reference< XComponentContext >& rM)
+                                            : ODatabaseImportExport(aDataDescriptor,rM,nullptr)
+                                            ,m_xTargetResultSetUpdate(xResultSetUpdate)
+                                            ,m_xTargetRowUpdate(xResultSetUpdate,UNO_QUERY)
+                                            ,m_pParent(pParent)
                                             ,m_bAlreadyAsked(false)
 {
-    OSL_ENSURE(_pParent,"Window can't be null!");
+    OSL_ENSURE(pParent,"Window can't be null!");
 }
 
 void ORowSetImportExport::initialize()
@@ -235,7 +234,7 @@ bool ORowSetImportExport::insertNewRow()
         if(!m_bAlreadyAsked)
         {
             OUString sAskIfContinue = DBA_RES(STR_ERROR_OCCURRED_WHILE_COPYING);
-            OSQLWarningBox aDlg(m_pParent ? m_pParent->GetFrameWeld() : nullptr, sAskIfContinue, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes);
+            OSQLWarningBox aDlg(m_pParent, sAskIfContinue, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes);
             if (aDlg.run() == RET_YES)
                 m_bAlreadyAsked = true;
             else


More information about the Libreoffice-commits mailing list