summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-18 11:34:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-18 11:34:32 +0100
commit841ffc4a848f8ca496154e4a37be8c3dc0db3107 (patch)
tree52f06414c7e9b2375013555d274c927149fea1aa
parentconvert LocaleDataWrapper to OUString (diff)
downloadbinfilter-841ffc4a848f8ca496154e4a37be8c3dc0db3107.tar.gz
binfilter-841ffc4a848f8ca496154e4a37be8c3dc0db3107.zip
detect wrong UniString ctor
there's no way j was intended to be used as a rtl_TextEncoding here. From context it's clearly meant to create a UniString from a subset of the input ByteString Change-Id: I4aa47173a8c81b3e61a14697ed3db89e93f4637b
-rw-r--r--binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx2
-rw-r--r--binfilter/inc/bf_tools/string.hxx5
2 files changed, 6 insertions, 1 deletions
diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx b/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
index e2bcfe092..ea35f0f5d 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
@@ -1178,7 +1178,7 @@ void SgfFontOne::ReadOne( const rtl::OString& rID, ByteString& Dsc )
i--;
j++;
}
- SVFName=String(Dsc,i+1,j); // SV-Fontname rausholen
+ SVFName=String(Dsc,i+1,j,RTL_TEXTENCODING_IBM_437); // SV-Fontname rausholen
Dsc.Erase(i,j);
IFID = (UINT32)rID.toInt32();
diff --git a/binfilter/inc/bf_tools/string.hxx b/binfilter/inc/bf_tools/string.hxx
index ab6584098..d8dfdfda7 100644
--- a/binfilter/inc/bf_tools/string.hxx
+++ b/binfilter/inc/bf_tools/string.hxx
@@ -277,6 +277,11 @@ private:
//detect and reject use of RTL_CONSTASCII_STRINGPARAM instead of RTL_CONSTASCII_USTRINGPARAM
UniString( const sal_Char*, sal_Int32 );
+
+ //detect and reject wrong way to attempt to create a UniString from a substring of
+ //a ByteString
+ UniString( const ByteString& rByteStr, xub_StrLen nPos, xub_StrLen nLen,
+ sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
public:
UniString();
UniString( const UniString& rStr );