diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 17:31:13 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 20:37:56 +0100 |
commit | 9407c1f96aaea4bd2751301a6d7ee262bef89b74 (patch) | |
tree | f919ec60586bee35278c42402a34d143886598c2 /sdext/source | |
parent | 142beb47ac285126aa5e2cbe9035394ecce952bf (diff) |
Extended loplugin:ostr: sdext
Change-Id: If4e8ccf288846fc768b3e035706a8bd0b2207f4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159678
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/pdfimport/filterdet.cxx | 4 | ||||
-rw-r--r-- | sdext/source/pdfimport/pdfparse/pdfentries.cxx | 26 | ||||
-rw-r--r-- | sdext/source/pdfimport/test/pdfunzip.cxx | 10 | ||||
-rw-r--r-- | sdext/source/pdfimport/tree/drawtreevisiting.cxx | 28 | ||||
-rw-r--r-- | sdext/source/pdfimport/tree/style.cxx | 2 | ||||
-rw-r--r-- | sdext/source/pdfimport/tree/writertreevisiting.cxx | 30 |
6 files changed, 50 insertions, 50 deletions
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx index 5f6392e18983..e8d2e11d30ba 100644 --- a/sdext/source/pdfimport/filterdet.cxx +++ b/sdext/source/pdfimport/filterdet.cxx @@ -578,7 +578,7 @@ uno::Reference< io::XStream > getAdditionalStream( const OUString& if( pTrailer && pTrailer->m_pDict ) { // search document checksum entry - auto chk = pTrailer->m_pDict->m_aMap.find( "DocChecksum" ); + auto chk = pTrailer->m_pDict->m_aMap.find( "DocChecksum"_ostr ); if( chk == pTrailer->m_pDict->m_aMap.end() ) { SAL_INFO( "sdext.pdfimport", "no DocChecksum entry" ); @@ -592,7 +592,7 @@ uno::Reference< io::XStream > getAdditionalStream( const OUString& } // search for AdditionalStreams entry - auto add_stream = pTrailer->m_pDict->m_aMap.find( "AdditionalStreams" ); + auto add_stream = pTrailer->m_pDict->m_aMap.find( "AdditionalStreams"_ostr ); if( add_stream == pTrailer->m_pDict->m_aMap.end() ) { SAL_INFO( "sdext.pdfimport", "no AdditionalStreams entry" ); diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index b1b7d9f86a58..03f4537080d7 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -624,7 +624,7 @@ unsigned int PDFStream::getDictLength( const PDFContainer* pContainer ) const return 0; // find /Length entry, can either be a direct or indirect number object std::unordered_map<OString,PDFEntry*>::const_iterator it = - m_pDict->m_aMap.find( "Length" ); + m_pDict->m_aMap.find( "Length"_ostr ); if( it == m_pDict->m_aMap.end() ) return 0; PDFNumber* pNum = dynamic_cast<PDFNumber*>(it->second); @@ -673,7 +673,7 @@ bool PDFObject::getDeflatedStream( std::unique_ptr<char[]>& rpStream, unsigned i } // is there a filter entry ? std::unordered_map<OString,PDFEntry*>::const_iterator it = - m_pStream->m_pDict->m_aMap.find( "Filter" ); + m_pStream->m_pDict->m_aMap.find( "Filter"_ostr ); if( it != m_pStream->m_pDict->m_aMap.end() ) { PDFName* pFilter = dynamic_cast<PDFName*>(it->second); @@ -842,13 +842,13 @@ bool PDFObject::emit( EmitContext& rWriteContext ) const std::unique_ptr<PDFObject> pClone(static_cast<PDFObject*>(clone())); // set length in the dictionary to new stream length std::unique_ptr<PDFNumber> pNewLen(new PDFNumber( double(nOutBytes) )); - pClone->m_pStream->m_pDict->insertValue( "Length", std::move(pNewLen) ); + pClone->m_pStream->m_pDict->insertValue( "Length"_ostr, std::move(pNewLen) ); if( bDeflate && rWriteContext.m_bDeflate ) { // delete flatedecode filter std::unordered_map<OString,PDFEntry*>::const_iterator it = - pClone->m_pStream->m_pDict->m_aMap.find( "Filter" ); + pClone->m_pStream->m_pDict->m_aMap.find( "Filter"_ostr ); if( it != pClone->m_pStream->m_pDict->m_aMap.end() ) { PDFName* pFilter = dynamic_cast<PDFName*>(it->second); @@ -1288,7 +1288,7 @@ PDFFileImplData* PDFFile::impl_getData() const if( pTrailer && pTrailer->m_pDict ) { // search doc id - PDFDict::Map::iterator doc_id = pTrailer->m_pDict->m_aMap.find( "ID" ); + PDFDict::Map::iterator doc_id = pTrailer->m_pDict->m_aMap.find( "ID"_ostr ); if( doc_id != pTrailer->m_pDict->m_aMap.end() ) { PDFArray* pArr = dynamic_cast<PDFArray*>(doc_id->second); @@ -1307,7 +1307,7 @@ PDFFileImplData* PDFFile::impl_getData() const } // search Encrypt entry PDFDict::Map::iterator enc = - pTrailer->m_pDict->m_aMap.find( "Encrypt" ); + pTrailer->m_pDict->m_aMap.find( "Encrypt"_ostr ); if( enc != pTrailer->m_pDict->m_aMap.end() ) { PDFDict* pDict = dynamic_cast<PDFDict*>(enc->second); @@ -1323,13 +1323,13 @@ PDFFileImplData* PDFFile::impl_getData() const } if( pDict ) { - PDFDict::Map::iterator filter = pDict->m_aMap.find( "Filter" ); - PDFDict::Map::iterator version = pDict->m_aMap.find( "V" ); - PDFDict::Map::iterator len = pDict->m_aMap.find( "Length" ); - PDFDict::Map::iterator o_ent = pDict->m_aMap.find( "O" ); - PDFDict::Map::iterator u_ent = pDict->m_aMap.find( "U" ); - PDFDict::Map::iterator r_ent = pDict->m_aMap.find( "R" ); - PDFDict::Map::iterator p_ent = pDict->m_aMap.find( "P" ); + PDFDict::Map::iterator filter = pDict->m_aMap.find( "Filter"_ostr ); + PDFDict::Map::iterator version = pDict->m_aMap.find( "V"_ostr ); + PDFDict::Map::iterator len = pDict->m_aMap.find( "Length"_ostr ); + PDFDict::Map::iterator o_ent = pDict->m_aMap.find( "O"_ostr ); + PDFDict::Map::iterator u_ent = pDict->m_aMap.find( "U"_ostr ); + PDFDict::Map::iterator r_ent = pDict->m_aMap.find( "R"_ostr ); + PDFDict::Map::iterator p_ent = pDict->m_aMap.find( "P"_ostr ); if( filter != pDict->m_aMap.end() ) { m_pData->m_bIsEncrypted = true; diff --git a/sdext/source/pdfimport/test/pdfunzip.cxx b/sdext/source/pdfimport/test/pdfunzip.cxx index c4d5b6bc0b71..b9bf3a62f14f 100644 --- a/sdext/source/pdfimport/test/pdfunzip.cxx +++ b/sdext/source/pdfimport/test/pdfunzip.cxx @@ -302,7 +302,7 @@ static int write_addStreams( const char* pInFile, const char* pOutFile, PDFFile* if( pTrailer && pTrailer->m_pDict ) { // search for AdditionalStreams entry - auto add_stream = pTrailer->m_pDict->m_aMap.find( "AdditionalStreams" ); + auto add_stream = pTrailer->m_pDict->m_aMap.find( "AdditionalStreams"_ostr ); if( add_stream != pTrailer->m_pDict->m_aMap.end() ) { PDFArray* pStreams = dynamic_cast<PDFArray*>(add_stream->second); @@ -328,7 +328,7 @@ static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* continue; std::unordered_map<OString,PDFEntry*>::iterator map_it = - pDict->m_aMap.find( "Type" ); + pDict->m_aMap.find( "Type"_ostr ); if( map_it == pDict->m_aMap.end() ) continue; @@ -340,7 +340,7 @@ static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* // the font name will be helpful, also there must be one in // a font descriptor - map_it = pDict->m_aMap.find( "FontName" ); + map_it = pDict->m_aMap.find( "FontName"_ostr ); if( map_it == pDict->m_aMap.end() ) continue; pName = dynamic_cast<PDFName*>(map_it->second); @@ -351,7 +351,7 @@ static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* PDFObjectRef* pStreamRef = nullptr; const char* pFileType = nullptr; // we have a font descriptor, try for a type 1 font - map_it = pDict->m_aMap.find( "FontFile" ); + map_it = pDict->m_aMap.find( "FontFile"_ostr ); if( map_it != pDict->m_aMap.end() ) { pStreamRef = dynamic_cast<PDFObjectRef*>(map_it->second); @@ -362,7 +362,7 @@ static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* // perhaps it's a truetype file ? if( ! pStreamRef ) { - map_it = pDict->m_aMap.find( "FontFile2" ); + map_it = pDict->m_aMap.find( "FontFile2"_ostr ); if( map_it != pDict->m_aMap.end() ) { pStreamRef = dynamic_cast<PDFObjectRef*>(map_it->second); diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index 58a55451a379..5aae54415800 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -797,7 +797,7 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu { PropertyMap props; FillDashStyleProps(props, rGC.DashArray, scale); - StyleContainer::Style style("draw:stroke-dash", std::move(props)); + StyleContainer::Style style("draw:stroke-dash"_ostr, std::move(props)); aGCProps[ "draw:stroke" ] = "dash"; aGCProps[ "draw:stroke-dash" ] = @@ -830,8 +830,8 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu aGCProps[ "draw:fill" ] = "none"; } - StyleContainer::Style aStyle( "style:style", std::move(aProps) ); - StyleContainer::Style aSubStyle( "style:graphic-properties", std::move(aGCProps) ); + StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); + StyleContainer::Style aSubStyle( "style:graphic-properties"_ostr, std::move(aGCProps) ); aStyle.SubStyles.push_back( &aSubStyle ); elem.StyleId = m_rStyleContainer.getStyleId( aStyle ); @@ -907,8 +907,8 @@ void DrawXmlFinalizer::visit( TextElement& elem, const std::list< std::unique_pt aFontProps[ "style:text-scale" ] = getPercentString(textScale); } - StyleContainer::Style aStyle( "style:style", std::move(aProps) ); - StyleContainer::Style aSubStyle( "style:text-properties", std::move(aFontProps) ); + StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); + StyleContainer::Style aSubStyle( "style:text-properties"_ostr, std::move(aFontProps) ); aStyle.SubStyles.push_back( &aSubStyle ); elem.StyleId = m_rStyleContainer.getStyleId( aStyle ); } @@ -929,8 +929,8 @@ void DrawXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::uniq else aParProps[ "style:writing-mode"] = "lr-tb"; - StyleContainer::Style aStyle( "style:style", std::move(aProps) ); - StyleContainer::Style aSubStyle( "style:paragraph-properties", std::move(aParProps) ); + StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); + StyleContainer::Style aSubStyle( "style:paragraph-properties"_ostr, std::move(aParProps) ); aStyle.SubStyles.push_back( &aSubStyle ); elem.StyleId = m_rStyleContainer.getStyleId( aStyle ); @@ -961,8 +961,8 @@ void DrawXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique_p aGCProps[ "fo:padding-right" ] = "0cm"; aGCProps[ "fo:padding-bottom" ] = "0cm"; - StyleContainer::Style style1( "style:style", std::move(props1) ); - StyleContainer::Style subStyle1( "style:graphic-properties", std::move(aGCProps) ); + StyleContainer::Style style1( "style:style"_ostr, std::move(props1) ); + StyleContainer::Style subStyle1( "style:graphic-properties"_ostr, std::move(aGCProps) ); style1.SubStyles.push_back(&subStyle1); elem.StyleId = m_rStyleContainer.getStyleId(style1); @@ -975,8 +975,8 @@ void DrawXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique_p PropertyMap textProps; SetFontsizeProperties(textProps, elem.FontSize); - StyleContainer::Style style2("style:style", std::move(props2)); - StyleContainer::Style subStyle2("style:text-properties", std::move(textProps)); + StyleContainer::Style style2("style:style"_ostr, std::move(props2)); + StyleContainer::Style subStyle2("style:text-properties"_ostr, std::move(textProps)); style2.SubStyles.push_back(&subStyle2); elem.TextStyleId = m_rStyleContainer.getStyleId(style2); } @@ -1069,8 +1069,8 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_pt aPageLayoutProps[ "style:print-orientation" ]= elem.w < elem.h ? std::u16string_view(u"portrait") : std::u16string_view(u"landscape"); aPageLayoutProps[ "style:writing-mode" ]= "lr-tb"; - StyleContainer::Style aStyle( "style:page-layout", std::move(aPageProps)); - StyleContainer::Style aSubStyle( "style:page-layout-properties", std::move(aPageLayoutProps)); + StyleContainer::Style aStyle( "style:page-layout"_ostr, std::move(aPageProps)); + StyleContainer::Style aSubStyle( "style:page-layout-properties"_ostr, std::move(aPageLayoutProps)); aStyle.SubStyles.push_back(&aSubStyle); sal_Int32 nPageStyle = m_rStyleContainer.impl_getStyleId( aStyle, false ); @@ -1078,7 +1078,7 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_pt OUString aMasterPageLayoutName = m_rStyleContainer.getStyleName( nPageStyle ); aPageProps[ "style:page-layout-name" ] = aMasterPageLayoutName; - StyleContainer::Style aMPStyle( "style:master-page", std::move(aPageProps)); + StyleContainer::Style aMPStyle( "style:master-page"_ostr, std::move(aPageProps)); elem.StyleId = m_rStyleContainer.impl_getStyleId( aMPStyle,false ); diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx index fe93f2d7ed29..3f1d20eb4244 100644 --- a/sdext/source/pdfimport/tree/style.cxx +++ b/sdext/source/pdfimport/tree/style.cxx @@ -79,7 +79,7 @@ sal_Int32 StyleContainer::getStandardStyleId( std::string_view rName ) aProps[ "style:family" ] = OStringToOUString( rName, RTL_TEXTENCODING_UTF8 ); aProps[ "style:name" ] = "standard"; - Style aStyle( "style:style", std::move(aProps) ); + Style aStyle( "style:style"_ostr, std::move(aProps) ); return getStyleId( aStyle ); } diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx index 98d2c9572b9b..7941f7d35709 100644 --- a/sdext/source/pdfimport/tree/writertreevisiting.cxx +++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx @@ -977,7 +977,7 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni { PropertyMap props; FillDashStyleProps(props, rGC.DashArray, scale); - StyleContainer::Style style("draw:stroke-dash", std::move(props)); + StyleContainer::Style style("draw:stroke-dash"_ostr, std::move(props)); aGCProps[ "draw:stroke" ] = "dash"; aGCProps[ "draw:stroke-dash" ] = @@ -1006,8 +1006,8 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni aGCProps[ "draw:fill" ] = "none"; } - StyleContainer::Style aStyle( "style:style", std::move(aProps) ); - StyleContainer::Style aSubStyle( "style:graphic-properties", std::move(aGCProps) ); + StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); + StyleContainer::Style aSubStyle( "style:graphic-properties"_ostr, std::move(aGCProps) ); aStyle.SubStyles.push_back( &aSubStyle ); elem.StyleId = m_rStyleContainer.getStyleId( aStyle ); @@ -1067,8 +1067,8 @@ void WriterXmlFinalizer::visit( TextElement& elem, const std::list< std::unique_ const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId ); aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); - StyleContainer::Style aStyle( "style:style", std::move(aProps) ); - StyleContainer::Style aSubStyle( "style:text-properties", std::move(aFontProps) ); + StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); + StyleContainer::Style aSubStyle( "style:text-properties"_ostr, std::move(aFontProps) ); aStyle.SubStyles.push_back( &aSubStyle ); elem.StyleId = m_rStyleContainer.getStyleId( aStyle ); } @@ -1131,8 +1131,8 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::un { PropertyMap aProps; aProps[ "style:family" ] = "paragraph"; - StyleContainer::Style aStyle( "style:style", std::move(aProps) ); - StyleContainer::Style aSubStyle( "style:paragraph-properties", std::move(aParaProps) ); + StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); + StyleContainer::Style aSubStyle( "style:paragraph-properties"_ostr, std::move(aParaProps) ); aStyle.SubStyles.push_back( &aSubStyle ); elem.StyleId = m_rStyleContainer.getStyleId( aStyle ); } @@ -1160,8 +1160,8 @@ void WriterXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique aGCProps[ "fo:padding-right" ] = "0cm"; aGCProps[ "fo:padding-bottom" ] = "0cm"; - StyleContainer::Style aStyle( "style:style", std::move(aProps) ); - StyleContainer::Style aSubStyle( "style:graphic-properties", std::move(aGCProps) ); + StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); + StyleContainer::Style aSubStyle( "style:graphic-properties"_ostr, std::move(aGCProps) ); aStyle.SubStyles.push_back( &aSubStyle ); elem.StyleId = m_rStyleContainer.getStyleId( aStyle ); @@ -1191,7 +1191,7 @@ void WriterXmlFinalizer::setFirstOnPage( ParagraphElement& rElem, rElem.StyleId = rStyles.setProperties( rElem.StyleId, std::move(aProps) ); else { - StyleContainer::Style aStyle( "style:style", std::move(aProps) ); + StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); rElem.StyleId = rStyles.getStyleId( aStyle ); } } @@ -1296,17 +1296,17 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_ aPageLayoutProps[ "fo:margin-right" ] = unitMMString( right_margin ); aPageLayoutProps[ "style:writing-mode" ]= "lr-tb"; - StyleContainer::Style aStyle( "style:page-layout", std::move(aPageProps)); - StyleContainer::Style aSubStyle( "style:page-layout-properties", std::move(aPageLayoutProps)); + StyleContainer::Style aStyle( "style:page-layout"_ostr, std::move(aPageProps)); + StyleContainer::Style aSubStyle( "style:page-layout-properties"_ostr, std::move(aPageLayoutProps)); aStyle.SubStyles.push_back(&aSubStyle); sal_Int32 nPageStyle = m_rStyleContainer.impl_getStyleId( aStyle, false ); // create master page OUString aMasterPageLayoutName = m_rStyleContainer.getStyleName( nPageStyle ); aPageProps[ "style:page-layout-name" ] = aMasterPageLayoutName; - StyleContainer::Style aMPStyle( "style:master-page", std::move(aPageProps) ); - StyleContainer::Style aHeaderStyle( "style:header", PropertyMap() ); - StyleContainer::Style aFooterStyle( "style:footer", PropertyMap() ); + StyleContainer::Style aMPStyle( "style:master-page"_ostr, std::move(aPageProps) ); + StyleContainer::Style aHeaderStyle( "style:header"_ostr, PropertyMap() ); + StyleContainer::Style aFooterStyle( "style:footer"_ostr, PropertyMap() ); if( elem.HeaderElement ) { elem.HeaderElement->visitedBy( *this, std::list<std::unique_ptr<Element>>::iterator() ); |