diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-02 01:18:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-02 18:46:47 +0200 |
commit | 116b9d6ddf2b61186b29f0370234eec9c1bbe306 (patch) | |
tree | 7f90a12333274086e33c4e0fabfd96a8e54e6b6c /cui/source/factory | |
parent | d7ba78e9c7be835a1e2ecdacd25995663e96862f (diff) |
Avoid conversions between OUString and OString in VCL
Standardize on OUString, which is the main internal string class.
Convert from/to OUString only when communicating with respective
external APIs.
Removes about 200 conversions from the code.
Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui/source/factory')
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 24 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 20 |
2 files changed, 22 insertions, 22 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index f0177530fa70..5478b62ad55c 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -165,7 +165,7 @@ void AbstractSvxCharacterMapDialog_Impl::SetText(const OUString& rStr) m_xDlg->set_title(rStr); } -void CuiAbstractTabController_Impl::SetCurPageId( const OString &rName ) +void CuiAbstractTabController_Impl::SetCurPageId( const OUString &rName ) { m_xDlg->SetCurPageId( rName ); } @@ -191,12 +191,12 @@ void CuiAbstractTabController_Impl::SetText( const OUString& rStr ) m_xDlg->set_title(rStr); } -std::vector<OString> CuiAbstractTabController_Impl::getAllPageUIXMLDescriptions() const +std::vector<OUString> CuiAbstractTabController_Impl::getAllPageUIXMLDescriptions() const { return m_xDlg->getAllPageUIXMLDescriptions(); } -bool CuiAbstractTabController_Impl::selectPageByUIXMLDescription(const OString& rUIXMLDescription) +bool CuiAbstractTabController_Impl::selectPageByUIXMLDescription(const OUString& rUIXMLDescription) { return m_xDlg->selectPageByUIXMLDescription(rUIXMLDescription); } @@ -206,7 +206,7 @@ BitmapEx CuiAbstractTabController_Impl::createScreenshot() const return m_xDlg->createScreenshot(); } -OString CuiAbstractTabController_Impl::GetScreenshotId() const +OUString CuiAbstractTabController_Impl::GetScreenshotId() const { return m_xDlg->GetScreenshotId(); } @@ -466,7 +466,7 @@ bool AbstractSvxSearchSimilarityDialog_Impl::IsRelaxed() } // AbstractSvxTransformTabDialog implementations just forwards everything to the dialog -void AbstractSvxTransformTabDialog_Impl::SetCurPageId( const OString& rName ) +void AbstractSvxTransformTabDialog_Impl::SetCurPageId( const OUString& rName ) { m_xDlg->SetCurPageId( rName ); } @@ -498,7 +498,7 @@ void AbstractSvxTransformTabDialog_Impl::SetValidateFramePosLink( const Link<Svx } // AbstractSvxCaptionDialog implementations just forwards everything to the dialog -void AbstractSvxCaptionDialog_Impl::SetCurPageId( const OString& rName ) +void AbstractSvxCaptionDialog_Impl::SetCurPageId( const OUString& rName ) { m_xDlg->SetCurPageId(rName); } @@ -571,12 +571,12 @@ void AbstractSvxNameDialog_Impl::SetCheckNameTooltipHdl( const Link<AbstractSvxN m_xDlg->SetCheckNameTooltipHdl( Link<SvxNameDialog&,OUString>()); } -void AbstractSvxNameDialog_Impl::SetEditHelpId(const OString& rHelpId) +void AbstractSvxNameDialog_Impl::SetEditHelpId(const OUString& rHelpId) { m_xDlg->SetEditHelpId(rHelpId); } -void AbstractSvxNameDialog_Impl::SetHelpId(const OString& rHelpId) +void AbstractSvxNameDialog_Impl::SetHelpId(const OUString& rHelpId) { m_xDlg->set_help_id(rHelpId); } @@ -691,7 +691,7 @@ Graphic AbstractGraphicFilterDialog_Impl::GetFilteredGraphic(const Graphic& rGra } // AbstractSvxAreaTabDialog implementations just forwards everything to the dialog -void AbstractSvxAreaTabDialog_Impl::SetCurPageId( const OString& rName ) +void AbstractSvxAreaTabDialog_Impl::SetCurPageId( const OUString& rName ) { m_xDlg->SetCurPageId( rName ); } @@ -1409,7 +1409,7 @@ VclPtr<SfxAbstractInsertObjectDialog> AbstractDialogFactory_Impl::CreateInsertOb if ( pDlg ) { - pDlg->SetHelpId( OUStringToOString( rCommand, RTL_TEXTENCODING_UTF8 ) ); + pDlg->SetHelpId(rCommand); return VclPtr<AbstractInsertObjectDialog_Impl>::Create( std::move(pDlg) ); } return nullptr; @@ -1421,7 +1421,7 @@ VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateEditObjectDialog(wel if ( rCommand == ".uno:InsertObjectFloatingFrame" ) { auto pDlg = std::make_unique<SfxInsertFloatingFrameDialog>(pParent, xObj); - pDlg->SetHelpId( OUStringToOString( rCommand, RTL_TEXTENCODING_UTF8 ) ); + pDlg->SetHelpId(rCommand); return VclPtr<AbstractInsertObjectDialog_Impl>::Create( std::move(pDlg) ); } return nullptr; @@ -1460,7 +1460,7 @@ VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateOptionsDialog(weld:: return VclPtr<CuiAbstractController_Impl>::Create(std::make_unique<OfaTreeOptionsDialog>(pParent, rExtensionId)); } -VclPtr<SvxAbstractInsRowColDlg> AbstractDialogFactory_Impl::CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) +VclPtr<SvxAbstractInsRowColDlg> AbstractDialogFactory_Impl::CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OUString& rHelpId) { return VclPtr<SvxInsRowColDlg>::Create(pParent, bCol, rHelpId); } diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 991ec082ad48..8e23592d87b7 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -122,17 +122,17 @@ DECL_ABSTDLG_CLASS_UNIQUE(CuiAbstractSingleTabController, SfxAbstractDialog, Sfx // CuiAbstractTabController_Impl DECL_ABSTDLG_CLASS_SHARED_ASYNC(CuiAbstractTabController, SfxAbstractTabDialog, SfxTabDialogController) - virtual void SetCurPageId( const OString &rName ) override; + virtual void SetCurPageId( const OUString &rName ) override; virtual const SfxItemSet* GetOutputItemSet() const override; virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet( const SfxItemSet* pInSet ) override; virtual void SetText( const OUString& rStr ) override; // screenshotting - virtual std::vector<OString> getAllPageUIXMLDescriptions() const override; - virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; + virtual std::vector<OUString> getAllPageUIXMLDescriptions() const override; + virtual bool selectPageByUIXMLDescription(const OUString& rUIXMLDescription) override; virtual BitmapEx createScreenshot() const override; - virtual OString GetScreenshotId() const override; + virtual OUString GetScreenshotId() const override; }; // AbstractHangulHanjaConversionDialog_Impl @@ -235,7 +235,7 @@ DECL_ABSTDLG_CLASS(AbstractSvxJSearchOptionsDialog,SvxJSearchOptionsDialog) // AbstractSvxTransformTabDialog_Impl DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxTransformTabDialog,SvxTransformTabDialog) virtual void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) override; - virtual void SetCurPageId( const OString& rName ) override; + virtual void SetCurPageId( const OUString& rName ) override; virtual const SfxItemSet* GetOutputItemSet() const override; virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet( const SfxItemSet* pInSet ) override; @@ -245,7 +245,7 @@ DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxTransformTabDialog,SvxTransformTabDialog) // AbstractSvxCaptionDialog_Impl DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxCaptionDialog,SvxCaptionTabDialog) virtual void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) override; - virtual void SetCurPageId( const OString& rName ) override; + virtual void SetCurPageId( const OUString& rName ) override; virtual const SfxItemSet* GetOutputItemSet() const override; virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet( const SfxItemSet* pInSet ) override; @@ -268,9 +268,9 @@ DECL_ABSTDLG_CLASS(AbstractSvxNameDialog,SvxNameDialog) virtual void GetName( OUString& rName ) override ; virtual void SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& rLink, bool bCheckImmediately = false ) override ; virtual void SetCheckNameTooltipHdl( const Link<AbstractSvxNameDialog&, OUString>& rLink ) override ; - virtual void SetEditHelpId(const OString&) override ; + virtual void SetEditHelpId(const OUString&) override ; //from class Window - virtual void SetHelpId( const OString& ) override ; + virtual void SetHelpId( const OUString& ) override ; virtual void SetText( const OUString& rStr ) override ; private: @@ -334,7 +334,7 @@ DECL_ABSTDLG_CLASS(AbstractGraphicFilterDialog,GraphicFilterDialog) // AbstractSvxAreaTabDialog_Impl DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxAreaTabDialog,SvxAreaTabDialog) - virtual void SetCurPageId(const OString& rName) override; + virtual void SetCurPageId(const OUString& rName) override; virtual const SfxItemSet* GetOutputItemSet() const override; virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet(const SfxItemSet* pInSet) override; @@ -586,7 +586,7 @@ public: virtual VclPtr<VclAbstractDialog> CreateOptionsDialog( weld::Window* pParent, const OUString& rExtensionId ) override; - virtual VclPtr<SvxAbstractInsRowColDlg> CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) override; + virtual VclPtr<SvxAbstractInsRowColDlg> CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OUString& rHelpId) override; virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(weld::Window* pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override; |