Kaydet (Commit) 5527d5c4 authored tarafından Noel Grandin's avatar Noel Grandin

convert drawinglayer module from String to OUString

Change-Id: I115dfd5ca7d343b220b2a3e8aa0565f9e4689042
üst 3728952b
...@@ -31,8 +31,8 @@ namespace drawinglayer ...@@ -31,8 +31,8 @@ namespace drawinglayer
{ {
public: public:
/// core data /// core data
String maFamilyName; // Font Family Name OUString maFamilyName; // Font Family Name
String maStyleName; // Font Style Name OUString maStyleName; // Font Style Name
sal_uInt16 mnWeight; // Font weight sal_uInt16 mnWeight; // Font weight
/// bitfield /// bitfield
...@@ -45,8 +45,8 @@ namespace drawinglayer ...@@ -45,8 +45,8 @@ namespace drawinglayer
unsigned mbMonospaced : 1; unsigned mbMonospaced : 1;
ImpFontAttribute( ImpFontAttribute(
const String& rFamilyName, const OUString& rFamilyName,
const String& rStyleName, const OUString& rStyleName,
sal_uInt16 nWeight, sal_uInt16 nWeight,
bool bSymbol, bool bSymbol,
bool bVertical, bool bVertical,
...@@ -83,8 +83,8 @@ namespace drawinglayer ...@@ -83,8 +83,8 @@ namespace drawinglayer
} }
// data read access // data read access
const String& getFamilyName() const { return maFamilyName; } const OUString& getFamilyName() const { return maFamilyName; }
const String& getStyleName() const { return maStyleName; } const OUString& getStyleName() const { return maStyleName; }
sal_uInt16 getWeight() const { return mnWeight; } sal_uInt16 getWeight() const { return mnWeight; }
bool getSymbol() const { return mbSymbol; } bool getSymbol() const { return mbSymbol; }
bool getVertical() const { return mbVertical; } bool getVertical() const { return mbVertical; }
...@@ -116,8 +116,8 @@ namespace drawinglayer ...@@ -116,8 +116,8 @@ namespace drawinglayer
} }
FontAttribute::FontAttribute( FontAttribute::FontAttribute(
const String& rFamilyName, const OUString& rFamilyName,
const String& rStyleName, const OUString& rStyleName,
sal_uInt16 nWeight, sal_uInt16 nWeight,
bool bSymbol, bool bSymbol,
bool bVertical, bool bVertical,
...@@ -161,12 +161,12 @@ namespace drawinglayer ...@@ -161,12 +161,12 @@ namespace drawinglayer
return rCandidate.mpFontAttribute == mpFontAttribute; return rCandidate.mpFontAttribute == mpFontAttribute;
} }
const String& FontAttribute::getFamilyName() const const OUString& FontAttribute::getFamilyName() const
{ {
return mpFontAttribute->getFamilyName(); return mpFontAttribute->getFamilyName();
} }
const String& FontAttribute::getStyleName() const const OUString& FontAttribute::getStyleName() const
{ {
return mpFontAttribute->getStyleName(); return mpFontAttribute->getStyleName();
} }
......
...@@ -38,7 +38,7 @@ namespace drawinglayer ...@@ -38,7 +38,7 @@ namespace drawinglayer
void TextDecoratedPortionPrimitive2D::impCreateGeometryContent( void TextDecoratedPortionPrimitive2D::impCreateGeometryContent(
std::vector< Primitive2DReference >& rTarget, std::vector< Primitive2DReference >& rTarget,
basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans, basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
const String& rText, const OUString& rText,
xub_StrLen aTextPosition, xub_StrLen aTextPosition,
xub_StrLen aTextLength, xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray, const ::std::vector< double >& rDXArray,
...@@ -311,7 +311,7 @@ namespace drawinglayer ...@@ -311,7 +311,7 @@ namespace drawinglayer
// TextSimplePortionPrimitive2D parameters // TextSimplePortionPrimitive2D parameters
const basegfx::B2DHomMatrix& rNewTransform, const basegfx::B2DHomMatrix& rNewTransform,
const String& rText, const OUString& rText,
xub_StrLen aTextPosition, xub_StrLen aTextPosition,
xub_StrLen aTextLength, xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray, const ::std::vector< double >& rDXArray,
......
...@@ -215,7 +215,7 @@ namespace drawinglayer ...@@ -215,7 +215,7 @@ namespace drawinglayer
} }
double TextLayouterDevice::getTextWidth( double TextLayouterDevice::getTextWidth(
const String& rText, const OUString& rText,
sal_uInt32 nIndex, sal_uInt32 nIndex,
sal_uInt32 nLength) const sal_uInt32 nLength) const
{ {
...@@ -224,14 +224,14 @@ namespace drawinglayer ...@@ -224,14 +224,14 @@ namespace drawinglayer
bool TextLayouterDevice::getTextOutlines( bool TextLayouterDevice::getTextOutlines(
basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector, basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
const String& rText, const OUString& rText,
sal_uInt32 nIndex, sal_uInt32 nIndex,
sal_uInt32 nLength, sal_uInt32 nLength,
const ::std::vector< double >& rDXArray) const const ::std::vector< double >& rDXArray) const
{ {
const sal_uInt32 nDXArrayCount(rDXArray.size()); const sal_uInt32 nDXArrayCount(rDXArray.size());
sal_uInt32 nTextLength(nLength); sal_uInt32 nTextLength(nLength);
const sal_uInt32 nStringLength(rText.Len()); const sal_uInt32 nStringLength(rText.getLength());
if(nTextLength + nIndex > nStringLength) if(nTextLength + nIndex > nStringLength)
{ {
...@@ -273,12 +273,12 @@ namespace drawinglayer ...@@ -273,12 +273,12 @@ namespace drawinglayer
} }
basegfx::B2DRange TextLayouterDevice::getTextBoundRect( basegfx::B2DRange TextLayouterDevice::getTextBoundRect(
const String& rText, const OUString& rText,
sal_uInt32 nIndex, sal_uInt32 nIndex,
sal_uInt32 nLength) const sal_uInt32 nLength) const
{ {
sal_uInt32 nTextLength(nLength); sal_uInt32 nTextLength(nLength);
const sal_uInt32 nStringLength(rText.Len()); const sal_uInt32 nStringLength(rText.getLength());
if(nTextLength + nIndex > nStringLength) if(nTextLength + nIndex > nStringLength)
{ {
...@@ -322,7 +322,7 @@ namespace drawinglayer ...@@ -322,7 +322,7 @@ namespace drawinglayer
void TextLayouterDevice::addTextRectActions( void TextLayouterDevice::addTextRectActions(
const Rectangle& rRectangle, const Rectangle& rRectangle,
const String& rText, const OUString& rText,
sal_uInt16 nStyle, sal_uInt16 nStyle,
GDIMetaFile& rGDIMetaFile) const GDIMetaFile& rGDIMetaFile) const
{ {
...@@ -331,13 +331,13 @@ namespace drawinglayer ...@@ -331,13 +331,13 @@ namespace drawinglayer
} }
::std::vector< double > TextLayouterDevice::getTextArray( ::std::vector< double > TextLayouterDevice::getTextArray(
const String& rText, const OUString& rText,
sal_uInt32 nIndex, sal_uInt32 nIndex,
sal_uInt32 nLength) const sal_uInt32 nLength) const
{ {
::std::vector< double > aRetval; ::std::vector< double > aRetval;
sal_uInt32 nTextLength(nLength); sal_uInt32 nTextLength(nLength);
const sal_uInt32 nStringLength(rText.Len()); const sal_uInt32 nStringLength(rText.getLength());
if(nTextLength + nIndex > nStringLength) if(nTextLength + nIndex > nStringLength)
{ {
......
...@@ -220,7 +220,7 @@ namespace drawinglayer ...@@ -220,7 +220,7 @@ namespace drawinglayer
TextSimplePortionPrimitive2D::TextSimplePortionPrimitive2D( TextSimplePortionPrimitive2D::TextSimplePortionPrimitive2D(
const basegfx::B2DHomMatrix& rNewTransform, const basegfx::B2DHomMatrix& rNewTransform,
const String& rText, const OUString& rText,
xub_StrLen aTextPosition, xub_StrLen aTextPosition,
xub_StrLen aTextLength, xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray, const ::std::vector< double >& rDXArray,
...@@ -243,7 +243,7 @@ namespace drawinglayer ...@@ -243,7 +243,7 @@ namespace drawinglayer
mnWidthToFill(nWidthToFill) mnWidthToFill(nWidthToFill)
{ {
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0
const xub_StrLen aStringLength(getText().Len()); const sal_Int32 aStringLength(getText().getLength());
OSL_ENSURE(aStringLength >= getTextPosition() && aStringLength >= getTextPosition() + getTextLength(), OSL_ENSURE(aStringLength >= getTextPosition() && aStringLength >= getTextPosition() + getTextLength(),
"TextSimplePortionPrimitive2D with text out of range (!)"); "TextSimplePortionPrimitive2D with text out of range (!)");
#endif #endif
......
...@@ -89,7 +89,7 @@ namespace drawinglayer ...@@ -89,7 +89,7 @@ namespace drawinglayer
const double fStrikeCharCount(fabs(getWidth()/fStrikeCharWidth)); const double fStrikeCharCount(fabs(getWidth()/fStrikeCharWidth));
const sal_uInt32 nStrikeCharCount(static_cast< sal_uInt32 >(fStrikeCharCount + 0.5)); const sal_uInt32 nStrikeCharCount(static_cast< sal_uInt32 >(fStrikeCharCount + 0.5));
std::vector<double> aDXArray(nStrikeCharCount); std::vector<double> aDXArray(nStrikeCharCount);
String aStrikeoutString; OUString aStrikeoutString;
for(sal_uInt32 a(0); a < nStrikeCharCount; a++) for(sal_uInt32 a(0); a < nStrikeCharCount; a++)
{ {
...@@ -102,7 +102,7 @@ namespace drawinglayer ...@@ -102,7 +102,7 @@ namespace drawinglayer
getObjectTransformation(), getObjectTransformation(),
aStrikeoutString, aStrikeoutString,
0, 0,
aStrikeoutString.Len(), aStrikeoutString.getLength(),
aDXArray, aDXArray,
getFontAttribute(), getFontAttribute(),
getLocale(), getLocale(),
......
...@@ -292,7 +292,7 @@ namespace drawinglayer ...@@ -292,7 +292,7 @@ namespace drawinglayer
if(bDoSaveForVisualControl) if(bDoSaveForVisualControl)
{ {
SvFileStream aNew((const String&)String( "c:\\content.bmp" ), STREAM_WRITE|STREAM_TRUNC); SvFileStream aNew( "c:\\content.bmp", STREAM_WRITE|STREAM_TRUNC);
WriteDIB(aContent, aNew, false, true); WriteDIB(aContent, aNew, false, true);
} }
...@@ -303,7 +303,7 @@ namespace drawinglayer ...@@ -303,7 +303,7 @@ namespace drawinglayer
if(bDoSaveForVisualControl) if(bDoSaveForVisualControl)
{ {
SvFileStream aNew((const String&)String( "c:\\transparence.bmp" ), STREAM_WRITE|STREAM_TRUNC); SvFileStream aNew( "c:\\transparence.bmp", STREAM_WRITE|STREAM_TRUNC);
WriteDIB(aAlphaMask.GetBitmap(), aNew, false, true); WriteDIB(aAlphaMask.GetBitmap(), aNew, false, true);
} }
...@@ -316,7 +316,7 @@ namespace drawinglayer ...@@ -316,7 +316,7 @@ namespace drawinglayer
if(bDoSaveForVisualControl) if(bDoSaveForVisualControl)
{ {
SvFileStream aNew((const String&)String( "c:\\mask.bmp" ), STREAM_WRITE|STREAM_TRUNC); SvFileStream aNew( "c:\\mask.bmp", STREAM_WRITE|STREAM_TRUNC);
WriteDIB(aMask, aNew, false, true); WriteDIB(aMask, aNew, false, true);
} }
......
...@@ -274,7 +274,7 @@ namespace drawinglayer ...@@ -274,7 +274,7 @@ namespace drawinglayer
mpOutputDevice->SetFont(aFont); mpOutputDevice->SetFont(aFont);
mpOutputDevice->SetTextColor(Color(aRGBFontColor)); mpOutputDevice->SetTextColor(Color(aRGBFontColor));
String aText( rTextCandidate.getText() ); OUString aText( rTextCandidate.getText() );
xub_StrLen nPos = rTextCandidate.getTextPosition(); xub_StrLen nPos = rTextCandidate.getTextPosition();
xub_StrLen nLen = rTextCandidate.getTextLength(); xub_StrLen nLen = rTextCandidate.getTextLength();
...@@ -295,7 +295,7 @@ namespace drawinglayer ...@@ -295,7 +295,7 @@ namespace drawinglayer
nChars = nWidthToFill / nWidth; nChars = nWidthToFill / nWidth;
OUStringBuffer aFilled; OUStringBuffer aFilled;
comphelper::string::padToLength(aFilled, (sal_uInt16)nChars, aText.GetChar(0)); comphelper::string::padToLength(aFilled, (sal_uInt16)nChars, aText[0]);
aText = aFilled.makeStringAndClear(); aText = aFilled.makeStringAndClear();
nPos = 0; nPos = 0;
nLen = nChars; nLen = nChars;
......
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// predefines // predefines
class String; namespace rtl {
class OUString;
}
namespace drawinglayer { namespace attribute { namespace drawinglayer { namespace attribute {
class ImpFontAttribute; class ImpFontAttribute;
...@@ -55,8 +57,8 @@ namespace drawinglayer ...@@ -55,8 +57,8 @@ namespace drawinglayer
/// constructors/assignmentoperator/destructor /// constructors/assignmentoperator/destructor
/// TODO: pair kerning and CJK kerning /// TODO: pair kerning and CJK kerning
FontAttribute( FontAttribute(
const String& rFamilyName, const rtl::OUString& rFamilyName,
const String& rStyleName, const rtl::OUString& rStyleName,
sal_uInt16 nWeight, sal_uInt16 nWeight,
bool bSymbol = false, bool bSymbol = false,
bool bVertical = false, bool bVertical = false,
...@@ -77,8 +79,8 @@ namespace drawinglayer ...@@ -77,8 +79,8 @@ namespace drawinglayer
bool operator==(const FontAttribute& rCandidate) const; bool operator==(const FontAttribute& rCandidate) const;
/// data read access /// data read access
const String& getFamilyName() const; const rtl::OUString& getFamilyName() const;
const String& getStyleName() const; const rtl::OUString& getStyleName() const;
sal_uInt16 getWeight() const; sal_uInt16 getWeight() const;
bool getSymbol() const; bool getSymbol() const;
bool getVertical() const; bool getVertical() const;
......
...@@ -72,7 +72,7 @@ namespace drawinglayer ...@@ -72,7 +72,7 @@ namespace drawinglayer
void impCreateGeometryContent( void impCreateGeometryContent(
std::vector< Primitive2DReference >& rTarget, std::vector< Primitive2DReference >& rTarget,
basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans, basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
const String& rText, const OUString& rText,
xub_StrLen aTextPosition, xub_StrLen aTextPosition,
xub_StrLen aTextLength, xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray, const ::std::vector< double >& rDXArray,
...@@ -88,7 +88,7 @@ namespace drawinglayer ...@@ -88,7 +88,7 @@ namespace drawinglayer
/// TextSimplePortionPrimitive2D parameters /// TextSimplePortionPrimitive2D parameters
const basegfx::B2DHomMatrix& rNewTransform, const basegfx::B2DHomMatrix& rNewTransform,
const String& rText, const OUString& rText,
xub_StrLen aTextPosition, xub_StrLen aTextPosition,
xub_StrLen aTextLength, xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray, const ::std::vector< double >& rDXArray,
......
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
// predefines // predefines
class VirtualDevice; class VirtualDevice;
class Font; class Font;
class String; namespace rtl {
class OUString;
};
class OutputDevice; class OutputDevice;
class GDIMetaFile; class GDIMetaFile;
...@@ -81,19 +83,19 @@ namespace drawinglayer ...@@ -81,19 +83,19 @@ namespace drawinglayer
double getStrikeoutOffset() const; double getStrikeoutOffset() const;
double getTextWidth( double getTextWidth(
const String& rText, const rtl::OUString& rText,
sal_uInt32 nIndex, sal_uInt32 nIndex,
sal_uInt32 nLength) const; sal_uInt32 nLength) const;
bool getTextOutlines( bool getTextOutlines(
basegfx::B2DPolyPolygonVector&, basegfx::B2DPolyPolygonVector&,
const String& rText, const rtl::OUString& rText,
sal_uInt32 nIndex, sal_uInt32 nIndex,
sal_uInt32 nLength, sal_uInt32 nLength,
const ::std::vector< double >& rDXArray) const; const ::std::vector< double >& rDXArray) const;
basegfx::B2DRange getTextBoundRect( basegfx::B2DRange getTextBoundRect(
const String& rText, const rtl::OUString& rText,
sal_uInt32 nIndex, sal_uInt32 nIndex,
sal_uInt32 nLength) const; sal_uInt32 nLength) const;
...@@ -102,12 +104,12 @@ namespace drawinglayer ...@@ -102,12 +104,12 @@ namespace drawinglayer
void addTextRectActions( void addTextRectActions(
const Rectangle& rRectangle, const Rectangle& rRectangle,
const String& rText, const rtl::OUString& rText,
sal_uInt16 nStyle, sal_uInt16 nStyle,
GDIMetaFile& rGDIMetaFile) const; GDIMetaFile& rGDIMetaFile) const;
::std::vector< double > getTextArray( ::std::vector< double > getTextArray(
const String& rText, const rtl::OUString& rText,
sal_uInt32 nIndex, sal_uInt32 nIndex,
sal_uInt32 nLength) const; sal_uInt32 nLength) const;
}; };
......
...@@ -97,7 +97,7 @@ namespace drawinglayer ...@@ -97,7 +97,7 @@ namespace drawinglayer
basegfx::B2DHomMatrix maTextTransform; basegfx::B2DHomMatrix maTextTransform;
/// The text, used from maTextPosition up to maTextPosition + maTextLength /// The text, used from maTextPosition up to maTextPosition + maTextLength
String maText; OUString maText;
/// The index from where on maText is used /// The index from where on maText is used
xub_StrLen maTextPosition; xub_StrLen maTextPosition;
...@@ -130,7 +130,7 @@ namespace drawinglayer ...@@ -130,7 +130,7 @@ namespace drawinglayer
/// constructor /// constructor
TextSimplePortionPrimitive2D( TextSimplePortionPrimitive2D(
const basegfx::B2DHomMatrix& rNewTransform, const basegfx::B2DHomMatrix& rNewTransform,
const String& rText, const OUString& rText,
xub_StrLen aTextPosition, xub_StrLen aTextPosition,
xub_StrLen aTextLength, xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray, const ::std::vector< double >& rDXArray,
...@@ -148,7 +148,7 @@ namespace drawinglayer ...@@ -148,7 +148,7 @@ namespace drawinglayer
/// data read access /// data read access
const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; } const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; }
const String& getText() const { return maText; } const OUString& getText() const { return maText; }
xub_StrLen getTextPosition() const { return maTextPosition; } xub_StrLen getTextPosition() const { return maTextPosition; }
xub_StrLen getTextLength() const { return maTextLength; } xub_StrLen getTextLength() const { return maTextLength; }
const ::std::vector< double >& getDXArray() const { return maDXArray; } const ::std::vector< double >& getDXArray() const { return maDXArray; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment