[Libreoffice-commits] .: 2 commits - starmath/inc starmath/source sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Jun 29 03:18:10 PDT 2011
starmath/inc/document.hxx | 4 --
starmath/source/document.cxx | 6 +---
starmath/source/edit.cxx | 2 -
sw/source/filter/html/css1atr.cxx | 56 +++++++++++++++++++-------------------
sw/source/filter/html/wrthtml.hxx | 8 +++++
5 files changed, 41 insertions(+), 35 deletions(-)
New commits:
commit 82cfe165b7509c2a3251caa2a8110d204ca35667
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 29 08:57:56 2011 +0100
remove deprecated ByteString::CreateFromInt64
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index d980b55..a44b5d8 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -101,6 +101,8 @@
#include <IDocumentStylePoolAccess.hxx>
#include <numrule.hxx>
+#include <rtl/strbuf.hxx>
+
using ::editeng::SvxBorderLine;
/*
@@ -321,13 +323,14 @@ void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp,
Strm() << sOut.GetBuffer();
}
-static void AddUnitPropertyValue( long nVal, FieldUnit eUnit, ByteString& rOut )
+static void AddUnitPropertyValue(rtl::OStringBuffer &rOut, long nVal,
+ FieldUnit eUnit)
{
if( nVal < 0 )
{
// Vorzeichen extra behandeln
nVal = -nVal;
- rOut += '-';
+ rOut.append('-');
}
// Die umgerechnete Einheit ergibt sich aus (x * nMul)/(nDiv*nFac*10)
@@ -416,12 +419,12 @@ static void AddUnitPropertyValue( long nVal, FieldUnit eUnit, ByteString& rOut )
rOut += (long)(nBigVal / nBigFac);
if( !(nBigVal % nBigFac).IsZero() )
{
- rOut += '.';
+ rOut.append('.');
while( nFac > 1 && !(nBigVal % nBigFac).IsZero() )
{
nFac /= 10;
nBigFac = nFac;
- rOut += (int)((nBigVal / nBigFac) % nBig10 );
+ rOut.append(static_cast<sal_Int32>((nBigVal / nBigFac) % nBig10));
}
}
bOutLongVal = sal_False;
@@ -440,15 +443,14 @@ static void AddUnitPropertyValue( long nVal, FieldUnit eUnit, ByteString& rOut )
}
else
{
- rOut += ByteString::CreateFromInt64( nBigVal / (sal_Int64)nFac );
+ rOut.append(nBigVal / (sal_Int64)nFac);
if( (nBigVal % (sal_Int64)nFac) != 0 )
{
- rOut += '.';
+ rOut.append('.');
while( nFac > 1 && (nBigVal % (sal_Int64)nFac) != 0 )
{
nFac /= 10;
- rOut += ByteString::CreateFromInt64(
- (nBigVal / (sal_Int64)nFac) % (sal_Int64)10 );
+ rOut.append((nBigVal / (sal_Int64)nFac) % (sal_Int64)10);
}
}
bOutLongVal = sal_False;
@@ -465,26 +467,26 @@ static void AddUnitPropertyValue( long nVal, FieldUnit eUnit, ByteString& rOut )
if( bOutLongVal )
{
- rOut += ByteString::CreateFromInt32( nLongVal/nFac );
+ rOut.append(static_cast<sal_Int32>(nLongVal/nFac));
if( (nLongVal % nFac) != 0 )
{
- rOut += '.';
+ rOut.append('.');
while( nFac > 1 && (nLongVal % nFac) != 0 )
{
nFac /= 10;
- rOut += ByteString::CreateFromInt32( (nLongVal / nFac) % 10 );
+ rOut.append(static_cast<sal_Int32>((nLongVal / nFac) % 10));
}
}
}
- rOut.Append( pUnit );
+ rOut.append(pUnit);
}
void SwHTMLWriter::OutCSS1_UnitProperty( const sal_Char *pProp, long nVal )
{
- ByteString sOut;
- AddUnitPropertyValue( nVal, eCSS1Unit, sOut );
- OutCSS1_PropertyAscii( pProp, sOut );
+ rtl::OStringBuffer sOut;
+ AddUnitPropertyValue(sOut, nVal, eCSS1Unit);
+ OutCSS1_PropertyAscii(pProp, sOut.makeStringAndClear());
}
void SwHTMLWriter::OutCSS1_PixelProperty( const sal_Char *pProp, long nVal,
@@ -1856,11 +1858,11 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc,
}
else
{
- ByteString sVal;
- AddUnitPropertyValue( rSz.Width(), rHTMLWrt.GetCSS1Unit(), sVal );
- sVal += ' ';
- AddUnitPropertyValue( rSz.Height(), rHTMLWrt.GetCSS1Unit(), sVal );
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_size, sVal );
+ rtl::OStringBuffer sVal;
+ AddUnitPropertyValue(sVal, rSz.Width(), rHTMLWrt.GetCSS1Unit());
+ sVal.append(' ');
+ AddUnitPropertyValue(sVal, rSz.Height(), rHTMLWrt.GetCSS1Unit());
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_size, sVal);
}
// Die Abstand-Attribute koennen auf gwohnte Weise exportiert werden
@@ -2418,8 +2420,8 @@ void SwHTMLWriter::OutCSS1_FrmFmtBackground( const SwFrmFmt& rFrmFmt )
}
ByteString sOut;
- GetCSS1Color( aColor, sOut );
- OutCSS1_PropertyAscii( sCSS1_P_background, sOut );
+ GetCSS1Color(aColor, sOut);
+ OutCSS1_PropertyAscii(sCSS1_P_background, sOut);
}
}
@@ -3647,14 +3649,14 @@ Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt )
if( nTopDist == nBottomDist && nLeftDist == nRightDist )
{
- ByteString sVal;
- AddUnitPropertyValue( nTopDist, rHTMLWrt.GetCSS1Unit(), sVal );
+ rtl::OStringBuffer sVal;
+ AddUnitPropertyValue(sVal, nTopDist, rHTMLWrt.GetCSS1Unit());
if( nTopDist != nLeftDist )
{
- sVal += ' ';
- AddUnitPropertyValue( nLeftDist, rHTMLWrt.GetCSS1Unit(), sVal );
+ sVal.append(' ');
+ AddUnitPropertyValue(sVal, nLeftDist, rHTMLWrt.GetCSS1Unit());
}
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_padding, sVal );
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_padding, sVal.makeStringAndClear());
}
else
{
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index e83c582..4e040f1 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -381,6 +381,8 @@ public:
const sal_Char *pVal );
inline void OutCSS1_PropertyAscii( const sal_Char *pProp,
const ByteString& rVal );
+ inline void OutCSS1_PropertyAscii( const sal_Char *pProp,
+ const rtl::OString& rVal );
inline void OutCSS1_Property( const sal_Char *pProp, const String& rVal );
void OutCSS1_Property( const sal_Char *pProp, const sal_Char *pVal,
const String *pSVal );
@@ -514,6 +516,12 @@ inline void SwHTMLWriter::OutCSS1_PropertyAscii( const sal_Char *pProp,
OutCSS1_Property( pProp, rVal.GetBuffer(), 0 );
}
+inline void SwHTMLWriter::OutCSS1_PropertyAscii( const sal_Char *pProp,
+ const rtl::OString& rVal )
+{
+ OutCSS1_Property( pProp, rVal.getStr(), 0 );
+}
+
inline void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp,
const String& rVal )
{
commit 857f4e874fefe2e6cd2f3d6e4b87d3a5cf4b35b3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 28 16:41:42 2011 +0100
fix nutty pseudo-deference of NULL
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 9635998..95144fb 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -100,9 +100,7 @@ public:
////////////////////////////////////////////////////////////
-void SetEditEngineDefaultFonts(
- EditEngine &rEditEngine,
- SfxItemPool &rEditEngineItemPool );
+void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool);
////////////////////////////////////////////////////////////
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 2ebf536..d836114 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -325,9 +325,7 @@ void SmDocShell::ArrangeFormula()
}
-void SetEditEngineDefaultFonts(
- EditEngine &/*rEditEngine*/,
- SfxItemPool &rEditEngineItemPool )
+void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool)
{
//
// set fonts to be used
@@ -394,7 +392,7 @@ EditEngine& SmDocShell::GetEditEngine()
pEditEngineItemPool = EditEngine::CreatePool();
- SetEditEngineDefaultFonts( *pEditEngine, *pEditEngineItemPool );
+ SetEditEngineDefaultFonts(*pEditEngineItemPool);
pEditEngine = new EditEngine( pEditEngineItemPool );
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index f0e0e03..7313ae6 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -250,7 +250,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& )
pEditEngine->SetDefTab( sal_uInt16( GetTextWidth( C2S("XXXX") ) ) );
- SetEditEngineDefaultFonts( *pEditEngine, *pEditEngineItemPool );
+ SetEditEngineDefaultFonts(*pEditEngineItemPool);
// forces new settings to be used
// unfortunately this resets the whole edit engine
More information about the Libreoffice-commits
mailing list