summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-28 17:37:43 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-28 17:39:13 +0200
commit6e793fdb9f349e650cf3bed47cd900119147c442 (patch)
treed8148a00e83070582c1e41dddc8b0c1de49e8af0 /sd/source
parent306b29a62f7735fb0d80b7e6e987c7921ebf2c82 (diff)
sd html: Support export of any text objects (draw) and groups
Change-Id: Ied2de0a076db722df8366e866ae66846f3fb2854
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/filter/html/htmlex.cxx52
-rw-r--r--sd/source/filter/html/htmlex.hxx4
2 files changed, 51 insertions, 5 deletions
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index dd69ce4fb475..e6f163d63141 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -62,13 +62,16 @@
#include <svl/style.hxx>
#include <editeng/frmdiritem.hxx>
#include <svx/svdoutl.hxx>
+#include <svx/svdogrp.hxx>
#include <tools/urlobj.hxx>
#include <vcl/bmpacc.hxx>
#include <svtools/sfxecode.hxx>
#include <com/sun/star/beans/PropertyState.hpp>
#include <tools/resmgr.hxx>
-#include "comphelper/anytostring.hxx"
-#include "cppuhelper/exc_hlp.hxx"
+#include <comphelper/anytostring.hxx>
+#include <cppuhelper/exc_hlp.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/svdotable.hxx>
#include "drawdoc.hxx"
#include "htmlpublishmode.hxx"
@@ -80,9 +83,6 @@
#include "imapinfo.hxx"
#include "sdresid.hxx"
#include "buttonset.hxx"
-#include <basegfx/polygon/b2dpolygon.hxx>
-
-#include <svx/svdotable.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -1218,6 +1218,23 @@ OUString HtmlExport::CreateTextForPage(SdrOutliner* pOutliner, SdPage* pPage,
switch (eKind)
{
+ case PRESOBJ_NONE:
+ {
+ if (pObject->GetObjIdentifier() == OBJ_GRUP)
+ {
+ SdrObjGroup* pObjectGroup = (SdrObjGroup*) pObject;
+ WriteObjectGroup(aStr, pObjectGroup, pOutliner, rBackgroundColor, false);
+ }
+ else
+ {
+ if (pObject->GetOutlinerParaObject())
+ {
+ WriteOutlinerParagraph(aStr, pOutliner, pObject->GetOutlinerParaObject(), rBackgroundColor, false);
+ }
+ }
+ }
+ break;
+
case PRESOBJ_TABLE:
{
SdrTableObj* pTableObject = (SdrTableObj*) pObject;
@@ -1248,6 +1265,7 @@ OUString HtmlExport::CreateTextForPage(SdrOutliner* pOutliner, SdPage* pPage,
aStr.append("</table>\r\n");
}
break;
+
case PRESOBJ_TEXT:
case PRESOBJ_OUTLINE:
{
@@ -1257,6 +1275,7 @@ OUString HtmlExport::CreateTextForPage(SdrOutliner* pOutliner, SdPage* pPage,
WriteOutlinerParagraph(aStr, pOutliner, pTextObject->GetOutlinerParaObject(), rBackgroundColor, bHeadLine);
}
break;
+
default:
break;
}
@@ -1264,6 +1283,29 @@ OUString HtmlExport::CreateTextForPage(SdrOutliner* pOutliner, SdPage* pPage,
return aStr.makeStringAndClear();
}
+void HtmlExport::WriteObjectGroup(OUStringBuffer& aStr, SdrObjGroup* pObjectGroup, SdrOutliner* pOutliner,
+ const Color& rBackgroundColor, bool bHeadLine)
+{
+ SdrObjListIter aGroupIterator(*pObjectGroup->GetSubList(), IM_DEEPNOGROUPS);
+ while (aGroupIterator.IsMore())
+ {
+ SdrObject* pCurrentObject = aGroupIterator.Next();
+ if (pCurrentObject->GetObjIdentifier() == OBJ_GRUP)
+ {
+ SdrObjGroup* pCurrentGroupObject = (SdrObjGroup*) pCurrentObject;
+ WriteObjectGroup(aStr, pCurrentGroupObject, pOutliner, rBackgroundColor, bHeadLine);
+ }
+ else
+ {
+ OutlinerParaObject* pOutlinerParagraphObject = pCurrentObject->GetOutlinerParaObject();
+ if (pOutlinerParagraphObject != NULL)
+ {
+ WriteOutlinerParagraph(aStr, pOutliner, pOutlinerParagraphObject, rBackgroundColor, bHeadLine);
+ }
+ }
+ }
+}
+
void HtmlExport::WriteOutlinerParagraph(OUStringBuffer& aStr, SdrOutliner* pOutliner,
OutlinerParaObject* pOutlinerParagraphObject,
const Color& rBackgroundColor, bool bHeadLine)
diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx
index 58e008670024..51d3359fec52 100644
--- a/sd/source/filter/html/htmlex.hxx
+++ b/sd/source/filter/html/htmlex.hxx
@@ -55,6 +55,7 @@ class SdrOutliner;
class SdPage;
class HtmlState;
class SdrTextObj;
+class SdrObjGroup;
class SdrPage;
class SdDrawDocument;
class ButtonSet;
@@ -215,6 +216,9 @@ class HtmlExport
OutlinerParaObject* pOutlinerParagraphObject,
const Color& rBackgroundColor, bool bHeadLine);
+ void WriteObjectGroup(OUStringBuffer& aStr, SdrObjGroup* pObjectGroup, SdrOutliner* pOutliner,
+ const Color& rBackgroundColor, bool bHeadLine);
+
public:
HtmlExport(const OUString& aPath,
const css::uno::Sequence<css::beans::PropertyValue>& rParams,