[Libreoffice-commits] core.git: Branch 'private/moggi/opengl-3D-bar-rendering' - 16 commits - chart2/qa chart2/source include/oox include/xmloff oox/source sc/source xmloff/inc xmloff/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Mon Apr 7 14:59:43 PDT 2014
chart2/qa/extras/chart2export.cxx | 24 +++++
chart2/qa/extras/charttest.hxx | 31 ++++++-
chart2/qa/extras/data/ods/labelString.ods |binary
chart2/source/tools/AxisHelper.cxx | 20 ++--
chart2/source/view/main/DummyXShape.cxx | 4
chart2/source/view/main/DummyXShape.hxx | 1
chart2/source/view/main/OpenGLRender.cxx | 21 ----
chart2/source/view/main/OpenGLRender.hxx | 4
include/oox/drawingml/chart/seriesmodel.hxx | 20 ----
include/oox/drawingml/chart/typegroupconverter.hxx | 17 ---
include/oox/drawingml/fillproperties.hxx | 12 --
include/oox/drawingml/lineproperties.hxx | 6 -
include/oox/drawingml/shape.hxx | 6 -
include/oox/export/chartexport.hxx | 2
include/xmloff/xmltoken.hxx | 1
oox/source/drawingml/chart/seriesconverter.cxx | 27 ------
oox/source/drawingml/chart/typegroupcontext.cxx | 22 -----
oox/source/drawingml/chart/typegroupconverter.cxx | 6 +
oox/source/export/chartexport.cxx | 92 +++++++++++----------
sc/source/filter/excel/xecontent.cxx | 24 -----
sc/source/filter/excel/xestyle.cxx | 49 -----------
sc/source/filter/excel/xicontent.cxx | 35 +++++++
sc/source/filter/excel/xistream.cxx | 24 -----
sc/source/filter/excel/xistyle.cxx | 30 ++++++
sc/source/filter/inc/xistyle.hxx | 28 +-----
sc/source/filter/inc/xlcontent.hxx | 4
sc/source/filter/inc/xlstyle.hxx | 18 ----
xmloff/inc/SchXMLImport.hxx | 1
xmloff/source/chart/SchXMLExport.cxx | 28 +++++-
xmloff/source/chart/SchXMLImport.cxx | 1
xmloff/source/chart/SchXMLSeries2Context.cxx | 19 +++-
xmloff/source/chart/SchXMLSeries2Context.hxx | 1
xmloff/source/chart/SchXMLTools.cxx | 32 +++++++
xmloff/source/chart/SchXMLTools.hxx | 5 +
xmloff/source/core/xmltoken.cxx | 1
35 files changed, 284 insertions(+), 332 deletions(-)
New commits:
commit 958a4a7403bdafde490943e7fb19d8fad3f3ad50
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Apr 7 23:54:25 2014 +0200
remove some OpenGL traces from OpenGLRender and DummyXShape
Change-Id: Ibc4877a7c98a0ee1920d6ff0137009f489e2e9a9
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index c3978f4..5a0f88e 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -1147,8 +1147,7 @@ DummyChart::DummyChart(uno::Reference< drawing::XShape > xTarget):
{
SAL_INFO("chart2.opengl", "DummyXShape::DummyChart()-----test: ");
setName("com.sun.star.chart2.shapes");
- m_aGLContext.init();
- m_GLRender.InitOpenGL(m_aGLContext.getOpenGLWindow());
+ m_GLRender.InitOpenGL();
}
void SAL_CALL DummyChart::setPosition( const awt::Point& aPosition )
@@ -1167,7 +1166,6 @@ void SAL_CALL DummyChart::setSize( const awt::Size& aSize )
SAL_INFO("chart2.opengl", "DummyChart::setSize()---aSize.Width = " << aSize.Width << ", aSize.Height = " << aSize.Height);
int width = aSize.Width / OPENGL_SCALE_VALUE;
int height = aSize.Height / OPENGL_SCALE_VALUE;
- m_aGLContext.setWinSize(Size(width, height));
DummyXShape::setSize(awt::Size(0,0));
m_GLRender.SetSize(width, height);
SAL_INFO("chart2.opengl", "DummyChart::GLRender.Width = " << width << ", GLRender.Height = " << height);
diff --git a/chart2/source/view/main/DummyXShape.hxx b/chart2/source/view/main/DummyXShape.hxx
index d480bae6..e3d7d44 100644
--- a/chart2/source/view/main/DummyXShape.hxx
+++ b/chart2/source/view/main/DummyXShape.hxx
@@ -404,7 +404,6 @@ public:
private:
TextCache maTextCache;
- OpenGLContext m_aGLContext;
public:
OpenGLRender m_GLRender;
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index a0f7573..610eb72 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -232,10 +232,10 @@ GLfloat texCoords[] = {
}
-int OpenGLRender::InitOpenGL(GLWindow aWindow)
+int OpenGLRender::InitOpenGL()
{
- glWin = aWindow;
- mbArbMultisampleSupported = glWin.bMultiSampleSupported;
+ //TODO: moggi: get the information from the context
+ mbArbMultisampleSupported = true;
if(!bGlewInit)
{
glewExperimental = GL_TRUE;
@@ -636,21 +636,6 @@ void OpenGLRender::Release()
glDeleteRenderbuffers(1, &m_RboID);
glDeleteRenderbuffers(1, &m_renderBufferColorMS);
glDeleteRenderbuffers(1, &m_renderBufferDepthMS);
-#if defined( WNT )
- wglMakeCurrent(NULL, NULL);
-#elif defined( MACOSX )
-
-#elif defined( UNX )
-
- glXMakeCurrent(glWin.dpy, None, NULL);
- if( glGetError() != GL_NO_ERROR ) {
- SAL_INFO("chart2.opengl", "glError: " << (char *)gluErrorString(glGetError()));
- }
- glXDestroyContext(glWin.dpy, glWin.ctx);
- glWin.ctx = NULL;
- glWin.win = 0;
-
-#endif
}
OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget)
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index 725e32e..6fde176 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -67,7 +67,7 @@ public:
OpenGLRender(com::sun::star::uno::Reference<
com::sun::star::drawing::XShape > xTarget );
~OpenGLRender();
- int InitOpenGL(GLWindow);
+ int InitOpenGL();
int MoveModelf(PosVecf3 trans, PosVecf3 angle, PosVecf3 scale);
void SetSize(int width, int height);
void Release();
@@ -141,8 +141,6 @@ private:
int m_iHeight;
- GLWindow glWin;
-
Line2DPointList m_Line2DPointList;
float m_fLineWidth;
commit 47a5f4fccb2be6111062feed78073575dbe58e71
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 16:37:25 2014 +0200
remove whitespace
Change-Id: I16930834f75efcac8c710486d4e3286fcaaf64fd
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 0df97bb..290f79f 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -77,8 +77,6 @@ struct XclExpHashEntrySWO
{ return *rLeft.mpString < *rRight.mpString; }
};
-
-
/** Implementation of the SST export.
@descr Stores all passed strings in a hash table and prevents repeated
insertion of equal strings. */
@@ -105,8 +103,6 @@ private:
sal_uInt32 mnSize; /// Size of the SST (count of unique strings).
};
-
-
const sal_uInt32 EXC_SST_HASHTABLE_SIZE = 2048;
XclExpSstImpl::XclExpSstImpl() :
@@ -229,8 +225,6 @@ void XclExpSstImpl::SaveXml( XclExpXmlStream& rStrm )
rStrm.PopStream();
}
-
-
XclExpSst::XclExpSst() :
mxImpl( new XclExpSstImpl )
{
@@ -602,8 +596,6 @@ private:
bool mbPattUsed; /// true = Pattern attribute used.
};
-
-
XclExpCFImpl::XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rFormatEntry, sal_Int32 nPriority ) :
XclExpRoot( rRoot ),
mrFormatEntry( rFormatEntry ),
@@ -960,8 +952,6 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->endElement( XML_cfRule );
}
-
-
XclExpCF::XclExpCF( const XclExpRoot& rRoot, const ScCondFormatEntry& rFormatEntry, sal_Int32 nPriority = 0 ) :
XclExpRecord( EXC_ID_CF ),
XclExpRoot( rRoot ),
@@ -1131,8 +1121,6 @@ void XclExpColScaleCol::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->endElement( XML_color );
}
-
-
XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat& rCondFormat, XclExtLstRef xExtLst, sal_Int32& rIndex ) :
XclExpRecord( EXC_ID_CONDFMT ),
XclExpRoot( rRoot )
@@ -1204,8 +1192,6 @@ void XclExpCondfmt::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->endElement( XML_conditionalFormatting );
}
-
-
XclExpColorScale::XclExpColorScale( const XclExpRoot& rRoot, const ScColorScaleFormat& rFormat, sal_Int32 nPriority ):
XclExpRecord(),
XclExpRoot( rRoot ),
@@ -1389,8 +1375,6 @@ void XclExpIconSet::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->endElement( XML_cfRule );
}
-
-
XclExpCondFormatBuffer::XclExpCondFormatBuffer( const XclExpRoot& rRoot, XclExtLstRef xExtLst ) :
XclExpRoot( rRoot )
{
@@ -1474,8 +1458,6 @@ const char* lcl_GetOperatorType( sal_uInt32 nFlags )
} // namespace
-
-
XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
XclExpRecord( EXC_ID_DV ),
XclExpRoot( rRoot ),
@@ -1693,8 +1675,6 @@ void XclExpDV::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->endElement( XML_dataValidation );
}
-
-
XclExpDval::XclExpDval( const XclExpRoot& rRoot ) :
XclExpRecord( EXC_ID_DVAL, 18 ),
XclExpRoot( rRoot )
@@ -1904,8 +1884,6 @@ void XclExpWebQuery::Save( XclExpStream& rStrm )
}
}
-
-
XclExpWebQueryBuffer::XclExpWebQueryBuffer( const XclExpRoot& rRoot )
{
SCTAB nScTab = rRoot.GetCurrScTab();
@@ -1974,6 +1952,4 @@ XclExpWebQueryBuffer::XclExpWebQueryBuffer( const XclExpRoot& rRoot )
}
}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 573ca8a..ccfb3e3 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -224,8 +224,6 @@ typedef ::std::vector< XclNearest > XclNearestVec;
} // namespace
-
-
class XclExpPaletteImpl
{
public:
@@ -318,8 +316,6 @@ private:
sal_uInt32 mnLastIdx; /// Last insertion index for search opt.
};
-
-
const sal_uInt32 EXC_PAL_INDEXBASE = 0xFFFF0000;
const sal_uInt32 EXC_PAL_MAXRAWSIZE = 1024;
@@ -762,8 +758,6 @@ sal_Int32 XclExpPaletteImpl::GetNearPaletteColors(
return nDist1;
}
-
-
XclExpPalette::XclExpPalette( const XclExpRoot& rRoot ) :
XclDefaultPalette( rRoot ),
XclExpRecord( EXC_ID_PALETTE )
@@ -939,8 +933,6 @@ bool XclExpFontHelper::CheckItems( const XclExpRoot& rRoot, const SfxItemSet& rI
return bUsed;
}
-
-
namespace {
sal_uInt32 lclCalcHash( const XclFontData& rFontData )
@@ -962,8 +954,6 @@ sal_uInt32 lclCalcHash( const XclFontData& rFontData )
} // namespace
-
-
XclExpFont::XclExpFont( const XclExpRoot& rRoot,
const XclFontData& rFontData, XclExpColorType eColorType ) :
XclExpRecord( EXC_ID2_FONT, 14 ),
@@ -1022,8 +1012,6 @@ void XclExpFont::WriteBody( XclExpStream& rStrm )
<< aFontName;
}
-
-
XclExpBlindFont::XclExpBlindFont( const XclExpRoot& rRoot ) :
XclExpFont( rRoot, XclFontData(), EXC_COLOR_CELLTEXT )
{
@@ -1039,8 +1027,6 @@ void XclExpBlindFont::Save( XclExpStream& /*rStrm*/ )
// do nothing
}
-
-
XclExpFontBuffer::XclExpFontBuffer( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
mnXclMaxSize( 0 )
@@ -1205,8 +1191,6 @@ struct XclExpNumFmtPred
{ return rFormat.mnScNumFmt == mnScNumFmt; }
};
-
-
void XclExpNumFmt::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream();
@@ -1216,8 +1200,6 @@ void XclExpNumFmt::SaveXml( XclExpXmlStream& rStrm )
FSEND );
}
-
-
XclExpNumFmtBuffer::XclExpNumFmtBuffer( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
/* Compiler needs a hint, this doesn't work: new NfKeywordTable;
@@ -1383,8 +1365,6 @@ void XclExpCellProt::SaveXml( XclExpXmlStream& rStrm ) const
FSEND );
}
-
-
bool XclExpCellAlign::FillFromItemSet(
const SfxItemSet& rItemSet, bool bForceLineBreak, XclBiff eBiff, bool bStyle )
{
@@ -1541,8 +1521,6 @@ void XclExpCellAlign::SaveXml( XclExpXmlStream& rStrm ) const
FSEND );
}
-
-
namespace {
void lclGetBorderLine(
@@ -1613,8 +1591,6 @@ void lclGetBorderLine(
} // namespace
-
-
XclExpCellBorder::XclExpCellBorder() :
mnLeftColorId( XclExpPalette::GetColorIdFromIndex( mnLeftColor ) ),
mnRightColorId( XclExpPalette::GetColorIdFromIndex( mnRightColor ) ),
@@ -1691,7 +1667,6 @@ void XclExpCellBorder::SetFinalColors( const XclExpPalette& rPalette )
mnDiagColor = rPalette.GetColorIndex( mnDiagColorId );
}
-
void XclExpCellBorder::FillToXF5( sal_uInt32& rnBorder, sal_uInt32& rnArea ) const
{
::insert_value( rnBorder, mnTopLine, 0, 3 );
@@ -1794,8 +1769,6 @@ void XclExpCellBorder::SaveXml( XclExpXmlStream& rStrm ) const
rStyleSheet->endElement( XML_border );
}
-
-
XclExpCellArea::XclExpCellArea() :
mnForeColorId( XclExpPalette::GetColorIdFromIndex( mnForeColor ) ),
mnBackColorId( XclExpPalette::GetColorIdFromIndex( mnBackColor ) )
@@ -1897,7 +1870,6 @@ void XclExpCellArea::SaveXml( XclExpXmlStream& rStrm ) const
rStyleSheet->endElement( XML_fill );
}
-
bool XclExpColor::FillFromItemSet( const SfxItemSet& rItemSet )
{
if( !ScfTools::CheckItem( rItemSet, ATTR_BACKGROUND, true ) )
@@ -1924,8 +1896,6 @@ void XclExpColor::SaveXml( XclExpXmlStream& rStrm ) const
rStyleSheet->endElement( XML_fill );
}
-
-
XclExpXFId::XclExpXFId() :
mnXFId( XclExpXFBuffer::GetDefCellXFId() ),
mnXFIndex( EXC_XF_DEFAULTCELL )
@@ -1943,8 +1913,6 @@ void XclExpXFId::ConvertXFIndex( const XclExpRoot& rRoot )
mnXFIndex = rRoot.GetXFBuffer().GetXFIndex( mnXFId );
}
-
-
XclExpXF::XclExpXF(
const XclExpRoot& rRoot, const ScPatternAttr& rPattern, sal_Int16 nScript,
sal_uLong nForceScNumFmt, sal_uInt16 nForceXclFont, bool bForceLineBreak ) :
@@ -2159,8 +2127,6 @@ void XclExpXF::SaveXml( XclExpXmlStream& rStrm )
rStyleSheet->endElement( XML_xf );
}
-
-
XclExpDefaultXF::XclExpDefaultXF( const XclExpRoot& rRoot, bool bCellXF ) :
XclExpXF( rRoot, bCellXF )
{
@@ -2178,8 +2144,6 @@ void XclExpDefaultXF::SetNumFmt( sal_uInt16 nXclNumFmt )
mbFmtUsed = true;
}
-
-
XclExpStyle::XclExpStyle( sal_uInt32 nXFId, const OUString& rStyleName ) :
XclExpRecord( EXC_ID_STYLE, 4 ),
maName( rStyleName ),
@@ -2265,8 +2229,6 @@ void XclExpStyle::SaveXml( XclExpXmlStream& rStrm )
// OOXTODO: XML_extLst
}
-
-
namespace {
const sal_uInt32 EXC_XFLIST_INDEXBASE = 0xFFFE0000;
@@ -2282,8 +2244,6 @@ bool lclIsBuiltInStyle( const OUString& rStyleName )
} // namespace
-
-
XclExpXFBuffer::XclExpBuiltInInfo::XclExpBuiltInInfo() :
mnStyleId( EXC_STYLE_USERDEF ),
mnLevel( EXC_STYLE_NOLEVEL ),
@@ -2292,8 +2252,6 @@ XclExpXFBuffer::XclExpBuiltInInfo::XclExpBuiltInInfo() :
{
}
-
-
/** Predicate for search algorithm. */
struct XclExpBorderPred
{
@@ -2884,7 +2842,6 @@ void XclExpXFBuffer::AddBorderAndFill( const XclExpXF& rXF )
}
}
-
XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
: XclExpRoot( rRoot ),
mxFormatter( new SvNumberFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US ) ),
@@ -3020,8 +2977,6 @@ void XclExpDxfs::SaveXml( XclExpXmlStream& rStrm )
rStyleSheet->endElement( XML_dxfs );
}
-
-
XclExpDxf::XclExpDxf( const XclExpRoot& rRoot, XclExpCellAlign* pAlign, XclExpCellBorder* pBorder,
XclExpFont* pFont, XclExpNumFmt* pNumberFmt, XclExpCellProt* pProt, XclExpColor* pColor)
: XclExpRoot( rRoot ),
@@ -3058,8 +3013,6 @@ void XclExpDxf::SaveXml( XclExpXmlStream& rStrm )
rStyleSheet->endElement( XML_dxf );
}
-
-
XclExpXmlStyleSheet::XclExpXmlStyleSheet( const XclExpRoot& rRoot )
: XclExpRoot( rRoot )
{
@@ -3090,6 +3043,4 @@ void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm )
rStrm.PopStream();
}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 78cdf9378288e2569269eafb50e5ef52840c1921
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 16:25:25 2014 +0200
import dxf protection record from xls, related fdo#76209
Change-Id: Ic8b4cd30b383763b034942d5a80914340d416c28
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 4016929..8e45697 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -614,6 +614,15 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
aArea.FillToItemSet( rStyleItemSet, rPalette );
}
+ if( get_flag( nFlags, EXC_CF_BLOCK_PROTECTION ) )
+ {
+ sal_uInt16 nCellProt;
+ rStrm >> nCellProt;
+ XclImpCellProt aCellProt;
+ aCellProt.FillFromXF3(nCellProt);
+ aCellProt.FillToItemSet( rStyleItemSet );
+ }
+
// *** formulas ***
const ScAddress& rPos = maRanges.front()->aStart; // assured above that maRanges is not empty
diff --git a/sc/source/filter/inc/xlcontent.hxx b/sc/source/filter/inc/xlcontent.hxx
index 3e0fefc..2dfe066 100644
--- a/sc/source/filter/inc/xlcontent.hxx
+++ b/sc/source/filter/inc/xlcontent.hxx
@@ -85,6 +85,7 @@ const sal_uInt32 EXC_CF_BLOCK_FONT = 0x04000000; /// Font block prese
const sal_uInt32 EXC_CF_BLOCK_ALIGNMENT = 0x08000000; /// Alignment block present?
const sal_uInt32 EXC_CF_BLOCK_BORDER = 0x10000000; /// Border block present?
const sal_uInt32 EXC_CF_BLOCK_AREA = 0x20000000; /// Pattern block present?
+const sal_uInt32 EXC_CF_BLOCK_PROTECTION = 0x20000000; /// Protection block present?
const sal_uInt32 EXC_CF_IFMT_USER = 0x1; /// NumberFormat String or Id?
const sal_uInt32 EXC_CF_FONT_STYLE = 0x00000002; /// Font posture or weight modified?
commit bf5c8a11ea34b984207ea060b320dacebd5ef290
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 14:49:33 2014 +0200
import dxf number format record, related fdo#76209
Thanks to Morten Welinder for pointing to the missing pieces.
Change-Id: I5eb447161ac5d79257a64acaa01e56374ba81587
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 5c04f8a..4016929 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -514,9 +514,9 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
sal_uInt8 nType(0), nOperator(0);
sal_uInt16 nFmlaSize1(0), nFmlaSize2(0);
sal_uInt32 nFlags(0);
+ sal_uInt16 nFlagsExtended(0);
- rStrm >> nType >> nOperator >> nFmlaSize1 >> nFmlaSize2 >> nFlags;
- rStrm.Ignore( 2 );
+ rStrm >> nType >> nOperator >> nFmlaSize1 >> nFmlaSize2 >> nFlags >> nFlagsExtended;
// *** mode and comparison operator ***
@@ -557,6 +557,16 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
const XclImpPalette& rPalette = GetPalette();
+ // number format
+
+ if( get_flag( nFlags, EXC_CF_BLOCK_NUMFMT ) )
+ {
+ XclImpNumFmtBuffer& rNumFmtBuffer = GetRoot().GetNumFmtBuffer();
+ bool bIFmt = get_flag( nFlags, EXC_CF_IFMT_USER );
+ sal_uInt16 nFormat = rNumFmtBuffer.ReadCFFormat( rStrm, bIFmt );
+ rNumFmtBuffer.FillToItemSet( rStyleItemSet, nFormat );
+ }
+
// *** font block ***
if( ::get_flag( nFlags, EXC_CF_BLOCK_FONT ) )
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 45a7f14..1c0d1e4 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -650,6 +650,25 @@ void XclImpNumFmtBuffer::ReadFormat( XclImpStream& rStrm )
}
}
+sal_uInt16 XclImpNumFmtBuffer::ReadCFFormat( XclImpStream& rStrm, bool bIFmt )
+{
+ // internal number format ?
+ if(bIFmt)
+ {
+ rStrm.Ignore(1);
+ sal_uInt8 nIndex;
+ rStrm >> nIndex;
+ return nIndex;
+ }
+ else
+ {
+ OUString aFormat = rStrm.ReadUniString();
+ InsertFormat( mnNextXclIdx, aFormat );
+ ++mnNextXclIdx;
+ return mnNextXclIdx - 1;
+ }
+}
+
void XclImpNumFmtBuffer::CreateScFormats()
{
OSL_ENSURE( maIndexMap.empty(), "XclImpNumFmtBuffer::CreateScFormats - already created" );
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 9271d5f..015263d 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -216,6 +216,10 @@ public:
/** Reads a FORMAT record. */
void ReadFormat( XclImpStream& rStrm );
+
+ /** Read NumFmt from conditional format record */
+ sal_uInt16 ReadCFFormat( XclImpStream& rStrm, bool bIFmt );
+
/** Creates the number formats in the Calc document. */
void CreateScFormats();
diff --git a/sc/source/filter/inc/xlcontent.hxx b/sc/source/filter/inc/xlcontent.hxx
index 416923f..3e0fefc 100644
--- a/sc/source/filter/inc/xlcontent.hxx
+++ b/sc/source/filter/inc/xlcontent.hxx
@@ -80,10 +80,12 @@ const sal_uInt32 EXC_CF_AREA_FGCOLOR = 0x00020000; /// Foreground color
const sal_uInt32 EXC_CF_AREA_BGCOLOR = 0x00040000; /// Background color modified?
const sal_uInt32 EXC_CF_AREA_ALL = 0x00070000; /// Any area attribute modified?
const sal_uInt32 EXC_CF_ALLDEFAULT = 0x003FFFFF; /// Default flags.
+const sal_uInt32 EXC_CF_BLOCK_NUMFMT = 0x02000000; /// Font block present?
const sal_uInt32 EXC_CF_BLOCK_FONT = 0x04000000; /// Font block present?
const sal_uInt32 EXC_CF_BLOCK_ALIGNMENT = 0x08000000; /// Alignment block present?
const sal_uInt32 EXC_CF_BLOCK_BORDER = 0x10000000; /// Border block present?
const sal_uInt32 EXC_CF_BLOCK_AREA = 0x20000000; /// Pattern block present?
+const sal_uInt32 EXC_CF_IFMT_USER = 0x1; /// NumberFormat String or Id?
const sal_uInt32 EXC_CF_FONT_STYLE = 0x00000002; /// Font posture or weight modified?
const sal_uInt32 EXC_CF_FONT_STRIKEOUT = 0x00000080; /// Font cancellation modified?
commit f1799aac227ba895699f1d6db529be6cda7361c2
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 14:42:08 2014 +0200
remove whitespace
Change-Id: Id8014a1165876e903a7a4311af43d4a946703f11
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index 75662a1..8962423 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <comphelper/docpasswordhelper.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <osl/thread.h>
@@ -27,13 +26,9 @@
#include <vector>
-
using namespace ::com::sun::star;
-
// Decryption
-
-
XclImpDecrypter::XclImpDecrypter() :
mnError( EXC_ENCR_ERROR_UNSUPP_CRYPT ),
mnOldPos( STREAM_SEEK_TO_END ),
@@ -106,8 +101,6 @@ sal_uInt16 XclImpDecrypter::Read( SvStream& rStrm, void* pData, sal_uInt16 nByte
return nRet;
}
-
-
XclImpBiff5Decrypter::XclImpBiff5Decrypter( sal_uInt16 nKey, sal_uInt16 nHash ) :
mnKey( nKey ),
mnHash( nHash )
@@ -197,8 +190,6 @@ sal_uInt16 XclImpBiff5Decrypter::OnRead( SvStream& rStrm, sal_uInt8* pnData, sal
return nRet;
}
-
-
XclImpBiff8Decrypter::XclImpBiff8Decrypter( sal_uInt8 pnSalt[ 16 ],
sal_uInt8 pnVerifier[ 16 ], sal_uInt8 pnVerifierHash[ 16 ] ) :
maSalt( pnSalt, pnSalt + 16 ),
@@ -321,10 +312,7 @@ sal_uInt16 XclImpBiff8Decrypter::GetOffset( sal_Size nStrmPos ) const
return static_cast< sal_uInt16 >( nStrmPos % EXC_ENCR_BLOCKSIZE );
}
-
// Stream
-
-
XclImpStreamPos::XclImpStreamPos() :
mnPos( STREAM_SEEK_TO_BEGIN ),
mnNextPos( STREAM_SEEK_TO_BEGIN ),
@@ -364,8 +352,6 @@ void XclImpStreamPos::Get(
rbValid = mbValid;
}
-
-
XclBiff XclImpStream::DetectBiffVersion( SvStream& rStrm )
{
XclBiff eBiff = EXC_BIFF_UNKNOWN;
@@ -513,8 +499,6 @@ void XclImpStream::EnableDecryption( bool bEnable )
mbUseDecr = bEnable && HasValidDecrypter();
}
-
-
void XclImpStream::PushPosition()
{
maPosStack.push_back( XclImpStreamPos() );
@@ -605,8 +589,6 @@ sal_uInt16 XclImpStream::PeekRecId( sal_Size nPos )
return nRecId;
}
-
-
XclImpStream& XclImpStream::operator>>( sal_Int8& rnValue )
{
if( EnsureRawReadSize( 1 ) )
@@ -873,8 +855,6 @@ void XclImpStream::Ignore( sal_Size nBytes )
}
}
-
-
sal_Size XclImpStream::ReadUniStringExtHeader(
bool& rb16Bit, bool& rbRich, bool& rbFareast,
sal_uInt16& rnFormatRuns, sal_uInt32& rnExtInf, sal_uInt8 nFlags )
@@ -896,8 +876,6 @@ sal_Size XclImpStream::ReadUniStringExtHeader( bool& rb16Bit, sal_uInt8 nFlags )
return ReadUniStringExtHeader( rb16Bit, bRich, bFareast, nCrun, nExtInf, nFlags );
}
-
-
OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
{
OUString aRet;
@@ -1009,8 +987,6 @@ void XclImpStream::IgnoreUniString( sal_uInt16 nChars )
IgnoreUniString( nChars, ReaduInt8() );
}
-
-
OUString XclImpStream::ReadRawByteString( sal_uInt16 nChars )
{
sal_Char* pcBuffer = new sal_Char[ nChars + 1 ];
commit 15780beffc46b6ca4aa1b3901e357fd696cebded
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 14:38:55 2014 +0200
import alignment dxf record, related fdo#76209
Thanks to Morten Welinder for pointing to the missing piece.
Change-Id: Ib527eb4f7d90fa1abc13446ac61631cf1a6a6e67
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index bb5ec44..5c04f8a 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -566,6 +566,18 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
aFont.FillToItemSet( rStyleItemSet, EXC_FONTITEM_CELL );
}
+ // alignment
+ if( get_flag( nFlags, EXC_CF_BLOCK_ALIGNMENT ) )
+ {
+ XclImpCellAlign aAlign;
+ sal_uInt16 nAlign(0);
+ sal_uInt16 nAlignMisc(0);
+ rStrm >> nAlign >> nAlignMisc;
+ aAlign.FillFromCF( nAlign, nAlignMisc );
+ aAlign.FillToItemSet( rStyleItemSet, NULL );
+ rStrm.Ignore(4);
+ }
+
// *** border block ***
if( ::get_flag( nFlags, EXC_CF_BLOCK_BORDER ) )
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 554e792..45a7f14 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -758,6 +758,17 @@ void XclImpCellAlign::FillFromXF8( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib )
mnTextDir = ::extract_value< sal_uInt8 >( nMiscAttrib, 6, 2 ); // new in BIFF8
}
+void XclImpCellAlign::FillFromCF( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib )
+{
+ mnHorAlign = extract_value< sal_uInt8 >( nAlign, 0, 3 );
+ mbLineBreak = get_flag< sal_uInt8 >( nAlign, EXC_XF_LINEBREAK );
+ mnVerAlign = ::extract_value< sal_uInt8 >( nAlign, 4, 3 );
+ mnRotation = ::extract_value< sal_uInt8 >( nAlign, 8, 8 );
+ mnIndent = ::extract_value< sal_uInt8 >( nMiscAttrib, 0, 4 );
+ mbShrink = ::get_flag( nMiscAttrib, EXC_XF8_SHRINK );
+ mnTextDir = ::extract_value< sal_uInt8 >( nMiscAttrib, 6, 2 );
+}
+
void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFont, bool bSkipPoolDefs ) const
{
// horizontal alignment
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 205d7f3..9271d5f 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -274,6 +274,8 @@ struct XclImpCellAlign : public XclCellAlign
void FillFromXF5( sal_uInt16 nAlign );
/** Fills this struct with BIFF8 XF record data. */
void FillFromXF8( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib );
+ /** Fills this struct with CF record data. */
+ void FillFromCF( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib );
/** Inserts items representing this alignment style into the item set.
@param bSkipPoolDefs true = Do not put items equal to pool default; false = Put all items. */
diff --git a/sc/source/filter/inc/xlcontent.hxx b/sc/source/filter/inc/xlcontent.hxx
index 9d00dcb..416923f 100644
--- a/sc/source/filter/inc/xlcontent.hxx
+++ b/sc/source/filter/inc/xlcontent.hxx
@@ -81,6 +81,7 @@ const sal_uInt32 EXC_CF_AREA_BGCOLOR = 0x00040000; /// Background color
const sal_uInt32 EXC_CF_AREA_ALL = 0x00070000; /// Any area attribute modified?
const sal_uInt32 EXC_CF_ALLDEFAULT = 0x003FFFFF; /// Default flags.
const sal_uInt32 EXC_CF_BLOCK_FONT = 0x04000000; /// Font block present?
+const sal_uInt32 EXC_CF_BLOCK_ALIGNMENT = 0x08000000; /// Alignment block present?
const sal_uInt32 EXC_CF_BLOCK_BORDER = 0x10000000; /// Border block present?
const sal_uInt32 EXC_CF_BLOCK_AREA = 0x20000000; /// Pattern block present?
commit 31672b86130760acb4a3a537208c7a34a302b32b
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 14:34:59 2014 +0200
remove whitespace
Change-Id: I9b8302b3a032c48ffacea94280db9e8466cc003c
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 6a9fb37..205d7f3 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -158,8 +158,6 @@ private:
bool mbShadowUsed; /// true = Shadowed used.
};
-
-
/** Stores the data of all fonts occurred in an Excel file. */
class XclImpFontBuffer : protected XclImpRoot, private boost::noncopyable
{
@@ -262,8 +260,6 @@ struct XclImpCellProt : public XclCellProt
void FillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
};
-
-
/** Extends the XclCellAlign struct for import.
@descr Provides functions to fill from Excel record data and to fill to item sets. */
struct XclImpCellAlign : public XclCellAlign
@@ -284,8 +280,6 @@ struct XclImpCellAlign : public XclCellAlign
void FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFont, bool bSkipPoolDefs = false ) const;
};
-
-
/** Extends the XclCellBorder struct for import.
@descr Provides functions to fill from Excel record data and to fill to item sets. */
struct XclImpCellBorder : public XclCellBorder
@@ -324,8 +318,6 @@ struct XclImpCellBorder : public XclCellBorder
bool bSkipPoolDefs = false ) const;
};
-
-
/** Extends the XclCellArea struct for import.
@descr Provides functions to fill from Excel record data and to fill to item sets. */
struct XclImpCellArea : public XclCellArea
@@ -359,8 +351,6 @@ struct XclImpCellArea : public XclCellArea
bool bSkipPoolDefs = false ) const;
};
-
-
/** Represents an XF record index with additional information. */
class XclImpXFIndex
{
@@ -382,8 +372,6 @@ inline bool operator==( const XclImpXFIndex& rLeft, const XclImpXFIndex& rRight
inline bool operator!=( const XclImpXFIndex& rLeft, const XclImpXFIndex& rRight )
{ return !(rLeft == rRight); }
-
-
/** Contains all data of a XF record and a Calc item set. */
class XclImpXF : public XclXFBase, protected XclImpRoot, private boost::noncopyable
{
@@ -447,8 +435,6 @@ private:
sal_uInt16 mnXclFont; /// Index to font record.
};
-
-
/** Contains all data of a cell style associated with an XF record. */
class XclImpStyle : protected XclImpRoot
{
@@ -483,8 +469,6 @@ private:
ScStyleSheet* mpStyleSheet; /// Calc cell style sheet.
};
-
-
/** Contains all XF records occurred in the file.
@descr This class is able to read XF records (BIFF2 - BIFF8) and STYLE records (BIFF8). */
class XclImpXFBuffer : protected XclImpRoot, private boost::noncopyable
@@ -571,8 +555,6 @@ inline bool XclImpXFRange::Contains( SCROW nScRow ) const
return (mnScRow1 <= nScRow) && (nScRow <= mnScRow2);
}
-
-
/** Contains the XF indexes for every used cell in a column. */
class XclImpXFRangeColumn : private boost::noncopyable
{
@@ -611,8 +593,6 @@ private:
IndexList maIndexList; /// The list of XF index range.
};
-
-
/** Contains the XF indexes for every used cell in a single sheet. */
class XclImpXFRangeBuffer : protected XclImpRoot, private boost::noncopyable
{
@@ -677,8 +657,6 @@ private:
ScRangeList maMergeList; /// List of merged cell ranges.
};
-
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx
index 76caec7..e5acee9 100644
--- a/sc/source/filter/inc/xlstyle.hxx
+++ b/sc/source/filter/inc/xlstyle.hxx
@@ -247,8 +247,6 @@ const sal_uInt8 EXC_STYLEEXT_BUILTIN = 0x01;
const sal_uInt8 EXC_STYLEEXT_HIDDEN = 0x02;
const sal_uInt8 EXC_STYLEEXT_CUSTOM = 0x04;
-// Structs and classes ========================================================
-
// Color data =================================================================
/** Stores all default colors for a specific BIFF version. */
@@ -391,8 +389,6 @@ struct XclFontData
bool operator==( const XclFontData& rLeft, const XclFontData& rRight );
-
-
/** Enumerates different types of Which-IDs for font items. */
enum XclFontItemType
{
@@ -409,8 +405,6 @@ enum XclFontPropSetType
EXC_FONTPROPSET_CONTROL /// Text formatting in form controls.
};
-
-
/** Helper class for usage of property sets. */
class XclFontPropSetHelper
{
@@ -454,8 +448,6 @@ struct XclNumFmt
LanguageType meLanguage; /// Language type to be set with the number format.
};
-
-
class XclNumFmtBuffer
{
public:
@@ -498,8 +490,6 @@ struct XclCellProt
bool operator==( const XclCellProt& rLeft, const XclCellProt& rRight );
-
-
/** Contains all cell alignment attributes. */
struct XclCellAlign
{
@@ -535,8 +525,6 @@ struct XclCellAlign
bool operator==( const XclCellAlign& rLeft, const XclCellAlign& rRight );
-
-
/** Contains color and line style for each cell border line. */
struct XclCellBorder
{
@@ -558,8 +546,6 @@ struct XclCellBorder
bool operator==( const XclCellBorder& rLeft, const XclCellBorder& rRight );
-
-
/** Contains background colors and pattern for a cell. */
struct XclCellArea
{
@@ -575,8 +561,6 @@ struct XclCellArea
bool operator==( const XclCellArea& rLeft, const XclCellArea& rRight );
-
-
/** Contains base members for XF record import/export.
@descr In detail this class stores the XF type (cell/style), the index to the
parent style XF and all "attribute used" flags, which reflect the state of
@@ -612,8 +596,6 @@ protected:
bool mbAreaUsed; /// true = area data used.
};
-
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit db9d6de1973286b22ec31f7aa0b085f3eaf91fb9
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 01:38:41 2014 +0200
export data point symbol color
Change-Id: I0dcbf616b8ab3c8cea4437d399fa4b5ec33e475a
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 3ddca53..001d055 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2999,6 +2999,9 @@ void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries)
break;
}
+ if( aSymbol.Style == chart2::SymbolStyle_AUTO )
+ pSymbolType = "auto";
+
if( pSymbolType )
{
pFS->singleElement( FSNS( XML_c, XML_symbol ),
@@ -3015,6 +3018,11 @@ void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries)
XML_val, I32S(nSize),
FSEND );
+ pFS->startElement( FSNS( XML_c, XML_spPr ),
+ FSEND );
+ WriteSolidFill(aSymbol.FillColor);
+ pFS->endElement( FSNS( XML_c, XML_spPr ) );
+
pFS->endElement( FSNS( XML_c, XML_marker ) );
}
commit 943a23ac0d8ebc445ebf73df0d83dd44715d7d3d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 01:38:13 2014 +0200
import data point symbol color
Change-Id: I27ebd67a535f8617a6f535414ee8426fae6614b9
diff --git a/include/oox/drawingml/chart/seriesmodel.hxx b/include/oox/drawingml/chart/seriesmodel.hxx
index e6e8a01..b9c2c3c 100644
--- a/include/oox/drawingml/chart/seriesmodel.hxx
+++ b/include/oox/drawingml/chart/seriesmodel.hxx
@@ -27,8 +27,6 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
struct DataLabelModelBase
{
typedef ModelRef< Shape > ShapeRef;
@@ -51,8 +49,6 @@ struct DataLabelModelBase
~DataLabelModelBase();
};
-
-
struct DataLabelModel : public DataLabelModelBase
{
typedef ModelRef< LayoutModel > LayoutRef;
@@ -66,8 +62,6 @@ struct DataLabelModel : public DataLabelModelBase
~DataLabelModel();
};
-
-
struct DataLabelsModel : public DataLabelModelBase
{
typedef ModelVector< DataLabelModel > DataLabelVector;
@@ -81,8 +75,6 @@ struct DataLabelsModel : public DataLabelModelBase
~DataLabelsModel();
};
-
-
struct PictureOptionsModel
{
double mfStackUnit; /// Bitmap stacking unit.
@@ -95,8 +87,6 @@ struct PictureOptionsModel
~PictureOptionsModel();
};
-
-
struct ErrorBarModel
{
enum SourceType
@@ -120,8 +110,6 @@ struct ErrorBarModel
~ErrorBarModel();
};
-
-
struct TrendlineLabelModel
{
typedef ModelRef< Shape > ShapeRef;
@@ -139,8 +127,6 @@ struct TrendlineLabelModel
~TrendlineLabelModel();
};
-
-
struct TrendlineModel
{
typedef ModelRef< Shape > ShapeRef;
@@ -162,8 +148,6 @@ struct TrendlineModel
~TrendlineModel();
};
-
-
struct DataPointModel
{
typedef ModelRef< Shape > ShapeRef;
@@ -183,8 +167,6 @@ struct DataPointModel
~DataPointModel();
};
-
-
struct SeriesModel
{
enum SourceType
@@ -226,8 +208,6 @@ struct SeriesModel
~SeriesModel();
};
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/include/oox/drawingml/chart/typegroupconverter.hxx b/include/oox/drawingml/chart/typegroupconverter.hxx
index e61f81f..16c8271 100644
--- a/include/oox/drawingml/chart/typegroupconverter.hxx
+++ b/include/oox/drawingml/chart/typegroupconverter.hxx
@@ -153,7 +153,8 @@ public:
sal_Int32 nAxesSetIdx, bool bSupportsVaryColorsByPoint );
/** Sets the passed OOXML marker style at the passed property set. */
- void convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize ) const;
+ void convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize,
+ ModelRef< Shape > xShapeProps ) const;
/** Sets the passed OOXML line smoothing at the passed property set. */
void convertLineSmooth( PropertySet& rPropSet, bool bOoxSmooth ) const;
/** Sets the passed OOXML bar 3D geometry at the passed property set. */
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index b33aabe..0b2b20a 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -481,7 +481,8 @@ void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDat
// data point marker
if( mrModel.monMarkerSymbol.differsFrom( rSeries.mnMarkerSymbol ) || mrModel.monMarkerSize.differsFrom( rSeries.mnMarkerSize ) )
- rTypeGroup.convertMarker( aPropSet, mrModel.monMarkerSymbol.get( rSeries.mnMarkerSymbol ), mrModel.monMarkerSize.get( rSeries.mnMarkerSize ) );
+ rTypeGroup.convertMarker( aPropSet, mrModel.monMarkerSymbol.get( rSeries.mnMarkerSymbol ),
+ mrModel.monMarkerSize.get( rSeries.mnMarkerSize ), mrModel.mxMarkerProp );
// data point pie explosion
if( mrModel.monExplosion.differsFrom( rSeries.mnExplosion ) )
@@ -578,7 +579,7 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConve
}
// data point markers
- rTypeGroup.convertMarker( aSeriesProp, mrModel.mnMarkerSymbol, mrModel.mnMarkerSize );
+ rTypeGroup.convertMarker( aSeriesProp, mrModel.mnMarkerSymbol, mrModel.mnMarkerSize, mrModel.mxMarkerProp );
#if OOX_CHART_SMOOTHED_PER_SERIES
// #i66858# smoothed series lines
rTypeGroup.convertLineSmooth( aSeriesProp, mrModel.mbSmooth );
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index 7804650..a57c218 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -452,7 +452,8 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra
}
}
-void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize ) const
+void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize,
+ ModelRef< Shape > xShapeProps ) const
{
if( !isSeriesFrameFormat() )
{
@@ -480,6 +481,9 @@ void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSym
sal_Int32 nSize = static_cast< sal_Int32 >( nOoxSize * (2540.0 / 72.0) + 0.5 );
aSymbol.Size.Width = aSymbol.Size.Height = nSize;
+ Color aFillColor = xShapeProps->getFillProperties().maFillColor;
+ aSymbol.FillColor = aFillColor.getColor(getFilter().getGraphicHelper());
+
// set the property
rPropSet.setProperty( PROP_Symbol, aSymbol );
}
commit cb469992ffe92bce0e8554beb522b520f4f40702
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 00:58:22 2014 +0200
remove whitespace
Change-Id: I69454c3d9bddfe01da2622117a16bbb37797062a
diff --git a/include/oox/drawingml/chart/typegroupconverter.hxx b/include/oox/drawingml/chart/typegroupconverter.hxx
index 2219e88..e61f81f 100644
--- a/include/oox/drawingml/chart/typegroupconverter.hxx
+++ b/include/oox/drawingml/chart/typegroupconverter.hxx
@@ -34,8 +34,6 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
/** Enumerates different chart types. */
enum TypeId
{
@@ -55,8 +53,6 @@ enum TypeId
TYPEID_UNKNOWN /// Default for unknown chart types.
};
-
-
/** Enumerates different categories of similar chart types. */
enum TypeCategory
{
@@ -68,8 +64,6 @@ enum TypeCategory
TYPECATEGORY_SURFACE /// Surface charts.
};
-
-
/** Enumerates modes for varying point colors in a series. */
enum VarPointMode
{
@@ -78,8 +72,6 @@ enum VarPointMode
VARPOINTMODE_MULTI /// Supported for multiple series in a chart type group.
};
-
-
/** Contains info for a chart type related to the OpenOffice.org chart module. */
struct TypeGroupInfo
{
@@ -101,8 +93,6 @@ struct TypeGroupInfo
bool mbPictureOptions; /// True = bitmaps support options from c:pictureOptions.
};
-
-
struct UpDownBarsModel;
class UpDownBarsConverter : public ConverterBase< UpDownBarsModel >
@@ -116,8 +106,6 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& rxChartType );
};
-
-
struct TypeGroupModel;
struct View3DModel;
@@ -187,8 +175,6 @@ private:
bool mb3dChart; /// True = type is a 3D chart type.
};
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/include/oox/drawingml/fillproperties.hxx b/include/oox/drawingml/fillproperties.hxx
index f588033..447cba2 100644
--- a/include/oox/drawingml/fillproperties.hxx
+++ b/include/oox/drawingml/fillproperties.hxx
@@ -38,8 +38,6 @@ namespace drawingml {
class ShapePropertyMap;
-
-
struct GradientFillProperties
{
typedef ::std::map< double, Color > GradientStopMap;
@@ -57,8 +55,6 @@ struct GradientFillProperties
void assignUsed( const GradientFillProperties& rSourceProps );
};
-
-
struct PatternFillProperties
{
Color maPattFgColor; /// Pattern foreground color.
@@ -69,8 +65,6 @@ struct PatternFillProperties
void assignUsed( const PatternFillProperties& rSourceProps );
};
-
-
struct BlipFillProperties
{
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
@@ -99,8 +93,6 @@ struct BlipFillProperties
void assignUsed( const BlipFillProperties& rSourceProps );
};
-
-
struct OOX_DLLPUBLIC FillProperties
{
OptValue< sal_Int32 > moFillType; /// Fill type (OOXML token).
@@ -126,8 +118,6 @@ struct OOX_DLLPUBLIC FillProperties
bool bFlipV = false ) const;
};
-
-
struct GraphicProperties
{
BlipFillProperties maBlipProps; /// Properties for the graphic.
@@ -143,8 +133,6 @@ struct GraphicProperties
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
};
-
-
} // namespace drawingml
} // namespace oox
diff --git a/include/oox/drawingml/lineproperties.hxx b/include/oox/drawingml/lineproperties.hxx
index 5e0c062..c38c7e1 100644
--- a/include/oox/drawingml/lineproperties.hxx
+++ b/include/oox/drawingml/lineproperties.hxx
@@ -27,8 +27,6 @@
namespace oox {
namespace drawingml {
-
-
struct LineArrowProperties
{
OptValue< sal_Int32 > moArrowType;
@@ -39,8 +37,6 @@ struct LineArrowProperties
void assignUsed( const LineArrowProperties& rSourceProps );
};
-
-
struct OOX_DLLPUBLIC LineProperties
{
typedef ::std::pair< sal_Int32, sal_Int32 > DashStop;
@@ -73,8 +69,6 @@ struct OOX_DLLPUBLIC LineProperties
sal_Int32 getLineWidth() const;
};
-
-
} // namespace drawingml
} // namespace oox
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 2d0cb45..47f1f85 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -54,8 +54,6 @@ struct ShapeStyleRef
typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap;
-
-
/** Additional information for a chart embedded in a drawing shape. */
struct ChartShapeInfo
{
@@ -65,8 +63,6 @@ struct ChartShapeInfo
explicit ChartShapeInfo( bool bEmbedShapes ) : mbEmbedShapes( bEmbedShapes ) {}
};
-
-
class OOX_DLLPUBLIC Shape
: public boost::enable_shared_from_this< Shape >
{
@@ -287,8 +283,6 @@ private:
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> maDiagramDoms;
};
-
-
} }
#endif // INCLUDED_OOX_DRAWINGML_SHAPE_HXX
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 240255c..b33aabe 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -39,15 +39,11 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::chart2;
using namespace ::com::sun::star::chart2::data;
using namespace ::com::sun::star::uno;
-
-
namespace {
/** nastied-up sgn function - employs some gratuity around 0 - values
@@ -168,8 +164,6 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt
} // namespace
-
-
DataLabelConverter::DataLabelConverter( const ConverterRoot& rParent, DataLabelModel& rModel ) :
ConverterBase< DataLabelModel >( rParent, rModel )
{
@@ -213,8 +207,6 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
}
}
-
-
DataLabelsConverter::DataLabelsConverter( const ConverterRoot& rParent, DataLabelsModel& rModel ) :
ConverterBase< DataLabelsModel >( rParent, rModel )
{
@@ -244,8 +236,6 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
}
}
-
-
ErrorBarConverter::ErrorBarConverter( const ConverterRoot& rParent, ErrorBarModel& rModel ) :
ConverterBase< ErrorBarModel >( rParent, rModel )
{
@@ -346,8 +336,6 @@ void ErrorBarConverter::convertFromModel( const Reference< XDataSeries >& rxData
}
}
-// private --------------------------------------------------------------------
-
Reference< XLabeledDataSequence > ErrorBarConverter::createLabeledDataSequence( ErrorBarModel::SourceType eSourceType )
{
OUString aRole;
@@ -372,8 +360,6 @@ Reference< XLabeledDataSequence > ErrorBarConverter::createLabeledDataSequence(
return lclCreateLabeledDataSequence( *this, mrModel.maSources.get( eSourceType ).get(), aRole );
}
-
-
TrendlineLabelConverter::TrendlineLabelConverter( const ConverterRoot& rParent, TrendlineLabelModel& rModel ) :
ConverterBase< TrendlineLabelModel >( rParent, rModel )
{
@@ -389,8 +375,6 @@ void TrendlineLabelConverter::convertFromModel( PropertySet& rPropSet )
getFormatter().convertFormatting( rPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, OBJECTTYPE_TRENDLINELABEL );
}
-
-
TrendlineConverter::TrendlineConverter( const ConverterRoot& rParent, TrendlineModel& rModel ) :
ConverterBase< TrendlineModel >( rParent, rModel )
{
@@ -479,8 +463,6 @@ void TrendlineConverter::convertFromModel( const Reference< XDataSeries >& rxDat
}
}
-
-
DataPointConverter::DataPointConverter( const ConverterRoot& rParent, DataPointModel& rModel ) :
ConverterBase< DataPointModel >( rParent, rModel )
{
@@ -519,8 +501,6 @@ void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDat
}
}
-
-
SeriesConverter::SeriesConverter( const ConverterRoot& rParent, SeriesModel& rModel ) :
ConverterBase< SeriesModel >( rParent, rModel )
{
@@ -683,8 +663,6 @@ Reference< XLabeledDataSequence > SeriesConverter::createLabeledDataSequence(
return lclCreateLabeledDataSequence( *this, pValues, rRole, pTitle );
}
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index 8b7b7fb..fd0d5e3 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -26,13 +26,9 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
using ::oox::core::ContextHandler2Helper;
using ::oox::core::ContextHandlerRef;
-
-
UpDownBarsContext::UpDownBarsContext( ContextHandler2Helper& rParent, UpDownBarsModel& rModel ) :
ContextBase< UpDownBarsModel >( rParent, rModel )
{
@@ -62,8 +58,6 @@ ContextHandlerRef UpDownBarsContext::onCreateContext( sal_Int32 nElement, const
return 0;
}
-
-
AreaTypeGroupContext::AreaTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -100,8 +94,6 @@ ContextHandlerRef AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, con
return 0;
}
-
-
BarTypeGroupContext::BarTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -151,8 +143,6 @@ ContextHandlerRef BarTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
return 0;
}
-
-
BubbleTypeGroupContext::BubbleTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -195,8 +185,6 @@ ContextHandlerRef BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, c
return 0;
}
-
-
LineTypeGroupContext::LineTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -245,8 +233,6 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
return 0;
}
-
-
PieTypeGroupContext::PieTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -295,8 +281,6 @@ ContextHandlerRef PieTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
return 0;
}
-
-
RadarTypeGroupContext::RadarTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -328,8 +312,6 @@ ContextHandlerRef RadarTypeGroupContext::onCreateContext( sal_Int32 nElement, co
return 0;
}
-
-
ScatterTypeGroupContext::ScatterTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -361,8 +343,6 @@ ContextHandlerRef ScatterTypeGroupContext::onCreateContext( sal_Int32 nElement,
return 0;
}
-
-
SurfaceTypeGroupContext::SurfaceTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -389,8 +369,6 @@ ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement,
return 0;
}
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
commit 147522755492373c6af5096dedd40c9e57a968a8
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 00:36:01 2014 +0200
improve chart series symbol export
Using the chart2 service allows us to export series symbols instead of
the diagram settings.
Change-Id: Ic46f067b60c972af35c0628b3ec4f7851580d725
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index b95fc58..3ba16ad 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -162,7 +162,7 @@ private:
sal_Int32 nSeriesLength );
void exportGrouping( sal_Bool isBar = sal_False );
void exportTrendlines( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > xSeries );
- void exportMarker();
+ void exportMarker( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > xSeries );
void exportSmooth();
void exportFirstSliceAng();
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index b38f308..3ddca53 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
+#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
@@ -1657,6 +1658,7 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
Reference< chart2::data::XDataSource > xSource( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY );
if( xSource.is())
{
+ Reference< chart2::XDataSeries > xDataSeries( xSource, uno::UNO_QUERY );
Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeqCnt(
xSource->getDataSequences());
// search for main sequence and create a series element
@@ -1727,7 +1729,7 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
{
case chart::TYPEID_LINE:
{
- exportMarker( );
+ exportMarker(xDataSeries);
break;
}
case chart::TYPEID_PIE:
@@ -1745,12 +1747,12 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
}
case chart::TYPEID_SCATTER:
{
- exportMarker( );
+ exportMarker(xDataSeries);
break;
}
case chart::TYPEID_RADARLINE:
{
- exportMarker( );
+ exportMarker(xDataSeries);
break;
}
}
@@ -2946,48 +2948,55 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries )
}
}
-void ChartExport::exportMarker()
+void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries)
{
+ Reference< XPropertySet > xPropSet( xSeries, uno::UNO_QUERY );
+ chart2::Symbol aSymbol;
+ if( GetProperty( xPropSet, "Symbol" ) )
+ mAny >>= aSymbol;
+
+ if(aSymbol.Style != chart2::SymbolStyle_STANDARD && aSymbol.Style != chart2::SymbolStyle_AUTO)
+ return;
+
FSHelperPtr pFS = GetFS();
pFS->startElement( FSNS( XML_c, XML_marker ),
FSEND );
- Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY );
- sal_Int32 nSymbolType = ::com::sun::star::chart::ChartSymbolType::NONE;
- if( GetProperty( xPropSet, "SymbolType" ) )
- mAny >>= nSymbolType;
+ sal_Int32 nSymbol = aSymbol.StandardSymbol;
// TODO: more properties support for marker
const char* pSymbolType = NULL;
- switch( nSymbolType )
+ switch( nSymbol )
{
- case cssc::ChartSymbolType::NONE:
- pSymbolType = "none";
- break;
- case cssc::ChartSymbolType::SYMBOL0:
+ case 0:
pSymbolType = "square";
break;
- case cssc::ChartSymbolType::SYMBOL1:
+ case 1:
pSymbolType = "diamond";
break;
- // map all triangle variants to the OOXML version
- case cssc::ChartSymbolType::SYMBOL2:
- case cssc::ChartSymbolType::SYMBOL3:
- case cssc::ChartSymbolType::SYMBOL4:
- case cssc::ChartSymbolType::SYMBOL5:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
pSymbolType = "triangle";
break;
- case cssc::ChartSymbolType::SYMBOL6:
- pSymbolType = "plus";
+ case 8:
+ pSymbolType = "circle";
break;
- case cssc::ChartSymbolType::SYMBOL7:
- pSymbolType = "plus";
+ case 9:
+ pSymbolType = "star";
+ break;
+ case 10:
+ pSymbolType = "X";
break;
- case cssc::ChartSymbolType::AUTO:
+ case 11:
+ pSymbolType = "plus";
break;
- case cssc::ChartSymbolType::BITMAPURL:
+ case 13:
+ pSymbolType = "dash";
break;
default:
- SAL_WARN("oox", "unknown data series symbol");
+ pSymbolType = "square";
+ break;
}
if( pSymbolType )
@@ -2996,21 +3005,16 @@ void ChartExport::exportMarker()
XML_val, pSymbolType,
FSEND );
}
- if( nSymbolType != cssc::ChartSymbolType::NONE )
- {
- awt::Size aSymbolSize;
- if( GetProperty( xPropSet, "SymbolSize" ) )
- {
- mAny >>= aSymbolSize;;
- sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height );
- nSize = nSize/250.0*7.0; // just guessed based on some test cases
- nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) );
- pFS->singleElement( FSNS( XML_c, XML_size),
- XML_val, I32S(nSize),
- FSEND );
- }
- }
+ awt::Size aSymbolSize = aSymbol.Size;
+ sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height );
+
+ nSize = nSize/250.0*7.0; // just guessed based on some test cases
+ nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) );
+ pFS->singleElement( FSNS( XML_c, XML_size),
+ XML_val, I32S(nSize),
+ FSEND );
+
pFS->endElement( FSNS( XML_c, XML_marker ) );
}
commit 379c457af064826c5423504d4e460ffd94bdd277
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Apr 5 18:33:07 2014 +0200
add test for fdo#64722, cp#1000058
Change-Id: Idccff4629b8af84e59d52fb3135e9217d3564cb9
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 7697bab..7c60e88 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -54,6 +54,7 @@ public:
void testPieChartRotation();
void testEmbeddingsOleObjectGrabBag();
void testGapWidthXLSX();
+ void testLabelStringODS();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
@@ -80,6 +81,7 @@ public:
CPPUNIT_TEST(testPieChartRotation);
CPPUNIT_TEST(testEmbeddingsOleObjectGrabBag);
CPPUNIT_TEST(testGapWidthXLSX);
+ CPPUNIT_TEST(testLabelStringODS);
CPPUNIT_TEST_SUITE_END();
protected:
@@ -772,6 +774,28 @@ void Chart2ExportTest::testGapWidthXLSX()
checkSheetForGapWidthAndOverlap(xChartDoc, 50, 30);
}
+void Chart2ExportTest::testLabelStringODS()
+{
+ load("/chart2/qa/extras/data/ods/", "labelString.ods");
+
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ Reference< chart2::data::XDataSequence > xLabelSeq =
+ getLabelDataSequenceFromDoc(xChartDoc);
+ CPPUNIT_ASSERT(xLabelSeq.is());
+
+ OUString aLabelString = xLabelSeq->getSourceRangeRepresentation();
+ CPPUNIT_ASSERT_EQUAL(OUString("\"LabelName\""), aLabelString);
+
+ reload("calc8");
+
+ xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ xLabelSeq = getLabelDataSequenceFromDoc(xChartDoc);
+ CPPUNIT_ASSERT(xLabelSeq.is());
+
+ aLabelString = xLabelSeq->getSourceRangeRepresentation();
+ CPPUNIT_ASSERT_EQUAL(OUString("\"LabelName\""), aLabelString);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index 73b5748..471346c 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -35,6 +35,8 @@
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
+#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
+#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
@@ -213,6 +215,29 @@ Reference< chart2::XDataSeries > getDataSeriesFromDoc( uno::Reference< chart2::X
return xSeries;
}
+Reference< chart2::data::XDataSequence > getLabelDataSequenceFromDoc(
+ Reference< chart2::XChartDocument > xChartDoc,
+ sal_Int32 nDataSeries = 0, sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0 )
+{
+ Reference< chart2::XDataSeries > xDataSeries =
+ getDataSeriesFromDoc( xChartDoc, nDataSeries, nChartType, nCooSys );
+ CPPUNIT_ASSERT(xDataSeries.is());
+ Reference< chart2::data::XDataSource > xDataSource( xDataSeries, uno::UNO_QUERY_THROW );
+ Sequence< Reference< chart2::data::XLabeledDataSequence > > xDataSequences =
+ xDataSource->getDataSequences();
+ for(sal_Int32 i = 0; i < xDataSequences.getLength(); ++i)
+ {
+ Reference< chart2::data::XDataSequence> xLabelSeq = xDataSequences[i]->getLabel();
+ if(!xLabelSeq.is())
+ continue;
+
+ return xLabelSeq;
+ }
+
+ CPPUNIT_FAIL("no Label sequence found");
+ return Reference< chart2::data::XDataSequence > ();
+}
+
uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XComponent > mxComponent )
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/chart2/qa/extras/data/ods/labelString.ods b/chart2/qa/extras/data/ods/labelString.ods
new file mode 100644
index 0000000..2b7e03c
Binary files /dev/null and b/chart2/qa/extras/data/ods/labelString.ods differ
commit a9b16d7f593abe5424180356ab7f24214bed2d8c
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Apr 5 17:18:53 2014 +0200
rename variable
Change-Id: I6ac553172a7c017010d4efa42224f25e2d5537da
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index 900fe45..73b5748 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -202,10 +202,10 @@ Reference< chart2::XDataSeries > getDataSeriesFromDoc( uno::Reference< chart2::X
sal_Int32 nDataSeries, sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0 )
{
Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, nChartType, nCooSys );
- Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( xChartType, UNO_QUERY_THROW );
- CPPUNIT_ASSERT ( xDataSequenceContainer.is() );
+ Reference< chart2::XDataSeriesContainer > xDataSeriesContainer( xChartType, UNO_QUERY_THROW );
+ CPPUNIT_ASSERT ( xDataSeriesContainer.is() );
- Sequence< Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() );
+ Sequence< Reference< chart2::XDataSeries > > xSeriesSequence( xDataSeriesContainer->getDataSeries() );
CPPUNIT_ASSERT( xSeriesSequence.getLength() > nDataSeries );
Reference< chart2::XDataSeries > xSeries = xSeriesSequence[nDataSeries];
commit 32cb6ed57d2722ef9b1b99dd06853319c5a473fc
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Apr 5 16:49:39 2014 +0200
export label names that are strings, fdo#64722, cp#1000058
Change-Id: Id72e9778c70db02b942326c6f8b5f448acb28b41
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 6f6ad44..fb4c87a 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -1066,6 +1066,7 @@ namespace xmloff { namespace token {
XML_LABEL_CELL_RANGE_ADDRESS,
XML_LABEL_RANGE,
XML_LABEL_RANGES,
+ XML_LABEL_STRING,
XML_LAMBDA,
XML_LANDSCAPE,
XML_LANGUAGE,
diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx
index 173788a..8b6286d 100644
--- a/xmloff/inc/SchXMLImport.hxx
+++ b/xmloff/inc/SchXMLImport.hxx
@@ -140,6 +140,7 @@ enum SchXMLSeriesAttrMap
{
XML_TOK_SERIES_CELL_RANGE,
XML_TOK_SERIES_LABEL_ADDRESS,
+ XML_TOK_SERIES_LABEL_STRING,
XML_TOK_SERIES_ATTACHED_AXIS,
XML_TOK_SERIES_STYLE_NAME,
XML_TOK_SERIES_CHART_CLASS
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 500a80e..7d0fe68 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -2553,6 +2553,14 @@ namespace
//no doubles and no texts
return false;
}
+
+ bool isString(const OUString& rString)
+ {
+ if(rString.startsWith("\"") && rString.endsWith("\""))
+ return true;
+
+ return false;
+ }
}
void SchXMLExportHelper_Impl::exportSeries(
@@ -2720,10 +2728,21 @@ void SchXMLExportHelper_Impl::exportSeries(
modifyLabelRange = true;
if (modifyLabelRange)
aRange = "label " + OUString::number(aRange.copy( OUString("label").getLength()).toInt32() - 1);
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LABEL_CELL_ADDRESS,
- lcl_ConvertRange(
- aRange,
- xNewDoc ));
+
+ OUString aXMLRange = lcl_ConvertRange( aRange, xNewDoc );
+ if(aXMLRange.isEmpty() && !aRange.isEmpty())
+ {
+ // might just be a string
+ bool bIsString = isString(aRange);
+ if(bIsString)
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_LO_EXT,
+ XML_LABEL_STRING, aRange );
+ }
+ }
+ else
+ mrExport.AddAttribute( XML_NAMESPACE_CHART,
+ XML_LABEL_CELL_ADDRESS, aXMLRange );
}
if( xLabelSeq.is() || xValuesSeq.is() )
aSeriesLabelValuesPair = tLabelValuesDataPair( xLabelSeq, xValuesSeq );
@@ -3138,6 +3157,7 @@ void SchXMLExportHelper_Impl::exportCandleStickSeries(
Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY );
//@todo: export data points
+ //TODO: moggi: same code three times
// open
if( bJapaneseCandleSticks )
{
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 3a3dc51..042dcba 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -339,6 +339,7 @@ const SvXMLTokenMap& SchXMLImportHelper::GetSeriesAttrTokenMap()
{
{ XML_NAMESPACE_CHART, XML_VALUES_CELL_RANGE_ADDRESS, XML_TOK_SERIES_CELL_RANGE },
{ XML_NAMESPACE_CHART, XML_LABEL_CELL_ADDRESS, XML_TOK_SERIES_LABEL_ADDRESS },
+ { XML_NAMESPACE_LO_EXT, XML_LABEL_STRING, XML_TOK_SERIES_LABEL_STRING },
{ XML_NAMESPACE_CHART, XML_ATTACHED_AXIS, XML_TOK_SERIES_ATTACHED_AXIS },
{ XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_SERIES_STYLE_NAME },
{ XML_NAMESPACE_CHART, XML_CLASS, XML_TOK_SERIES_CHART_CLASS },
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 795effb..54dcd57 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -308,6 +308,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
bool bHasRange = false;
OUString aSeriesLabelRange;
+ OUString aSeriesLabelString;
for( sal_Int16 i = 0; i < nAttrCount; i++ )
{
@@ -325,6 +326,9 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
case XML_TOK_SERIES_LABEL_ADDRESS:
aSeriesLabelRange = aValue;
break;
+ case XML_TOK_SERIES_LABEL_STRING:
+ aSeriesLabelString = aValue;
+ break;
case XML_TOK_SERIES_ATTACHED_AXIS:
{
sal_Int32 nNumOfAxes = mrAxes.size();
@@ -442,6 +446,12 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
SchXMLTools::CreateDataSequence( aSeriesLabelRange, mxNewDoc );
xLabeledSeq->setLabel( xLabelSequence );
}
+ else if( !aSeriesLabelString.isEmpty() )
+ {
+ Reference< chart2::data::XDataSequence > xLabelSequence =
+ SchXMLTools::CreateDataSequenceWithoutConvert( aSeriesLabelString, mxNewDoc );
+ xLabeledSeq->setLabel( xLabelSequence );
+ }
// Note: Even if we have no label, we have to register the label
// for creation, because internal data always has labels. If
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index 06efa57..f704784 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -424,6 +424,38 @@ Reference< chart2::data::XDataSequence > CreateDataSequence(
return xRet;
}
+Reference< chart2::data::XDataSequence > CreateDataSequenceWithoutConvert(
+ const OUString & rRange,
+ const Reference< chart2::XChartDocument >& xChartDoc )
+{
+ Reference< chart2::data::XDataSequence > xRet;
+
+ if( !xChartDoc.is() )
+ {
+ SAL_WARN("xmloff.chart", "need a chart document" );
+ return xRet;
+ }
+
+ Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() );
+ if( !xDataProvider.is() )
+ {
+ SAL_WARN("xmloff.chart", "need a data provider" );
+ return xRet;
+ }
+
+ try
+ {
+ xRet.set( xDataProvider->createDataSequenceByRangeRepresentation( rRange ) );
+ SchXMLTools::setXMLRangePropertyAtDataSequence( xRet, rRange );
+ }
+ catch( const lang::IllegalArgumentException & )
+ {
+ SAL_WARN("xmloff.chart", "could not create data sequence" );
+ }
+
+ return xRet;
+}
+
void CreateCategories(
const uno::Reference< chart2::data::XDataProvider > & xDataProvider,
const uno::Reference< chart2::XChartDocument > & xNewDoc,
diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx
index 0b6f49a..ed21ea2 100644
--- a/xmloff/source/chart/SchXMLTools.hxx
+++ b/xmloff/source/chart/SchXMLTools.hxx
@@ -86,6 +86,11 @@ namespace SchXMLTools
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument >& xChartDoc );
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > CreateDataSequenceWithoutConvert(
+ const OUString& rRange,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument >& xChartDoc );
+
void CreateCategories(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > & xDataProvider,
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > & xNewDoc,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 4002ae0..1e1aa42 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -1071,6 +1071,7 @@ namespace xmloff { namespace token {
TOKEN( "label-cell-range-address", XML_LABEL_CELL_RANGE_ADDRESS ),
TOKEN( "label-range", XML_LABEL_RANGE ),
TOKEN( "label-ranges", XML_LABEL_RANGES ),
+ TOKEN( "label-string", XML_LABEL_STRING ),
TOKEN( "lambda", XML_LAMBDA ),
TOKEN( "landscape", XML_LANDSCAPE ),
TOKEN( "language", XML_LANGUAGE ),
commit 3d8d54ee2283380ea6ab48195d53a0ddf2e3cbdf
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Apr 5 15:34:38 2014 +0200
no need for member variable and bool variable
Change-Id: I58dc22fdec3db8280506a92fe16065cc5482c357
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index bbea32e..795effb 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -307,7 +307,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
mnAttachedAxis = 1;
bool bHasRange = false;
- bool bHasLabelRange = false;
+ OUString aSeriesLabelRange;
for( sal_Int16 i = 0; i < nAttrCount; i++ )
{
@@ -323,8 +323,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
bHasRange = true;
break;
case XML_TOK_SERIES_LABEL_ADDRESS:
- m_aSeriesLabelRange = aValue;
- bHasLabelRange = true;
+ aSeriesLabelRange = aValue;
break;
case XML_TOK_SERIES_ATTACHED_AXIS:
{
@@ -437,10 +436,10 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq ));
// label
- if( bHasLabelRange && !m_aSeriesLabelRange.isEmpty() )
+ if( !aSeriesLabelRange.isEmpty() )
{
Reference< chart2::data::XDataSequence > xLabelSequence =
- SchXMLTools::CreateDataSequence( m_aSeriesLabelRange, mxNewDoc );
+ SchXMLTools::CreateDataSequence( aSeriesLabelRange, mxNewDoc );
xLabeledSeq->setLabel( xLabelSequence );
}
diff --git a/xmloff/source/chart/SchXMLSeries2Context.hxx b/xmloff/source/chart/SchXMLSeries2Context.hxx
index a4974ce..ee78f4c 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.hxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.hxx
@@ -64,7 +64,6 @@ private:
OUString maGlobalChartTypeName;
OUString maSeriesChartTypeName;
OUString m_aSeriesRange;
- OUString m_aSeriesLabelRange;
bool m_bHasDomainContext;
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
tSchXMLLSequencesPerIndex maPostponedSequences;
commit c07b2d1ec86da69f1b453cac724d1a09692e50f0
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Apr 5 02:50:40 2014 +0200
prevent excessive exceptions
They hide the interesting parts that I'm interested in and are always
thrown so let us avoid them
Change-Id: I532a3fe678de7d3ac0776db23363df5d35c793eb
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index 4b372ca..65c297fb 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -597,14 +597,18 @@ Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAx
, const Reference< XCoordinateSystem >& xCooSys )
{
Reference< XAxis > xRet;
- try
- {
- if( xCooSys.is() )
- xRet.set( xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) );
- }
- catch( const uno::Exception & )
- {
- }
+ if(!xCooSys.is())
+ return xRet;
+
+ if(nDimensionIndex >= xCooSys->getDimension())
+ return xRet;
+
+ if(nAxisIndex > xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex))
+ return xRet;
+
+ assert(nAxisIndex >= 0);
+ assert(nDimensionIndex >= 0);
+ xRet.set( xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) );
return xRet;
}
More information about the Libreoffice-commits
mailing list