summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-10-07 18:27:43 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-07 18:27:43 +0200
commite738e79d21c8f48784602efdd915aed3ef2a7c2d (patch)
treec9e7bb3a0cddbcef8b3bb45d2c62aa5877b34c7b /svtools
parent5c2894222beed4b30c6be0379cade228c42c5610 (diff)
Clean up RTFOutFuncs interface
Change-Id: I934f2375474035504b4ba9612af4f45a7d05ce9b
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svrtf/rtfout.cxx47
1 files changed, 25 insertions, 22 deletions
diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx
index 68ccedd1b48e..405d2e429a2e 100644
--- a/svtools/source/svrtf/rtfout.cxx
+++ b/svtools/source/svrtf/rtfout.cxx
@@ -24,7 +24,29 @@
#include <svtools/rtfkeywd.hxx>
#include <svtools/rtfout.hxx>
-SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c,
+namespace {
+
+SvStream& Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen )
+{
+ sal_Char aNToABuf[] = "0000000000000000";
+
+ DBG_ASSERT( nLen < sizeof(aNToABuf), "zu viele Stellen" );
+ if( nLen >= sizeof(aNToABuf) )
+ nLen = (sizeof(aNToABuf)-1);
+
+ // set pointer to end of buffer
+ sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1);
+ for( sal_uInt8 n = 0; n < nLen; ++n )
+ {
+ *(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
+ if( *pStr > '9' )
+ *pStr += 39;
+ nHex >>= 4;
+ }
+ return rStream.WriteCharPtr( pStr );
+}
+
+SvStream& Out_Char(SvStream& rStream, sal_Unicode c,
int *pUCMode, rtl_TextEncoding eDestEnc, bool bWriteHelpFile)
{
const sal_Char* pStr = nullptr;
@@ -147,6 +169,8 @@ SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c,
return rStream;
}
+}
+
SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const OUString& rStr,
rtl_TextEncoding eDestEnc, bool bWriteHelpFile)
{
@@ -158,25 +182,4 @@ SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const OUString& rStr,
return rStream;
}
-SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen )
-{
- sal_Char aNToABuf[] = "0000000000000000";
-
- DBG_ASSERT( nLen < sizeof(aNToABuf), "zu viele Stellen" );
- if( nLen >= sizeof(aNToABuf) )
- nLen = (sizeof(aNToABuf)-1);
-
- // set pointer to end of buffer
- sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1);
- for( sal_uInt8 n = 0; n < nLen; ++n )
- {
- *(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
- if( *pStr > '9' )
- *pStr += 39;
- nHex >>= 4;
- }
- return rStream.WriteCharPtr( pStr );
-}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */