accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx   |    6 -
 accessibility/source/extended/AccessibleGridControlTable.cxx     |    6 -
 accessibility/source/extended/AccessibleGridControlTableBase.cxx |    6 -
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx  |    2 
 accessibility/source/extended/accessiblelistboxentry.cxx         |   14 +-
 accessibility/source/extended/accessibletablistbox.cxx           |    2 
 accessibility/source/extended/textwindowaccessibility.cxx        |   48 
+++++-----
 accessibility/source/helper/acc_factory.cxx                      |    4 
 accessibility/source/standard/vclxaccessibleedit.cxx             |    2 
 accessibility/source/standard/vclxaccessibleheaderbaritem.cxx    |    4 
 accessibility/source/standard/vclxaccessiblelist.cxx             |    4 
 accessibility/source/standard/vclxaccessiblelistbox.cxx          |    4 
 accessibility/source/standard/vclxaccessiblelistitem.cxx         |    8 -
 accessibility/source/standard/vclxaccessiblemenubar.cxx          |    4 
 accessibility/source/standard/vclxaccessiblemenuitem.cxx         |    4 
 accessibility/source/standard/vclxaccessiblemenuseparator.cxx    |    4 
 accessibility/source/standard/vclxaccessibleradiobutton.cxx      |    4 
 sw/source/writerfilter/dmapper/FormControlHelper.cxx             |   37 ++-----
 sw/source/writerfilter/dmapper/FormControlHelper.hxx             |    6 -
 19 files changed, 79 insertions(+), 90 deletions(-)

New commits:
commit 6e8f12c44bfe3483f69127f7d5429536249f6c2b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Apr 30 13:48:08 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Apr 30 19:35:48 2024 +0200

    loplugin:ostr in accessibility
    
    Change-Id: Iff3e6af9627aa5d31b00ad48bc6c6ea8d3913fe9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166927
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx 
b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx
index a1ae5a969dcb..044a85958e98 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx
@@ -263,13 +263,13 @@ void 
AccessibleBrowseBoxTableBase::implGetSelectedColumns( Sequence< sal_Int32 >
 void AccessibleBrowseBoxTableBase::ensureIsValidRow( sal_Int32 nRow )
 {
     if( nRow >= implGetRowCount() )
-        throw lang::IndexOutOfBoundsException( "row index is invalid", *this );
+        throw lang::IndexOutOfBoundsException( u"row index is invalid"_ustr, 
*this );
 }
 
 void AccessibleBrowseBoxTableBase::ensureIsValidColumn( sal_Int32 nColumn )
 {
     if( nColumn >= implGetColumnCount() )
-        throw lang::IndexOutOfBoundsException( "column index is invalid", 
*this );
+        throw lang::IndexOutOfBoundsException( u"column index is 
invalid"_ustr, *this );
 }
 
 void AccessibleBrowseBoxTableBase::ensureIsValidAddress(
@@ -282,7 +282,7 @@ void AccessibleBrowseBoxTableBase::ensureIsValidAddress(
 void AccessibleBrowseBoxTableBase::ensureIsValidIndex( sal_Int64 nChildIndex )
 {
     if( nChildIndex >= implGetChildCount() )
-        throw lang::IndexOutOfBoundsException( "child index is invalid", *this 
);
+        throw lang::IndexOutOfBoundsException( u"child index is invalid"_ustr, 
*this );
 }
 
 
diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx 
b/accessibility/source/extended/AccessibleGridControlTable.cxx
index 3b8f0138267e..1f1a0436951c 100644
--- a/accessibility/source/extended/AccessibleGridControlTable.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTable.cxx
@@ -116,7 +116,7 @@ OUString SAL_CALL 
AccessibleGridControlTable::getAccessibleRowDescription( sal_I
 
     ensureIsAlive();
     ensureIsValidRow( nRow );
-    return "row description";
+    return u"row description"_ustr;
 }
 
 OUString SAL_CALL AccessibleGridControlTable::getAccessibleColumnDescription( 
sal_Int32 nColumn )
@@ -125,7 +125,7 @@ OUString SAL_CALL 
AccessibleGridControlTable::getAccessibleColumnDescription( sa
 
     ensureIsAlive();
     ensureIsValidColumn( nColumn );
-    return "col description";
+    return u"col description"_ustr;
 }
 
 Reference< XAccessibleTable > SAL_CALL 
AccessibleGridControlTable::getAccessibleRowHeaders()
@@ -253,7 +253,7 @@ AccessibleGridControlTable::getSelectedAccessibleChild( 
sal_Int64 nSelectedChild
 
     ensureIsAlive();
     if (nSelectedChildIndex < 0 || nSelectedChildIndex >= 
getSelectedAccessibleChildCount())
-        throw lang::IndexOutOfBoundsException("Invalid index into selection", 
*this);
+        throw lang::IndexOutOfBoundsException(u"Invalid index into 
selection"_ustr, *this);
 
     const sal_Int32 nColCount = getAccessibleColumnCount();
     assert(nColCount > 0 && "Column count non-positive, but child count > 0");
diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx 
b/accessibility/source/extended/AccessibleGridControlTableBase.cxx
index 499a3cec23cb..08fae3d0c3f3 100644
--- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx
@@ -217,13 +217,13 @@ void AccessibleGridControlTableBase::implGetSelectedRows( 
Sequence< sal_Int32 >&
 void AccessibleGridControlTableBase::ensureIsValidRow( sal_Int32 nRow )
 {
     if (nRow >= getAccessibleRowCount())
-        throw lang::IndexOutOfBoundsException( "row index is invalid", *this );
+        throw lang::IndexOutOfBoundsException( u"row index is invalid"_ustr, 
*this );
 }
 
 void AccessibleGridControlTableBase::ensureIsValidColumn( sal_Int32 nColumn )
 {
     if (nColumn >= getAccessibleColumnCount())
-        throw lang::IndexOutOfBoundsException( "column index is invalid", 
*this );
+        throw lang::IndexOutOfBoundsException( u"column index is 
invalid"_ustr, *this );
 }
 
 void AccessibleGridControlTableBase::ensureIsValidAddress(
@@ -236,7 +236,7 @@ void AccessibleGridControlTableBase::ensureIsValidAddress(
 void AccessibleGridControlTableBase::ensureIsValidIndex( sal_Int64 nChildIndex 
)
 {
     if (nChildIndex >= static_cast<sal_Int64>(m_aTable.GetRowCount()) * 
static_cast<sal_Int64>(m_aTable.GetColumnCount()))
-        throw lang::IndexOutOfBoundsException( "child index is invalid", *this 
);
+        throw lang::IndexOutOfBoundsException( u"child index is invalid"_ustr, 
*this );
 }
 
 
diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx 
b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
index edab950a855e..5f4761770f03 100644
--- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
@@ -651,7 +651,7 @@ namespace accessibility
         checkActionIndex_Impl( nIndex );
         EnsureIsAlive();
 
-        return "Select";
+        return u"Select"_ustr;
     }
 
     Reference< XAccessibleKeyBinding > 
AccessibleIconChoiceCtrlEntry::getAccessibleActionKeyBinding( sal_Int32 nIndex )
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx 
b/accessibility/source/extended/accessiblelistboxentry.cxx
index a843b938b9a3..74c7c9c58171 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -531,7 +531,7 @@ namespace accessibility
         EnsureIsAlive();
         SvTreeListEntry* pEntry = m_pTreeListBox->GetEntry( VCLPoint( _aPoint 
) );
         if ( !pEntry )
-            throw 
RuntimeException("AccessibleListBoxEntry::getAccessibleAtPoint - pEntry cannot 
be empty!");
+            throw 
RuntimeException(u"AccessibleListBoxEntry::getAccessibleAtPoint - pEntry cannot 
be empty!"_ustr);
 
         Reference< XAccessible > xAcc;
         rtl::Reference<AccessibleListBox> xListBox(m_wListBox);
@@ -784,9 +784,9 @@ namespace accessibility
             if(getAccessibleRole() == AccessibleRole::CHECK_BOX)
             {
                 if ( state == SvButtonState::Checked )
-                    return "UnCheck";
+                    return u"UnCheck"_ustr;
                 else if (state == SvButtonState::Unchecked)
-                    return "Check";
+                    return u"Check"_ustr;
             }
             else
             {
@@ -860,7 +860,7 @@ namespace accessibility
 
         SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( 
m_aEntryPath );
         if ( !pParent )
-            throw 
RuntimeException("AccessibleListBoxEntry::clearAccessibleSelection - pParent 
cannot be empty!");
+            throw 
RuntimeException(u"AccessibleListBoxEntry::clearAccessibleSelection - pParent 
cannot be empty!"_ustr);
         sal_Int32 nCount = m_pTreeListBox->GetLevelChildCount( pParent );
         for ( sal_Int32 i = 0; i < nCount; ++i )
         {
@@ -879,7 +879,7 @@ namespace accessibility
 
         SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( 
m_aEntryPath );
         if ( !pParent )
-            throw 
RuntimeException("AccessibleListBoxEntry::selectAllAccessibleChildren - pParent 
cannot be empty!");
+            throw 
RuntimeException(u"AccessibleListBoxEntry::selectAllAccessibleChildren - 
pParent cannot be empty!"_ustr);
         sal_Int32 nCount = m_pTreeListBox->GetLevelChildCount( pParent );
         for ( sal_Int32 i = 0; i < nCount; ++i )
         {
@@ -900,7 +900,7 @@ namespace accessibility
 
         SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( 
m_aEntryPath );
         if ( !pParent )
-            throw 
RuntimeException("AccessibleListBoxEntry::getSelectedAccessibleChildCount - 
pParent cannot be empty!");
+            throw 
RuntimeException(u"AccessibleListBoxEntry::getSelectedAccessibleChildCount - 
pParent cannot be empty!"_ustr);
         sal_Int32 nCount = m_pTreeListBox->GetLevelChildCount( pParent );
         for (sal_Int32 i = 0; i < nCount; ++i )
         {
@@ -927,7 +927,7 @@ namespace accessibility
 
         SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( 
m_aEntryPath );
         if ( !pParent )
-            throw 
RuntimeException("AccessibleListBoxEntry::getSelectedAccessibleChild - pParent 
cannot be empty!");
+            throw 
RuntimeException(u"AccessibleListBoxEntry::getSelectedAccessibleChild - pParent 
cannot be empty!"_ustr);
         sal_Int32 nCount = m_pTreeListBox->GetLevelChildCount( pParent );
         for (sal_Int32 i = 0; i < nCount; ++i )
         {
diff --git a/accessibility/source/extended/accessibletablistbox.cxx 
b/accessibility/source/extended/accessibletablistbox.cxx
index 88bffdc1b4e5..2e5b36227d20 100644
--- a/accessibility/source/extended/accessibletablistbox.cxx
+++ b/accessibility/source/extended/accessibletablistbox.cxx
@@ -100,7 +100,7 @@ namespace accessibility
             xRet = implGetTable();
 
         if ( !xRet.is() )
-            throw RuntimeException("getAccessibleChild called with NULL 
xRet",getXWeak());
+            throw RuntimeException(u"getAccessibleChild called with NULL 
xRet"_ustr,getXWeak());
 
         return xRet;
     }
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx 
b/accessibility/source/extended/textwindowaccessibility.cxx
index 5cef04128d82..0badad467a6f 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -143,8 +143,8 @@ Paragraph::getAccessibleChild(sal_Int64)
 {
     checkDisposed();
     throw css::lang::IndexOutOfBoundsException(
-        "textwindowaccessibility.cxx:"
-        " Paragraph::getAccessibleChild",
+        u"textwindowaccessibility.cxx:"
+        " Paragraph::getAccessibleChild"_ustr,
         getXWeak());
 }
 
@@ -556,8 +556,8 @@ css::accessibility::TextSegment SAL_CALL 
Paragraph::getTextAtLineWithCaret(  )
     } catch (const css::lang::IndexOutOfBoundsException&) {
         css::uno::Any anyEx = cppu::getCaughtException();
         throw css::lang::WrappedTargetRuntimeException(
-            "textwindowaccessibility.cxx:"
-            " Paragraph::getTextAtLineWithCaret",
+            u"textwindowaccessibility.cxx:"
+            " Paragraph::getTextAtLineWithCaret"_ustr,
             getXWeak(), anyEx );
     }
 }
@@ -861,8 +861,8 @@ Document::retrieveCharacterBounds(Paragraph const * 
pParagraph,
         // XXX  numeric overflow
     if (nIndex < 0 || nIndex > nLength)
         throw css::lang::IndexOutOfBoundsException(
-            "textwindowaccessibility.cxx:"
-            " Document::retrieveCharacterAttributes",
+            u"textwindowaccessibility.cxx:"
+            " Document::retrieveCharacterAttributes"_ustr,
             getXWeak());
     css::awt::Rectangle aBounds( 0, 0, 0, 0 );
     if ( nIndex == nLength )
@@ -986,8 +986,8 @@ Document::retrieveCharacterAttributes(
         // nIndex can be equal to getLength();
     if (nIndex < 0 || nIndex > m_rEngine.GetText(nNumber).getLength())
         throw css::lang::IndexOutOfBoundsException(
-            "textwindowaccessibility.cxx:"
-            " Document::retrieveCharacterAttributes",
+            u"textwindowaccessibility.cxx:"
+            " Document::retrieveCharacterAttributes"_ustr,
             getXWeak());
 
 
@@ -1079,8 +1079,8 @@ Document::retrieveRunAttributes(
         // XXX  numeric overflow
     if ( Index < 0 || Index >= m_rEngine.GetText(nNumber).getLength() )
         throw css::lang::IndexOutOfBoundsException(
-            "textwindowaccessibility.cxx:"
-            " Document::retrieveRunAttributes",
+            u"textwindowaccessibility.cxx:"
+            " Document::retrieveRunAttributes"_ustr,
             getXWeak() );
 
     tPropValMap aRunAttrSeq;
@@ -1114,8 +1114,8 @@ void Document::changeParagraphText(Paragraph const * 
pParagraph,
         if (nBegin < 0 || nBegin > nEnd
             || nEnd > m_rEngine.GetText(nNumber).getLength())
             throw css::lang::IndexOutOfBoundsException(
-                "textwindowaccessibility.cxx:"
-                " Document::changeParagraphText",
+                u"textwindowaccessibility.cxx:"
+                " Document::changeParagraphText"_ustr,
                 getXWeak());
         changeParagraphText(nNumber, static_cast< ::sal_uInt16 >(nBegin),
                             static_cast< ::sal_uInt16 >(nEnd), bCut, bPaste, 
rText);
@@ -1134,8 +1134,8 @@ void Document::copyParagraphText(Paragraph const * 
pParagraph,
         if (nBegin < 0 || nBegin > nEnd
             || nEnd > m_rEngine.GetText(nNumber).getLength())
             throw css::lang::IndexOutOfBoundsException(
-                "textwindowaccessibility.cxx:"
-                " Document::copyParagraphText",
+                u"textwindowaccessibility.cxx:"
+                " Document::copyParagraphText"_ustr,
                 getXWeak());
         m_rView.SetSelection(
             ::TextSelection(::TextPaM(nNumber, nBegin),
@@ -1157,8 +1157,8 @@ void Document::changeParagraphAttributes(
         if (nBegin < 0 || nBegin > nEnd
             || nEnd > m_rEngine.GetText(nNumber).getLength())
             throw css::lang::IndexOutOfBoundsException(
-                "textwindowaccessibility.cxx:"
-                " Document::changeParagraphAttributes",
+                u"textwindowaccessibility.cxx:"
+                " Document::changeParagraphAttributes"_ustr,
                 getXWeak());
 
         // FIXME  The new attributes are added to any attributes already set,
@@ -1189,8 +1189,8 @@ void Document::changeParagraphSelection(Paragraph const * 
pParagraph,
         if (nBegin < 0 || nBegin > nEnd
             || nEnd > m_rEngine.GetText(nNumber).getLength())
             throw css::lang::IndexOutOfBoundsException(
-                "textwindowaccessibility.cxx:"
-                " Document::changeParagraphSelection",
+                u"textwindowaccessibility.cxx:"
+                " Document::changeParagraphSelection"_ustr,
                 getXWeak());
         m_rView.SetSelection(
             ::TextSelection(::TextPaM(nNumber, nBegin),
@@ -1213,8 +1213,8 @@ Document::retrieveParagraphLineBoundary( Paragraph const 
* pParagraph,
         ::sal_uInt32 nNumber = static_cast< ::sal_uInt32 >( 
pParagraph->getNumber() );
         if ( nIndex < 0 || nIndex > m_rEngine.GetText( nNumber ).getLength() )
             throw css::lang::IndexOutOfBoundsException(
-                "textwindowaccessibility.cxx:"
-                " Document::retrieveParagraphLineBoundary",
+                u"textwindowaccessibility.cxx:"
+                " Document::retrieveParagraphLineBoundary"_ustr,
                 getXWeak() );
         ::sal_Int32 nLineStart = 0;
         ::sal_Int32 nLineEnd = 0;
@@ -1251,8 +1251,8 @@ Document::retrieveParagraphBoundaryOfLine( Paragraph 
const * pParagraph,
         ::sal_uInt32 nNumber = static_cast< ::sal_uInt32 >( 
pParagraph->getNumber() );
         if ( nLineNo >= m_rEngine.GetLineCount( nNumber ) )
             throw css::lang::IndexOutOfBoundsException(
-                "textwindowaccessibility.cxx:"
-                " Document::retrieveParagraphBoundaryOfLine",
+                u"textwindowaccessibility.cxx:"
+                " Document::retrieveParagraphBoundaryOfLine"_ustr,
                 getXWeak() );
         ::sal_Int32 nLineStart = 0;
         ::sal_Int32 nLineEnd = 0;
@@ -1324,8 +1324,8 @@ Document::getAccessibleChild(sal_Int64 i)
     init();
     if (i < 0 || i >= m_aVisibleEnd - m_aVisibleBegin)
         throw css::lang::IndexOutOfBoundsException(
-            "textwindowaccessibility.cxx:"
-            " Document::getAccessibleChild",
+            u"textwindowaccessibility.cxx:"
+            " Document::getAccessibleChild"_ustr,
             getXWeak());
     return getAccessibleChild(m_aVisibleBegin
                               + static_cast< Paragraphs::size_type >(i));
diff --git a/accessibility/source/helper/acc_factory.cxx 
b/accessibility/source/helper/acc_factory.cxx
index 25622d1c7c22..f6d861f4c5ee 100644
--- a/accessibility/source/helper/acc_factory.cxx
+++ b/accessibility/source/helper/acc_factory.cxx
@@ -484,11 +484,11 @@ class GetStandardAccessibleFactoryService:
 public:
     // css::lang::XServiceInfo:
     virtual OUString SAL_CALL getImplementationName() override
-        { return 
"com.sun.star.accessibility.comp.GetStandardAccessibleFactoryService"; }
+        { return 
u"com.sun.star.accessibility.comp.GetStandardAccessibleFactoryService"_ustr; }
     virtual sal_Bool SAL_CALL supportsService(const OUString & serviceName) 
override
         { return cppu::supportsService(this, serviceName); }
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override
-        { return { 
"com.sun.star.accessibility.GetStandardAccessibleFactoryService" }; }
+        { return { 
u"com.sun.star.accessibility.GetStandardAccessibleFactoryService"_ustr }; }
 
     // XUnoTunnel
     virtual sal_Int64 SAL_CALL getSomething( const ::css::uno::Sequence< 
::sal_Int8 >& /*aIdentifier*/ ) override
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx 
b/accessibility/source/standard/vclxaccessibleedit.cxx
index 5943b4c8c745..f29e3224e293 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -255,7 +255,7 @@ OUString VCLXAccessibleEdit::getAccessibleActionDescription 
( sal_Int32 nIndex )
     if ( nIndex != 0)
         throw IndexOutOfBoundsException();
 
-    return "activate";
+    return u"activate"_ustr;
 }
 
 
diff --git a/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx 
b/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx
index d3463f5cdae7..0b1445461b1b 100644
--- a/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx
+++ b/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx
@@ -84,7 +84,7 @@ awt::Rectangle VCLXAccessibleHeaderBarItem::implGetBounds()
 // XServiceInfo
 OUString VCLXAccessibleHeaderBarItem::getImplementationName()
 {
-    return "com.sun.star.comp.svtools.AccessibleHeaderBarItem";
+    return u"com.sun.star.comp.svtools.AccessibleHeaderBarItem"_ustr;
 }
 
 sal_Bool VCLXAccessibleHeaderBarItem::supportsService( const OUString& 
rServiceName )
@@ -94,7 +94,7 @@ sal_Bool VCLXAccessibleHeaderBarItem::supportsService( const 
OUString& rServiceN
 
 Sequence< OUString > VCLXAccessibleHeaderBarItem::getSupportedServiceNames()
 {
-    return { "com.sun.star.awt.AccessibleHeaderBarItem" };
+    return { u"com.sun.star.awt.AccessibleHeaderBarItem"_ustr };
 }
 
 // XAccessible
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index c001b59c42fc..04bb77d0d02e 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -596,13 +596,13 @@ sal_Int16 SAL_CALL VCLXAccessibleList::getAccessibleRole()
 // XServiceInfo
 OUString VCLXAccessibleList::getImplementationName()
 {
-    return "com.sun.star.comp.toolkit.AccessibleList";
+    return u"com.sun.star.comp.toolkit.AccessibleList"_ustr;
 }
 
 Sequence< OUString > VCLXAccessibleList::getSupportedServiceNames()
 {
     return 
comphelper::concatSequences(VCLXAccessibleComponent::getSupportedServiceNames(),
-                                       
Sequence<OUString>{"com.sun.star.accessibility.AccessibleList"});
+                                       
Sequence<OUString>{u"com.sun.star.accessibility.AccessibleList"_ustr});
 }
 
 void VCLXAccessibleList::UpdateVisibleLineCount()
diff --git a/accessibility/source/standard/vclxaccessiblelistbox.cxx 
b/accessibility/source/standard/vclxaccessiblelistbox.cxx
index 591eada5112a..1b4d444e6ca9 100644
--- a/accessibility/source/standard/vclxaccessiblelistbox.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistbox.cxx
@@ -39,14 +39,14 @@ bool VCLXAccessibleListBox::IsValid() const
 
 OUString VCLXAccessibleListBox::getImplementationName()
 {
-    return "com.sun.star.comp.toolkit.AccessibleListBox";
+    return u"com.sun.star.comp.toolkit.AccessibleListBox"_ustr;
 }
 
 
 Sequence< OUString > VCLXAccessibleListBox::getSupportedServiceNames()
 {
     return 
comphelper::concatSequences(VCLXAccessibleBox::getSupportedServiceNames(),
-                                       
Sequence<OUString>{"com.sun.star.accessibility.AccessibleListBox"});
+                                       
Sequence<OUString>{u"com.sun.star.accessibility.AccessibleListBox"_ustr});
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx 
b/accessibility/source/standard/vclxaccessiblelistitem.cxx
index 31b889ebc3b5..62cd311abbe0 100644
--- a/accessibility/source/standard/vclxaccessiblelistitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx
@@ -166,7 +166,7 @@ void 
VCLXAccessibleListItem::disposing(std::unique_lock<std::mutex>& rGuard)
 
 OUString VCLXAccessibleListItem::getImplementationName()
 {
-    return "com.sun.star.comp.toolkit.AccessibleListItem";
+    return u"com.sun.star.comp.toolkit.AccessibleListItem"_ustr;
 }
 
 sal_Bool VCLXAccessibleListItem::supportsService( const OUString& rServiceName 
)
@@ -176,9 +176,9 @@ sal_Bool VCLXAccessibleListItem::supportsService( const 
OUString& rServiceName )
 
 Sequence< OUString > VCLXAccessibleListItem::getSupportedServiceNames()
 {
-    return {"com.sun.star.accessibility.AccessibleContext",
-            "com.sun.star.accessibility.AccessibleComponent",
-            "com.sun.star.accessibility.AccessibleListItem"};
+    return {u"com.sun.star.accessibility.AccessibleContext"_ustr,
+            u"com.sun.star.accessibility.AccessibleComponent"_ustr,
+            u"com.sun.star.accessibility.AccessibleListItem"_ustr};
 }
 
 // XAccessible
diff --git a/accessibility/source/standard/vclxaccessiblemenubar.cxx 
b/accessibility/source/standard/vclxaccessiblemenubar.cxx
index c54f376fe056..9664254fa543 100644
--- a/accessibility/source/standard/vclxaccessiblemenubar.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenubar.cxx
@@ -122,13 +122,13 @@ void VCLXAccessibleMenuBar::disposing()
 
 OUString VCLXAccessibleMenuBar::getImplementationName()
 {
-    return "com.sun.star.comp.toolkit.AccessibleMenuBar";
+    return u"com.sun.star.comp.toolkit.AccessibleMenuBar"_ustr;
 }
 
 
 Sequence< OUString > VCLXAccessibleMenuBar::getSupportedServiceNames()
 {
-    return { "com.sun.star.awt.AccessibleMenuBar" };
+    return { u"com.sun.star.awt.AccessibleMenuBar"_ustr };
 }
 
 
diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx 
b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
index 03bdc88c93c5..1766b316559b 100644
--- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
@@ -149,13 +149,13 @@ void VCLXAccessibleMenuItem::implGetSelection( sal_Int32& 
nStartIndex, sal_Int32
 
 OUString VCLXAccessibleMenuItem::getImplementationName()
 {
-    return "com.sun.star.comp.toolkit.AccessibleMenuItem";
+    return u"com.sun.star.comp.toolkit.AccessibleMenuItem"_ustr;
 }
 
 
 Sequence< OUString > VCLXAccessibleMenuItem::getSupportedServiceNames()
 {
-    return { "com.sun.star.awt.AccessibleMenuItem" };
+    return { u"com.sun.star.awt.AccessibleMenuItem"_ustr };
 }
 
 
diff --git a/accessibility/source/standard/vclxaccessiblemenuseparator.cxx 
b/accessibility/source/standard/vclxaccessiblemenuseparator.cxx
index bbb73977f7c9..d64ccb0baa25 100644
--- a/accessibility/source/standard/vclxaccessiblemenuseparator.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenuseparator.cxx
@@ -34,12 +34,12 @@ 
VCLXAccessibleMenuSeparator::VCLXAccessibleMenuSeparator(Menu* pParent, sal_uInt
 
 OUString VCLXAccessibleMenuSeparator::getImplementationName()
 {
-    return "com.sun.star.comp.toolkit.AccessibleMenuSeparator";
+    return u"com.sun.star.comp.toolkit.AccessibleMenuSeparator"_ustr;
 }
 
 Sequence<OUString> VCLXAccessibleMenuSeparator::getSupportedServiceNames()
 {
-    return { "com.sun.star.awt.AccessibleMenuSeparator" };
+    return { u"com.sun.star.awt.AccessibleMenuSeparator"_ustr };
 }
 
 // XAccessibleContext
diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx 
b/accessibility/source/standard/vclxaccessibleradiobutton.cxx
index 3d66b799db0d..71cc0bc71e16 100644
--- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx
+++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx
@@ -111,13 +111,13 @@ void VCLXAccessibleRadioButton::FillAccessibleStateSet( 
sal_Int64& rStateSet )
 
 OUString VCLXAccessibleRadioButton::getImplementationName()
 {
-    return "com.sun.star.comp.toolkit.AccessibleRadioButton";
+    return u"com.sun.star.comp.toolkit.AccessibleRadioButton"_ustr;
 }
 
 
 Sequence< OUString > VCLXAccessibleRadioButton::getSupportedServiceNames()
 {
-    return { "com.sun.star.awt.AccessibleRadioButton" };
+    return { u"com.sun.star.awt.AccessibleRadioButton"_ustr };
 }
 
 
commit 3f19decc2cdf57bd4197f179cfd2f8b2e8805865
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Apr 25 16:18:24 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Apr 30 19:35:33 2024 +0200

    use more concrete UNO classes in writerfilter (SwXTextDocument)
    
    Change-Id: If07817eb5cc687ce8472d2a08c08acf00d3c76e9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166812
    Tested-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/writerfilter/dmapper/FormControlHelper.cxx 
b/sw/source/writerfilter/dmapper/FormControlHelper.cxx
index 40f5d703815e..4baf7490d2cf 100644
--- a/sw/source/writerfilter/dmapper/FormControlHelper.cxx
+++ b/sw/source/writerfilter/dmapper/FormControlHelper.cxx
@@ -41,6 +41,8 @@
 #include <xmloff/odffields.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/diagnose_ex.hxx>
+#include <rtl/ref.hxx>
+#include <unotxdoc.hxx>
 
 namespace writerfilter::dmapper {
 
@@ -53,11 +55,9 @@ struct FormControlHelper::FormControlHelper_Impl : public 
virtual SvRefBase
     uno::Reference<drawing::XDrawPage> rDrawPage;
     uno::Reference<form::XForm> rForm;
     uno::Reference<form::XFormComponent> rFormComponent;
-    uno::Reference<lang::XMultiServiceFactory> rServiceFactory;
-    uno::Reference<text::XTextDocument> rTextDocument;
+    rtl::Reference<SwXTextDocument> mxTextDocument;
 
     uno::Reference<drawing::XDrawPage> const & getDrawPage();
-    uno::Reference<lang::XMultiServiceFactory> const & getServiceFactory();
     uno::Reference<form::XForm> const & getForm();
     uno::Reference<container::XIndexContainer> getFormComps();
 };
@@ -66,23 +66,13 @@ uno::Reference<drawing::XDrawPage> const & 
FormControlHelper::FormControlHelper_
 {
     if (! rDrawPage.is())
     {
-        uno::Reference<drawing::XDrawPageSupplier>
-            xDrawPageSupplier(rTextDocument, uno::UNO_QUERY);
-        if (xDrawPageSupplier.is())
-            rDrawPage = xDrawPageSupplier->getDrawPage();
+        if (mxTextDocument)
+            rDrawPage = mxTextDocument->getDrawPage();
     }
 
     return rDrawPage;
 }
 
-uno::Reference<lang::XMultiServiceFactory> const & 
FormControlHelper::FormControlHelper_Impl::getServiceFactory()
-{
-    if (! rServiceFactory.is())
-        rServiceFactory.set(rTextDocument, uno::UNO_QUERY);
-
-    return rServiceFactory;
-}
-
 uno::Reference<form::XForm> const & 
FormControlHelper::FormControlHelper_Impl::getForm()
 {
     if (! rForm.is())
@@ -103,7 +93,7 @@ uno::Reference<form::XForm> const & 
FormControlHelper::FormControlHelper_Impl::g
                 sFormName = sDOCXForm + OUString::number(nUnique);
             }
 
-            uno::Reference<uno::XInterface> 
xForm(getServiceFactory()->createInstance("com.sun.star.form.component.Form"));
+            uno::Reference<uno::XInterface> 
xForm(mxTextDocument->createInstance("com.sun.star.form.component.Form"));
             if (xForm.is())
             {
                 uno::Reference<beans::XPropertySet>
@@ -131,12 +121,12 @@ uno::Reference<container::XIndexContainer> 
FormControlHelper::FormControlHelper_
 }
 
 FormControlHelper::FormControlHelper(FieldId eFieldId,
-                                     uno::Reference<text::XTextDocument> 
const& xTextDocument,
+                                     rtl::Reference<SwXTextDocument> const& 
xTextDocument,
                                      FFDataHandler::Pointer_t pFFData)
     : m_pFFData(std::move(pFFData)), m_pImpl(new FormControlHelper_Impl)
 {
     m_pImpl->m_eFieldId = eFieldId;
-    m_pImpl->rTextDocument = xTextDocument;
+    m_pImpl->mxTextDocument = xTextDocument;
 }
 
 FormControlHelper::~FormControlHelper()
@@ -148,13 +138,10 @@ bool 
FormControlHelper::createCheckbox(uno::Reference<text::XTextRange> const& x
 {
     if ( !m_pFFData )
         return false;
-    uno::Reference<lang::XMultiServiceFactory>
-        xServiceFactory(m_pImpl->getServiceFactory());
-
-    if (! xServiceFactory.is())
+    if (! m_pImpl->mxTextDocument)
         return false;
 
-    uno::Reference<uno::XInterface> xInterface = 
xServiceFactory->createInstance("com.sun.star.form.component.CheckBox");
+    uno::Reference<uno::XInterface> xInterface = 
m_pImpl->mxTextDocument->createInstance("com.sun.star.form.component.CheckBox");
 
     if (!xInterface.is())
         return false;
@@ -342,10 +329,10 @@ void 
FormControlHelper::insertControl(uno::Reference<text::XTextRange> const& xT
     uno::Any aAny(m_pImpl->rFormComponent);
     xFormComps->insertByIndex(xFormComps->getCount(), aAny);
 
-    if (! m_pImpl->getServiceFactory().is())
+    if (! m_pImpl->mxTextDocument )
         return;
 
-    uno::Reference<uno::XInterface> xInterface = 
m_pImpl->getServiceFactory()->createInstance("com.sun.star.drawing.ControlShape");
+    uno::Reference<uno::XInterface> xInterface = 
m_pImpl->mxTextDocument->createInstance("com.sun.star.drawing.ControlShape");
 
     if (! xInterface.is())
         return;
diff --git a/sw/source/writerfilter/dmapper/FormControlHelper.hxx 
b/sw/source/writerfilter/dmapper/FormControlHelper.hxx
index 326637f85f78..6b0f39dd5ab1 100644
--- a/sw/source/writerfilter/dmapper/FormControlHelper.hxx
+++ b/sw/source/writerfilter/dmapper/FormControlHelper.hxx
@@ -23,6 +23,9 @@
 #include <com/sun/star/text/XFormField.hpp>
 #include <com/sun/star/uno/Reference.hxx>
 #include "FieldTypes.hxx"
+#include <rtl/ref.hxx>
+
+class SwXTextDocument;
 
 namespace writerfilter::dmapper
 {
@@ -30,8 +33,7 @@ class FormControlHelper : public virtual SvRefBase
 {
 public:
     typedef tools::SvRef<FormControlHelper> Pointer_t;
-    FormControlHelper(FieldId eFieldId,
-                      css::uno::Reference<css::text::XTextDocument> const& 
rTextDocument,
+    FormControlHelper(FieldId eFieldId, rtl::Reference<SwXTextDocument> const& 
rTextDocument,
                       FFDataHandler::Pointer_t pFFData);
     ~FormControlHelper() override;
 

Reply via email to