diff options
-rw-r--r-- | sc/Library_vbaobj.mk | 1 | ||||
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/vba/vbainterior.cxx | 9 | ||||
-rw-r--r-- | sw/Library_msword.mk | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 9 | ||||
-rw-r--r-- | vcl/Library_vcl.mk | 1 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 237 |
7 files changed, 135 insertions, 130 deletions
diff --git a/sc/Library_vbaobj.mk b/sc/Library_vbaobj.mk index a2adeecca076..49868d85e97a 100644 --- a/sc/Library_vbaobj.mk +++ b/sc/Library_vbaobj.mk @@ -23,6 +23,7 @@ $(eval $(call gb_Library_set_componentfile,vbaobj,sc/util/vbaobj,services)) $(eval $(call gb_Library_use_externals,vbaobj,\ boost_headers \ + frozen \ mdds_headers \ )) diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index e53d2d004e95..dac336ad35b8 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -52,6 +52,9 @@ #include <stylehelper.hxx> #include <utility> #include <unordered_map> +#include <frozen/bits/defines.h> +#include <frozen/bits/elsa_std.h> +#include <frozen/unordered_map.h> using namespace com::sun::star; @@ -101,7 +104,7 @@ void ScOrcusGlobalSettings::set_origin_date(int year, int month, int day) void ScOrcusGlobalSettings::set_character_set(orcus::character_set_t cs) { // Keep the entries sorted by the key. - static const std::unordered_map<orcus::character_set_t, rtl_TextEncoding> rules = { + static constexpr auto rules = frozen::make_unordered_map<orcus::character_set_t, rtl_TextEncoding>({ { orcus::character_set_t::big5, RTL_TEXTENCODING_BIG5 }, { orcus::character_set_t::euc_jp, RTL_TEXTENCODING_EUC_JP }, { orcus::character_set_t::euc_kr, RTL_TEXTENCODING_EUC_KR }, @@ -145,7 +148,7 @@ void ScOrcusGlobalSettings::set_character_set(orcus::character_set_t cs) { orcus::character_set_t::windows_1256, RTL_TEXTENCODING_MS_1256 }, { orcus::character_set_t::windows_1257, RTL_TEXTENCODING_MS_1257 }, { orcus::character_set_t::windows_1258, RTL_TEXTENCODING_MS_1258 }, - }; + }); if (auto it = rules.find(cs); it != rules.end()) mnTextEncoding = it->second; diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx index 7b678d508c90..8172d4096407 100644 --- a/sc/source/ui/vba/vbainterior.cxx +++ b/sc/source/ui/vba/vbainterior.cxx @@ -30,6 +30,9 @@ #include "vbapalette.hxx" #include <document.hxx> #include <utility> +#include <frozen/bits/defines.h> +#include <frozen/bits/elsa_std.h> +#include <frozen/map.h> using namespace ::com::sun::star; using namespace ::ooo::vba; @@ -39,7 +42,7 @@ constexpr OUStringLiteral BACKCOLOR = u"CellBackColor"; constexpr OUStringLiteral PATTERN = u"Pattern"; constexpr OUStringLiteral PATTERNCOLOR = u"PatternColor"; -static std::map< sal_Int32, sal_Int32 > aPatternMap { +constexpr auto aPatternMap = frozen::make_map<sal_Int32, sal_Int32>({ { xlPatternAutomatic, 0 }, { xlPatternChecker, 9 }, { xlPatternCrissCross, 16 }, @@ -60,7 +63,7 @@ static std::map< sal_Int32, sal_Int32 > aPatternMap { { xlPatternSolid, 0 }, { xlPatternUp, 8 }, { xlPatternVertical, 6 } -}; +}); ScVbaInterior::ScVbaInterior( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< beans::XPropertySet > xProps, ScDocument* pScDoc ) : ScVbaInterior_BASE( xParent, xContext ), m_xProps(std::move(xProps)), m_pScDoc( pScDoc ) { @@ -97,7 +100,7 @@ ScVbaInterior::SetMixedColor() { m_nPattern = GetAttributeData( aPattern ); } - sal_Int32 nPattern = aPatternMap[ m_nPattern ]; + sal_Int32 nPattern = aPatternMap.find( m_nPattern )->second; // pattern color uno::Any aPatternColor = GetUserDefinedAttributes( PATTERNCOLOR ); if( aPatternColor.hasValue() ) diff --git a/sw/Library_msword.mk b/sw/Library_msword.mk index e4358a6601eb..5427e2d3e858 100644 --- a/sw/Library_msword.mk +++ b/sw/Library_msword.mk @@ -70,6 +70,7 @@ $(eval $(call gb_Library_use_libraries,msword,\ $(eval $(call gb_Library_use_externals,msword,\ boost_headers \ + frozen \ icui18n \ icuuc \ icu_headers \ diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index cadea4cab043..c97000ca3e4b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -157,6 +157,9 @@ #include <toolkit/helper/vclunohelper.hxx> #include <unicode/regex.h> +#include <frozen/bits/defines.h> +#include <frozen/bits/elsa_std.h> +#include <frozen/unordered_map.h> using ::editeng::SvxBorderLine; @@ -294,7 +297,7 @@ void lclAddThemeValuesToCustomAttributes( rtl::Reference<sax_fastparser::FastAttributeList>& pAttrList, model::ComplexColor const& rComplexColor, sal_Int32 nThemeAttrId, sal_Int32 nThemeTintAttrId, sal_Int32 nThemeShadeAttrId) { - static std::unordered_map<model::ThemeColorType, const char*> constThemeColorTypeTokenMap = { + static constexpr auto constThemeColorTypeTokenMap = frozen::make_unordered_map<model::ThemeColorType, const char*>({ { model::ThemeColorType::Dark1, "dark1" }, { model::ThemeColorType::Light1, "light1" }, { model::ThemeColorType::Dark2, "dark2" }, @@ -307,12 +310,12 @@ void lclAddThemeValuesToCustomAttributes( { model::ThemeColorType::Accent6, "accent6" }, { model::ThemeColorType::Hyperlink, "hyperlink" }, { model::ThemeColorType::FollowedHyperlink, "followedHyperlink" } - }; + }); if (rComplexColor.getType() == model::ColorType::Scheme && rComplexColor.getSchemeType() != model::ThemeColorType::Unknown) { - OString sSchemeType = constThemeColorTypeTokenMap[rComplexColor.getSchemeType()]; + OString sSchemeType = constThemeColorTypeTokenMap.find(rComplexColor.getSchemeType())->second; if (rComplexColor.meThemeColorUsage == model::ThemeColorUsage::Text) { if (rComplexColor.getSchemeType() == model::ThemeColorType::Dark1) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index a7c1fbc22b2f..1c18f470cfeb 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -82,6 +82,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\ $(eval $(call gb_Library_use_externals,vcl,\ boost_headers \ expat \ + frozen \ gio \ glm_headers \ graphite \ diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 9d957f0d113a..a86e385f013c 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -93,6 +93,9 @@ #include <pdf/pdfwriter_impl.hxx> #include <pdf/PdfConfig.hxx> #include <o3tl/sorted_vector.hxx> +#include <frozen/bits/defines.h> +#include <frozen/bits/elsa_std.h> +#include <frozen/map.h> using namespace::com::sun::star; @@ -1839,37 +1842,33 @@ sal_Int32 PDFWriterImpl::emitStructIDTree(sal_Int32 const nObject) const char* PDFWriterImpl::getAttributeTag( PDFWriter::StructAttribute eAttr ) { - static std::map< PDFWriter::StructAttribute, const char* > aAttributeStrings; - // fill maps once - if( aAttributeStrings.empty() ) - { - aAttributeStrings[ PDFWriter::Placement ] = "Placement"; - aAttributeStrings[ PDFWriter::WritingMode ] = "WritingMode"; - aAttributeStrings[ PDFWriter::SpaceBefore ] = "SpaceBefore"; - aAttributeStrings[ PDFWriter::SpaceAfter ] = "SpaceAfter"; - aAttributeStrings[ PDFWriter::StartIndent ] = "StartIndent"; - aAttributeStrings[ PDFWriter::EndIndent ] = "EndIndent"; - aAttributeStrings[ PDFWriter::TextIndent ] = "TextIndent"; - aAttributeStrings[ PDFWriter::TextAlign ] = "TextAlign"; - aAttributeStrings[ PDFWriter::Width ] = "Width"; - aAttributeStrings[ PDFWriter::Height ] = "Height"; - aAttributeStrings[ PDFWriter::BlockAlign ] = "BlockAlign"; - aAttributeStrings[ PDFWriter::InlineAlign ] = "InlineAlign"; - aAttributeStrings[ PDFWriter::LineHeight ] = "LineHeight"; - aAttributeStrings[ PDFWriter::BaselineShift ] = "BaselineShift"; - aAttributeStrings[ PDFWriter::TextDecorationType ] = "TextDecorationType"; - aAttributeStrings[ PDFWriter::ListNumbering ] = "ListNumbering"; - aAttributeStrings[ PDFWriter::RowSpan ] = "RowSpan"; - aAttributeStrings[ PDFWriter::ColSpan ] = "ColSpan"; - aAttributeStrings[ PDFWriter::Scope ] = "Scope"; - aAttributeStrings[ PDFWriter::Role ] = "Role"; - aAttributeStrings[ PDFWriter::Type ] = "Type"; - aAttributeStrings[ PDFWriter::Subtype ] = "Subtype"; - aAttributeStrings[ PDFWriter::LinkAnnotation ] = "LinkAnnotation"; - } - - std::map< PDFWriter::StructAttribute, const char* >::const_iterator it = - aAttributeStrings.find( eAttr ); + static constexpr auto aAttributeStrings = frozen::make_map<PDFWriter::StructAttribute, const char*>({ + { PDFWriter::Placement, "Placement" }, + { PDFWriter::WritingMode, "WritingMode" }, + { PDFWriter::SpaceBefore, "SpaceBefore" }, + { PDFWriter::SpaceAfter, "SpaceAfter" }, + { PDFWriter::StartIndent, "StartIndent" }, + { PDFWriter::EndIndent, "EndIndent" }, + { PDFWriter::TextIndent, "TextIndent" }, + { PDFWriter::TextAlign, "TextAlign" }, + { PDFWriter::Width, "Width" }, + { PDFWriter::Height, "Height" }, + { PDFWriter::BlockAlign, "BlockAlign" }, + { PDFWriter::InlineAlign, "InlineAlign" }, + { PDFWriter::LineHeight, "LineHeight" }, + { PDFWriter::BaselineShift, "BaselineShift" }, + { PDFWriter::TextDecorationType,"TextDecorationType" }, + { PDFWriter::ListNumbering, "ListNumbering" }, + { PDFWriter::RowSpan, "RowSpan" }, + { PDFWriter::ColSpan, "ColSpan" }, + { PDFWriter::Scope, "Scope" }, + { PDFWriter::Role, "Role" }, + { PDFWriter::Type, "Type" }, + { PDFWriter::Subtype, "Subtype" }, + { PDFWriter::LinkAnnotation, "LinkAnnotation" } + }); + + auto it = aAttributeStrings.find( eAttr ); if( it == aAttributeStrings.end() ) SAL_INFO("vcl.pdfwriter", "invalid PDFWriter::StructAttribute " << eAttr); @@ -1879,54 +1878,50 @@ const char* PDFWriterImpl::getAttributeTag( PDFWriter::StructAttribute eAttr ) const char* PDFWriterImpl::getAttributeValueTag( PDFWriter::StructAttributeValue eVal ) { - static std::map< PDFWriter::StructAttributeValue, const char* > aValueStrings; - - if( aValueStrings.empty() ) - { - aValueStrings[ PDFWriter::NONE ] = "None"; - aValueStrings[ PDFWriter::Block ] = "Block"; - aValueStrings[ PDFWriter::Inline ] = "Inline"; - aValueStrings[ PDFWriter::Before ] = "Before"; - aValueStrings[ PDFWriter::After ] = "After"; - aValueStrings[ PDFWriter::Start ] = "Start"; - aValueStrings[ PDFWriter::End ] = "End"; - aValueStrings[ PDFWriter::LrTb ] = "LrTb"; - aValueStrings[ PDFWriter::RlTb ] = "RlTb"; - aValueStrings[ PDFWriter::TbRl ] = "TbRl"; - aValueStrings[ PDFWriter::Center ] = "Center"; - aValueStrings[ PDFWriter::Justify ] = "Justify"; - aValueStrings[ PDFWriter::Auto ] = "Auto"; - aValueStrings[ PDFWriter::Middle ] = "Middle"; - aValueStrings[ PDFWriter::Normal ] = "Normal"; - aValueStrings[ PDFWriter::Underline ] = "Underline"; - aValueStrings[ PDFWriter::Overline ] = "Overline"; - aValueStrings[ PDFWriter::LineThrough ] = "LineThrough"; - aValueStrings[ PDFWriter::Row ] = "Row"; - aValueStrings[ PDFWriter::Column ] = "Column"; - aValueStrings[ PDFWriter::Both ] = "Both"; - aValueStrings[ PDFWriter::Pagination ] = "Pagination"; - aValueStrings[ PDFWriter::Layout ] = "Layout"; - aValueStrings[ PDFWriter::Page ] = "Page"; - aValueStrings[ PDFWriter::Background ] = "Background"; - aValueStrings[ PDFWriter::Header ] = "Header"; - aValueStrings[ PDFWriter::Footer ] = "Footer"; - aValueStrings[ PDFWriter::Watermark ] = "Watermark"; - aValueStrings[ PDFWriter::Rb ] = "rb"; - aValueStrings[ PDFWriter::Cb ] = "cb"; - aValueStrings[ PDFWriter::Pb ] = "pb"; - aValueStrings[ PDFWriter::Tv ] = "tv"; - aValueStrings[ PDFWriter::Disc ] = "Disc"; - aValueStrings[ PDFWriter::Circle ] = "Circle"; - aValueStrings[ PDFWriter::Square ] = "Square"; - aValueStrings[ PDFWriter::Decimal ] = "Decimal"; - aValueStrings[ PDFWriter::UpperRoman ] = "UpperRoman"; - aValueStrings[ PDFWriter::LowerRoman ] = "LowerRoman"; - aValueStrings[ PDFWriter::UpperAlpha ] = "UpperAlpha"; - aValueStrings[ PDFWriter::LowerAlpha ] = "LowerAlpha"; - } - - std::map< PDFWriter::StructAttributeValue, const char* >::const_iterator it = - aValueStrings.find( eVal ); + static constexpr auto aValueStrings = frozen::make_map<PDFWriter::StructAttributeValue, const char*>({ + { PDFWriter::NONE, "None" }, + { PDFWriter::Block, "Block" }, + { PDFWriter::Inline, "Inline" }, + { PDFWriter::Before, "Before" }, + { PDFWriter::After, "After" }, + { PDFWriter::Start, "Start" }, + { PDFWriter::End, "End" }, + { PDFWriter::LrTb, "LrTb" }, + { PDFWriter::RlTb, "RlTb" }, + { PDFWriter::TbRl, "TbRl" }, + { PDFWriter::Center, "Center" }, + { PDFWriter::Justify, "Justify" }, + { PDFWriter::Auto, "Auto" }, + { PDFWriter::Middle, "Middle" }, + { PDFWriter::Normal, "Normal" }, + { PDFWriter::Underline, "Underline" }, + { PDFWriter::Overline, "Overline" }, + { PDFWriter::LineThrough,"LineThrough" }, + { PDFWriter::Row, "Row" }, + { PDFWriter::Column, "Column" }, + { PDFWriter::Both, "Both" }, + { PDFWriter::Pagination, "Pagination" }, + { PDFWriter::Layout, "Layout" }, + { PDFWriter::Page, "Page" }, + { PDFWriter::Background, "Background" }, + { PDFWriter::Header, "Header" }, + { PDFWriter::Footer, "Footer" }, + { PDFWriter::Watermark, "Watermark" }, + { PDFWriter::Rb, "rb" }, + { PDFWriter::Cb, "cb" }, + { PDFWriter::Pb, "pb" }, + { PDFWriter::Tv, "tv" }, + { PDFWriter::Disc, "Disc" }, + { PDFWriter::Circle, "Circle" }, + { PDFWriter::Square, "Square" }, + { PDFWriter::Decimal, "Decimal" }, + { PDFWriter::UpperRoman, "UpperRoman" }, + { PDFWriter::LowerRoman, "LowerRoman" }, + { PDFWriter::UpperAlpha, "UpperAlpha" }, + { PDFWriter::LowerAlpha, "LowerAlpha" } + }); + + auto it = aValueStrings.find( eVal ); if( it == aValueStrings.end() ) SAL_INFO("vcl.pdfwriter", "invalid PDFWriter::StructAttributeValue " << eVal); @@ -10592,48 +10587,46 @@ void PDFWriterImpl::setOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID ) const char* PDFWriterImpl::getStructureTag( PDFWriter::StructElement eType ) { - static std::map< PDFWriter::StructElement, const char* > aTagStrings; - if( aTagStrings.empty() ) - { - aTagStrings[ PDFWriter::NonStructElement] = "NonStruct"; - aTagStrings[ PDFWriter::Document ] = "Document"; - aTagStrings[ PDFWriter::Part ] = "Part"; - aTagStrings[ PDFWriter::Article ] = "Art"; - aTagStrings[ PDFWriter::Section ] = "Sect"; - aTagStrings[ PDFWriter::Division ] = "Div"; - aTagStrings[ PDFWriter::BlockQuote ] = "BlockQuote"; - aTagStrings[ PDFWriter::Caption ] = "Caption"; - aTagStrings[ PDFWriter::TOC ] = "TOC"; - aTagStrings[ PDFWriter::TOCI ] = "TOCI"; - aTagStrings[ PDFWriter::Index ] = "Index"; - aTagStrings[ PDFWriter::Paragraph ] = "P"; - aTagStrings[ PDFWriter::Heading ] = "H"; - aTagStrings[ PDFWriter::H1 ] = "H1"; - aTagStrings[ PDFWriter::H2 ] = "H2"; - aTagStrings[ PDFWriter::H3 ] = "H3"; - aTagStrings[ PDFWriter::H4 ] = "H4"; - aTagStrings[ PDFWriter::H5 ] = "H5"; - aTagStrings[ PDFWriter::H6 ] = "H6"; - aTagStrings[ PDFWriter::List ] = "L"; - aTagStrings[ PDFWriter::ListItem ] = "LI"; - aTagStrings[ PDFWriter::LILabel ] = "Lbl"; - aTagStrings[ PDFWriter::LIBody ] = "LBody"; - aTagStrings[ PDFWriter::Table ] = "Table"; - aTagStrings[ PDFWriter::TableRow ] = "TR"; - aTagStrings[ PDFWriter::TableHeader ] = "TH"; - aTagStrings[ PDFWriter::TableData ] = "TD"; - aTagStrings[ PDFWriter::Span ] = "Span"; - aTagStrings[ PDFWriter::Quote ] = "Quote"; - aTagStrings[ PDFWriter::Note ] = "Note"; - aTagStrings[ PDFWriter::Reference ] = "Reference"; - aTagStrings[ PDFWriter::BibEntry ] = "BibEntry"; - aTagStrings[ PDFWriter::Code ] = "Code"; - aTagStrings[ PDFWriter::Link ] = "Link"; - aTagStrings[ PDFWriter::Annot ] = "Annot"; - aTagStrings[ PDFWriter::Figure ] = "Figure"; - aTagStrings[ PDFWriter::Formula ] = "Formula"; - aTagStrings[ PDFWriter::Form ] = "Form"; - } + static constexpr auto aTagStrings = frozen::make_map<PDFWriter::StructElement, const char*>({ + { PDFWriter::NonStructElement, "NonStruct" }, + { PDFWriter::Document, "Document" }, + { PDFWriter::Part, "Part" }, + { PDFWriter::Article, "Art" }, + { PDFWriter::Section, "Sect" }, + { PDFWriter::Division, "Div" }, + { PDFWriter::BlockQuote, "BlockQuote" }, + { PDFWriter::Caption, "Caption" }, + { PDFWriter::TOC, "TOC" }, + { PDFWriter::TOCI, "TOCI" }, + { PDFWriter::Index, "Index" }, + { PDFWriter::Paragraph, "P" }, + { PDFWriter::Heading, "H" }, + { PDFWriter::H1, "H1" }, + { PDFWriter::H2, "H2" }, + { PDFWriter::H3, "H3" }, + { PDFWriter::H4, "H4" }, + { PDFWriter::H5, "H5" }, + { PDFWriter::H6, "H6" }, + { PDFWriter::List, "L" }, + { PDFWriter::ListItem, "LI" }, + { PDFWriter::LILabel, "Lbl" }, + { PDFWriter::LIBody, "LBody" }, + { PDFWriter::Table, "Table" }, + { PDFWriter::TableRow, "TR" }, + { PDFWriter::TableHeader, "TH" }, + { PDFWriter::TableData, "TD" }, + { PDFWriter::Span, "Span" }, + { PDFWriter::Quote, "Quote" }, + { PDFWriter::Note, "Note" }, + { PDFWriter::Reference, "Reference" }, + { PDFWriter::BibEntry, "BibEntry" }, + { PDFWriter::Code, "Code" }, + { PDFWriter::Link, "Link" }, + { PDFWriter::Annot, "Annot" }, + { PDFWriter::Figure, "Figure" }, + { PDFWriter::Formula, "Formula"}, + { PDFWriter::Form, "Form" } + }); if (eType == PDFWriter::Annot && m_aContext.Version < PDFWriter::PDFVersion::PDF_1_5) @@ -10641,7 +10634,7 @@ const char* PDFWriterImpl::getStructureTag( PDFWriter::StructElement eType ) return "Figure"; // fallback } - std::map< PDFWriter::StructElement, const char* >::const_iterator it = aTagStrings.find( eType ); + auto it = aTagStrings.find( eType ); return it != aTagStrings.end() ? it->second : "Div"; } |