[Libreoffice-commits] .: 3 commits - oox/inc oox/source sw/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Tue Aug 14 07:31:42 PDT 2012
oox/inc/oox/export/vmlexport.hxx | 2
oox/source/export/vmlexport.cxx | 20 ++++++-
sw/source/filter/ww8/docxattributeoutput.cxx | 5 +
sw/source/filter/ww8/docxattributeoutput.hxx | 1
sw/source/filter/ww8/rtfsdrexport.cxx | 75 +++++++++++++++------------
5 files changed, 70 insertions(+), 33 deletions(-)
New commits:
commit c9cae5b599a951ce0a0aae67dff69b6b677b1e86
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Aug 14 14:10:33 2012 +0200
RtfSdrExport: unnecessary explicit OString ctors
Change-Id: I2d8b9870f2d8c6836e1006e10eed3fe4a2566c2d
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index b75c94c..7792f97 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -180,35 +180,35 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
}
break;
case ESCHER_Prop_fillColor:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fillColor"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fillColor", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_fillBackColor:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fillBackColor"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fillBackColor", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_AnchorText:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("anchorText"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("anchorText", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_fNoFillHitTest:
if (it->nPropValue)
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fNoFillHitTest"), OString::valueOf(sal_Int32(1))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fNoFillHitTest", OString::valueOf(sal_Int32(1))));
break;
case ESCHER_Prop_fNoLineDrawDash:
// for some reason the value is set to 0x90000 if lines are switched off
if( it->nPropValue == 0x90000 )
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fLine"), OString::valueOf(sal_Int32(0))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fLine", OString::valueOf(sal_Int32(0))));
break;
case ESCHER_Prop_lineColor:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("lineColor"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("lineColor", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_lineBackColor:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("lineBackColor"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("lineBackColor", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_lineJoinStyle:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("lineJoinStyle"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("lineJoinStyle", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_fshadowObscured:
if (it->nPropValue)
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fshadowObscured"), OString::valueOf(sal_Int32(1))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fshadowObscured", "1"));
break;
case ESCHER_Prop_geoLeft:
case ESCHER_Prop_geoTop:
@@ -226,9 +226,9 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft );
}
- m_aShapeProps.insert(std::pair<OString,OString>(OString("geoLeft"),
+ m_aShapeProps.insert(std::pair<OString,OString>("geoLeft",
OString::valueOf(sal_Int32(sal_Int32( nLeft )))));
- m_aShapeProps.insert(std::pair<OString,OString>(OString("geoTop"),
+ m_aShapeProps.insert(std::pair<OString,OString>("geoTop",
OString::valueOf(sal_Int32(sal_Int32( nTop )))));
}
break;
@@ -251,9 +251,9 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
rProps.GetOpt( ESCHER_Prop_geoRight, nRight );
}
- m_aShapeProps.insert(std::pair<OString,OString>(OString("geoRight"),
+ m_aShapeProps.insert(std::pair<OString,OString>("geoRight",
OString::valueOf(sal_Int32(sal_Int32( nRight ) - sal_Int32( nLeft )))));
- m_aShapeProps.insert(std::pair<OString,OString>(OString("geoBottom"),
+ m_aShapeProps.insert(std::pair<OString,OString>("geoBottom",
OString::valueOf(sal_Int32(sal_Int32( nBottom ) - sal_Int32( nTop )))));
}
break;
@@ -332,10 +332,10 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
OStringBuffer aBuf;
aBuf.append("8;").append((sal_Int32)nVertices);
aBuf.append(aVerticies.makeStringAndClear());
- m_aShapeProps.insert(std::pair<OString,OString>(OString("pVerticies"), aBuf.makeStringAndClear()));
+ m_aShapeProps.insert(std::pair<OString,OString>("pVerticies", aBuf.makeStringAndClear()));
}
if ( aSegmentInfo.getLength() )
- m_aShapeProps.insert(std::pair<OString,OString>(OString("pSegmentInfo"), aSegmentInfo.makeStringAndClear()));
+ m_aShapeProps.insert(std::pair<OString,OString>("pSegmentInfo", aSegmentInfo.makeStringAndClear()));
}
else
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ": unhandled shape path, missing either pVertices or pSegmentInfo");
@@ -346,34 +346,34 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
break;
case ESCHER_Prop_fFillOK:
if (!it->nPropValue)
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fFillOK"), OString::valueOf(sal_Int32(0))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fFillOK", "0"));
break;
case ESCHER_Prop_dxTextLeft:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("dxTextLeft"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("dxTextLeft", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_dyTextTop:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("dyTextTop"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("dyTextTop", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_dxTextRight:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("dxTextRight"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("dxTextRight", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_dyTextBottom:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("dyTextBottom"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("dyTextBottom", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_FitTextToShape:
// Size text to fit shape size: not supported by RTF
break;
case ESCHER_Prop_adjustValue:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("adjustValue"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("adjustValue", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_txflTextFlow:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("txflTextFlow"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("txflTextFlow", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_fillType:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fillType"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fillType", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_fillOpacity:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fillOpacity"), OString::valueOf(sal_Int32(it->nPropValue))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fillOpacity", OString::valueOf(sal_Int32(it->nPropValue))));
break;
case ESCHER_Prop_fillBlip:
{
@@ -382,7 +382,7 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
int nHeaderSize = 25; // The first bytes are WW8-specific, we're only interested in the PNG
aBuf.append(RtfAttributeOutput::WriteHex(it->pBuf + nHeaderSize, it->nPropSize - nHeaderSize));
aBuf.append('}');
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fillBlip"), aBuf.makeStringAndClear()));
+ m_aShapeProps.insert(std::pair<OString,OString>("fillBlip", aBuf.makeStringAndClear()));
}
break;
default:
@@ -397,19 +397,19 @@ void RtfSdrExport::AddLineDimensions( const Rectangle& rRectangle )
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
// We get the position relative to (the current?) character
- m_aShapeProps.insert(std::pair<OString,OString>(OString("posrelh"), OString::valueOf(sal_Int32(3))));
+ m_aShapeProps.insert(std::pair<OString,OString>("posrelh", "3"));
switch ( m_nShapeFlags & 0xC0 )
{
case 0x40:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipV"), OString::valueOf(sal_Int32(1))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fFlipV", "1"));
break;
case 0x80:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipH"), OString::valueOf(sal_Int32(1))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fFlipH", "1"));
break;
case 0xC0:
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipV"), OString::valueOf(sal_Int32(1))));
- m_aShapeProps.insert(std::pair<OString,OString>(OString("fFlipH"), OString::valueOf(sal_Int32(1))));
+ m_aShapeProps.insert(std::pair<OString,OString>("fFlipV", "1"));
+ m_aShapeProps.insert(std::pair<OString,OString>("fFlipH", "1"));
break;
}
@@ -425,7 +425,7 @@ void RtfSdrExport::AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Re
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
// We get the position relative to (the current?) character
- m_aShapeProps.insert(std::pair<OString,OString>(OString("posrelh"), OString::valueOf(sal_Int32(3))));
+ m_aShapeProps.insert(std::pair<OString,OString>("posrelh", "3"));
rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left());
rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top());
@@ -470,7 +470,7 @@ void RtfSdrExport::impl_writeGraphic()
aBuf->append(OOO_STRING_SVTOOLS_RTF_PICH).append(sal_Int32(aMapped.Height())).append(RtfExport::sNewLine);
aBuf->append(RtfAttributeOutput::WriteHex(pGraphicAry, nSize));
aBuf->append('}');
- m_aShapeProps.insert(std::pair<OString,OString>(OString("pib"), aBuf.makeStringAndClear()));
+ m_aShapeProps.insert(std::pair<OString,OString>("pib", aBuf.makeStringAndClear()));
}
sal_Int32 RtfSdrExport::StartShape()
@@ -480,7 +480,7 @@ sal_Int32 RtfSdrExport::StartShape()
if ( m_nShapeType == ESCHER_ShpInst_Nil )
return -1;
- m_aShapeProps.insert(std::pair<OString,OString>(OString("shapeType"), OString::valueOf(sal_Int32(m_nShapeType))));
+ m_aShapeProps.insert(std::pair<OString,OString>("shapeType", OString::valueOf(sal_Int32(m_nShapeType))));
if (ESCHER_ShpInst_PictureFrame == m_nShapeType)
impl_writeGraphic();
commit 6e4c10c1dcd7c7d6b464746495fc4e33a428b41b
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Aug 14 13:51:45 2012 +0200
RTF export of fillBlip and fillOpacity shape properties
Change-Id: Ib2c10de54725e51ecbb3dc425ab6ca8e01a4c6ea
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index a377ef0..b75c94c 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -372,6 +372,19 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
case ESCHER_Prop_fillType:
m_aShapeProps.insert(std::pair<OString,OString>(OString("fillType"), OString::valueOf(sal_Int32(it->nPropValue))));
break;
+ case ESCHER_Prop_fillOpacity:
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fillOpacity"), OString::valueOf(sal_Int32(it->nPropValue))));
+ break;
+ case ESCHER_Prop_fillBlip:
+ {
+ OStringBuffer aBuf;
+ aBuf.append('{').append(OOO_STRING_SVTOOLS_RTF_PICT).append(OOO_STRING_SVTOOLS_RTF_PNGBLIP).append(RtfExport::sNewLine);
+ int nHeaderSize = 25; // The first bytes are WW8-specific, we're only interested in the PNG
+ aBuf.append(RtfAttributeOutput::WriteHex(it->pBuf + nHeaderSize, it->nPropSize - nHeaderSize));
+ aBuf.append('}');
+ m_aShapeProps.insert(std::pair<OString,OString>(OString("fillBlip"), aBuf.makeStringAndClear()));
+ }
+ break;
default:
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ": unhandled property: " << nId << " (value: " << it->nPropValue << ")");
break;
commit 05d86fcdd9eafac6e337e2117502662688118ea0
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Aug 14 16:27:28 2012 +0200
fdo#53113 DOCX: export fillBlip shape property
Change-Id: Id23518d0f72d7650f3d875028f83caf9b6581ccd
diff --git a/oox/inc/oox/export/vmlexport.hxx b/oox/inc/oox/export/vmlexport.hxx
index ec5a4d9..54296a0 100644
--- a/oox/inc/oox/export/vmlexport.hxx
+++ b/oox/inc/oox/export/vmlexport.hxx
@@ -21,6 +21,7 @@
#define _OOX_EXPORT_VMLEXPORT_HXX_
#include <oox/dllapi.h>
+#include <oox/export/drawingml.hxx>
#include <sax/fshelper.hxx>
#include <filter/msfilter/escherex.hxx>
#include <editeng/outlobj.hxx>
@@ -39,6 +40,7 @@ class OOX_DLLPUBLIC VMLTextExport
{
public:
virtual void WriteOutliner(const OutlinerParaObject& rParaObj) = 0;
+ virtual oox::drawingml::DrawingML& GetDrawingML() = 0;
protected:
VMLTextExport() {}
virtual ~VMLTextExport() {}
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index e764d87..254bee0 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -26,6 +26,7 @@
#include <tools/stream.hxx>
#include <svx/svdotext.hxx>
+#include <vcl/cvtgrf.hxx>
#include <cstdio>
@@ -492,6 +493,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
case ESCHER_Prop_fillType: // 384
case ESCHER_Prop_fillColor: // 385
case ESCHER_Prop_fillBackColor: // 387
+ case ESCHER_Prop_fillBlip: // 390
case ESCHER_Prop_fNoFillHitTest: // 447
{
sal_uInt32 nValue;
@@ -504,7 +506,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
{
case ESCHER_FillSolid: pFillType = "solid"; break;
// TODO case ESCHER_FillPattern: pFillType = ""; break;
- // TODO case ESCHER_FillTexture: pFillType = ""; break;
+ case ESCHER_FillTexture: pFillType = "tile"; break;
// TODO case ESCHER_FillPicture: pFillType = ""; break;
// TODO case ESCHER_FillShade: pFillType = ""; break;
// TODO case ESCHER_FillShadeCenter: pFillType = ""; break;
@@ -528,6 +530,19 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
if ( rProps.GetOpt( ESCHER_Prop_fillBackColor, nValue ) )
impl_AddColor( pAttrList, XML_color2, nValue );
+ EscherPropSortStruct aStruct;
+ if ( rProps.GetOpt( ESCHER_Prop_fillBlip, aStruct ) && m_pTextExport)
+ {
+ SvMemoryStream aStream;
+ int nHeaderSize = 25; // The first bytes are WW8-specific, we're only interested in the PNG
+ aStream.Write(aStruct.pBuf + nHeaderSize, aStruct.nPropSize - nHeaderSize);
+ aStream.Seek(0);
+ Graphic aGraphic;
+ GraphicConverter::Import(aStream, aGraphic, CVT_PNG);
+ OUString aImageId = m_pTextExport->GetDrawingML().WriteImage( aGraphic );
+ pAttrList->add(FSNS(XML_r, XML_id), OUStringToOString(aImageId, RTL_TEXTENCODING_UTF8));
+ }
+
if ( rProps.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) )
impl_AddBool( pAttrList, XML_detectmouseclick, nValue );
@@ -536,6 +551,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
bAlreadyWritten[ ESCHER_Prop_fillType ] = true;
bAlreadyWritten[ ESCHER_Prop_fillColor ] = true;
bAlreadyWritten[ ESCHER_Prop_fillBackColor ] = true;
+ bAlreadyWritten[ ESCHER_Prop_fillBlip ] = true;
bAlreadyWritten[ ESCHER_Prop_fNoFillHitTest ] = true;
break;
@@ -673,7 +689,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
default:
#if OSL_DEBUG_LEVEL > 0
fprintf( stderr, "TODO VMLExport::Commit(), unimplemented id: %d, value: %" SAL_PRIuUINT32 ", data: [%" SAL_PRIuUINT32 ", %p]\n",
- it->nPropId, it->nPropValue, it->nPropSize, it->pBuf );
+ nId, it->nPropValue, it->nPropSize, it->pBuf );
if ( it->nPropSize )
{
const sal_uInt8 *pIt = it->pBuf;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index da3c926..cbca1b6 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2412,6 +2412,11 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
m_pSerializer->endElementNS( XML_w, XML_textbox );
}
+oox::drawingml::DrawingML& DocxAttributeOutput::GetDrawingML()
+{
+ return m_rDrawingML;
+}
+
void DocxAttributeOutput::StartStyle( const String& rName, bool bPapFmt,
sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool bAutoUpdate )
{
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index f549784..24b6836 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -637,6 +637,7 @@ public:
/// VMLTextExport
virtual void WriteOutliner(const OutlinerParaObject& rParaObj);
+ virtual oox::drawingml::DrawingML& GetDrawingML();
};
#endif // _DOCXATTRIBUTEOUTPUT_HXX_
More information about the Libreoffice-commits
mailing list