summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/embeddedfontshelper.hxx4
-rw-r--r--include/xmloff/xmlimp.hxx2
-rw-r--r--vcl/source/gdi/embeddedfontshelper.cxx8
-rw-r--r--writerfilter/source/dmapper/FontTable.cxx14
-rw-r--r--writerfilter/source/dmapper/FontTable.hxx6
-rw-r--r--xmloff/source/core/xmlimp.cxx2
-rw-r--r--xmloff/source/style/XMLFontStylesContext.cxx4
7 files changed, 20 insertions, 20 deletions
diff --git a/include/vcl/embeddedfontshelper.hxx b/include/vcl/embeddedfontshelper.hxx
index 4802c13a2d8d..cbf91ee7f09b 100644
--- a/include/vcl/embeddedfontshelper.hxx
+++ b/include/vcl/embeddedfontshelper.hxx
@@ -65,7 +65,7 @@ public:
@param eot whether the data is compressed in Embedded OpenType format
*/
bool addEmbeddedFont( const css::uno::Reference< css::io::XInputStream >& stream,
- const OUString& fontName, const char* extra,
+ const OUString& fontName, std::u16string_view extra,
std::vector< unsigned char > const & key, bool eot = false);
/**
@@ -76,7 +76,7 @@ public:
@param fontName name of the font (e.g. 'Times New Roman')
@param extra additional text to use for name (e.g. to distinguish regular from bold, italic,...), "?" for unique
*/
- static OUString fileUrlForTemporaryFont( const OUString& fontName, const char* extra );
+ static OUString fileUrlForTemporaryFont( const OUString& fontName, std::u16string_view extra );
/**
Adds the accumulated fonts to the list of known fonts. The fonts are used only until application
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 3287911f1112..fda180bb7837 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -582,7 +582,7 @@ public:
// see EmbeddedFontsHelper::addEmbeddedFont
bool addEmbeddedFont( const css::uno::Reference< css::io::XInputStream >& stream,
- const OUString& fontName, const char* extra,
+ const OUString& fontName, std::u16string_view extra,
std::vector< unsigned char > const & key, bool eot);
virtual void NotifyContainsEmbeddedFont() {}
diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx
index b5aa00aafebe..a8a4f7e983ba 100644
--- a/vcl/source/gdi/embeddedfontshelper.cxx
+++ b/vcl/source/gdi/embeddedfontshelper.cxx
@@ -66,7 +66,7 @@ void EmbeddedFontsHelper::clearTemporaryFontFiles()
}
bool EmbeddedFontsHelper::addEmbeddedFont( const uno::Reference< io::XInputStream >& stream, const OUString& fontName,
- const char* extra, std::vector< unsigned char > const & key, bool eot )
+ std::u16string_view extra, std::vector< unsigned char > const & key, bool eot )
{
OUString fileUrl = EmbeddedFontsHelper::fileUrlForTemporaryFont( fontName, extra );
osl::File file( fileUrl );
@@ -189,7 +189,7 @@ void EmbeddedFontsHelper::activateFonts()
m_aAccumulatedFonts.clear();
}
-OUString EmbeddedFontsHelper::fileUrlForTemporaryFont( const OUString& fontName, const char* extra )
+OUString EmbeddedFontsHelper::fileUrlForTemporaryFont( const OUString& fontName, std::u16string_view extra )
{
OUString path = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE( "bootstrap") "::UserInstallation}";
rtl::Bootstrap::expandMacros( path );
@@ -197,10 +197,10 @@ OUString EmbeddedFontsHelper::fileUrlForTemporaryFont( const OUString& fontName,
osl::Directory::createPath( path );
OUString filename = fontName;
static int uniqueCounter = 0;
- if( strcmp( extra, "?" ) == 0 )
+ if( extra == u"?" )
filename += OUString::number( uniqueCounter++ );
else
- filename += OStringToOUString( extra, RTL_TEXTENCODING_ASCII_US );
+ filename += extra;
filename += ".ttf"; // TODO is it always ttf?
return path + filename;
}
diff --git a/writerfilter/source/dmapper/FontTable.cxx b/writerfilter/source/dmapper/FontTable.cxx
index d7c6b4fe3f5b..3ddebaedf419 100644
--- a/writerfilter/source/dmapper/FontTable.cxx
+++ b/writerfilter/source/dmapper/FontTable.cxx
@@ -119,10 +119,10 @@ void FontTable::lcl_sprm(Sprm& rSprm)
if( pProperties )
{
EmbeddedFontHandler handler(*this, m_pImpl->pCurrentEntry->sFontName,
- nSprmId == NS_ooxml::LN_CT_Font_embedRegular ? ""
- : nSprmId == NS_ooxml::LN_CT_Font_embedBold ? "b"
- : nSprmId == NS_ooxml::LN_CT_Font_embedItalic ? "i"
- : /*NS_ooxml::LN_CT_Font_embedBoldItalic*/ "bi" );
+ nSprmId == NS_ooxml::LN_CT_Font_embedRegular ? u""
+ : nSprmId == NS_ooxml::LN_CT_Font_embedBold ? u"b"
+ : nSprmId == NS_ooxml::LN_CT_Font_embedItalic ? u"i"
+ : /*NS_ooxml::LN_CT_Font_embedBoldItalic*/ u"bi" );
pProperties->resolve( handler );
}
break;
@@ -226,7 +226,7 @@ sal_uInt32 FontTable::size()
}
void FontTable::addEmbeddedFont(const css::uno::Reference<css::io::XInputStream>& stream,
- const OUString& fontName, const char* extra,
+ const OUString& fontName, std::u16string_view extra,
std::vector<unsigned char> const & key)
{
if (!m_pImpl->xEmbeddedFontHelper)
@@ -234,11 +234,11 @@ void FontTable::addEmbeddedFont(const css::uno::Reference<css::io::XInputStream>
m_pImpl->xEmbeddedFontHelper->addEmbeddedFont(stream, fontName, extra, key);
}
-EmbeddedFontHandler::EmbeddedFontHandler(FontTable& rFontTable, OUString _fontName, const char* _style )
+EmbeddedFontHandler::EmbeddedFontHandler(FontTable& rFontTable, OUString _fontName, std::u16string_view style )
: LoggedProperties("EmbeddedFontHandler")
, m_fontTable( rFontTable )
, m_fontName(std::move( _fontName ))
-, m_style( _style )
+, m_style( style )
{
}
diff --git a/writerfilter/source/dmapper/FontTable.hxx b/writerfilter/source/dmapper/FontTable.hxx
index ba1d2387a39b..a3ec72bb6917 100644
--- a/writerfilter/source/dmapper/FontTable.hxx
+++ b/writerfilter/source/dmapper/FontTable.hxx
@@ -52,7 +52,7 @@ class FontTable : public LoggedProperties, public LoggedTable
FontEntry::Pointer_t getFontEntry(sal_uInt32 nIndex);
void addEmbeddedFont(const css::uno::Reference<css::io::XInputStream>& stream,
- const OUString& fontName, const char* extra,
+ const OUString& fontName, std::u16string_view extra,
std::vector<unsigned char> const & key);
private:
@@ -88,14 +88,14 @@ typedef tools::SvRef< FontTable > FontTablePtr;
class EmbeddedFontHandler : public LoggedProperties
{
public:
- EmbeddedFontHandler(FontTable& rFontTable, OUString fontName, const char* style);
+ EmbeddedFontHandler(FontTable& rFontTable, OUString fontName, std::u16string_view style);
virtual ~EmbeddedFontHandler() override;
private:
virtual void lcl_attribute( Id name, Value& val ) override;
virtual void lcl_sprm( Sprm& rSprm ) override;
FontTable& m_fontTable;
OUString m_fontName;
- const char* const m_style;
+ std::u16string_view m_style;
OUString m_fontKey;
css::uno::Reference<css::io::XInputStream> m_inputStream;
};
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index a3c5e6fb31d6..0ec4d287cf92 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -466,7 +466,7 @@ SvXMLImport::~SvXMLImport() noexcept
}
bool SvXMLImport::addEmbeddedFont(const css::uno::Reference< css::io::XInputStream >& stream,
- const OUString& fontName, const char* extra,
+ const OUString& fontName, std::u16string_view extra,
std::vector<unsigned char> const & key, bool eot)
{
if (!mxEmbeddedFontHelper)
diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx
index dd495ce928c6..71fe2ad5149b 100644
--- a/xmloff/source/style/XMLFontStylesContext.cxx
+++ b/xmloff/source/style/XMLFontStylesContext.cxx
@@ -291,7 +291,7 @@ void XMLFontStyleContextFontFaceUri::handleEmbeddedFont( const OUString& url, bo
uno::Reference< io::XInputStream > inputStream;
inputStream.set( storage->openStreamElement( url.copy( url.indexOf( '/' ) + 1 ), ::embed::ElementModes::READ ),
UNO_QUERY_THROW );
- if (GetImport().addEmbeddedFont(inputStream, fontName, "?", std::vector< unsigned char >(), eot))
+ if (GetImport().addEmbeddedFont(inputStream, fontName, u"?", std::vector< unsigned char >(), eot))
GetImport().NotifyContainsEmbeddedFont();
inputStream->closeInput();
}
@@ -303,7 +303,7 @@ void XMLFontStyleContextFontFaceUri::handleEmbeddedFont( const ::css::uno::Seque
{
const uno::Reference< io::XInputStream > xInput( new comphelper::SequenceInputStream( rData ) );
const OUString fontName = font.familyName();
- if (GetImport().addEmbeddedFont(xInput, fontName, "?", std::vector< unsigned char >(), eot))
+ if (GetImport().addEmbeddedFont(xInput, fontName, u"?", std::vector< unsigned char >(), eot))
GetImport().NotifyContainsEmbeddedFont();
xInput->closeInput();
}