[Libreoffice-commits] core.git: 2 commits - sc/source sw/qa sw/source
Christian M. Heller
christian.heller63 at gmail.com
Wed Oct 1 07:16:15 PDT 2014
sc/source/filter/dif/difimp.cxx | 26 +++++++++++++-------------
sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 6 +++++-
sw/source/filter/ww8/docxattributeoutput.cxx | 2 +-
sw/source/filter/ww8/wrtw8esh.cxx | 10 +++++++++-
sw/source/filter/ww8/wrtww8.cxx | 1 +
sw/source/filter/ww8/wrtww8.hxx | 2 ++
6 files changed, 31 insertions(+), 16 deletions(-)
New commits:
commit 3bbb934da7368217680e67cb76d6ecd2b4694696
Author: Christian M. Heller <christian.heller63 at gmail.com>
Date: Wed Oct 1 05:30:54 2014 -0400
fdo#39468 Translate German Comments - sc/cource/filter/dif
Change-Id: I1d44c2538baac9a1443118c95a2886db5098dab1
Reviewed-on: https://gerrit.libreoffice.org/11736
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 243f6fa..2a8e187 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -121,7 +121,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc,
}
if( eTopic == T_DATA )
- { // Ab hier kommen die Daten
+ { // data starts here
SCCOL nBaseCol = rInsPos.Col();
SCCOL nColCnt = SCCOL_MAX;
@@ -149,7 +149,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc,
break;
case D_EOD:
break;
- case D_NUMERIC: // Numbercell
+ case D_NUMERIC: // Number cell
if( nColCnt == SCCOL_MAX )
nColCnt = nBaseCol;
@@ -188,7 +188,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc,
nColCnt++;
break;
- case D_STRING: // Textcell
+ case D_STRING: // Text cell
if( nColCnt == SCCOL_MAX )
nColCnt = nBaseCol;
@@ -221,7 +221,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc,
if( bSyntErrWarn )
- // ACHTUNG: Hier fehlt noch die richtige Warnung!
+ // FIXME: Add proper Warnung!
return eERR_RNGOVRFLW;
else if( bOverflowWarn )
@@ -369,7 +369,7 @@ TOPIC DifParser::GetNextTopic( void )
break;
case S_Data:
OSL_ENSURE( aLine.getLength() >= 2,
- "+GetNextTopic(): <String> ist zu kurz!" );
+ "+GetNextTopic(): <String> is too short!" );
if( aLine.getLength() > 2 )
aData = aLine.copy( 1, aLine.getLength() - 2 );
else
@@ -380,11 +380,11 @@ TOPIC DifParser::GetNextTopic( void )
OSL_FAIL( "DifParser::GetNextTopic - unexpected state" );
break;
case S_UNKNOWN:
- // 2 Zeilen ueberlesen
+ // skip 2 lines
ReadNextLine( aLine );
// fall-through
case S_ERROR_L2: // Fehler in Line 2 aufgetreten
- // eine Zeile ueberlesen
+ // skip 1 line
ReadNextLine( aLine );
eS = S_END;
break;
@@ -418,7 +418,7 @@ DATASET DifParser::GetNumberDataset( const sal_Unicode* pPossibleNumericData )
eRet = D_SYNT_ERROR;
}
else
- { // ...und zur Strafe mit'm Numberformatter...
+ { // ...and for punishment, with number formatting...
OSL_ENSURE( pNumFormatter, "-DifParser::GetNextDataset(): No Formatter, more fun!" );
OUString aTestVal( pPossibleNumericData );
sal_uInt32 nFormat = 0;
@@ -514,7 +514,7 @@ DATASET DifParser::GetNextDataset( void )
}
break;
case '0': // Numeric Data
- pAktBuffer++; // Wert in fVal, 2. Zeile in aData
+ pAktBuffer++; // value in fVal, 2. line in aData
if( *pAktBuffer == ',' )
{
pAktBuffer++;
@@ -636,7 +636,7 @@ bool DifParser::ScanFloatVal( const sal_Unicode* pStart )
sal_Int32 nExp = 0;
bool bExpNeg = false;
bool bExpOverflow = false;
- static const sal_uInt16 nExpLimit = 4096; // ACHTUNG: muss genauer ermittelt werden!
+ static const sal_uInt16 nExpLimit = 4096; // FIXME: has to be set more accurately!
sal_Unicode cAkt;
bool bRet = false;
@@ -774,7 +774,7 @@ bool DifParser::ScanFloatVal( const sal_Unicode* pStart )
case S_FINDEND:
if( IsNumberEnding( cAkt ) )
{
- bRet = true; // damit sinnvoll weitergeparst werden kann
+ bRet = true; // to continue parsing
eS = S_END;
}
break;
@@ -790,7 +790,7 @@ bool DifParser::ScanFloatVal( const sal_Unicode* pStart )
if( bRet )
{
if( bExpOverflow )
- return false; // ACHTUNG: hier muss noch differenziert werden
+ return false; // FIXME: add special cases here
if( bNeg )
fNewVal *= 1.0;
@@ -883,7 +883,7 @@ void DifColumn::Apply( ScDocument& rDoc, const SCCOL nCol, const SCTAB nTab )
for (boost::ptr_vector<ENTRY>::const_iterator it = aEntries.begin(); it != aEntries.end(); ++it)
{
OSL_ENSURE( it->nNumFormat > 0,
- "+DifColumn::Apply(): Numberformat darf hier nicht 0 sein!" );
+ "+DifColumn::Apply(): Number format must not be 0!" );
rItemSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, it->nNumFormat ) );
commit d691156db9b3348371c14b4f17d242beff3e9f47
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Oct 1 15:58:11 2014 +0200
DocxAttributeOutput::CharEscapement: avoid writing <w:sz> twice
As comments-nested.odt shows, that would lead to invalid output.
Change-Id: I5c8f7ae0df60f80b0e58f7007c2f7f5e2a1cee87
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index 32a63d5..2086d4a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -81,7 +81,11 @@ protected:
bool mustValidate(const char* filename) const SAL_OVERRIDE
{
const char* aWhitelist[] = {
- "zoom.docx"
+ "page-graphic-background.odt",
+ "zoom.docx",
+ "empty.odt",
+ "fdo38244.docx",
+ "comments-nested.odt"
};
std::vector<const char*> vWhitelist(aWhitelist, aWhitelist + SAL_N_ELEMENTS(aWhitelist));
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f206acf..da0c48c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6062,7 +6062,7 @@ void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement )
m_pSerializer->singleElementNS( XML_w, XML_position,
FSNS( XML_w, XML_val ), sPos.getStr( ), FSEND );
- if( 100 != nProp || sIss.match( OString( "baseline" ) ) )
+ if( ( 100 != nProp || sIss.match( OString( "baseline" ) ) ) && !m_rExport.mbFontSizeWritten )
{
OString sSize = OString::number( ( nHeight * nProp + 500 ) / 1000 );
m_pSerializer->singleElementNS( XML_w, XML_sz,
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 4d52650..1c2f3ff 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1174,6 +1174,8 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos )
const SfxItemPool& rDstPool = m_rExport.pDoc->GetAttrPool();
nTmpSwPos = nSwPos;
+ // Did we already produce a <w:sz> element?
+ m_rExport.mbFontSizeWritten = false;
for(std::vector<EECharAttrib>::const_iterator i = aTxtAtrArr.begin(); i < aTxtAtrArr.end(); ++i)
{
if (nSwPos >= i->nStart && nSwPos < i->nEnd)
@@ -1201,7 +1203,12 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos )
// use always the SW-Which Id !
SfxPoolItem* pI = i->pAttr->Clone();
pI->SetWhich( nWhich );
- m_rExport.AttrOutput().OutputItem( *pI );
+ // Will this item produce a <w:sz> element?
+ bool bFontSizeItem = nWhich == RES_CHRATR_FONTSIZE || nWhich == RES_CHRATR_CJK_FONTSIZE;
+ if (!m_rExport.mbFontSizeWritten || !bFontSizeItem)
+ m_rExport.AttrOutput().OutputItem( *pI );
+ if (bFontSizeItem)
+ m_rExport.mbFontSizeWritten = true;
delete pI;
}
}
@@ -1210,6 +1217,7 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos )
if( nSwPos < i->nStart )
break;
}
+ m_rExport.mbFontSizeWritten = false;
nTmpSwPos = 0; // HasTextItem nur in dem obigen Bereich erlaubt
m_rExport.pOutFmtNode = pOldMod;
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index eeda7ee..e64c9dd 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3523,6 +3523,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM
, bHideTabLeaderAndPageNumbers(false)
, mbExportModeRTF(false)
, mbOutOutlineOnly(false)
+ , mbFontSizeWritten(false)
, pDoc(pDocument)
, pCurPam(pCurrentPam)
, pOrigPam(pOriginalPam)
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 8110165..c725847 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -551,6 +551,8 @@ public:
bool bHideTabLeaderAndPageNumbers : 1 ; // true: the 'z' field of TOC is set.
bool mbExportModeRTF;
bool mbOutOutlineOnly; // export outline nodes, only (send outline to clipboard/presentation)
+ /// Is font size written already as part of the current character properties?
+ bool mbFontSizeWritten;
SwDoc *pDoc;
SwPaM *pCurPam, *pOrigPam;
More information about the Libreoffice-commits
mailing list