summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-02 01:18:42 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-04-02 18:46:47 +0200
commit116b9d6ddf2b61186b29f0370234eec9c1bbe306 (patch)
tree7f90a12333274086e33c4e0fabfd96a8e54e6b6c /test
parentd7ba78e9c7be835a1e2ecdacd25995663e96862f (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 'test')
-rw-r--r--test/source/screenshot_test.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index fdd172f29a68..e699072f37ac 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -24,15 +24,15 @@
namespace {
- void splitHelpId( const OString& rHelpId, OUString& rDirname, OUString &rBasename )
+ void splitHelpId( const OUString& rHelpId, OUString& rDirname, OUString &rBasename )
{
sal_Int32 nIndex = rHelpId.lastIndexOf( '/' );
if( nIndex > 0 )
- rDirname = OStringToOUString( rHelpId.subView( 0, nIndex ), RTL_TEXTENCODING_UTF8 );
+ rDirname = rHelpId.subView( 0, nIndex );
if( rHelpId.getLength() > nIndex+1 )
- rBasename= OStringToOUString( rHelpId.subView( nIndex+1 ), RTL_TEXTENCODING_UTF8 );
+ rBasename = rHelpId.subView( nIndex+1 );
}
}
@@ -71,7 +71,7 @@ void ScreenshotTest::setUp()
}
}
-void ScreenshotTest::implSaveScreenshot(const BitmapEx& rScreenshot, const OString& rScreenshotId)
+void ScreenshotTest::implSaveScreenshot(const BitmapEx& rScreenshot, const OUString& rScreenshotId)
{
OUString aDirname, aBasename;
splitHelpId(rScreenshotId, aDirname, aBasename);
@@ -102,7 +102,7 @@ void ScreenshotTest::saveScreenshot(VclAbstractDialog const & rDialog)
if (!aScreenshot.IsEmpty())
{
- const OString aScreenshotId = rDialog.GetScreenshotId();
+ const OUString aScreenshotId = rDialog.GetScreenshotId();
if (!aScreenshotId.isEmpty())
{
@@ -118,7 +118,7 @@ void ScreenshotTest::saveScreenshot(weld::Window& rDialog)
if (!aScreenshot.IsEmpty())
{
- const OString aScreenshotId = rDialog.get_help_id();
+ const OUString aScreenshotId = rDialog.get_help_id();
assert(!aScreenshotId.isEmpty());
implSaveScreenshot(aScreenshot, aScreenshotId);
}
@@ -138,7 +138,7 @@ VclPtr<VclAbstractDialog> ScreenshotTest::createDialogByName(const OString& rNam
void ScreenshotTest::dumpDialogToPath(VclAbstractDialog& rDialog)
{
- const std::vector<OString> aPageDescriptions(rDialog.getAllPageUIXMLDescriptions());
+ const std::vector<OUString> aPageDescriptions(rDialog.getAllPageUIXMLDescriptions());
if (!aPageDescriptions.empty())
{
@@ -171,14 +171,14 @@ void ScreenshotTest::dumpDialogToPath(weld::Builder& rBuilder)
{
for (int i = 0; i < nPages; ++i)
{
- OString sIdent(xTabCtrl->get_page_ident(i));
+ OUString sIdent(xTabCtrl->get_page_ident(i));
xTabCtrl->set_current_page(sIdent);
if (xTabCtrl->get_current_page_ident() == sIdent)
{
- OString sOrigHelpId(xDialog->get_help_id());
+ OUString sOrigHelpId(xDialog->get_help_id());
// skip empty pages
weld::Container* pPage = xTabCtrl->get_page(sIdent);
- OString sBuildableName(pPage->get_buildable_name());
+ OUString sBuildableName(pPage->get_buildable_name());
if (!sBuildableName.isEmpty() && !sBuildableName.startsWith("__"))
xDialog->set_help_id(pPage->get_help_id());
saveScreenshot(*xDialog);