diff options
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/autoredactdialog.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 8 |
5 files changed, 13 insertions, 13 deletions
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index f9b8ac53ea66..b1bb3c7aed27 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1852,7 +1852,7 @@ void SfxDispatcher::ExecutePopup( const OUString& rResName, vcl::Window* pWin, c std::stringstream aStream; boost::property_tree::write_json(aStream, aRoot, true); if (SfxViewShell* pViewShell = xImp->pFrame->GetViewShell()) - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, aStream.str().c_str()); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, OString(aStream.str())); } else { diff --git a/sfx2/source/doc/autoredactdialog.cxx b/sfx2/source/doc/autoredactdialog.cxx index f84af9622f95..665e5c0ec781 100644 --- a/sfx2/source/doc/autoredactdialog.cxx +++ b/sfx2/source/doc/autoredactdialog.cxx @@ -402,7 +402,7 @@ IMPL_LINK_NOARG(SfxAutoRedactDialog, LoadHdl, sfx2::FileDialogHelper*, void) try { // Create path string, and read JSON from file - std::string sPathStr(OUStringToOString(sTargetsFile, RTL_TEXTENCODING_UTF8).getStr()); + std::string sPathStr(OUStringToOString(sTargetsFile, RTL_TEXTENCODING_UTF8)); boost::property_tree::ptree aTargetsJSON; @@ -459,7 +459,7 @@ IMPL_LINK_NOARG(SfxAutoRedactDialog, SaveHdl, sfx2::FileDialogHelper*, void) aTargetsTree.add_child("RedactionTargets", aTargetsArray); // Create path string, and write JSON to file - std::string sPathStr(OUStringToOString(sTargetsFile, RTL_TEXTENCODING_UTF8).getStr()); + std::string sPathStr(OUStringToOString(sTargetsFile, RTL_TEXTENCODING_UTF8)); boost::property_tree::write_json(sPathStr, aTargetsTree); } diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 2d7b0c31ef6e..78c4fd01f667 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -465,7 +465,7 @@ static void sendErrorToLOK(ErrCode error) std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); - SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, aStream.str().c_str()); + SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, OString(aStream.str())); } namespace diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 1bd5dc58ee86..b967cbb10369 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -227,7 +227,7 @@ void SidebarController::disposeDecks() const std::string hide = UnoNameFromDeckId(msCurrentDeckId, GetCurrentContext()); if (!hide.empty()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, - (hide + "=false").c_str()); + OString(hide + "=false")); } if (mpParentWindow) @@ -802,13 +802,13 @@ void SidebarController::SwitchToDeck ( const std::string hide = UnoNameFromDeckId(msCurrentDeckId, GetCurrentContext()); if (!hide.empty()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, - (hide + "=false").c_str()); + OString(hide + "=false")); } const std::string show = UnoNameFromDeckId(rDeckDescriptor.msId, GetCurrentContext()); if (!show.empty()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, - (show + "=true").c_str()); + OString(show + "=true")); } } @@ -1320,7 +1320,7 @@ void SidebarController::UpdateDeckOpenState() const std::string uno = UnoNameFromDeckId(msCurrentDeckId, GetCurrentContext()); if (!uno.empty()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, - (uno + "=true").c_str()); + OString(uno + "=true")); } } } @@ -1358,7 +1358,7 @@ void SidebarController::UpdateDeckOpenState() const std::string uno = UnoNameFromDeckId(msCurrentDeckId, GetCurrentContext()); if (!uno.empty()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, - (uno + "=false").c_str()); + OString(uno + "=false")); } } } diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 513e9e2270b7..6f7f9ee60dd2 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -18,6 +18,7 @@ #include <com/sun/star/ui/ContextChangeEventObject.hpp> #include <comphelper/processfactory.hxx> +#include <o3tl/string_view.hxx> #include <rtl/strbuf.hxx> #include <vcl/lok.hxx> #include <vcl/svapp.hxx> @@ -408,8 +409,7 @@ static OString lcl_generateJSON(const SfxViewShell* pView, const boost::property aMessageProps.put("mode", pView->getEditMode()); std::stringstream aStream; boost::property_tree::write_json(aStream, aMessageProps, false /* pretty */); - const std::string aString = aStream.str(); - return OString(aString.c_str(), aString.size()).trim(); + return OString(o3tl::trim(aStream.str())); } static inline OString lcl_generateJSON(const SfxViewShell* pView, int nViewId, std::string_view rKey, @@ -552,7 +552,7 @@ void SfxLokHelper::sendUnoStatus(const SfxViewShell* pShell, const SfxPoolItem* std::stringstream aStream; boost::property_tree::write_json(aStream, aItem); - pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aStream.str().c_str()); + pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, OString(aStream.str())); } } @@ -969,7 +969,7 @@ void SfxLokHelper::notifyMediaUpdate(boost::property_tree::ptree& json) boost::property_tree::write_json(aStream, json, /*pretty=*/ false); const std::string str = aStream.str(); - SfxLokHelper::notifyAllViews(LOK_CALLBACK_MEDIA_SHAPE, str.c_str()); + SfxLokHelper::notifyAllViews(LOK_CALLBACK_MEDIA_SHAPE, OString(str)); } bool SfxLokHelper::testInPlaceComponentMouseEventHit(SfxViewShell* pViewShell, int nType, int nX, |