summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-06-10 13:00:14 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-06-10 14:03:36 +0200
commitc74a6e6bce9bfcae74e1a264557197176bba75e7 (patch)
treeee44b1497827b2bd329ff804078d9dee28f0fb90 /sw
parenta2a342495361726c7d085910a5ac127d8cf522c9 (diff)
mingw64: use the right format for writing out pointer-sized integers
Change-Id: I7961ffd978cb02c62be176a0afe931959b7d8f1f
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/docnode/nodedump.cxx14
-rw-r--r--sw/source/core/text/xmldump.cxx6
2 files changed, 14 insertions, 6 deletions
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 20c13f2c7343..96e787a5669f 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -93,6 +93,10 @@ void WriterHelper::writeFormatAttribute( const char* attribute, const char* form
va_end( va );
}
+// Hack: somehow conversion from "..." to va_list does
+// bomb on two string litterals in the format.
+static const char* TMP_FORMAT = "%" SAL_PRIuUINTPTR;
+
}
void SwDoc::dumpAsXml( xmlTextWriterPtr w )
@@ -117,9 +121,9 @@ void MarkManager::dumpAsXml( xmlTextWriterPtr w )
{
pMark_t pMark = *it;
writer.startElement("fieldmark");
- writer.writeFormatAttribute("startNode", "%lu", pMark->GetMarkStart().nNode.GetIndex());
+ writer.writeFormatAttribute("startNode", TMP_FORMAT, pMark->GetMarkStart().nNode.GetIndex());
writer.writeFormatAttribute("startOffset", "%d", pMark->GetMarkStart().nContent.GetIndex());
- writer.writeFormatAttribute("endNode", "%lu", pMark->GetMarkEnd().nNode.GetIndex());
+ writer.writeFormatAttribute("endNode", TMP_FORMAT, pMark->GetMarkEnd().nNode.GetIndex());
writer.writeFormatAttribute("endOffset", "%d", pMark->GetMarkEnd().nContent.GetIndex());
OString txt8 = OUStringToOString(pMark->GetName(), RTL_TEXTENCODING_UTF8);
writer.writeFormatAttribute("name", "%s", BAD_CAST( txt8.getStr()));
@@ -206,7 +210,7 @@ void SwNode::dumpAsXml( xmlTextWriterPtr w )
}
writer.startElement( name );
writer.writeFormatAttribute( "ptr", "%p", this );
- writer.writeFormatAttribute( "index", "%lu", GetIndex() );
+ writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() );
writer.endElement();
if( GetNodeType() == ND_ENDNODE )
writer.endElement(); // end start node
@@ -239,7 +243,7 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
}
writer.startElement( name );
writer.writeFormatAttribute( "ptr", "%p", this );
- writer.writeFormatAttribute( "index", "%lu", GetIndex() );
+ writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() );
// writer.endElement(); - it is a start node, so don't end, will make xml better nested
}
@@ -248,7 +252,7 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w )
WriterHelper writer( w );
writer.startElement( "text" );
writer.writeFormatAttribute( "ptr", "%p", this );
- writer.writeFormatAttribute( "index", "%lu", GetIndex() );
+ writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() );
OUString txt = GetTxt();
for( int i = 0; i < 32; ++i )
txt = txt.replace( i, '*' );
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index ff410f817c5f..069ff535f310 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -348,6 +348,10 @@ void SwFrm::dumpInfosAsXml( xmlTextWriterPtr writer )
xmlTextWriterEndElement( writer );
}
+// Hack: somehow conversion from "..." to va_list does
+// bomb on two string litterals in the format.
+static const char* TMP_FORMAT = "%" SAL_PRIuUINTPTR;
+
void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
{
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
@@ -365,7 +369,7 @@ void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
{
SwTxtFrm *pTxtFrm = ( SwTxtFrm * ) this;
SwTxtNode *pTxtNode = pTxtFrm->GetTxtNode();
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), "%lu", pTxtNode->GetIndex() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), TMP_FORMAT, pTxtNode->GetIndex() );
}
if (IsHeaderFrm() || IsFooterFrm())
{