[Libreoffice-commits] core.git: writerperfect/source

2023-10-20 Thread Stephan Bergmann (via logerrit)
 writerperfect/source/impress/KeynoteImportFilter.cxx |4 ++--
 writerperfect/source/writer/EPUBPackage.cxx  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9108c6e2755b8d6de3b20ad9a868dd393d5b80a8
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:41 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 20 22:56:41 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: writerperfect

Change-Id: Ibaf69c1d922be6fade028ce6602f215cd9cd35cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158293
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx 
b/writerperfect/source/impress/KeynoteImportFilter.cxx
index abf7d21e4055..c2fb11012391 100644
--- a/writerperfect/source/impress/KeynoteImportFilter.cxx
+++ b/writerperfect/source/impress/KeynoteImportFilter.cxx
@@ -215,8 +215,8 @@ 
KeynoteImportFilter::detect(css::uno::Sequence& Descr
 if (bUCBContentChanged)
 pDescriptor[nUCBContentLocation].Value <<= xContent;
 
-static constexpr OUStringLiteral sTypeName(u"impress_AppleKeynote");
-pDescriptor[nTypeNameLocation].Value <<= OUString(sTypeName);
+static constexpr OUString sTypeName(u"impress_AppleKeynote"_ustr);
+pDescriptor[nTypeNameLocation].Value <<= sTypeName;
 
 return sTypeName;
 }
diff --git a/writerperfect/source/writer/EPUBPackage.cxx 
b/writerperfect/source/writer/EPUBPackage.cxx
index ba8bac1d91ce..6ad143aa5e49 100644
--- a/writerperfect/source/writer/EPUBPackage.cxx
+++ b/writerperfect/source/writer/EPUBPackage.cxx
@@ -43,7 +43,7 @@ 
EPUBPackage::EPUBPackage(uno::Reference xContext,
 mxOutputStream.set(
 mxStorage->openStreamElementByHierarchicalName("mimetype", 
embed::ElementModes::READWRITE),
 uno::UNO_QUERY);
-static constexpr OStringLiteral aMimeType("application/epub+zip");
+static constexpr OString aMimeType("application/epub+zip"_ostr);
 uno::Sequence aData(reinterpret_cast(aMimeType.getStr()),
   aMimeType.getLength());
 mxOutputStream->writeBytes(aData);


[Libreoffice-commits] core.git: writerperfect/source

2023-08-24 Thread Caolán McNamara (via logerrit)
 writerperfect/source/common/WPXSvInputStream.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit bf1e649e6f626268db99d20ae921669ed557c3af
Author: Caolán McNamara 
AuthorDate: Wed Aug 23 17:18:41 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 24 10:03:53 2023 +0200

cid#1541185 Operands don't affect result

when sal_Int64 == long

Change-Id: I36fab92613a2e7dd8f3817b151e9a836b29803f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156014
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/writerperfect/source/common/WPXSvInputStream.cxx 
b/writerperfect/source/common/WPXSvInputStream.cxx
index 2bcef2b52824..ded992e69c5c 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -441,8 +441,12 @@ tools::Long WPXSvInputStream::tellImpl()
 else
 {
 const sal_Int64 tmpPosition = mxSeekable->getPosition();
-if ((tmpPosition < 0) || (tmpPosition > LONG_MAX))
+if (tmpPosition < 0)
 return -1;
+#if SAL_TYPES_SIZEOFLONG == 4
+if (tmpPosition > LONG_MAX)
+return -1;
+#endif
 return static_cast(tmpPosition);
 }
 }


[Libreoffice-commits] core.git: writerperfect/source

2023-08-23 Thread Caolán McNamara (via logerrit)
 writerperfect/source/common/WPXSvInputStream.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 9f6927e882b8e4f207ec632f0802a6136a165d88
Author: Caolán McNamara 
AuthorDate: Tue Aug 22 21:45:13 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 23 18:10:45 2023 +0200

cid#1541186 Operands don't affect result

We probably manually silenced this in the past, so now it has returned
after the code has changed enough to trigger it.

I don't think we need to check for LONG_MAX in this case, we only return
0 or -1 here anyway.

Change-Id: Ic2ba171a8c7c3f74d98088434a85e947fcadf7b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155958
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/writerperfect/source/common/WPXSvInputStream.cxx 
b/writerperfect/source/common/WPXSvInputStream.cxx
index fa5984dc842e..2bcef2b52824 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -453,19 +453,20 @@ int WPXSvInputStream::seek(tools::Long offset)
 return -1;
 
 const sal_Int64 tmpPosition = mxSeekable->getPosition();
-if ((tmpPosition < 0) || (tmpPosition > LONG_MAX))
+if (tmpPosition < 0)
 return -1;
 
 try
 {
 mxSeekable->seek(offset);
-return 0;
 }
 catch (...)
 {
 SAL_WARN("writerperfect", "mxSeekable->seek(offset) threw exception");
 return -1;
 }
+
+return 0;
 }
 
 bool WPXSvInputStream::isStructured()


[Libreoffice-commits] core.git: writerperfect/source

2023-03-31 Thread Mike Kaganski (via logerrit)
 writerperfect/source/writer/WordPerfectImportFilter.cxx |   17 +---
 1 file changed, 6 insertions(+), 11 deletions(-)

New commits:
commit d408e940630d131ab886a1d4619671fa0299c03e
Author: Mike Kaganski 
AuthorDate: Fri Mar 31 22:05:24 2023 +0200
Commit: Mike Kaganski 
CommitDate: Fri Mar 31 23:06:59 2023 +0200

Simplify a bit

Change-Id: I56de67a7860263d40b4352e93927dfdb107eb4bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149875
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx 
b/writerperfect/source/writer/WordPerfectImportFilter.cxx
index 46e3241ee5eb..518c5556bb13 100644
--- a/writerperfect/source/writer/WordPerfectImportFilter.cxx
+++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx
@@ -167,18 +167,15 @@ WordPerfectImportFilter::setTargetDocument(const 
Reference& 
Descriptor)
 {
-libwpd::WPDConfidence confidence = libwpd::WPD_CONFIDENCE_NONE;
-OUString sTypeName;
 sal_Int32 nLength = Descriptor.getLength();
 sal_Int32 location = nLength;
-const css::beans::PropertyValue* pValue = Descriptor.getConstArray();
 Reference xInputStream;
 for (sal_Int32 i = 0; i < nLength; i++)
 {
-if (pValue[i].Name == "TypeName")
+if (Descriptor[i].Name == "TypeName")
 location = i;
-else if (pValue[i].Name == "InputStream")
-pValue[i].Value >>= xInputStream;
+else if (Descriptor[i].Name == "InputStream")
+Descriptor[i].Value >>= xInputStream;
 }
 
 if (!xInputStream.is())
@@ -186,13 +183,10 @@ 
WordPerfectImportFilter::detect(css::uno::Sequence& D
 
 WPXSvInputStream input(xInputStream);
 
-confidence = libwpd::WPDocument::isFileFormatSupported();
-
+OUString sTypeName;
+libwpd::WPDConfidence confidence = 
libwpd::WPDocument::isFileFormatSupported();
 if (confidence == libwpd::WPD_CONFIDENCE_EXCELLENT
 || confidence == libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION)
-sTypeName = "writer_WordPerfect_Document";
-
-if (!sTypeName.isEmpty())
 {
 if (location == nLength)
 {
@@ -200,6 +194,7 @@ 
WordPerfectImportFilter::detect(css::uno::Sequence& D
 Descriptor.getArray()[location].Name = "TypeName";
 }
 
+sTypeName = "writer_WordPerfect_Document";
 Descriptor.getArray()[location].Value <<= sTypeName;
 }
 


[Libreoffice-commits] core.git: writerperfect/source

2022-12-19 Thread Szymon Kłos (via logerrit)
 writerperfect/source/writer/EPUBExportDialog.cxx |5 +
 writerperfect/source/writer/EPUBExportDialog.hxx |1 +
 2 files changed, 6 insertions(+)

New commits:
commit 35d8b4c36299df39de36f2c7ade5727fc525eaab
Author: Szymon Kłos 
AuthorDate: Wed Dec 14 09:29:22 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Dec 20 06:40:31 2022 +

lok: hide customization in EPUB export dialog

Change-Id: I531aba2eb52e74904b6cba82add769d35a8a28c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144150
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144534
Tested-by: Jenkins

diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index 0bba77a1898b..ecea590ac831 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -92,6 +93,7 @@ EPUBExportDialog::EPUBExportDialog(weld::Window* pParent,
 , m_xInitialCreator(m_xBuilder->weld_entry("author"))
 , m_xLanguage(m_xBuilder->weld_entry("language"))
 , m_xDate(m_xBuilder->weld_entry("date"))
+, m_xCustomizeFrame(m_xBuilder->weld_frame("customize"))
 
 {
 assert(PositionToVersion(m_xVersion->get_active()) == 
EPUBExportFilter::GetDefaultVersion());
@@ -154,6 +156,9 @@ EPUBExportDialog::EPUBExportDialog(weld::Window* pParent,
 }
 
 m_xOKButton->connect_clicked(LINK(this, EPUBExportDialog, OKClickHdl));
+
+if (comphelper::LibreOfficeKit::isActive())
+m_xCustomizeFrame->hide();
 }
 
 IMPL_LINK_NOARG(EPUBExportDialog, VersionSelectHdl, weld::ComboBox&, void)
diff --git a/writerperfect/source/writer/EPUBExportDialog.hxx 
b/writerperfect/source/writer/EPUBExportDialog.hxx
index 9e11d5351559..440c74d1176e 100644
--- a/writerperfect/source/writer/EPUBExportDialog.hxx
+++ b/writerperfect/source/writer/EPUBExportDialog.hxx
@@ -54,6 +54,7 @@ private:
 std::unique_ptr m_xInitialCreator;
 std::unique_ptr m_xLanguage;
 std::unique_ptr m_xDate;
+std::unique_ptr m_xCustomizeFrame;
 };
 
 } // namespace writerperfect


[Libreoffice-commits] core.git: writerperfect/source

2022-12-19 Thread Szymon Kłos (via logerrit)
 writerperfect/source/writer/EPUBExportUIComponent.cxx |   25 ++
 writerperfect/source/writer/EPUBExportUIComponent.hxx |   14 ++
 2 files changed, 39 insertions(+)

New commits:
commit 34709aa3f4f166879004670e60ff3b37ad3eacd5
Author: Szymon Kłos 
AuthorDate: Fri Dec 9 13:53:47 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Dec 20 03:10:59 2022 +

Make EPUB Export dialog async

(cherry picked from commit 9461b0e1385b87d2490bf9402729fb9e912395e9)

Change-Id: Iead5b4ff6064395fd5abbcdea73db38415dbb37c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144514
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/writerperfect/source/writer/EPUBExportUIComponent.cxx 
b/writerperfect/source/writer/EPUBExportUIComponent.cxx
index e8d618b99cf6..0e392ffe00ec 100644
--- a/writerperfect/source/writer/EPUBExportUIComponent.cxx
+++ b/writerperfect/source/writer/EPUBExportUIComponent.cxx
@@ -90,6 +90,31 @@ void SAL_CALL EPUBExportUIComponent::setSourceDocument(
 mxSourceDocument = xDocument;
 }
 
+void SAL_CALL EPUBExportUIComponent::setDialogTitle(const OUString& aTitle) { 
setTitle(aTitle); }
+
+void SAL_CALL EPUBExportUIComponent::startExecuteModal(
+const css::uno::Reference& 
xListener)
+{
+SolarMutexGuard aSolarGuard;
+
+if (!mxAsyncDialog)
+{
+if (mxSourceDocument.is())
+mxAsyncDialog
+= 
std::make_shared(Application::GetFrameWeld(mxDialogParent),
+ maFilterData, mxContext, 
mxSourceDocument);
+
+if (!mxAsyncDialog)
+return;
+}
+
+weld::DialogController::runAsync(mxAsyncDialog, [xListener](sal_Int32 
nResponse) {
+css::ui::dialogs::DialogClosedEvent aEvent;
+aEvent.DialogResult = nResponse;
+xListener->dialogClosed(aEvent);
+});
+}
+
 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
 com_sun_star_comp_Writer_EPUBExportUIComponent_get_implementation(
 uno::XComponentContext* pCtx, uno::Sequence const& /*rSeq*/)
diff --git a/writerperfect/source/writer/EPUBExportUIComponent.hxx 
b/writerperfect/source/writer/EPUBExportUIComponent.hxx
index 71fcc0ace168..b453a4e88096 100644
--- a/writerperfect/source/writer/EPUBExportUIComponent.hxx
+++ b/writerperfect/source/writer/EPUBExportUIComponent.hxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -19,6 +20,11 @@
 #include 
 #include 
 
+namespace weld
+{
+class DialogController;
+}
+
 namespace com::sun::star::uno
 {
 class XComponentContext;
@@ -30,6 +36,7 @@ namespace writerperfect
 class EPUBExportUIComponent
 : public cppu::WeakImplHelper
 {
 public:
@@ -49,6 +56,12 @@ public:
 void SAL_CALL setTitle(const OUString& rTitle) override;
 sal_Int16 SAL_CALL execute() override;
 
+// XAsynchronousExecutableDialog
+void SAL_CALL setDialogTitle(const OUString& aTitle) override;
+
+void SAL_CALL startExecuteModal(
+const css::uno::Reference& 
xListener) override;
+
 // XExporter
 void SAL_CALL
 setSourceDocument(const css::uno::Reference& 
xDocument) override;
@@ -65,6 +78,7 @@ private:
 css::uno::Reference mxContext;
 css::uno::Reference mxSourceDocument;
 css::uno::Reference mxDialogParent;
+std::shared_ptr mxAsyncDialog;
 };
 
 } // namespace writerperfect


[Libreoffice-commits] core.git: writerperfect/source

2022-10-05 Thread Nalini Prasad Dash (via logerrit)
 writerperfect/source/writer/EBookImportFilter.hxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 837d52dbc296526f65e16b458152414059abd782
Author: Nalini Prasad Dash 
AuthorDate: Tue Oct 4 20:54:26 2022 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Wed Oct 5 11:48:40 2022 +0200

tdf#143148 Use pragma once instead of include guards

Change-Id: Ib3b4a98560c278965a1e671171e1a84f600f09bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140948
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/writerperfect/source/writer/EBookImportFilter.hxx 
b/writerperfect/source/writer/EBookImportFilter.hxx
index 9ebdc9234a88..13307321b029 100644
--- a/writerperfect/source/writer/EBookImportFilter.hxx
+++ b/writerperfect/source/writer/EBookImportFilter.hxx
@@ -6,9 +6,7 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
-
-#ifndef EBOOKIMPORTFILTER_HXX
-#define EBOOKIMPORTFILTER_HXX
+#pragma once
 
 #include 
 
@@ -39,6 +37,4 @@ private:
   utl::MediaDescriptor& rDescriptor) override;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: writerperfect/source

2021-05-17 Thread Miklos Vajna (via logerrit)
 writerperfect/source/writer/exp/txtparai.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b9496faebcdf8827864636803101c6a9a88b6155
Author: Miklos Vajna 
AuthorDate: Mon May 17 09:35:25 2021 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 17 10:13:20 2021 +0200

EPUB export: make sure txtparai.hxx is self-contained

txtparai.hxx was the first include in txtparai.cxx to make sure the
header is self-contained, restore that. (Ignoring sal/config.h.)

Change-Id: I430e1bef12191e15f416381cd8d83c503b284851
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115692
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index da9c0f28e530..101546c39e35 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -9,10 +9,10 @@
 
 #include 
 
-#include 
-
 #include "txtparai.hxx"
 
+#include 
+
 #include "XMLFootnoteImportContext.hxx"
 #include "XMLTextFrameContext.hxx"
 #include "xmlimp.hxx"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2020-12-26 Thread halfhiddencode (via logerrit)
 writerperfect/source/calc/MSWorksCalcImportFilter.hxx|5 +
 writerperfect/source/calc/MWAWCalcImportFilter.hxx   |5 +
 writerperfect/source/calc/NumbersImportFilter.hxx|5 +
 writerperfect/source/calc/StarOfficeCalcImportFilter.hxx |5 +
 4 files changed, 4 insertions(+), 16 deletions(-)

New commits:
commit 90be4d003b36428a88847d36354c3572c453c90d
Author: halfhiddencode 
AuthorDate: Sat Dec 26 09:21:56 2020 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Sat Dec 26 12:10:51 2020 +0100

tdf#124176 Use pragma once in writerperfect

Change-Id: I2484df85c3f3d6011f04844ff30de53c287ab36d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108317
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.hxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.hxx
index 82cf7676339c..d0ce3e1fccea 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.hxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WRITERPERFECT_SOURCE_CALC_MSWORKSCALCIMPORTFILTER_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_CALC_MSWORKSCALCIMPORTFILTER_HXX
+#pragma once
 
 #include 
 
@@ -43,6 +42,4 @@ private:
 virtual void doRegisterHandlers(OdsGenerator& rGenerator) override;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/MWAWCalcImportFilter.hxx 
b/writerperfect/source/calc/MWAWCalcImportFilter.hxx
index 97cfc18915af..aa574315d5c6 100644
--- a/writerperfect/source/calc/MWAWCalcImportFilter.hxx
+++ b/writerperfect/source/calc/MWAWCalcImportFilter.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WRITERPERFECT_SOURCE_CALC_MWAWCALCIMPORTFILTER_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_CALC_MWAWCALCIMPORTFILTER_HXX
+#pragma once
 
 #include 
 
@@ -38,6 +37,4 @@ private:
 virtual void doRegisterHandlers(OdsGenerator& rGenerator) override;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/NumbersImportFilter.hxx 
b/writerperfect/source/calc/NumbersImportFilter.hxx
index 9bbbc174b773..96db0b689392 100644
--- a/writerperfect/source/calc/NumbersImportFilter.hxx
+++ b/writerperfect/source/calc/NumbersImportFilter.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_NUMBERSIMPORTFILTER_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_NUMBERSIMPORTFILTER_HXX
+#pragma once
 
 #include 
 
@@ -38,6 +37,4 @@ private:
 virtual void doRegisterHandlers(OdsGenerator& rGenerator) override;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/StarOfficeCalcImportFilter.hxx 
b/writerperfect/source/calc/StarOfficeCalcImportFilter.hxx
index bef0e2cef4d2..0b11e5166fd8 100644
--- a/writerperfect/source/calc/StarOfficeCalcImportFilter.hxx
+++ b/writerperfect/source/calc/StarOfficeCalcImportFilter.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WRITERPERFECT_SOURCE_CALC_STAROFFICECALCIMPORTFILTER_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_CALC_STAROFFICECALCIMPORTFILTER_HXX
+#pragma once
 
 #include 
 
@@ -39,6 +38,4 @@ private:
 virtual void doRegisterHandlers(OdsGenerator& rGenerator) override;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2020-09-17 Thread Miklos Vajna (via logerrit)
 writerperfect/source/writer/exp/xmlimp.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit efe8082b888ddd7c5c8f18ebf8df4cd8b300bd40
Author: Miklos Vajna 
AuthorDate: Thu Sep 17 17:39:05 2020 +0200
Commit: Miklos Vajna 
CommitDate: Thu Sep 17 22:06:22 2020 +0200

writerperfect: include sal/config.h first

To confirm to the convention outlined at

.

Change-Id: Ib3f5f872e7635df355ca0d9f12e55fc0b1da2cb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102964
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index 4654fde4204e..5f22f372b9ad 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -7,10 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include "xmlimp.hxx"
-
 #include 
 
+#include "xmlimp.hxx"
+
 #include 
 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2020-09-17 Thread Miklos Vajna (via logerrit)
 writerperfect/source/writer/exp/xmlimp.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fb4c53a1bbe57de93a92abc04736c0afdfd16170
Author: Miklos Vajna 
AuthorDate: Thu Sep 17 09:26:47 2020 +0200
Commit: Miklos Vajna 
CommitDate: Thu Sep 17 10:53:44 2020 +0200

writerperfect: make sure "own" header is the first one

So that we have a build-time check that the header is self-contained.

Change-Id: Idbaab48c3f4dba03c383c3c152bca47883376396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102899
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index 009e1f590a9b..4654fde4204e 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -7,12 +7,12 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include "xmlimp.hxx"
+
 #include 
 
 #include 
 
-#include "xmlimp.hxx"
-
 #include 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2020-04-29 Thread Noel Grandin (via logerrit)
 writerperfect/source/common/DocumentHandler.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit dab8e9f7a8f70a72040e2df9bb69361c3e355e6b
Author: Noel Grandin 
AuthorDate: Wed Apr 29 19:15:16 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 30 07:40:28 2020 +0200

no need to use strlen here

since librevenge's string class already has the length

Change-Id: I194ae49596dacc1205bdfb10d0a6a1833914f884
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93171
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/writerperfect/source/common/DocumentHandler.cxx 
b/writerperfect/source/common/DocumentHandler.cxx
index 869955aead67..35aa49181313 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -136,8 +136,7 @@ void DocumentHandler::startElement(const char* psName,
 {
 size_t keyLength = strlen(i.key());
 OUString sName(i.key(), keyLength, RTL_TEXTENCODING_UTF8);
-OUString sValue(i()->getStr().cstr(), strlen(i()->getStr().cstr()),
-RTL_TEXTENCODING_UTF8);
+OUString sValue(i()->getStr().cstr(), i()->getStr().len(), 
RTL_TEXTENCODING_UTF8);
 
 // libodfgen xml-encodes some attribute's value, so check if the 
value is encoded or not
 for (int j = 0; j < 9; ++j)
@@ -153,10 +152,9 @@ void DocumentHandler::startElement(const char* psName,
 {
 librevenge::RVNGString decodedValue("");
 unescapeXML(i()->getStr().cstr(),
-static_cast(strlen(i()->getStr().cstr())),
-decodedValue);
-sValue = OUString(decodedValue.cstr(), 
strlen(decodedValue.cstr()),
-  RTL_TEXTENCODING_UTF8);
+static_cast(i()->getStr().len()), decodedValue);
+sValue
+= OUString(decodedValue.cstr(), decodedValue.len(), 
RTL_TEXTENCODING_UTF8);
 break;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2020-01-08 Thread Miklos Vajna (via logerrit)
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |   34 ++
 1 file changed, 19 insertions(+), 15 deletions(-)

New commits:
commit 838935758a5ec8e0e68f4df0cf5bfcf737e3f6f2
Author: Miklos Vajna 
AuthorDate: Wed Jan 8 21:05:34 2020 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 9 08:33:31 2020 +0100

writerprefect: add missing braces around try-catch

Spelling them out helps readability.

Change-Id: I878e1a258b7d15b673ff3dbb42e40147bf60b41a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86453
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index 875f7ebe32cd..9eec43b28545 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -38,24 +38,28 @@ namespace MSWorksCalcImportFilterInternal
 {
 /// returns the list of stream name present in a folder
 static uno::Reference
-getResultSet(const css::uno::Reference& xPackageContent) 
try
+getResultSet(const css::uno::Reference& xPackageContent)
 {
-if (xPackageContent.is())
+try
 {
-ucbhelper::Content packageContent(xPackageContent,
-  
uno::Reference(),
-  
comphelper::getProcessComponentContext());
-uno::Sequence lPropNames{ "Title" };
-uno::Reference xResultSet(
-packageContent.createCursor(lPropNames, 
ucbhelper::INCLUDE_DOCUMENTS_ONLY));
-return xResultSet;
+if (xPackageContent.is())
+{
+ucbhelper::Content packageContent(xPackageContent,
+  
uno::Reference(),
+  
comphelper::getProcessComponentContext());
+uno::Sequence lPropNames{ "Title" };
+uno::Reference xResultSet(
+packageContent.createCursor(lPropNames, 
ucbhelper::INCLUDE_DOCUMENTS_ONLY));
+return xResultSet;
+}
+return uno::Reference();
+}
+catch (...)
+{
+SAL_WARN("writerperfect",
+ "ignoring Exception in 
MSWorksCalcImportFilterInternal:getResultSet");
+return uno::Reference();
 }
-return uno::Reference();
-}
-catch (...)
-{
-SAL_WARN("writerperfect", "ignoring Exception in 
MSWorksCalcImportFilterInternal:getResultSet");
-return uno::Reference();
 }
 
 namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2019-12-17 Thread alonso (via logerrit)
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |  127 ++
 writerperfect/source/writer/MSWorksImportFilter.cxx   |   42 +++--
 2 files changed, 99 insertions(+), 70 deletions(-)

New commits:
commit f14cd1ad62e6f17f2a1e56a7d4dfb8fad8d5375e
Author: alonso 
AuthorDate: Wed Nov 13 14:03:53 2019 +0100
Commit: Noel Grandin 
CommitDate: Wed Dec 18 08:03:42 2019 +0100

writerperfect[libwps,tdf#128673]: use the inFilter option in headless 
mode...

Change-Id: I494360ddb55e39e09edf03aaf0bf6a01dc432f83
Reviewed-on: https://gerrit.libreoffice.org/82595
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index b2f00e437e3a..875f7ebe32cd 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -177,7 +177,8 @@ private:
 
 bool MSWorksCalcImportFilter::doImportDocument(weld::Window* pParent,
librevenge::RVNGInputStream& 
rInput,
-   OdsGenerator& rGenerator, 
utl::MediaDescriptor&)
+   OdsGenerator& rGenerator,
+   utl::MediaDescriptor& 
mediaDescriptor)
 {
 libwps::WPSKind kind = libwps::WPS_TEXT;
 libwps::WPSCreator creator;
@@ -191,70 +192,88 @@ bool 
MSWorksCalcImportFilter::doImportDocument(weld::Window* pParent,
 std::string fileEncoding;
 if (needEncoding)
 {
-OUString title, encoding;
-switch (creator)
+OUString encoding;
+// first check if we can find the encoding in the filter options 
(headless mode)
+mediaDescriptor[utl::MediaDescriptor::PROP_FILTEROPTIONS()] >>= 
encoding;
+if (!encoding.isEmpty()) // TODO: check if the encoding string is valid
+fileEncoding = encoding.toUtf8().getStr();
+else
 {
-case libwps::WPS_MSWORKS:
-title = WpResId(STR_ENCODING_DIALOG_TITLE_MSWORKS);
-encoding = "CP850";
-break;
-case libwps::WPS_LOTUS:
-title = WpResId(STR_ENCODING_DIALOG_TITLE_LOTUS);
-encoding = "CP437";
-break;
-case libwps::WPS_SYMPHONY:
-title = WpResId(STR_ENCODING_DIALOG_TITLE_SYMPHONY);
-encoding = "CP437";
-break;
-case libwps::WPS_QUATTRO_PRO:
-title = WpResId(STR_ENCODING_DIALOG_TITLE_QUATTROPRO);
-encoding = "CP437";
-break;
-case libwps::WPS_RESERVED_2:
-title = WpResId(STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN);
-encoding = "CP437";
-break;
-default:
-SAL_INFO("writerperfect", "unexpected creator: " << creator);
-title = WpResId(STR_ENCODING_DIALOG_TITLE);
-encoding = "CP437";
-break;
-}
+OUString title;
+switch (creator)
+{
+case libwps::WPS_MSWORKS:
+title = WpResId(STR_ENCODING_DIALOG_TITLE_MSWORKS);
+encoding = "CP850";
+break;
+case libwps::WPS_LOTUS:
+title = WpResId(STR_ENCODING_DIALOG_TITLE_LOTUS);
+encoding = "CP437";
+break;
+case libwps::WPS_SYMPHONY:
+title = WpResId(STR_ENCODING_DIALOG_TITLE_SYMPHONY);
+encoding = "CP437";
+break;
+case libwps::WPS_QUATTRO_PRO:
+title = WpResId(STR_ENCODING_DIALOG_TITLE_QUATTROPRO);
+encoding = "CP437";
+break;
+case libwps::WPS_RESERVED_2:
+title = WpResId(STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN);
+encoding = "CP437";
+break;
+default:
+SAL_INFO("writerperfect", "unexpected creator: " << 
creator);
+title = WpResId(STR_ENCODING_DIALOG_TITLE);
+encoding = "CP437";
+break;
+}
 
-try
-{
-writerperfect::WPFTEncodingDialog aDlg(pParent, title, encoding);
-if (aDlg.run() == RET_OK)
+fileEncoding = encoding.toUtf8().getStr(); // set default to the 
proposed encoding
+try
 {
-if (!aDlg.GetEncoding().isEmpty())
-fileEncoding = aDlg.GetEncoding().toUtf8().getStr();
+writerperfect::WPFTEncodingDialog aDlg(pParent, title, 
encoding);
+if (aDlg.run() == RET_OK)
+   

[Libreoffice-commits] core.git: writerperfect/source

2019-08-15 Thread Julien Nabet (via logerrit)
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |   15 
 writerperfect/source/calc/MWAWCalcImportFilter.cxx|   14 
 writerperfect/source/calc/NumbersImportFilter.cxx |   14 
 writerperfect/source/draw/CDRImportFilter.cxx |   14 
 writerperfect/source/draw/CMXImportFilter.cxx |   14 
 writerperfect/source/draw/FreehandImportFilter.cxx|   14 
 writerperfect/source/draw/MSPUBImportFilter.cxx   |   14 
 writerperfect/source/draw/MWAWDrawImportFilter.cxx|   14 
 writerperfect/source/draw/PageMakerImportFilter.cxx   |   14 
 writerperfect/source/draw/VisioImportFilter.cxx   |   14 
 writerperfect/source/draw/WPGImportFilter.cxx |   14 
 writerperfect/source/impress/KeynoteImportFilter.cxx  |   29 ++--
 writerperfect/source/impress/MWAWPresentationImportFilter.cxx |   14 
 writerperfect/source/writer/AbiWordImportFilter.cxx   |   14 
 writerperfect/source/writer/EBookImportFilter.cxx |   14 
 writerperfect/source/writer/MSWorksImportFilter.cxx   |   15 
 writerperfect/source/writer/MWAWImportFilter.cxx  |   14 
 writerperfect/source/writer/PagesImportFilter.cxx |   14 
 writerperfect/source/writer/WordPerfectImportFilter.cxx   |   35 --
 19 files changed, 73 insertions(+), 231 deletions(-)

New commits:
commit f817ce79d501ce32d54d6c8a3492f1913fb85a55
Author: Julien Nabet 
AuthorDate: Thu Aug 15 19:44:25 2019 +0200
Commit: Julien Nabet 
CommitDate: Thu Aug 15 20:49:17 2019 +0200

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

in writerperfect
+ remove some using

Change-Id: I7ced8e49ba2d85a4354d9a5d048531c023faacf0
Reviewed-on: https://gerrit.libreoffice.org/77540
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index 919184a1fd75..e1c9b18d4163 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -34,12 +34,6 @@
 
 using namespace ::com::sun::star;
 
-using uno::Exception;
-using uno::RuntimeException;
-using uno::Sequence;
-using uno::XComponentContext;
-using uno::XInterface;
-
 namespace MSWorksCalcImportFilterInternal
 {
 /// returns the list of stream name present in a folder
@@ -435,13 +429,10 @@ sal_Bool SAL_CALL 
MSWorksCalcImportFilter::supportsService(const OUString& rServ
 return cppu::supportsService(this, rServiceName);
 }
 
-Sequence SAL_CALL MSWorksCalcImportFilter::getSupportedServiceNames()
+css::uno::Sequence SAL_CALL 
MSWorksCalcImportFilter::getSupportedServiceNames()
 {
-Sequence aRet(2);
-OUString* pArray = aRet.getArray();
-pArray[0] = "com.sun.star.document.ImportFilter";
-pArray[1] = "com.sun.star.document.ExtendedTypeDetection";
-return aRet;
+return css::uno::Sequence{ "com.sun.star.document.ImportFilter",
+ 
"com.sun.star.document.ExtendedTypeDetection" };
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
diff --git a/writerperfect/source/calc/MWAWCalcImportFilter.cxx 
b/writerperfect/source/calc/MWAWCalcImportFilter.cxx
index ce9834bdf8ec..5e4236d4772f 100644
--- a/writerperfect/source/calc/MWAWCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MWAWCalcImportFilter.cxx
@@ -17,11 +17,6 @@
 
 #include "MWAWCalcImportFilter.hxx"
 
-using com::sun::star::uno::RuntimeException;
-using com::sun::star::uno::Sequence;
-using com::sun::star::uno::XComponentContext;
-using com::sun::star::uno::XInterface;
-
 static bool handleEmbeddedMWAWGraphicObject(const librevenge::RVNGBinaryData& 
data,
 OdfDocumentHandler* pHandler,
 const OdfStreamType streamType)
@@ -116,13 +111,10 @@ sal_Bool SAL_CALL 
MWAWCalcImportFilter::supportsService(const OUString& rService
 return cppu::supportsService(this, rServiceName);
 }
 
-Sequence SAL_CALL MWAWCalcImportFilter::getSupportedServiceNames()
+css::uno::Sequence SAL_CALL 
MWAWCalcImportFilter::getSupportedServiceNames()
 {
-Sequence aRet(2);
-OUString* pArray = aRet.getArray();
-pArray[0] = "com.sun.star.document.ImportFilter";
-pArray[1] = "com.sun.star.document.ExtendedTypeDetection";
-return aRet;
+return css::uno::Sequence{ "com.sun.star.document.ImportFilter",
+ 
"com.sun.star.document.ExtendedTypeDetection" };
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
diff --git a/writerperfect/source/calc/NumbersImportFilter.cxx 
b/writerperfect/source/calc/NumbersImportFilter.cxx
index 8cf18b492b9e..0352b2fa2981 100644
--- a/writerperfect/source/calc/NumbersImportFilter.cxx

[Libreoffice-commits] core.git: writerperfect/source xmloff/source xmlscript/source

2019-08-12 Thread Andrea Gelmini (via logerrit)
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |2 +-
 xmloff/source/forms/elementimport.cxx |2 +-
 xmloff/source/table/XMLTableExport.cxx|2 +-
 xmloff/source/text/txtimp.cxx |2 +-
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx   |6 +++---
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 89fa56078e97525986a6bd3fcc084130bfcbb7c2
Author: Andrea Gelmini 
AuthorDate: Sun Aug 11 18:07:03 2019 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 12 10:25:53 2019 +0200

Fix typos

Change-Id: I52ac067c200b02bc8513033b249863f67b245528
Reviewed-on: https://gerrit.libreoffice.org/77271
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index 8b9a40bd5f61..919184a1fd75 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -89,7 +89,7 @@ public:
 const unsigned char* read(unsigned long, unsigned long&) override { return 
nullptr; }
 //! returns actual offset position
 long tell() override { return 0; }
-/*! \brief seeks to a offset position, from actual, beginning or ending 
position
+/*! \brief seeks to an offset position, from actual, beginning or ending 
position
  * \return 0 if ok
  */
 int seek(long, librevenge::RVNG_SEEK_TYPE) override { return 1; }
diff --git a/xmloff/source/forms/elementimport.cxx 
b/xmloff/source/forms/elementimport.cxx
index bf213dd8b5bf..c1083ba2332f 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -1781,7 +1781,7 @@ namespace xmloff
 
 // clone the attributes
 Reference< XCloneable > xCloneList(_rxAttrList, UNO_QUERY);
-OSL_ENSURE(xCloneList.is(), "OColumnWrapperImport::StartElement: 
AttributeList not cloneable!");
+OSL_ENSURE(xCloneList.is(), "OColumnWrapperImport::StartElement: 
AttributeList not clonable!");
 if ( xCloneList.is() )
 m_xOwnAttributes.set(xCloneList->createClone(), UNO_QUERY);
 OSL_ENSURE(m_xOwnAttributes.is(), "OColumnWrapperImport::StartElement: 
no cloned list!");
diff --git a/xmloff/source/table/XMLTableExport.cxx 
b/xmloff/source/table/XMLTableExport.cxx
index 563d57ca7e94..596e94149785 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -394,7 +394,7 @@ static bool has_states( const std::vector< XMLPropertyState 
>& xPropStates )
 mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, 
sStyleName );
 }
 
-// TODO: All columns first have to be checked if some ones
+// TODO: all columns first have to be checked if someone
 // have identical properties. If yes, attr 
table:number-columns-repeated
 // has to be written.
 SvXMLElementExport tableColumnElement( mrExport, 
XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, true, true );
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 09d569bfb5ee..ac9a144953f7 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -2442,7 +2442,7 @@ sal_Int32 XMLTextImportHelper::GetDataStyleKey(const 
OUString& sStyleName,
 
 
 // first check if it's an Impress and draw only number format
-// this is needed since its also a SvXMLNumFormatContext,
+// this is needed since it's also a SvXMLNumFormatContext,
 // that was needed to support them for controls in impress/draw also
 const SdXMLNumberFormatImportContext* pSdNumStyle = dynamic_cast( pStyle  );
 if( pSdNumStyle )
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index eca2feb26fa0..3deca0ba6c04 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -1058,15 +1058,15 @@ void ElementDescriptor::readDefaults( bool 
supportPrintable, bool supportVisible
 Any a( _xProps->getPropertyValue( "Name" ) );
 
 // The following is a hack to allow 'form' controls to override the default
-// control supported by dialogs. This should work well for both vba 
support and
-// normal openoffice ( when normal 'Dialogs' decide to support form 
control models )
+// control supported by dialogs. This should work well for both VBA 
support and
+// normal LibreOffice (when normal 'Dialogs' decide to support form 
control models)
 // In the future VBA support might require custom models ( and not the 
just the form
 // variant of a control that we currently use ) In this case the door is 
still open,
 // we just need to define a new way for the 'ServiceName' to be extracted 
from the
 // incoming model. E.g. the use of supporting service
 // 

[Libreoffice-commits] core.git: writerperfect/source

2019-07-31 Thread Stephan Bergmann (via logerrit)
 writerperfect/source/writer/exp/xmltbli.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit de455fcaa725343bc516fa13cf1bf5253178a0a6
Author: Stephan Bergmann 
AuthorDate: Tue Jul 30 17:32:03 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 31 09:18:54 2019 +0200

Always pair openTable/closeTable calls

`--convert-to epub doc/ooo24702-1.doc` (i.e., attachment
4 SMS SPECIFICATIONS.doc at
) issues some calls to
XMLTableContext::startElement and XMLTableContext::endElement without any
matching calls to XMLTableContext::CreateChildContext, so closeTable was 
called
without a matching openTable call, ultimately causing

> soffice.bin: sax/source/expatwrap/saxwriter.cxx:1184: virtual void 
(anonymous namespace)::SAXWriter::endElement(const rtl::OUString &): Assertion 
`aName == m_pSaxWriterHelper->m_DebugStartedElements.top()' failed.

to fire.

Change-Id: I41c3071ace0934143881c77e4b00c23e79ff7ea2
Reviewed-on: https://gerrit.libreoffice.org/76618
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/writerperfect/source/writer/exp/xmltbli.cxx 
b/writerperfect/source/writer/exp/xmltbli.cxx
index a96582ecc3f9..263b6c3af414 100644
--- a/writerperfect/source/writer/exp/xmltbli.cxx
+++ b/writerperfect/source/writer/exp/xmltbli.cxx
@@ -239,7 +239,10 @@ void XMLTableContext::startElement(
 
 void XMLTableContext::endElement(const OUString& /*rName*/)
 {
-GetImport().GetGenerator().closeTable();
+if (m_bTableOpened)
+{
+GetImport().GetGenerator().closeTable();
+}
 }
 
 } // namespace exp
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: writerperfect/source

2019-04-17 Thread Miklos Vajna (via logerrit)
 writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx |   10 
 writerperfect/source/writer/exp/XMLSectionContext.cxx|6 
 writerperfect/source/writer/exp/XMLTextFrameContext.cxx  |   22 -
 writerperfect/source/writer/exp/XMLTextListContext.cxx   |2 
 writerperfect/source/writer/exp/XMLTextListItemContext.cxx   |4 
 writerperfect/source/writer/exp/txtparai.cxx |  127 +--
 writerperfect/source/writer/exp/txtstyli.cxx |   16 -
 writerperfect/source/writer/exp/xmlfmt.cxx   |   57 ++--
 writerperfect/source/writer/exp/xmlictxt.hxx |3 
 writerperfect/source/writer/exp/xmlimp.cxx   |   30 +-
 writerperfect/source/writer/exp/xmlmetai.cxx |   41 +--
 writerperfect/source/writer/exp/xmlmetai.hxx |3 
 writerperfect/source/writer/exp/xmltbli.cxx  |   40 +--
 writerperfect/source/writer/exp/xmltext.cxx  |6 
 14 files changed, 193 insertions(+), 174 deletions(-)

New commits:
commit 9a0934babd347c579c7f5f5c4094800cdc239063
Author: Miklos Vajna 
AuthorDate: Tue Apr 16 21:31:05 2019 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 17 09:05:09 2019 +0200

EPUB export: make member variable private

In most cases these were public without a good reason, in other cases
setter / getters are added.

Change-Id: Id6c1032189db1bba211344162e737dabf7ff3f07
Reviewed-on: https://gerrit.libreoffice.org/70842
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx 
b/writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx
index 5f1b53c804a8..15753306a97d 100644
--- a/writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx
+++ b/writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx
@@ -81,19 +81,19 @@ XMLFootnoteBodyImportContext::XMLFootnoteBodyImportContext(
 rtl::Reference 
XMLFootnoteBodyImportContext::CreateChildContext(
 const OUString& rName, const 
css::uno::Reference& /*xAttribs*/)
 {
-return CreateTextChildContext(mrImport, rName);
+return CreateTextChildContext(GetImport(), rName);
 }
 
 void XMLFootnoteBodyImportContext::startElement(
 const OUString& /*rName*/,
 const css::uno::Reference& /*xAttribs*/)
 {
-mrImport.GetGenerator().openFootnote(m_rProperties);
+GetImport().GetGenerator().openFootnote(m_rProperties);
 }
 
 void XMLFootnoteBodyImportContext::endElement(const OUString& /*rName*/)
 {
-mrImport.GetGenerator().closeFootnote();
+GetImport().GetGenerator().closeFootnote();
 }
 
 XMLFootnoteImportContext::XMLFootnoteImportContext(XMLImport& rImport)
@@ -105,9 +105,9 @@ rtl::Reference 
XMLFootnoteImportContext::CreateChildContext(
 const OUString& rName, const 
css::uno::Reference& /*xAttribs*/)
 {
 if (rName == "text:note-citation")
-return new XMLTextNoteCitationContext(mrImport, m_aProperties);
+return new XMLTextNoteCitationContext(GetImport(), m_aProperties);
 if (rName == "text:note-body")
-return new XMLFootnoteBodyImportContext(mrImport, m_aProperties);
+return new XMLFootnoteBodyImportContext(GetImport(), m_aProperties);
 SAL_WARN("writerperfect", "XMLFootnoteImportContext::CreateChildContext: 
unhandled " << rName);
 return nullptr;
 }
diff --git a/writerperfect/source/writer/exp/XMLSectionContext.cxx 
b/writerperfect/source/writer/exp/XMLSectionContext.cxx
index bf88d0e174fb..dbd1f9663539 100644
--- a/writerperfect/source/writer/exp/XMLSectionContext.cxx
+++ b/writerperfect/source/writer/exp/XMLSectionContext.cxx
@@ -26,19 +26,19 @@ XMLSectionContext::XMLSectionContext(XMLImport& rImport)
 rtl::Reference XMLSectionContext::CreateChildContext(
 const OUString& rName, const 
css::uno::Reference& /*xAttribs*/)
 {
-return CreateTextChildContext(mrImport, rName);
+return CreateTextChildContext(GetImport(), rName);
 }
 
 void XMLSectionContext::startElement(
 const OUString& /*rName*/,
 const css::uno::Reference& /*xAttribs*/)
 {
-mrImport.GetGenerator().openSection(librevenge::RVNGPropertyList());
+GetImport().GetGenerator().openSection(librevenge::RVNGPropertyList());
 }
 
 void XMLSectionContext::endElement(const OUString& /*rName*/)
 {
-mrImport.GetGenerator().closeSection();
+GetImport().GetGenerator().closeSection();
 }
 
 } // namespace exp
diff --git a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx 
b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
index cb7d3f9a8340..dc62f8bf85ce 100644
--- a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
+++ b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
@@ -46,19 +46,19 @@ XMLTextBoxContext::XMLTextBoxContext(XMLImport& rImport)
 rtl::Reference XMLTextBoxContext::CreateChildContext(
 const OUString& rName, const 
css::uno::Reference& /*xAttribs*/)
 {
-return 

[Libreoffice-commits] core.git: writerperfect/source

2018-04-26 Thread David Tardon
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |   36 --
 writerperfect/source/writer/MSWorksImportFilter.cxx   |   26 ++---
 2 files changed, 30 insertions(+), 32 deletions(-)

New commits:
commit e0e8f5f60f9912cd2e12818cd1bc2eb6c3e1e75f
Author: David Tardon 
Date:   Thu Apr 26 14:41:09 2018 +0200

replace a series of if/else if/ by a switch

Change-Id: I6319971e1a2a4bffa0466fa37a31beff5a349fd1
Reviewed-on: https://gerrit.libreoffice.org/53535
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index 0972c97df84e..04dcffcdac48 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -388,29 +388,27 @@ bool 
MSWorksCalcImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput
 if ((kind == libwps::WPS_SPREADSHEET || kind == libwps::WPS_DATABASE)
 && confidence != libwps::WPS_CONFIDENCE_NONE)
 {
-if (creator == libwps::WPS_MSWORKS)
-{
-rTypeName = "calc_MS_Works_Document";
-return true;
-}
-if (creator == libwps::WPS_LOTUS || creator == libwps::WPS_SYMPHONY)
-{
-rTypeName = "calc_WPS_Lotus_Document";
-return true;
-}
-if (creator == libwps::WPS_QUATTRO_PRO)
-{
-rTypeName = "calc_WPS_QPro_Document";
-return true;
-}
-if (creator == libwps::WPS_RESERVED_2)
+switch (creator)
 {
-rTypeName = "calc_MS_Multiplan";
-return true;
+case libwps::WPS_MSWORKS:
+rTypeName = "calc_MS_Works_Document";
+break;
+case libwps::WPS_LOTUS:
+case libwps::WPS_SYMPHONY:
+rTypeName = "calc_WPS_Lotus_Document";
+break;
+case libwps::WPS_QUATTRO_PRO:
+rTypeName = "calc_WPS_QPro_Document";
+break;
+case libwps::WPS_RESERVED_2:
+rTypeName = "calc_MS_Multiplan";
+break;
+default:
+break;
 }
 }
 
-return false;
+return !rTypeName.isEmpty();
 }
 
 void MSWorksCalcImportFilter::doRegisterHandlers(OdsGenerator&) {}
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx 
b/writerperfect/source/writer/MSWorksImportFilter.cxx
index c22474d190bc..4c2c86c5e787 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -98,23 +98,23 @@ bool 
MSWorksImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput, OU
 
 if ((kind == libwps::WPS_TEXT) && (confidence == 
libwps::WPS_CONFIDENCE_EXCELLENT))
 {
-if (creator == libwps::WPS_MSWORKS)
+switch (creator)
 {
-rTypeName = "writer_MS_Works_Document";
+case libwps::WPS_MSWORKS:
+rTypeName = "writer_MS_Works_Document";
+break;
+case libwps::WPS_RESERVED_0:
+rTypeName = "writer_MS_Write";
+break;
+case libwps::WPS_RESERVED_1:
+rTypeName = "writer_DosWord";
+break;
+default:
+break;
 }
-else if (creator == libwps::WPS_RESERVED_0)
-{
-rTypeName = "writer_MS_Write";
-}
-else
-{
-rTypeName = "writer_DosWord";
-}
-
-return true;
 }
 
-return false;
+return !rTypeName.isEmpty();
 }
 
 void MSWorksImportFilter::doRegisterHandlers(OdtGenerator& rGenerator)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2018-04-11 Thread Miklos Vajna
 writerperfect/source/writer/exp/xmlfmt.cxx |2 +-
 writerperfect/source/writer/exp/xmlimp.hxx |   10 --
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit ca04e146ba4581f63bc9548ef926b611f1578804
Author: Miklos Vajna 
Date:   Wed Apr 11 09:20:43 2018 +0200

writerperfect: fix whitespace

Be consistent with surrounding code.

Change-Id: I86eb3a663a54a63c850ada229ea24d9c770365df
Reviewed-on: https://gerrit.libreoffice.org/52708
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/source/writer/exp/xmlfmt.cxx 
b/writerperfect/source/writer/exp/xmlfmt.cxx
index 42e2b0aa70c0..e8b735c44890 100644
--- a/writerperfect/source/writer/exp/xmlfmt.cxx
+++ b/writerperfect/source/writer/exp/xmlfmt.cxx
@@ -36,7 +36,7 @@ XMLStylesContext::XMLStylesContext(XMLImport , 
StyleType eType)
 
 rtl::Reference XMLStylesContext::CreateChildContext(const 
OUString , const css::uno::Reference 
&/*xAttribs*/)
 {
-if (rName == "style:style" || rName == "style:page-layout" || rName == 
"style:master-page" )
+if (rName == "style:style" || rName == "style:page-layout" || rName == 
"style:master-page")
 return new XMLStyleContext(mrImport, *this);
 return nullptr;
 }
diff --git a/writerperfect/source/writer/exp/xmlimp.hxx 
b/writerperfect/source/writer/exp/xmlimp.hxx
index 097a96cdcce9..4ef4bf3f5c43 100644
--- a/writerperfect/source/writer/exp/xmlimp.hxx
+++ b/writerperfect/source/writer/exp/xmlimp.hxx
@@ -114,8 +114,14 @@ public:
 const std::vector () const;
 const css::uno::Reference 
() const;
 
-bool GetIsInPageSpan() const { return mbIsInPageSpan; }
-void SetIsInPageSpan(bool bSet) { mbIsInPageSpan = bSet; }
+bool GetIsInPageSpan() const
+{
+return mbIsInPageSpan;
+}
+void SetIsInPageSpan(bool bSet)
+{
+mbIsInPageSpan = bSet;
+}
 void HandlePageSpan(const librevenge::RVNGPropertyList );
 
 // XDocumentHandler
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2018-04-08 Thread Mark Hung
 writerperfect/source/writer/exp/txtstyli.cxx |8 
 writerperfect/source/writer/exp/txtstyli.hxx |2 ++
 writerperfect/source/writer/exp/xmlfmt.cxx   |   10 --
 writerperfect/source/writer/exp/xmlfmt.hxx   |2 ++
 writerperfect/source/writer/exp/xmlimp.cxx   |7 +++
 writerperfect/source/writer/exp/xmlimp.hxx   |2 ++
 6 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit e371819719a099e5c4fc0af1c2d1ee8ffc4e97c0
Author: Mark Hung 
Date:   Wed Feb 14 23:48:57 2018 +0800

tdf#115623: EPUB export: support style:master-page

Change-Id: I12d04c2e346c5202274a01b1f8950e3412dc9081
Reviewed-on: https://gerrit.libreoffice.org/52081
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/exp/txtstyli.cxx 
b/writerperfect/source/writer/exp/txtstyli.cxx
index 4a8f6a42e3c0..548aa654dcdf 100644
--- a/writerperfect/source/writer/exp/txtstyli.cxx
+++ b/writerperfect/source/writer/exp/txtstyli.cxx
@@ -295,6 +295,7 @@ void XMLStyleContext::startElement(const OUString 
&/*rName*/, const css::uno::Re
 m_aParagraphPropertyList.insert(sName.getStr(), sValue.getStr());
 m_aGraphicPropertyList.insert(sName.getStr(), sValue.getStr());
 m_aPageLayoutPropertyList.insert(sName.getStr(), sValue.getStr());
+m_aMasterPagePropertyList.insert(sName.getStr(), sValue.getStr());
 }
 }
 
@@ -319,6 +320,8 @@ void XMLStyleContext::endElement(const OUString )
 m_rStyles.GetCurrentGraphicStyles()[m_aName] = m_aGraphicPropertyList;
 else if (rName == "style:page-layout")
 m_rStyles.GetCurrentPageLayouts()[m_aName] = m_aPageLayoutPropertyList;
+else if (rName == "style:master-page")
+m_rStyles.GetCurrentMasterStyles()[m_aName] = 
m_aMasterPagePropertyList;
 }
 
 librevenge::RVNGPropertyList ::GetTextPropertyList()
@@ -361,6 +364,11 @@ librevenge::RVNGPropertyList 
::GetPageLayoutPropertyList()
 return m_aPageLayoutPropertyList;
 }
 
+librevenge::RVNGPropertyList ::GetMasterPagePropertyList()
+{
+return m_aMasterPagePropertyList;
+}
+
 } // namespace exp
 } // namespace writerperfect
 
diff --git a/writerperfect/source/writer/exp/txtstyli.hxx 
b/writerperfect/source/writer/exp/txtstyli.hxx
index 82f3abea6174..05d549ab2a79 100644
--- a/writerperfect/source/writer/exp/txtstyli.hxx
+++ b/writerperfect/source/writer/exp/txtstyli.hxx
@@ -39,6 +39,7 @@ public:
 librevenge::RVNGPropertyList ();
 librevenge::RVNGPropertyList ();
 librevenge::RVNGPropertyList ();
+librevenge::RVNGPropertyList ();
 
 private:
 OUString m_aName;
@@ -51,6 +52,7 @@ private:
 librevenge::RVNGPropertyList m_aTablePropertyList;
 librevenge::RVNGPropertyList m_aGraphicPropertyList;
 librevenge::RVNGPropertyList m_aPageLayoutPropertyList;
+librevenge::RVNGPropertyList m_aMasterPagePropertyList;
 XMLStylesContext _rStyles;
 };
 
diff --git a/writerperfect/source/writer/exp/xmlfmt.cxx 
b/writerperfect/source/writer/exp/xmlfmt.cxx
index a1a7c3da4db0..42e2b0aa70c0 100644
--- a/writerperfect/source/writer/exp/xmlfmt.cxx
+++ b/writerperfect/source/writer/exp/xmlfmt.cxx
@@ -29,13 +29,14 @@ XMLStylesContext::XMLStylesContext(XMLImport , 
StyleType eType)
   m_rRowStyles(eType == StyleType_AUTOMATIC ? 
mrImport.GetAutomaticRowStyles() : mrImport.GetRowStyles()),
   m_rTableStyles(eType == StyleType_AUTOMATIC ? 
mrImport.GetAutomaticTableStyles() : mrImport.GetTableStyles()),
   m_rGraphicStyles(eType == StyleType_AUTOMATIC ? 
mrImport.GetAutomaticGraphicStyles() : mrImport.GetGraphicStyles()),
-  m_rPageLayouts(mrImport.GetPageLayouts())
+  m_rPageLayouts(mrImport.GetPageLayouts()),
+  m_rMasterStyles(mrImport.GetMasterStyles())
 {
 }
 
 rtl::Reference XMLStylesContext::CreateChildContext(const 
OUString , const css::uno::Reference 
&/*xAttribs*/)
 {
-if (rName == "style:style" || rName == "style:page-layout")
+if (rName == "style:style" || rName == "style:page-layout" || rName == 
"style:master-page" )
 return new XMLStyleContext(mrImport, *this);
 return nullptr;
 }
@@ -80,6 +81,11 @@ std::map 
::GetCurrentPa
 return m_rPageLayouts;
 }
 
+std::map 
::GetCurrentMasterStyles()
+{
+return m_rMasterStyles;
+}
+
 /// Handler for .
 class XMLFontFaceContext : public XMLImportContext
 {
diff --git a/writerperfect/source/writer/exp/xmlfmt.hxx 
b/writerperfect/source/writer/exp/xmlfmt.hxx
index 99224f317026..71c3c8e80ace 100644
--- a/writerperfect/source/writer/exp/xmlfmt.hxx
+++ b/writerperfect/source/writer/exp/xmlfmt.hxx
@@ -45,6 +45,7 @@ public:
 std::map ();
 std::map 
();
 std::map ();
+std::map ();
 

[Libreoffice-commits] core.git: writerperfect/source

2018-04-05 Thread Mark Hung
 writerperfect/source/writer/exp/txtstyli.cxx |   44 ++-
 writerperfect/source/writer/exp/txtstyli.hxx |2 +
 writerperfect/source/writer/exp/xmlfmt.cxx   |   10 --
 writerperfect/source/writer/exp/xmlfmt.hxx   |2 +
 writerperfect/source/writer/exp/xmlimp.cxx   |5 +++
 writerperfect/source/writer/exp/xmlimp.hxx   |2 +
 6 files changed, 62 insertions(+), 3 deletions(-)

New commits:
commit 4e9dbb4c81dfd99cfec4a36372b09a96ad4d4133
Author: Mark Hung 
Date:   Wed Feb 14 21:47:51 2018 +0800

tdf#115623: EPUB export: handle style:page-layout

handle style:page-layout XMLPageLayoutPropertiesContext,
store style:writing-mode so that it can be processed
in libepubgen.

Change-Id: Id997ef84a39bd3321d678ea23c5d1b9101297b34
Reviewed-on: https://gerrit.libreoffice.org/52080
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/exp/txtstyli.cxx 
b/writerperfect/source/writer/exp/txtstyli.cxx
index 931fbe459f65..4a8f6a42e3c0 100644
--- a/writerperfect/source/writer/exp/txtstyli.cxx
+++ b/writerperfect/source/writer/exp/txtstyli.cxx
@@ -102,6 +102,38 @@ void XMLGraphicPropertiesContext::startElement(const 
OUString &/*rName*/, const
 }
 }
 
+/// Handler for .
+class XMLPageLayoutPropertiesContext : public XMLImportContext
+{
+public:
+XMLPageLayoutPropertiesContext(XMLImport , XMLStyleContext 
);
+
+void SAL_CALL startElement(const OUString , const 
css::uno::Reference ) override;
+
+private:
+XMLStyleContext 
+};
+
+XMLPageLayoutPropertiesContext::XMLPageLayoutPropertiesContext(XMLImport 
, XMLStyleContext )
+: XMLImportContext(rImport)
+, mrStyle(rStyle)
+{
+}
+
+void XMLPageLayoutPropertiesContext::startElement(const OUString &/*rName*/, 
const css::uno::Reference )
+{
+for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
+{
+OString sName = OUStringToOString(xAttribs->getNameByIndex(i), 
RTL_TEXTENCODING_UTF8);
+OString sValue = OUStringToOString(xAttribs->getValueByIndex(i), 
RTL_TEXTENCODING_UTF8);
+// We only care about writing-mode for now.
+if (sName != "style:writing-mode")
+continue;
+
+mrStyle.GetPageLayoutPropertyList().insert(sName.getStr(), 
sValue.getStr());
+}
+}
+
 /// Handler for .
 class XMLTablePropertiesContext : public XMLImportContext
 {
@@ -240,6 +272,8 @@ rtl::Reference 
XMLStyleContext::CreateChildContext(const OUStr
 return new XMLTablePropertiesContext(mrImport, *this);
 if (rName == "style:graphic-properties")
 return new XMLGraphicPropertiesContext(mrImport, *this);
+if (rName == "style:page-layout-properties")
+return new XMLPageLayoutPropertiesContext(mrImport, *this);
 return nullptr;
 }
 
@@ -260,10 +294,11 @@ void XMLStyleContext::startElement(const OUString 
&/*rName*/, const css::uno::Re
 m_aTextPropertyList.insert(sName.getStr(), sValue.getStr());
 m_aParagraphPropertyList.insert(sName.getStr(), sValue.getStr());
 m_aGraphicPropertyList.insert(sName.getStr(), sValue.getStr());
+m_aPageLayoutPropertyList.insert(sName.getStr(), sValue.getStr());
 }
 }
 
-void XMLStyleContext::endElement(const OUString &/*rName*/)
+void XMLStyleContext::endElement(const OUString )
 {
 if (m_aName.isEmpty())
 return;
@@ -282,6 +317,8 @@ void XMLStyleContext::endElement(const OUString &/*rName*/)
 m_rStyles.GetCurrentTableStyles()[m_aName] = m_aTablePropertyList;
 else if (m_aFamily == "graphic")
 m_rStyles.GetCurrentGraphicStyles()[m_aName] = m_aGraphicPropertyList;
+else if (rName == "style:page-layout")
+m_rStyles.GetCurrentPageLayouts()[m_aName] = m_aPageLayoutPropertyList;
 }
 
 librevenge::RVNGPropertyList ::GetTextPropertyList()
@@ -319,6 +356,11 @@ librevenge::RVNGPropertyList 
::GetGraphicPropertyList()
 return m_aGraphicPropertyList;
 }
 
+librevenge::RVNGPropertyList ::GetPageLayoutPropertyList()
+{
+return m_aPageLayoutPropertyList;
+}
+
 } // namespace exp
 } // namespace writerperfect
 
diff --git a/writerperfect/source/writer/exp/txtstyli.hxx 
b/writerperfect/source/writer/exp/txtstyli.hxx
index f3b3b6da38c9..82f3abea6174 100644
--- a/writerperfect/source/writer/exp/txtstyli.hxx
+++ b/writerperfect/source/writer/exp/txtstyli.hxx
@@ -38,6 +38,7 @@ public:
 librevenge::RVNGPropertyList ();
 librevenge::RVNGPropertyList ();
 librevenge::RVNGPropertyList ();
+librevenge::RVNGPropertyList ();
 
 private:
 OUString m_aName;
@@ -49,6 +50,7 @@ private:
 librevenge::RVNGPropertyList m_aRowPropertyList;
 librevenge::RVNGPropertyList m_aTablePropertyList;
 librevenge::RVNGPropertyList m_aGraphicPropertyList;
+librevenge::RVNGPropertyList m_aPageLayoutPropertyList;
 XMLStylesContext _rStyles;
 };
 
diff --git a/writerperfect/source/writer/exp/xmlfmt.cxx 

[Libreoffice-commits] core.git: writerperfect/source

2018-02-01 Thread Miklos Vajna
 writerperfect/source/writer/EPUBExportDialog.cxx |4 ++--
 writerperfect/source/writer/EPUBExportDialog.hxx |2 +-
 writerperfect/source/writer/EPUBExportFilter.hxx |6 --
 3 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit bf79168dba6100624bc105a66ce3f4d1bff9353b
Author: Miklos Vajna 
Date:   Wed Jan 31 22:06:29 2018 +0100

EPUB export: can use std::move() here

And get rid of an easy to avoid include if we are at it.

Change-Id: I63cb4628a3a7038aab91c66f592920923a31d7a6
Reviewed-on: https://gerrit.libreoffice.org/49060
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index 59e5cb4bf469..bbd241bb7b63 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -70,11 +70,11 @@ sal_Int32 PositionToVersion(sal_Int32 nPosition)
 namespace writerperfect
 {
 
-EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsHashMap , 
uno::Reference xContext, const 
css::uno::Reference )
+EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsHashMap , 
uno::Reference xContext, 
css::uno::Reference xDocument)
 : ModalDialog(pParent, "EpubDialog", "writerperfect/ui/exportepub.ui"),
   mxContext(std::move(xContext)),
   mrFilterData(rFilterData),
-  mxSourceDocument(xDocument)
+  mxSourceDocument(std::move(xDocument))
 {
 get(m_pVersion, "versionlb");
 assert(PositionToVersion(m_pVersion->GetSelectedEntryPos()) == 
EPUBExportFilter::GetDefaultVersion());
diff --git a/writerperfect/source/writer/EPUBExportDialog.hxx 
b/writerperfect/source/writer/EPUBExportDialog.hxx
index 7d7f016b1a18..ab90c48ee04c 100644
--- a/writerperfect/source/writer/EPUBExportDialog.hxx
+++ b/writerperfect/source/writer/EPUBExportDialog.hxx
@@ -27,7 +27,7 @@ namespace writerperfect
 class EPUBExportDialog : public ModalDialog
 {
 public:
-EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap 
, css::uno::Reference xContext, const 
css::uno::Reference );
+EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap 
, css::uno::Reference xContext, 
css::uno::Reference xDocument);
 ~EPUBExportDialog() override;
 void dispose() override;
 
diff --git a/writerperfect/source/writer/EPUBExportFilter.hxx 
b/writerperfect/source/writer/EPUBExportFilter.hxx
index ee676d3e1701..fb5d7d6616a9 100644
--- a/writerperfect/source/writer/EPUBExportFilter.hxx
+++ b/writerperfect/source/writer/EPUBExportFilter.hxx
@@ -19,10 +19,12 @@
 #include 
 #include 
 
-#include "exp/xmlimp.hxx"
-
 namespace writerperfect
 {
+namespace exp
+{
+struct FixedLayoutPage;
+}
 
 /// EPUB export XFilter implementation.
 class EPUBExportFilter : public cppu::WeakImplHelper
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2018-01-24 Thread Stephan Bergmann
 writerperfect/source/common/DocumentHandler.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7ca9619dfe976e5c443956aefad4bb3635aa530d
Author: Stephan Bergmann 
Date:   Tue Jan 23 12:33:39 2018 +0100

-Werror=parentheses (upcoming GCC 8)

Change-Id: I4522dc7929030c5da59f2ab030a806ebe7516bd1
Reviewed-on: https://gerrit.libreoffice.org/48403
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/writerperfect/source/common/DocumentHandler.cxx 
b/writerperfect/source/common/DocumentHandler.cxx
index cba9a983aae9..43de86bfc879 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -145,12 +145,12 @@ void DocumentHandler::startElement(const char *psName, 
const librevenge::RVNGPro
 for (int j=0; j<9; ++j)
 {
 // list of the encoded attributes followed by their lengths
-static char const *(listEncoded[9])=
+static char const *listEncoded[9]=
 {
 "draw:name", "svg:font-family", "style:condition", 
"style:num-prefix", "style:num-suffix",
 "table:formula", "text:bullet-char", "text:label", 
"xlink:href"
 };
-static size_t const(listEncodedLength[9])= 
{9,15,15,16,16,13,16,10,10};
+static size_t const listEncodedLength[9]= 
{9,15,15,16,16,13,16,10,10};
 if (keyLength==listEncodedLength[j] && strncmp(i.key(), 
listEncoded[j], keyLength)==0)
 {
 librevenge::RVNGString decodedValue("");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2018-01-19 Thread Miklos Vajna
 writerperfect/source/writer/EPUBExportDialog.cxx  |   14 --
 writerperfect/source/writer/EPUBExportDialog.hxx  |3 ++-
 writerperfect/source/writer/EPUBExportUIComponent.cxx |7 ++-
 writerperfect/source/writer/EPUBExportUIComponent.hxx |8 +++-
 writerperfect/source/writer/exp/xmlimp.cxx|2 +-
 5 files changed, 28 insertions(+), 6 deletions(-)

New commits:
commit 9bca3cc18655d02f3c111d692b26339a6e3669d4
Author: Miklos Vajna 
Date:   Thu Jan 18 18:04:45 2018 +0100

EPUB export UI: show title from the doc model

It was a bit confusing that the doc model had a title set, it was
written to the EPUB file but the UI did not show it.

Change-Id: Ife408e0dabd3fe48e8acc1f09be0c86f78ed4b80
Reviewed-on: https://gerrit.libreoffice.org/48150
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index 2add78c6389f..09ab58499a26 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -13,6 +13,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -68,10 +69,11 @@ sal_Int32 PositionToVersion(sal_Int32 nPosition)
 namespace writerperfect
 {
 
-EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsHashMap , 
uno::Reference xContext)
+EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsHashMap , 
uno::Reference xContext, const 
css::uno::Reference )
 : ModalDialog(pParent, "EpubDialog", "writerperfect/ui/exportepub.ui"),
   mxContext(std::move(xContext)),
-  mrFilterData(rFilterData)
+  mrFilterData(rFilterData),
+  mxSourceDocument(xDocument)
 {
 get(m_pVersion, "versionlb");
 assert(PositionToVersion(m_pVersion->GetSelectedEntryPos()) == 
EPUBExportFilter::GetDefaultVersion());
@@ -124,7 +126,15 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsH
 m_pMediaButton->SetClickHdl(LINK(this, EPUBExportDialog, MediaClickHdl));
 
 get(m_pIdentifier, "identifier");
+
 get(m_pTitle, "title");
+uno::Reference 
xDPS(mxSourceDocument, uno::UNO_QUERY);
+uno::Reference xDP;
+if (xDPS.is())
+xDP = xDPS->getDocumentProperties();
+if (xDP.is())
+m_pTitle->SetText(xDP->getTitle());
+
 get(m_pInitialCreator, "author");
 get(m_pLanguage, "language");
 get(m_pDate, "date");
diff --git a/writerperfect/source/writer/EPUBExportDialog.hxx 
b/writerperfect/source/writer/EPUBExportDialog.hxx
index 8180e4a24366..7d7f016b1a18 100644
--- a/writerperfect/source/writer/EPUBExportDialog.hxx
+++ b/writerperfect/source/writer/EPUBExportDialog.hxx
@@ -27,7 +27,7 @@ namespace writerperfect
 class EPUBExportDialog : public ModalDialog
 {
 public:
-EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap 
, css::uno::Reference xContext);
+EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap 
, css::uno::Reference xContext, const 
css::uno::Reference );
 ~EPUBExportDialog() override;
 void dispose() override;
 
@@ -41,6 +41,7 @@ private:
 
 css::uno::Reference mxContext;
 comphelper::SequenceAsHashMap 
+css::uno::Reference mxSourceDocument;
 VclPtr m_pVersion;
 VclPtr m_pSplit;
 VclPtr m_pLayout;
diff --git a/writerperfect/source/writer/EPUBExportUIComponent.cxx 
b/writerperfect/source/writer/EPUBExportUIComponent.cxx
index 66d8506fa771..4df8ea4a1946 100644
--- a/writerperfect/source/writer/EPUBExportUIComponent.cxx
+++ b/writerperfect/source/writer/EPUBExportUIComponent.cxx
@@ -76,12 +76,17 @@ sal_Int16 EPUBExportUIComponent::execute()
 {
 SolarMutexGuard aGuard;
 
-ScopedVclPtrInstance 
pDialog(Application::GetDefDialogParent(), maFilterData, mxContext);
+ScopedVclPtrInstance 
pDialog(Application::GetDefDialogParent(), maFilterData, mxContext, 
mxSourceDocument);
 if (pDialog->Execute() == RET_OK)
 return ui::dialogs::ExecutableDialogResults::OK;
 return ui::dialogs::ExecutableDialogResults::CANCEL;
 }
 
+void SAL_CALL EPUBExportUIComponent::setSourceDocument(const 
css::uno::Reference )
+{
+mxSourceDocument = xDocument;
+}
+
 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface 
*com_sun_star_comp_Writer_EPUBExportUIComponent_get_implementation(uno::XComponentContext
 *pCtx, uno::Sequence const &/*rSeq*/)
 {
 return cppu::acquire(new EPUBExportUIComponent(pCtx));
diff --git a/writerperfect/source/writer/EPUBExportUIComponent.hxx 
b/writerperfect/source/writer/EPUBExportUIComponent.hxx
index 3ef6d7cc1b2f..865571dde97b 100644
--- a/writerperfect/source/writer/EPUBExportUIComponent.hxx
+++ b/writerperfect/source/writer/EPUBExportUIComponent.hxx
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -26,7 +27,8 @@ class 

[Libreoffice-commits] core.git: writerperfect/source

2018-01-17 Thread Miklos Vajna
 writerperfect/source/writer/EPUBExportDialog.cxx  |4 +--
 writerperfect/source/writer/EPUBExportDialog.hxx  |2 -
 writerperfect/source/writer/EPUBExportFilter.cxx  |8 +++---
 writerperfect/source/writer/EPUBExportFilter.hxx  |4 +--
 writerperfect/source/writer/EPUBExportUIComponent.cxx |6 ++--
 writerperfect/source/writer/EPUBExportUIComponent.hxx |4 +--
 writerperfect/source/writer/EPUBPackage.cxx   |4 +--
 writerperfect/source/writer/EPUBPackage.hxx   |2 -
 writerperfect/source/writer/exp/xmlfmt.cxx|2 -
 writerperfect/source/writer/exp/xmlimp.cxx|   22 --
 writerperfect/source/writer/exp/xmlmetai.hxx  |   18 +++---
 11 files changed, 37 insertions(+), 39 deletions(-)

New commits:
commit 9b3904357be1fc4775fe5fb516d82c7c1ee53a1e
Author: Miklos Vajna 
Date:   Tue Jan 16 23:10:44 2018 +0100

EPUB export: various small cleanups

Change-Id: Iaa921257720adc6a65c8598b1105a4d7249778e6
Reviewed-on: https://gerrit.libreoffice.org/48021
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index fd449970fa7b..2add78c6389f 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -68,9 +68,9 @@ sal_Int32 PositionToVersion(sal_Int32 nPosition)
 namespace writerperfect
 {
 
-EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsHashMap , const 
uno::Reference )
+EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsHashMap , 
uno::Reference xContext)
 : ModalDialog(pParent, "EpubDialog", "writerperfect/ui/exportepub.ui"),
-  mxContext(xContext),
+  mxContext(std::move(xContext)),
   mrFilterData(rFilterData)
 {
 get(m_pVersion, "versionlb");
diff --git a/writerperfect/source/writer/EPUBExportDialog.hxx 
b/writerperfect/source/writer/EPUBExportDialog.hxx
index 8f84779aa8cc..8180e4a24366 100644
--- a/writerperfect/source/writer/EPUBExportDialog.hxx
+++ b/writerperfect/source/writer/EPUBExportDialog.hxx
@@ -27,7 +27,7 @@ namespace writerperfect
 class EPUBExportDialog : public ModalDialog
 {
 public:
-EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap 
, const css::uno::Reference );
+EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap 
, css::uno::Reference xContext);
 ~EPUBExportDialog() override;
 void dispose() override;
 
diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index 7c1bd1a6d796..b25118350193 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -34,8 +34,8 @@ using namespace com::sun::star;
 namespace writerperfect
 {
 
-EPUBExportFilter::EPUBExportFilter(const 
uno::Reference )
-: mxContext(xContext)
+EPUBExportFilter::EPUBExportFilter(uno::Reference 
xContext)
+: mxContext(std::move(xContext))
 {
 }
 
@@ -143,7 +143,7 @@ void 
EPUBExportFilter::CreateMetafiles(std::vector

[Libreoffice-commits] core.git: writerperfect/source

2017-12-14 Thread Stephan Bergmann
 writerperfect/source/writer/EPUBExportFilter.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit a5c201790bac259da543852c8734ed4a9132
Author: Stephan Bergmann 
Date:   Thu Dec 14 10:14:58 2017 +0100

...and another

Change-Id: I833350b5c193223d24550e58f7ec99ae081afe8b

diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index 7b7654c8097e..eb65c0ee5098 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -9,8 +9,6 @@
 
 #include "EPUBExportFilter.hxx"
 
-#include 
-
 #include 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-12-14 Thread Stephan Bergmann
 writerperfect/source/writer/EPUBExportDialog.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit db75836932bdab0f888764bfe1b53269d9da2b09
Author: Stephan Bergmann 
Date:   Thu Dec 14 10:11:11 2017 +0100

Blind fix for recently removed config_host/config_libepubgen.h.in

Change-Id: If91cfdce97f4f3868c2b09013220d27ceaffdfbe

diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index 918d9eb9a198..81efcdfcf687 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -13,7 +13,6 @@
 
 #include 
 #include 
-#include 
 #include 
 
 #include "EPUBExportFilter.hxx"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-12-04 Thread Miklos Vajna
 writerperfect/source/writer/EPUBExportDialog.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 32fd735a6a30a8e552488f78a1577755a0e3db3d
Author: Miklos Vajna 
Date:   Fri Dec 1 16:35:05 2017 +0100

EPUB export, fixed layout always means "split at the end of the page"

So disable split type on the UI, as it has no effect.

Change-Id: Ia16e8050a732fce2f7881eee1b64e4487e843574
Reviewed-on: https://gerrit.libreoffice.org/45691
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index 232ca4128fec..2d429abf657c 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -9,8 +9,11 @@
 
 #include "EPUBExportDialog.hxx"
 
+#include 
+
 #include 
 #include 
+#include 
 #include 
 
 #include "EPUBExportFilter.hxx"
@@ -147,6 +150,9 @@ IMPL_LINK_NOARG(EPUBExportDialog, LayoutSelectHdl, ListBox 
&, void)
 // No conversion, 1:1 mapping between entry positions and
 // libepubgen::EPUBLayoutMethod.
 mrFilterData["EPUBLayoutMethod"] <<= m_pLayout->GetSelectedEntryPos();
+#if LIBEPUBGEN_VERSION_SUPPORT
+m_pSplit->Enable(m_pLayout->GetSelectedEntryPos() != 
libepubgen::EPUB_LAYOUT_METHOD_FIXED);
+#endif
 }
 
 IMPL_LINK_NOARG(EPUBExportDialog, CoverClickHdl, Button *, void)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-12-01 Thread Stephan Bergmann
 writerperfect/source/writer/exp/xmlimp.cxx |3 +--
 writerperfect/source/writer/exp/xmlimp.hxx |1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 09d96767a405a7d2bb338dbb5af3d781cdddb50d
Author: Stephan Bergmann 
Date:   Fri Dec 1 10:07:05 2017 +0100

-Werror,-Wunused-private-field

Change-Id: Ia265d565bbc6b9e4c03aa9be66916b926b54bed8

diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index ad4928f17a65..7b6cc2791459 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -256,8 +256,7 @@ rtl::Reference 
XMLOfficeDocContext::CreateChildContext(const O
 
 XMLImport::XMLImport(const uno::Reference , 
librevenge::RVNGTextInterface , const OUString , const 
uno::Sequence )
 : mrGenerator(rGenerator),
-  mxContext(xContext),
-  maDocumentBaseURL(rURL)
+  mxContext(xContext)
 {
 uno::Sequence aFilterData;
 for (sal_Int32 i = 0; i < rDescriptor.getLength(); ++i)
diff --git a/writerperfect/source/writer/exp/xmlimp.hxx 
b/writerperfect/source/writer/exp/xmlimp.hxx
index 0777e71953a4..de9fa58d7e1f 100644
--- a/writerperfect/source/writer/exp/xmlimp.hxx
+++ b/writerperfect/source/writer/exp/xmlimp.hxx
@@ -57,7 +57,6 @@ class XMLImport : public cppu::WeakImplHelper
 librevenge::RVNGPropertyList maMetaData;
 const css::uno::Reference 
 css::uno::Reference mxUriReferenceFactory;
-OUString maDocumentBaseURL;
 OUString maMediaDir;
 
 public:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-09-22 Thread Andrea Gelmini
 writerperfect/source/writer/EPUBExportFilter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 43fd2b2597ce7ac3307794c712e4d8e29e26db5c
Author: Andrea Gelmini 
Date:   Fri Sep 22 11:36:31 2017 +0200

Fix typo

Change-Id: I3bdc875963c413996ffb6403c44968447dbb3131
Reviewed-on: https://gerrit.libreoffice.org/42629
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 

diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index a00ad51a8488..eefbdc4c9d4d 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -30,7 +30,7 @@ namespace libepubgen
 {
 enum EPUBStylesMethod
 {
-EPUB_STYLES_METHOD_CSS, //< The styles will be described in a 
seprarate CSS file.
+EPUB_STYLES_METHOD_CSS, //< The styles will be described in a separate 
CSS file.
 EPUB_STYLES_METHOD_INLINE, //< The styles will be described inline.
 };
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-09-22 Thread Caolán McNamara
 writerperfect/source/writer/EPUBExportFilter.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit a411d7729ab2bed05c3c5d22a8cbcf5dde034b91
Author: Caolán McNamara 
Date:   Fri Sep 22 09:05:22 2017 +0100

allow system-libepubgen to limp along

Change-Id: I038421749ed6f20d74984beb2e703ffa43a09ff3
Reviewed-on: https://gerrit.libreoffice.org/42620
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index f30f18bb6735..a00ad51a8488 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -25,6 +25,17 @@
 
 using namespace com::sun::star;
 
+#if !LIBEPUBGEN_VERSION_SUPPORT
+namespace libepubgen
+{
+enum EPUBStylesMethod
+{
+EPUB_STYLES_METHOD_CSS, //< The styles will be described in a 
seprarate CSS file.
+EPUB_STYLES_METHOD_INLINE, //< The styles will be described inline.
+};
+}
+#endif
+
 namespace writerperfect
 {
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-09-21 Thread Stephan Bergmann
 writerperfect/source/writer/EPUBExportDialog.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit cb14175ee3a2122041bbd831b968cfca7c1036b5
Author: Stephan Bergmann 
Date:   Thu Sep 21 14:44:02 2017 +0200

More missing GetSelectEntryPos -> GetSelectedEntryPos

Change-Id: I0c59eac4d0bca2d0a086b9e319dcb50bc6a15b8e

diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index 50bad98b4281..23faa939db31 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -66,7 +66,7 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsH
   mrFilterData(rFilterData)
 {
 get(m_pVersion, "versionlb");
-assert(PositionToVersion(m_pVersion->GetSelectEntryPos()) == 
EPUBExportFilter::GetDefaultVersion());
+assert(PositionToVersion(m_pVersion->GetSelectedEntryPos()) == 
EPUBExportFilter::GetDefaultVersion());
 
 auto it = rFilterData.find("EPUBVersion");
 if (it != rFilterData.end())
@@ -94,14 +94,14 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, 
comphelper::SequenceAsH
 
 IMPL_LINK_NOARG(EPUBExportDialog, VersionSelectHdl, ListBox &, void)
 {
-mrFilterData["EPUBVersion"] <<= 
PositionToVersion(m_pVersion->GetSelectEntryPos());
+mrFilterData["EPUBVersion"] <<= 
PositionToVersion(m_pVersion->GetSelectedEntryPos());
 }
 
 IMPL_LINK_NOARG(EPUBExportDialog, SplitSelectHdl, ListBox &, void)
 {
 // No conversion, 1:1 mapping between entry positions and
 // libepubgen::EPUBSplitMethod.
-mrFilterData["EPUBSplitMethod"] <<= m_pSplit->GetSelectEntryPos();
+mrFilterData["EPUBSplitMethod"] <<= m_pSplit->GetSelectedEntryPos();
 }
 
 EPUBExportDialog::~EPUBExportDialog()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-09-06 Thread Miklos Vajna
 writerperfect/source/writer/exp/txtparai.cxx |   97 +--
 1 file changed, 34 insertions(+), 63 deletions(-)

New commits:
commit 3621c773a867eb2bbee83035c7125ca11296e44a
Author: Miklos Vajna 
Date:   Wed Sep 6 09:56:07 2017 +0200

EPUB export: pull out FillStyle() from XMLSpan/ParaContext

To avoid repeating similar code 3 times.

Change-Id: I76a7d2329488ba9b77b789c0393ac120e8e775d1
Reviewed-on: https://gerrit.libreoffice.org/41973
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 31ab25f43cad..f2df54d0e1b0 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -14,6 +14,37 @@
 
 using namespace com::sun::star;
 
+namespace
+{
+
+/// Looks for rName in rAutomaticStyles (and failing that, in rNamedStyles) 
and fills rPropertyList based on that.
+void FillStyle(const OUString ,
+   std::map ,
+   std::map 
,
+   librevenge::RVNGPropertyList )
+{
+auto itStyle = rAutomaticStyles.find(rName);
+if (itStyle != rAutomaticStyles.end())
+{
+// Apply properties from automatic style.
+librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+for (itProp.rewind(); itProp.next();)
+rPropertyList.insert(itProp.key(), itProp()->clone());
+return;
+}
+
+itStyle = rNamedStyles.find(rName);
+if (itStyle != rNamedStyles.end())
+{
+// Apply properties from named style.
+librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+for (itProp.rewind(); itProp.next();)
+rPropertyList.insert(itProp.key(), itProp()->clone());
+}
+}
+
+}
+
 namespace writerperfect
 {
 namespace exp
@@ -52,27 +83,7 @@ void XMLSpanContext::startElement(const OUString &/*rName*/, 
const css::uno::Ref
 const OUString  = xAttribs->getNameByIndex(i);
 const OUString  = xAttribs->getValueByIndex(i);
 if (rAttributeName == "text:style-name")
-{
-// Reference to an automatic text style, try to look it up.
-auto itStyle = 
mrImport.GetAutomaticTextStyles().find(rAttributeValue);
-if (itStyle != mrImport.GetAutomaticTextStyles().end())
-{
-// Apply properties directly, librevenge has no notion of 
automatic styles.
-librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
-for (itProp.rewind(); itProp.next();)
-aPropertyList.insert(itProp.key(), itProp()->clone());
-continue;
-}
-
-itStyle = mrImport.GetTextStyles().find(rAttributeValue);
-if (itStyle != mrImport.GetTextStyles().end())
-{
-// Apply properties from text style.
-librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
-for (itProp.rewind(); itProp.next();)
-aPropertyList.insert(itProp.key(), itProp()->clone());
-}
-}
+FillStyle(rAttributeValue, mrImport.GetAutomaticTextStyles(), 
mrImport.GetTextStyles(), aPropertyList);
 else
 {
 OString sName = OUStringToOString(rAttributeName, 
RTL_TEXTENCODING_UTF8);
@@ -163,26 +174,7 @@ void XMLParaContext::startElement(const OUString 
&/*rName*/, const css::uno::Ref
 if (rAttributeName == "text:style-name")
 {
 m_aStyleName = rAttributeValue;
-
-// Reference to an automatic style, try to look it up.
-auto itStyle = 
mrImport.GetAutomaticParagraphStyles().find(m_aStyleName);
-if (itStyle != mrImport.GetAutomaticParagraphStyles().end())
-{
-// Found an automatic paragraph style.
-librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
-for (itProp.rewind(); itProp.next();)
-aPropertyList.insert(itProp.key(), itProp()->clone());
-continue;
-}
-
-itStyle = mrImport.GetParagraphStyles().find(m_aStyleName);
-if (itStyle != mrImport.GetParagraphStyles().end())
-{
-// Found a paragraph style.
-librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
-for (itProp.rewind(); itProp.next();)
-aPropertyList.insert(itProp.key(), itProp()->clone());
-}
+FillStyle(m_aStyleName, mrImport.GetAutomaticParagraphStyles(), 
mrImport.GetParagraphStyles(), aPropertyList);
 }
 else
 {
@@ -204,28 +196,7 @@ void XMLParaContext::characters(const OUString )
 {
 librevenge::RVNGPropertyList 

[Libreoffice-commits] core.git: writerperfect/source

2017-08-22 Thread Miklos Vajna
 writerperfect/source/writer/EPUBExportFilter.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 9f794e4cf619210d3ce7cfbab51a36ea14c4ad8d
Author: Miklos Vajna 
Date:   Tue Aug 22 09:47:57 2017 +0200

writerperfect: oops, duplicated include

Change-Id: I101856ddf3d636c1ac5535043bf5cd63b6d90acd

diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index 7f4ce28aa5ad..465d8bc256ac 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -7,8 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include "config_libepubgen.h"
-
 #include "EPUBExportFilter.hxx"
 
 #include "config_libepubgen.h"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-21 Thread Stephan Bergmann
 writerperfect/source/writer/EPUBExportFilter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a7c26cbf73f961fbe82e0331779b935e9e1ff9ef
Author: Stephan Bergmann 
Date:   Mon Aug 21 13:15:51 2017 +0200

loplugin:checkconfigmacros

Change-Id: Ic9ffe0af9e32b45c304c1edee92ed4b185b4ed19

diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index 2cc5c6479aa8..a3e490428143 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -39,7 +39,7 @@ sal_Bool EPUBExportFilter::filter(const 
uno::Sequence 
 // is in-between.
 EPUBPackage aPackage(mxContext, rDescriptor);
 libepubgen::EPUBTextGenerator aGenerator(, 
libepubgen::EPUB_SPLIT_METHOD_HEADING
-#if defined(LIBEPUBGEN_VERSION_SUPPORT)
+#if LIBEPUBGEN_VERSION_SUPPORT
  , /*version=*/30
 #endif
 );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-17 Thread Miklos Vajna
 writerperfect/source/writer/exp/txtparai.cxx |   46 +++
 1 file changed, 46 insertions(+)

New commits:
commit 9480ff6a2b6057410940ff5c40828d5746898a0e
Author: Miklos Vajna 
Date:   Thu Aug 17 10:58:33 2017 +0200

EPUB export: implement link support

Not only the link but the text of it was also unhandled, add code for
both.

Change-Id: Ic3a26db64a10d44f1f94b7358ed9103bb68bbe95
Reviewed-on: https://gerrit.libreoffice.org/41245
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 02e4f78c1ef5..72cc401ceb91 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -50,6 +50,50 @@ void XMLSpanContext::characters(const OUString )
 
mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
 }
 
+/// Handler for .
+class XMLHyperlinkContext : public XMLImportContext
+{
+public:
+XMLHyperlinkContext(XMLImport );
+
+void SAL_CALL startElement(const OUString , const 
css::uno::Reference ) override;
+void SAL_CALL endElement(const OUString ) override;
+void SAL_CALL characters(const OUString ) override;
+};
+
+XMLHyperlinkContext::XMLHyperlinkContext(XMLImport )
+: XMLImportContext(rImport)
+{
+}
+
+void XMLHyperlinkContext::startElement(const OUString &/*rName*/, const 
css::uno::Reference )
+{
+librevenge::RVNGPropertyList aPropertyList;
+for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
+{
+const OUString  = xAttribs->getNameByIndex(i);
+if (rAttributeName == "xlink:href")
+{
+OString sName = OUStringToOString(rAttributeName, 
RTL_TEXTENCODING_UTF8);
+OString sValue = OUStringToOString(xAttribs->getValueByIndex(i), 
RTL_TEXTENCODING_UTF8);
+aPropertyList.insert(sName.getStr(), sValue.getStr());
+}
+}
+
+mrImport.GetGenerator().openLink(aPropertyList);
+}
+
+void XMLHyperlinkContext::endElement(const OUString &/*rName*/)
+{
+mrImport.GetGenerator().closeLink();
+}
+
+void XMLHyperlinkContext::characters(const OUString )
+{
+OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
+
mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+}
+
 XMLParaContext::XMLParaContext(XMLImport )
 : XMLImportContext(rImport)
 {
@@ -59,6 +103,8 @@ XMLImportContext *XMLParaContext::CreateChildContext(const 
OUString , cons
 {
 if (rName == "text:span")
 return new XMLSpanContext(mrImport);
+if (rName == "text:a")
+return new XMLHyperlinkContext(mrImport);
 return nullptr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-15 Thread Miklos Vajna
 writerperfect/source/writer/exp/txtparai.cxx |   36 ++-
 1 file changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 185e197724c1e2cdb07ebb94be617c856d45d96f
Author: Miklos Vajna 
Date:   Tue Aug 15 08:45:33 2017 +0200

EPUB export: initial span support

Characters under  (and not only under ) are now
handled.

Change-Id: Iac353005423d65f446b9f93519957f4caeaf1c7a
Reviewed-on: https://gerrit.libreoffice.org/41164
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 9507ceb759b9..8abf113dad52 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -18,13 +18,47 @@ namespace writerperfect
 namespace exp
 {
 
+/// Handler for .
+class XMLSpanContext : public XMLImportContext
+{
+public:
+XMLSpanContext(XMLImport );
+
+void SAL_CALL startElement(const OUString , const 
css::uno::Reference ) override;
+void SAL_CALL endElement(const OUString ) override;
+void SAL_CALL characters(const OUString ) override;
+};
+
+XMLSpanContext::XMLSpanContext(XMLImport )
+: XMLImportContext(rImport)
+{
+}
+
+void XMLSpanContext::startElement(const OUString &/*rName*/, const 
css::uno::Reference &/*xAttribs*/)
+{
+mrImport.GetGenerator().openSpan(librevenge::RVNGPropertyList());
+}
+
+void XMLSpanContext::endElement(const OUString &/*rName*/)
+{
+mrImport.GetGenerator().closeSpan();
+}
+
+void XMLSpanContext::characters(const OUString )
+{
+OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
+
mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+}
+
 XMLParaContext::XMLParaContext(XMLImport )
 : XMLImportContext(rImport)
 {
 }
 
-XMLImportContext *XMLParaContext::CreateChildContext(const OUString 
&/*rName*/, const css::uno::Reference 
&/*xAttribs*/)
+XMLImportContext *XMLParaContext::CreateChildContext(const OUString , 
const css::uno::Reference &/*xAttribs*/)
 {
+if (rName == "text:span")
+return new XMLSpanContext(mrImport);
 return nullptr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-09 Thread Miklos Vajna
 writerperfect/source/writer/EPUBPackage.cxx |   23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 758b33f4d5eaa2e81afcb27b61847864a178a597
Author: Miklos Vajna 
Date:   Tue Aug 8 17:10:21 2017 +0200

EPUB export: write CSS rules

With this, a hello world writer document is handled correctly.

Change-Id: Ib1efea5aa5ea5049beee719f14f85b41c56d1967
Reviewed-on: https://gerrit.libreoffice.org/40890
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/EPUBPackage.cxx 
b/writerperfect/source/writer/EPUBPackage.cxx
index 520fece6d9ca..d3b51d4848da 100644
--- a/writerperfect/source/writer/EPUBPackage.cxx
+++ b/writerperfect/source/writer/EPUBPackage.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -105,9 +106,27 @@ void EPUBPackage::openCSSFile(const char *pName)
 
mxOutputStream.set(mxStorage->openStreamElementByHierarchicalName(OUString::fromUtf8(pName),
 embed::ElementModes::READWRITE), uno::UNO_QUERY);
 }
 
-void EPUBPackage::insertRule(const librevenge::RVNGString &/*rSelector*/, 
const librevenge::RVNGPropertyList &/*rProperties*/)
+void EPUBPackage::insertRule(const librevenge::RVNGString , const 
librevenge::RVNGPropertyList )
 {
-SAL_WARN("writerperfect", "EPUBPackage::insertRule: implement me");
+assert(mxOutputStream.is());
+
+uno::Reference xSeekable(mxOutputStream, uno::UNO_QUERY);
+std::stringstream aStream;
+if (xSeekable->getPosition() != 0)
+aStream << '\n';
+aStream << rSelector.cstr() << " {\n";
+
+librevenge::RVNGPropertyList::Iter it(rProperties);
+for (it.rewind(); it.next();)
+{
+if (it())
+aStream << "  " << it.key() << ": " << it()->getStr().cstr() << 
";\n";
+}
+
+aStream << "}\n";
+std::string aString = aStream.str();
+uno::Sequence aData(reinterpret_cast(aString.c_str()), aString.size());
+mxOutputStream->writeBytes(aData);
 }
 
 void EPUBPackage::closeCSSFile()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-08 Thread Miklos Vajna
 writerperfect/source/writer/EPUBPackage.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 6db0cc7b5c55ee06b33c5a537b881a884adc1fa4
Author: Miklos Vajna 
Date:   Tue Aug 8 15:29:20 2017 +0200

EPUB export: write XML attributes

Which means that for a hello world, only the CSS part is missing.

Change-Id: I0a19eade8505e273f93a5078e689f6f9c2b00dab

diff --git a/writerperfect/source/writer/EPUBPackage.cxx 
b/writerperfect/source/writer/EPUBPackage.cxx
index 7589dae19722..520fece6d9ca 100644
--- a/writerperfect/source/writer/EPUBPackage.cxx
+++ b/writerperfect/source/writer/EPUBPackage.cxx
@@ -59,11 +59,16 @@ void EPUBPackage::openXMLFile(const char *pName)
 mxOutputWriter->startDocument();
 }
 
-void EPUBPackage::openElement(const char *pName, const 
librevenge::RVNGPropertyList &/*rAttributes*/)
+void EPUBPackage::openElement(const char *pName, const 
librevenge::RVNGPropertyList )
 {
 assert(mxOutputWriter.is());
 
 rtl::Reference pAttributeList(new 
SvXMLAttributeList());
+
+librevenge::RVNGPropertyList::Iter it(rAttributes);
+for (it.rewind(); it.next();)
+pAttributeList->AddAttribute(OUString::fromUtf8(it.key()), 
OUString::fromUtf8(it()->getStr().cstr()));
+
 mxOutputWriter->startElement(OUString::fromUtf8(pName), 
uno::Reference(pAttributeList.get()));
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-08 Thread Miklos Vajna
 writerperfect/source/writer/EPUBPackage.cxx |   21 ++---
 writerperfect/source/writer/EPUBPackage.hxx |6 --
 2 files changed, 22 insertions(+), 5 deletions(-)

New commits:
commit 9d1350fe183485025a924f8c03d8f34c077028d3
Author: Miklos Vajna 
Date:   Tue Aug 8 11:02:31 2017 +0200

EPUB export: write most of XML content in the package

No attributes yet, though.

Change-Id: I268d59a67c311f8e2e46331b2add1a91702545e2
Reviewed-on: https://gerrit.libreoffice.org/40864
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/EPUBPackage.cxx 
b/writerperfect/source/writer/EPUBPackage.cxx
index bf9c03089708..7589dae19722 100644
--- a/writerperfect/source/writer/EPUBPackage.cxx
+++ b/writerperfect/source/writer/EPUBPackage.cxx
@@ -11,9 +11,11 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 
@@ -49,29 +51,42 @@ void EPUBPackage::openXMLFile(const char *pName)
 {
 assert(pName);
 assert(!mxOutputStream.is());
+assert(!mxOutputWriter.is());
 
 
mxOutputStream.set(mxStorage->openStreamElementByHierarchicalName(OUString::fromUtf8(pName),
 embed::ElementModes::READWRITE), uno::UNO_QUERY);
+mxOutputWriter = xml::sax::Writer::create(mxContext);
+mxOutputWriter->setOutputStream(mxOutputStream);
+mxOutputWriter->startDocument();
 }
 
 void EPUBPackage::openElement(const char *pName, const 
librevenge::RVNGPropertyList &/*rAttributes*/)
 {
-SAL_WARN("writerperfect", "EPUBPackage::openElement, " << pName << ": 
implement me");
+assert(mxOutputWriter.is());
+
+rtl::Reference pAttributeList(new 
SvXMLAttributeList());
+mxOutputWriter->startElement(OUString::fromUtf8(pName), 
uno::Reference(pAttributeList.get()));
 }
 
 void EPUBPackage::closeElement(const char *pName)
 {
-SAL_WARN("writerperfect", "EPUBPackage::closeElement, " << pName << ": 
implement me");
+assert(mxOutputWriter.is());
+
+mxOutputWriter->endElement(OUString::fromUtf8(pName));
 }
 
 void EPUBPackage::insertCharacters(const librevenge::RVNGString )
 {
-SAL_WARN("writerperfect", "EPUBPackage::insertCharacters, " << 
rCharacters.cstr() << ": implement me");
+mxOutputWriter->characters(OUString::fromUtf8(rCharacters.cstr()));
 }
 
 void EPUBPackage::closeXMLFile()
 {
+assert(mxOutputWriter.is());
 assert(mxOutputStream.is());
 
+mxOutputWriter->endDocument();
+mxOutputWriter.clear();
+
 uno::Reference xTransactedObject(mxOutputStream, 
uno::UNO_QUERY);
 xTransactedObject->commit();
 mxOutputStream.clear();
diff --git a/writerperfect/source/writer/EPUBPackage.hxx 
b/writerperfect/source/writer/EPUBPackage.hxx
index 9d8ff8eef543..5e093f540cc8 100644
--- a/writerperfect/source/writer/EPUBPackage.hxx
+++ b/writerperfect/source/writer/EPUBPackage.hxx
@@ -12,10 +12,11 @@
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
-#include 
+#include 
+#include 
 
 namespace writerperfect
 {
@@ -26,6 +27,7 @@ class EPUBPackage : public libepubgen::EPUBPackage
 css::uno::Reference mxContext;
 css::uno::Reference mxStorage;
 css::uno::Reference mxOutputStream;
+css::uno::Reference mxOutputWriter;
 
 public:
 explicit EPUBPackage(const 
css::uno::Reference , const 
css::uno::Sequence );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-08 Thread Miklos Vajna
 writerperfect/source/writer/EPUBPackage.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 06283dcba13ee18716da9eee728210a00bcb5b97
Author: Miklos Vajna 
Date:   Tue Aug 8 09:16:04 2017 +0200

EPUB export: write mime type

libepubgen won't emit calls on the package interface to do this, it
turns out.

Change-Id: Ib9826f1df348fd7afbccdc5d5a92a6d94f8aa9af
Reviewed-on: https://gerrit.libreoffice.org/40862
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/EPUBPackage.cxx 
b/writerperfect/source/writer/EPUBPackage.cxx
index 060c3828a4de..bf9c03089708 100644
--- a/writerperfect/source/writer/EPUBPackage.cxx
+++ b/writerperfect/source/writer/EPUBPackage.cxx
@@ -28,6 +28,15 @@ EPUBPackage::EPUBPackage(const 
uno::Reference ,
 auto xStream = 
aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STREAMFOROUTPUT(),
 uno::Reference());
 const sal_Int32 nOpenMode = embed::ElementModes::READWRITE | 
embed::ElementModes::TRUNCATE;
 
mxStorage.set(comphelper::OStorageHelper::GetStorageOfFormatFromStream(ZIP_STORAGE_FORMAT_STRING,
 xStream, nOpenMode, mxContext), uno::UNO_QUERY);
+
+// The zipped content represents an EPUB Publication.
+
mxOutputStream.set(mxStorage->openStreamElementByHierarchicalName("mimetype", 
embed::ElementModes::READWRITE), uno::UNO_QUERY);
+const OString aMimeType("application/epub+zip");
+uno::Sequence aData(reinterpret_cast(aMimeType.getStr()), aMimeType.getLength());
+mxOutputStream->writeBytes(aData);
+uno::Reference xTransactedObject(mxOutputStream, 
uno::UNO_QUERY);
+xTransactedObject->commit();
+mxOutputStream.clear();
 }
 
 EPUBPackage::~EPUBPackage()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-07 Thread Miklos Vajna
 writerperfect/source/writer/EPUBPackage.cxx |   37 
 writerperfect/source/writer/EPUBPackage.hxx |5 ++-
 2 files changed, 35 insertions(+), 7 deletions(-)

New commits:
commit 98a7251b24c9f42bdb333bacbe06a2821e6942f2
Author: Miklos Vajna 
Date:   Mon Aug 7 16:29:45 2017 +0200

EPUB export: start creating XML and CSS files

Though at the moment all of them are empty.

Change-Id: I4e53c81df2d709f06eb2a1df814b887181ae84c9
Reviewed-on: https://gerrit.libreoffice.org/40840
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/EPUBPackage.cxx 
b/writerperfect/source/writer/EPUBPackage.cxx
index 54300c2fbf0a..060c3828a4de 100644
--- a/writerperfect/source/writer/EPUBPackage.cxx
+++ b/writerperfect/source/writer/EPUBPackage.cxx
@@ -9,23 +9,39 @@
 
 #include "EPUBPackage.hxx"
 
+#include 
+#include 
+
+#include 
+#include 
+
 using namespace com::sun::star;
 
 namespace writerperfect
 {
 
-EPUBPackage::EPUBPackage(const uno::Reference 
, const uno::Sequence &/*rDescriptor*/)
+EPUBPackage::EPUBPackage(const uno::Reference 
, const uno::Sequence )
 : mxContext(xContext)
 {
+// Extract the output stream from the descriptor.
+utl::MediaDescriptor aMediaDesc(rDescriptor);
+auto xStream = 
aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STREAMFOROUTPUT(),
 uno::Reference());
+const sal_Int32 nOpenMode = embed::ElementModes::READWRITE | 
embed::ElementModes::TRUNCATE;
+
mxStorage.set(comphelper::OStorageHelper::GetStorageOfFormatFromStream(ZIP_STORAGE_FORMAT_STRING,
 xStream, nOpenMode, mxContext), uno::UNO_QUERY);
 }
 
 EPUBPackage::~EPUBPackage()
 {
+uno::Reference xTransactedObject(mxStorage, 
uno::UNO_QUERY);
+xTransactedObject->commit();
 }
 
 void EPUBPackage::openXMLFile(const char *pName)
 {
-SAL_WARN("writerperfect", "EPUBPackage::openXMLFile, " << pName << ": 
implement me");
+assert(pName);
+assert(!mxOutputStream.is());
+
+
mxOutputStream.set(mxStorage->openStreamElementByHierarchicalName(OUString::fromUtf8(pName),
 embed::ElementModes::READWRITE), uno::UNO_QUERY);
 }
 
 void EPUBPackage::openElement(const char *pName, const 
librevenge::RVNGPropertyList &/*rAttributes*/)
@@ -45,12 +61,19 @@ void EPUBPackage::insertCharacters(const 
librevenge::RVNGString )
 
 void EPUBPackage::closeXMLFile()
 {
-SAL_WARN("writerperfect", "EPUBPackage::closeXMLFile: implement me");
+assert(mxOutputStream.is());
+
+uno::Reference xTransactedObject(mxOutputStream, 
uno::UNO_QUERY);
+xTransactedObject->commit();
+mxOutputStream.clear();
 }
 
 void EPUBPackage::openCSSFile(const char *pName)
 {
-SAL_WARN("writerperfect", "EPUBPackage::openCSSFile, " << pName << ": 
implement me");
+assert(pName);
+assert(!mxOutputStream.is());
+
+
mxOutputStream.set(mxStorage->openStreamElementByHierarchicalName(OUString::fromUtf8(pName),
 embed::ElementModes::READWRITE), uno::UNO_QUERY);
 }
 
 void EPUBPackage::insertRule(const librevenge::RVNGString &/*rSelector*/, 
const librevenge::RVNGPropertyList &/*rProperties*/)
@@ -60,7 +83,11 @@ void EPUBPackage::insertRule(const librevenge::RVNGString 
&/*rSelector*/, const
 
 void EPUBPackage::closeCSSFile()
 {
-SAL_WARN("writerperfect", "EPUBPackage::closeCSSFile: implement me");
+assert(mxOutputStream.is());
+
+uno::Reference xTransactedObject(mxOutputStream, 
uno::UNO_QUERY);
+xTransactedObject->commit();
+mxOutputStream.clear();
 }
 
 void EPUBPackage::openBinaryFile(const char *pName)
diff --git a/writerperfect/source/writer/EPUBPackage.hxx 
b/writerperfect/source/writer/EPUBPackage.hxx
index 48c1f8a035e0..9d8ff8eef543 100644
--- a/writerperfect/source/writer/EPUBPackage.hxx
+++ b/writerperfect/source/writer/EPUBPackage.hxx
@@ -13,7 +13,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -24,7 +24,8 @@ namespace writerperfect
 class EPUBPackage : public libepubgen::EPUBPackage
 {
 css::uno::Reference mxContext;
-css::uno::Reference mxStorage;
+css::uno::Reference mxStorage;
+css::uno::Reference mxOutputStream;
 
 public:
 explicit EPUBPackage(const 
css::uno::Reference , const 
css::uno::Sequence );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2017-08-07 Thread Miklos Vajna
 writerperfect/source/writer/EPUBExportFilter.cxx |   14 ++--
 writerperfect/source/writer/EPUBPackage.cxx  |4 +--
 writerperfect/source/writer/exp/xmlimp.cxx   |   26 +++
 writerperfect/source/writer/exp/xmlimp.hxx   |7 +-
 4 files changed, 37 insertions(+), 14 deletions(-)

New commits:
commit 7915f35d7fca5d0720d96954beaa97c00a2c3821
Author: Miklos Vajna 
Date:   Mon Aug 7 10:09:19 2017 +0200

EPUB export: implement doc/para open/close and text in doc handler

This should be enough for plain text of multiple paragraphs, but the
package part is still missing.

Change-Id: I05fe87fd01e078262a1be9ce76eaaa016de484bf
Reviewed-on: https://gerrit.libreoffice.org/40822
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index 75032cae6ada..2bfe9b8b0824 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -9,6 +9,8 @@
 
 #include "EPUBExportFilter.hxx"
 
+#include 
+
 #include 
 #include 
 #include 
@@ -30,16 +32,14 @@ EPUBExportFilter::EPUBExportFilter(const 
uno::Reference
 
 sal_Bool EPUBExportFilter::filter(const uno::Sequence 
)
 {
-// The package writes to the output file.
+// Build the export filter chain: the package has direct access to the ZIP
+// file, the flat ODF filter has access to the doc model, everything else
+// is in-between.
 EPUBPackage aPackage(mxContext, rDescriptor);
+libepubgen::EPUBTextGenerator aGenerator();
+uno::Reference xExportHandler(new 
exp::XMLImport(aGenerator));
 
-// Create ODT exporter, this will feed our document handler.
 uno::Reference 
xInitialization(mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.Writer.XMLOasisExporter",
 mxContext), uno::UNO_QUERY);
-
-// The document handler will make the calls on the text interface provided 
by the EPUB export.
-uno::Reference xExportHandler(new 
exp::XMLImport);
-
-// Let the ODT exporter read the doc model and invoke the doc handler.
 xInitialization->initialize({uno::makeAny(xExportHandler)});
 uno::Reference xExporter(xInitialization, 
uno::UNO_QUERY);
 xExporter->setSourceDocument(mxSourceDocument);
diff --git a/writerperfect/source/writer/EPUBPackage.cxx 
b/writerperfect/source/writer/EPUBPackage.cxx
index 0296b183327c..54300c2fbf0a 100644
--- a/writerperfect/source/writer/EPUBPackage.cxx
+++ b/writerperfect/source/writer/EPUBPackage.cxx
@@ -38,9 +38,9 @@ void EPUBPackage::closeElement(const char *pName)
 SAL_WARN("writerperfect", "EPUBPackage::closeElement, " << pName << ": 
implement me");
 }
 
-void EPUBPackage::insertCharacters(const librevenge::RVNGString 
&/*rCharacters*/)
+void EPUBPackage::insertCharacters(const librevenge::RVNGString )
 {
-SAL_WARN("writerperfect", "EPUBPackage::insertCharacters: implement me");
+SAL_WARN("writerperfect", "EPUBPackage::insertCharacters, " << 
rCharacters.cstr() << ": implement me");
 }
 
 void EPUBPackage::closeXMLFile()
diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index 1c915857413e..21c4809ffc57 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -16,28 +16,46 @@ namespace writerperfect
 namespace exp
 {
 
-XMLImport::XMLImport()
+XMLImport::XMLImport(librevenge::RVNGTextInterface )
+: mrGenerator(rGenerator)
 {
 }
 
 void XMLImport::startDocument()
 {
+mrGenerator.startDocument(librevenge::RVNGPropertyList());
 }
 
 void XMLImport::endDocument()
 {
+mrGenerator.endDocument();
 }
 
-void XMLImport::startElement(const OUString &/*rName*/, const 
css::uno::Reference &/*xAttribs*/)
+void XMLImport::startElement(const OUString , const 
css::uno::Reference &/*xAttribs*/)
 {
+if (rName == "text:p")
+{
+mrGenerator.openParagraph(librevenge::RVNGPropertyList());
+mbParagraphOpened = true;
+}
 }
 
-void XMLImport::endElement(const OUString &/*rName*/)
+void XMLImport::endElement(const OUString )
 {
+if (rName == "text:p")
+{
+mrGenerator.closeParagraph();
+mbParagraphOpened = false;
+}
 }
 
-void XMLImport::characters(const OUString &/*rChars*/)
+void XMLImport::characters(const OUString )
 {
+if (mbParagraphOpened)
+{
+OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
+mrGenerator.insertText(librevenge::RVNGString(sCharU8.getStr()));
+}
 }
 
 void XMLImport::ignorableWhitespace(const OUString &/*rWhitespaces*/)
diff --git a/writerperfect/source/writer/exp/xmlimp.hxx 
b/writerperfect/source/writer/exp/xmlimp.hxx
index 9d6d1eb4c0c6..2b1c743fcf03 100644
--- a/writerperfect/source/writer/exp/xmlimp.hxx
+++ 

[Libreoffice-commits] core.git: writerperfect/source

2017-08-01 Thread Miklos Vajna
 writerperfect/source/writer/EPUBExportFilter.cxx |   25 +--
 writerperfect/source/writer/EPUBExportFilter.hxx |4 ++-
 2 files changed, 22 insertions(+), 7 deletions(-)

New commits:
commit a0abb2f6a4e2392ce44634a58f3a5d1af1868499
Author: Miklos Vajna 
Date:   Tue Aug 1 15:09:03 2017 +0200

EPUB export: invoke the underlying ODT exporter

The document handler is still missing, though.

Change-Id: I26aa9c2211fafb311e297f48d4301c0c26ec8edf
Reviewed-on: https://gerrit.libreoffice.org/40636
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index d7fb0cac0e0d..36cff7ab9dd6 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -9,7 +9,9 @@
 
 #include "EPUBExportFilter.hxx"
 
+#include 
 #include 
+#include 
 
 #include 
 
@@ -18,14 +20,25 @@ using namespace com::sun::star;
 namespace writerperfect
 {
 
-EPUBExportFilter::EPUBExportFilter()
+EPUBExportFilter::EPUBExportFilter(const 
uno::Reference )
+: mxContext(xContext)
 {
 }
 
-sal_Bool EPUBExportFilter::filter(const uno::Sequence 
&/*rDescriptor*/)
+sal_Bool EPUBExportFilter::filter(const uno::Sequence 
)
 {
-SAL_WARN("writerperfect", "EPUBExportFilter::filter: implement me");
-return true;
+// Create ODT exporter, this will feed our document handler.
+uno::Reference 
xInitialization(mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.Writer.XMLOasisExporter",
 mxContext), uno::UNO_QUERY);
+
+// The document handler will make the calls on the text interface provided 
by the EPUB export.
+uno::Reference xExportHandler;
+
+// Let the ODT exporter read the doc model and invoke the doc handler.
+xInitialization->initialize({uno::makeAny(xExportHandler)});
+uno::Reference xExporter(xInitialization, 
uno::UNO_QUERY);
+xExporter->setSourceDocument(mxSourceDocument);
+uno::Reference xFilter(xInitialization, uno::UNO_QUERY);
+return xFilter->filter(rDescriptor);
 }
 
 void EPUBExportFilter::cancel()
@@ -56,9 +69,9 @@ uno::Sequence 
EPUBExportFilter::getSupportedServiceNames()
 return aRet;
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface *SAL_CALL 
com_sun_star_comp_Writer_EPUBExportFilter_get_implementation(uno::XComponentContext
 *, uno::Sequence const &)
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface *SAL_CALL 
com_sun_star_comp_Writer_EPUBExportFilter_get_implementation(uno::XComponentContext
 *pContext, uno::Sequence const &)
 {
-return cppu::acquire(new EPUBExportFilter);
+return cppu::acquire(new EPUBExportFilter(pContext));
 }
 
 } // namespace writerperfect
diff --git a/writerperfect/source/writer/EPUBExportFilter.hxx 
b/writerperfect/source/writer/EPUBExportFilter.hxx
index 101a4f85bf42..10f39dcfbef4 100644
--- a/writerperfect/source/writer/EPUBExportFilter.hxx
+++ b/writerperfect/source/writer/EPUBExportFilter.hxx
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace writerperfect
 {
@@ -27,10 +28,11 @@ class EPUBExportFilter : public cppu::WeakImplHelper
 css::lang::XServiceInfo
 >
 {
+css::uno::Reference mxContext;
 css::uno::Reference mxSourceDocument;
 
 public:
-EPUBExportFilter();
+EPUBExportFilter(const css::uno::Reference 
);
 
 // XFilter
 sal_Bool SAL_CALL filter(const 
css::uno::Sequence ) override;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2016-12-05 Thread Stephan Bergmann
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 9277bd24f22c6c2361d50f8b242cfef8d5573428
Author: Stephan Bergmann 
Date:   Mon Dec 5 14:34:50 2016 +0100

loplugin:unnecessaryoverride

Change-Id: I7721c15ba94ff27f64962bb67698853bc3b86cea

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index cca7fa2..cff8a02 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -69,11 +69,6 @@ public:
 {
 }
 
-//! destructor
-~FolderStream() override
-{
-}
-
 //! add a file
 void addFile(rtl::OUString const , std::string const )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2016-12-05 Thread Caolán McNamara
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e84e15b79cc0541323c01a1040e0cce96bd9032f
Author: Caolán McNamara 
Date:   Mon Dec 5 11:42:56 2016 +

fix build

Change-Id: I3fa46edfbdb75201e9dc4a615d67124487e2dd20

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index e46b869..cca7fa2 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -315,9 +315,9 @@ throw (css::uno::RuntimeException, std::exception)
 const uno::Reference 
xContentAccess(xResultSet, uno::UNO_QUERY_THROW);
 const uno::Reference xRow(xResultSet, 
uno::UNO_QUERY_THROW);
 INetURLObject aTmpUrl(sUrl);
-sWM3Name = aTmpUrl.getName(INetURLObject::LAST_SEGMENT, 
true, INetURLObject::DECODE_WITH_CHARSET);
+sWM3Name = aTmpUrl.getName(INetURLObject::LAST_SEGMENT, 
true, INetURLObject::DecodeMechanism::WithCharset);
 aTmpUrl.setExtension("FM3");
-const rtl::OUString  = 
aTmpUrl.getName(INetURLObject::LAST_SEGMENT, true, 
INetURLObject::DECODE_WITH_CHARSET);
+const rtl::OUString  = 
aTmpUrl.getName(INetURLObject::LAST_SEGMENT, true, 
INetURLObject::DecodeMechanism::WithCharset);
 do
 {
 const rtl::OUString (xRow->getString(1));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2016-10-19 Thread Giuseppe Castagno
 writerperfect/source/impress/KeynoteImportFilter.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 17b94a616d63759294a9530dca5139972172aadf
Author: Giuseppe Castagno 
Date:   Wed Oct 19 09:25:14 2016 +0200

tdf#103274 (9): Add default XCommandEnvironment reference

Change-Id: If1b7bc913e392f511caf0684baa5bc3ce2c6933d
Reviewed-on: https://gerrit.libreoffice.org/30035
Tested-by: Jenkins 
Reviewed-by: Giuseppe Castagno 

diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx 
b/writerperfect/source/impress/KeynoteImportFilter.cxx
index 1547d1d..cf274c8 100644
--- a/writerperfect/source/impress/KeynoteImportFilter.cxx
+++ b/writerperfect/source/impress/KeynoteImportFilter.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -132,7 +133,9 @@ throw(css::uno::RuntimeException, std::exception)
  */
 if (xContent.is())
 {
-ucbhelper::Content aContent(xContent, Reference< 
ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext());
+ucbhelper::Content aContent(xContent,
+
utl::UCBContentHelper::getDefaultCommandEnvironment(),
+comphelper::getProcessComponentContext());
 try
 {
 if (aContent.isFolder())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2016-03-01 Thread Sean Young
 writerperfect/source/writer/MSWorksImportFilter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f2bd96f7dd5225c2547889b55809701caf12d3c2
Author: Sean Young 
Date:   Mon Feb 29 18:57:07 2016 +

MS Write conversion should default to CP1252

2f7f818eeada83c0491dbf40253934d177c36621 "Add Microsoft Word for
DOS conversion" changed this to CP1251 by mistake.

Change-Id: I5d51d8518322a7e542ae8931cf7e72053d89f971
Reviewed-on: https://gerrit.libreoffice.org/22787
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx 
b/writerperfect/source/writer/MSWorksImportFilter.cxx
index de8f0a6..a4ca000 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -56,7 +56,7 @@ bool 
MSWorksImportFilter::doImportDocument(librevenge::RVNGInputStream ,
 break;
 case libwps::WPS_RESERVED_0: // MS Write
 title = WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_MSWRITE);
-encoding = "CP1251";
+encoding = "CP1252";
 break;
 case libwps::WPS_RESERVED_1: // DosWord
 title = WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_DOSWORD);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2015-10-08 Thread Caolán McNamara
 writerperfect/source/writer/WordPerfectImportFilter.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 64a252ffa9d0c30bec195a68c6837a0acdeca29a
Author: Caolán McNamara 
Date:   Thu Oct 8 11:18:33 2015 +0100

don't crash on loading abi13730-1.wpd

Change-Id: I3796f16c4df8cc055fb1a75b1583c5b959f02799

diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx 
b/writerperfect/source/writer/WordPerfectImportFilter.cxx
index cc38317..7bbb36f 100644
--- a/writerperfect/source/writer/WordPerfectImportFilter.cxx
+++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx
@@ -84,6 +84,9 @@ static bool handleEmbeddedWPGImage(const 
librevenge::RVNGBinaryData , libr
 if (!libwpg::WPGraphics::parse(input.getDataStream(), , 
fileFormat))
 return false;
 
+if (svgOutput.empty())
+return false;
+
 assert(1 == svgOutput.size());
 
 output.clear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2015-10-06 Thread Sean Young
 writerperfect/source/common/WPFTEncodingDialog.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 11c2d1e027503b03829f06ffd4bec5ac6ca38403
Author: Sean Young 
Date:   Mon Oct 5 09:54:01 2015 +0100

Add code pages introduced in libwps 0.4.2

Change-Id: Ice017ac5e15b786538604f7ff9ce8a9f3612e813
Reviewed-on: https://gerrit.libreoffice.org/19183
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/writerperfect/source/common/WPFTEncodingDialog.cxx 
b/writerperfect/source/common/WPFTEncodingDialog.cxx
index 1b6e11b..30c02c4 100644
--- a/writerperfect/source/common/WPFTEncodingDialog.cxx
+++ b/writerperfect/source/common/WPFTEncodingDialog.cxx
@@ -77,9 +77,14 @@ std::pair const 
s_encodings[] =
 {OUStringLiteral("CP862"), OUStringLiteral("Hebrew (DOS/OS2-862)")},
 {OUStringLiteral("CP1255"), OUStringLiteral("Hebrew (Windows-1255)")},
 {OUStringLiteral("CP500"), OUStringLiteral("International (DOS/OS2-500)")},
+{OUStringLiteral("CP932"), OUStringLiteral("Japanese (Windows-932)")},
 {OUStringLiteral("MacThai"), OUStringLiteral("Thai (Apple Macintosh)")},
 {OUStringLiteral("CP874"), OUStringLiteral("Thai (DOS/OS2-874)")},
 {
+OUStringLiteral("CP950"),
+OUStringLiteral("Traditional Chinese (Windows-950)")
+},
+{
 OUStringLiteral("MacTurkish"),
 OUStringLiteral("Turkish (Apple Macintosh)")
 },
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2015-09-19 Thread Riccardo Magliocchetti
 writerperfect/source/writer/MSWorksImportFilter.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 28fb7c92b4a471a754cb0a567e693eab91726d34
Author: Riccardo Magliocchetti 
Date:   Sat Sep 19 00:25:05 2015 +0200

Remove unused boost include

Change-Id: I1cc5d141bb89c574b0f3fd592f21aed82bc46019
Reviewed-on: https://gerrit.libreoffice.org/18710
Tested-by: Jenkins 
Reviewed-by: Riccardo Magliocchetti 

diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx 
b/writerperfect/source/writer/MSWorksImportFilter.cxx
index 35e4cb6..ff1e49d 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -9,7 +9,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
 #include 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2015-09-10 Thread Stephan Bergmann
 writerperfect/source/common/WPXSvInputStream.cxx |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit bb71e3a40067e4ef6c6879e6d26ad20f728dd822
Author: Stephan Bergmann 
Date:   Thu Sep 10 15:38:14 2015 +0200

This presumably wants to swallow exceptions from XSeekable::seek

...instead of doing a needless catch and re-throw

Change-Id: I1b1c593ac19a46aa7acfca753bc8177aa7a8ff12

diff --git a/writerperfect/source/common/WPXSvInputStream.cxx 
b/writerperfect/source/common/WPXSvInputStream.cxx
index d3befd0..84bcabb 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -60,12 +60,11 @@ PositionHolder::PositionHolder(const Reference 
)
 {
 }
 
-PositionHolder::~PositionHolder() try
-{
-mxSeekable->seek(mnPosition);
-}
-catch (...)
+PositionHolder::~PositionHolder()
 {
+try {
+mxSeekable->seek(mnPosition);
+} catch (...) {}
 }
 
 } // anonymous namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2015-06-19 Thread Stephan Bergmann
 writerperfect/source/common/WPFTEncodingDialog.cxx |  159 ++---
 1 file changed, 82 insertions(+), 77 deletions(-)

New commits:
commit 56813553a39716f710d1406cbc1c90435ca2e223
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Jun 19 15:54:22 2015 +0200

clean up

Change-Id: Ife8c272d2ac110c44908b0e248f0c53c0f477c06

diff --git a/writerperfect/source/common/WPFTEncodingDialog.cxx 
b/writerperfect/source/common/WPFTEncodingDialog.cxx
index f174cc0..2841be8 100644
--- a/writerperfect/source/common/WPFTEncodingDialog.cxx
+++ b/writerperfect/source/common/WPFTEncodingDialog.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include sal/config.h
+
+#include cstddef
+#include utility
+
 #include WPFTEncodingDialog.hxx
 
 namespace writerperfect
@@ -25,97 +30,97 @@ namespace writerperfect
 namespace
 {
 
-struct EncodingImplementation
-{
-
-static OUString const(s_encodings[]);
-
-static inline int numEncodings();
-static void insertEncodings(ListBox *box);
-static void selectEncoding(ListBox *box, const OUString encoding);
-static OUString getEncoding(ListBox *box);
+std::pairOUStringLiteral, OUStringLiteral const s_encodings[] = {
+{OUStringLiteral(MacArabic), OUStringLiteral(Arabic (Apple 
Macintosh))},
+{OUStringLiteral(CP864), OUStringLiteral(Arabic (DOS/OS2-864))},
+{OUStringLiteral(CP1006), OUStringLiteral(Arabic (IBM-1006))},
+{OUStringLiteral(CP1256), OUStringLiteral(Arabic (Windows-1256))},
+{OUStringLiteral(CP775), OUStringLiteral(Baltic (DOS/OS2-775))},
+{OUStringLiteral(CP1257), OUStringLiteral(Baltic (Windows-1257))},
+{OUStringLiteral(MacCeltic), OUStringLiteral(Celtic (Apple 
Macintosh))},
+{OUStringLiteral(MacCyrillic),
+ OUStringLiteral(Cyrillic (Apple Macintosh))},
+{OUStringLiteral(CP855), OUStringLiteral(Cyrillic (DOS/OS2-855))},
+{OUStringLiteral(CP866),
+ OUStringLiteral(Cyrillic (DOS/OS2-866/Russian))},
+{OUStringLiteral(CP1251), OUStringLiteral(Cyrillic (Windows-1251))},
+{OUStringLiteral(MacCEurope),
+ OUStringLiteral(Eastern Europe (Apple Macintosh))},
+{OUStringLiteral(MacCroatian),
+ OUStringLiteral(Eastern Europe (Apple Macintosh/Croatian))},
+{OUStringLiteral(MacRomanian),
+ OUStringLiteral(Eastern Europe (Apple Macintosh/Romanian))},
+{OUStringLiteral(CP852), OUStringLiteral(Eastern Europe 
(DOS/OS2-852))},
+{OUStringLiteral(CP1250),
+ OUStringLiteral(Eastern Europe (Windows-1250/WinLatin 2))},
+{OUStringLiteral(MacGreek), OUStringLiteral(Greek (Apple Macintosh))},
+{OUStringLiteral(CP737), OUStringLiteral(Greek (DOS/OS2-737))},
+{OUStringLiteral(CP869), OUStringLiteral(Greek (DOS/OS2-869/Greek-2))},
+{OUStringLiteral(CP875), OUStringLiteral(Greek (DOS/OS2-875))},
+{OUStringLiteral(CP1253), OUStringLiteral(Greek (Windows-1253))},
+{OUStringLiteral(MacHebrew), OUStringLiteral(Hebrew (Apple 
Macintosh))},
+{OUStringLiteral(CP424), OUStringLiteral(Hebrew (DOS/OS2-424))},
+{OUStringLiteral(CP856), OUStringLiteral(Hebrew (DOS/OS2-856))},
+{OUStringLiteral(CP862), OUStringLiteral(Hebrew (DOS/OS2-862))},
+{OUStringLiteral(CP1255), OUStringLiteral(Hebrew (Windows-1255))},
+{OUStringLiteral(CP500), OUStringLiteral(International (DOS/OS2-500))},
+{OUStringLiteral(MacThai), OUStringLiteral(Thai (Apple Macintosh))},
+{OUStringLiteral(CP874), OUStringLiteral(Thai (DOS/OS2-874))},
+{OUStringLiteral(MacTurkish),
+ OUStringLiteral(Turkish (Apple Macintosh))},
+{OUStringLiteral(CP857), OUStringLiteral(Turkish (DOS/OS2-857))},
+{OUStringLiteral(CP1026), OUStringLiteral(Turkish (DOS/OS2-1026))},
+{OUStringLiteral(CP1254), OUStringLiteral(Turkish (Windows-1254))},
+{OUStringLiteral(CP1258), OUStringLiteral(Vietnamese (Windows-1258))},
+{OUStringLiteral(MacRoman),
+ OUStringLiteral(Western Europe (Apple Macintosh))},
+{OUStringLiteral(MacIceland),
+ OUStringLiteral(Western Europe (Apple Macintosh/Icelandic))},
+{OUStringLiteral(CP037),
+ OUStringLiteral(Western Europe (DOS/OS2-037/US-Canada))},
+{OUStringLiteral(CP437),
+ OUStringLiteral(Western Europe (DOS/OS2-437/US))},
+{OUStringLiteral(CP850), OUStringLiteral(Western Europe 
(DOS/OS2-850))},
+{OUStringLiteral(CP860),
+ OUStringLiteral(Western Europe (DOS/OS2-860/Portuguese))},
+{OUStringLiteral(CP861),
+ OUStringLiteral(Western Europe (DOS/OS2-861/Icelandic))},
+{OUStringLiteral(CP863),
+ OUStringLiteral(Western Europe (DOS/OS2-863/French))},
+{OUStringLiteral(CP865),
+ OUStringLiteral(Western Europe (DOS/OS2-865/Nordic))},
+{OUStringLiteral(CP1252),
+ OUStringLiteral(Western Europe (Windows-1252/WinLatin 1))}
 };
 
-OUString const(EncodingImplementation::s_encodings[])=
-{
-OUString(MacArabic), OUString(Arabic (Apple Macintosh)),
-OUString(CP864), OUString(Arabic (DOS/OS2-864)),
-OUString(CP1006), 

[Libreoffice-commits] core.git: writerperfect/source

2015-05-21 Thread Stephan Bergmann
 writerperfect/source/writer/MSWorksImportFilter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dae9a386bacc08a55eda96e1e8925883a4fa494d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu May 21 16:46:08 2015 +0100

-fsanitize=bool (during CppunitTest_writerperfect_writer)

...as libwps::WPSDocument::isFileFormatSupported doesn't necessarily write 
false
into its needCharSetEncoding param (A flag set to true if we need the 
character
set encoding), whether or not that's a good idea.

Change-Id: Ib094a0fed84b6e6ff66e9b8a2524f55a60de64ef

diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx 
b/writerperfect/source/writer/MSWorksImportFilter.cxx
index 018f790..90bb62d 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -37,7 +37,7 @@ bool 
MSWorksImportFilter::doImportDocument(librevenge::RVNGInputStream rInput,
 {
 libwps::WPSKind kind = libwps::WPS_TEXT;
 libwps::WPSCreator creator;
-bool needEncoding;
+bool needEncoding = false;
 const libwps::WPSConfidence confidence = 
libwps::WPSDocument::isFileFormatSupported(rInput, kind, creator, 
needEncoding);
 
 std::string fileEncoding();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2015-05-19 Thread Stephan Bergmann
 writerperfect/source/common/WPFTEncodingDialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 685e30c3bdd010d09ac585bd621dd17149e5cb77
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue May 19 09:27:49 2015 +0200

loplugin:cstylecast

Change-Id: I0ef11bcb30bcfbecf5afe5c4c38391acc7b72968

diff --git a/writerperfect/source/common/WPFTEncodingDialog.cxx 
b/writerperfect/source/common/WPFTEncodingDialog.cxx
index 4e04304..fa0be53 100644
--- a/writerperfect/source/common/WPFTEncodingDialog.cxx
+++ b/writerperfect/source/common/WPFTEncodingDialog.cxx
@@ -114,7 +114,7 @@ void EncodingImplementation::selectEncoding(ListBox *box, 
const OUString *encodi
 
 OUString EncodingImplementation::getEncoding(ListBox *box)
 {
-sal_IntPtr pos=(sal_IntPtr) box-GetSelectEntryData();
+sal_IntPtr pos = reinterpret_castsal_IntPtr(box-GetSelectEntryData());
 if (pos0||pos=numEncodings())
 return OUString();
 return s_encodings[2*pos];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source writerperfect/uiconfig

2015-05-19 Thread Stephan Bergmann
 writerperfect/source/common/WPFTEncodingDialog.cxx |2 +-
 writerperfect/uiconfig/ui/wpftencodingdialog.ui|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b8f3b8fd99a0b7c784b0f361f0c28a663839695c
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue May 19 10:25:11 2015 +0200

Fix wpftencodingdialog.ui

Change-Id: I03430895a9289331bcbbd1f4a442dabddab5e751

diff --git a/writerperfect/source/common/WPFTEncodingDialog.cxx 
b/writerperfect/source/common/WPFTEncodingDialog.cxx
index f6afb90..4c69a77 100644
--- a/writerperfect/source/common/WPFTEncodingDialog.cxx
+++ b/writerperfect/source/common/WPFTEncodingDialog.cxx
@@ -126,7 +126,7 @@ WPFTEncodingDialog::WPFTEncodingDialog(
 vcl::Window *pParent,
 const OUString *pStrTitle,
 const OUString *encoding)
-:   ModalDialog(pParent, WPFTEncodingDialog, 
writerperfect/ui/WPFTEncodingDialog.ui),
+:   ModalDialog(pParent, WPFTEncodingDialog, 
writerperfect/ui/wpftencodingdialog.ui),
 m_pLbCharset(), m_pBtnOk(), m_pBtnCancel(), m_userHasCancelled(false)
 {
 get(m_pLbCharset, comboboxtext);
diff --git a/writerperfect/uiconfig/ui/wpftencodingdialog.ui 
b/writerperfect/uiconfig/ui/wpftencodingdialog.ui
index bf00869..8c47bf8 100644
--- a/writerperfect/uiconfig/ui/wpftencodingdialog.ui
+++ b/writerperfect/uiconfig/ui/wpftencodingdialog.ui
@@ -34,7 +34,7 @@
 /child
 child
   object class=GtkButton id=cancel
-property name=labelgtk-undo/property
+property name=labelgtk-cancel/property
 property name=visibleTrue/property
 property name=can_focusTrue/property
 property name=receives_defaultTrue/property
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2015-05-19 Thread Stephan Bergmann
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |3 ++-
 writerperfect/source/writer/MSWorksImportFilter.cxx   |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0a5f8dcdf2f1dcaf3e0ef1b626906f6496de6b23
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue May 19 10:28:49 2015 +0200

...assuming these want to actually catch css::uno::Exceptions

(which ones? or is this just needless cargo cult anyway?)

Change-Id: If1450d4f34acd1475eb71c49e0eaf99c40833a8e

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index f68b4a0..8d7dc75 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -68,8 +68,9 @@ bool 
MSWorksCalcImportFilter::doImportDocument(librevenge::RVNGInputStream rInp
 else if (pDlg-hasUserCalledCancel())
 return false;
 }
-catch (...)
+catch (css::uno::Exception  e)
 {
+SAL_WARN(writerperfect, ignoring Exception   e.Message);
 }
 }
 return libwps::WPS_OK == libwps::WPSDocument::parse(rInput, rGenerator, 
, fileEncoding.c_str());
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx 
b/writerperfect/source/writer/MSWorksImportFilter.cxx
index f06a21a..d5e0947 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -58,8 +58,9 @@ bool 
MSWorksImportFilter::doImportDocument(librevenge::RVNGInputStream rInput,
 return false;
 }
 }
-catch (...)
+catch (css::uno::Exception  e)
 {
+SAL_WARN(writerperfect, ignoring Exception   e.Message);
 }
 return libwps::WPS_OK == libwps::WPSDocument::parse(rInput, rGenerator, 
, fileEncoding.c_str());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2014-08-19 Thread Caolán McNamara
 writerperfect/source/common/WPXSvInputStream.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 83991055eed93bb0ad96e3690062798a57df6c74
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Aug 19 08:59:35 2014 +0100

can actually manage to ask createStream for missing streams

writerperfect::(anonymous 
namespace)::OLEStorageImpl::createStream(rtl::OUString const) 
(WPXSvInputStream.cxx:260)
writerperfect::WPXSvInputStreamImpl::getSubStreamByName(char const*) 
(WPXSvInputStream.cxx:201)
MWAWInputStream::unzipStream()
MWAWInputStream::MWAWInputStream

valgrind + bff

Change-Id: Iaecb8b7f05ed4369ddd37b34166dc3c3388ffb4d

diff --git a/writerperfect/source/common/WPXSvInputStream.cxx 
b/writerperfect/source/common/WPXSvInputStream.cxx
index 264dcc8..1f8d575 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -253,9 +253,8 @@ SotStorageStreamRef OLEStorageImpl::createStream(const 
rtl::OUString rPath)
 
 const OLEStorageMap_t::const_iterator aIt = maStorageMap.find(aDir);
 
-// We can only get there for paths that are present in the OLE.
-// Which means the storage must exist.
-assert(maStorageMap.end() != aIt);
+if (maStorageMap.end() == aIt)
+return 0;
 
 return aIt-second.ref-OpenSotStream(aName, STREAM_STD_READ);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2014-08-13 Thread osnola
 writerperfect/source/common/DocumentHandler.cxx |  103 +++-
 1 file changed, 102 insertions(+), 1 deletion(-)

New commits:
commit 46f52010e08ebc03c8a8efacd887b0ab526efaed
Author: osnola alo...@loria.fr
Date:   Wed Aug 13 09:52:05 2014 +0200

fdo#81787 attrs are already XML-encoded by libodfgen

Change-Id: Icee62e1ec9cee71930bcd52dbab850396fc96efa

diff --git a/writerperfect/source/common/DocumentHandler.cxx 
b/writerperfect/source/common/DocumentHandler.cxx
index be62978..d1224bf 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -20,6 +20,90 @@
 namespace writerperfect
 {
 
+static const unsigned char librvng_utf8_skip_data[256] =
+{
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1
+};
+
+#define librvng_utf8_next_char(p) (char const *)((p) + 
librvng_utf8_skip_data[*((unsigned char const *)p)])
+
+static void unescapeXML(const char *s, const unsigned long sz, 
librevenge::RVNGString res)
+{
+const char *p = s;
+const char *const end = p + sz;
+while (p != end)
+{
+const char *const next = librvng_utf8_next_char(p);
+if (next  end)
+{
+// oops, the string is invalid
+break;
+}
+if (p+4 = end  p+1==next  *p=='')
+{
+// look for amp; , lt; , gt; , apos; , quot;
+bool escapedChar=false;
+switch(*(p+1))
+{
+case 'a':
+if (p+5 = end  strncmp(p,amp;,5)==0)
+{
+res.append('');
+p+=5;
+escapedChar=true;
+}
+else if (p+6 = end  strncmp(p,apos;,6)==0)
+{
+res.append('\'');
+p+=6;
+escapedChar=true;
+}
+break;
+case 'g':
+if (strncmp(p,gt;,4)==0)
+{
+res.append('');
+p+=4;
+escapedChar=true;
+}
+break;
+case 'l':
+if (strncmp(p,lt;,4)==0)
+{
+res.append('');
+p+=4;
+escapedChar=true;
+}
+break;
+case 'q':
+if (p+6 = end  strncmp(p,quot;,6)==0)
+{
+res.append('');
+p+=6;
+escapedChar=true;
+}
+break;
+default:
+break;
+}
+if (escapedChar) continue;
+}
+
+while (p != next) {
+res.append(*p);
+++p;
+}
+p = next;
+}
+}
+
 using com::sun::star::uno::Reference;
 using com::sun::star::xml::sax::XAttributeList;
 using com::sun::star::xml::sax::XDocumentHandler;
@@ -49,8 +133,25 @@ void DocumentHandler::startElement(const char *psName, 
const librevenge::RVNGPro
 // filter out librevenge elements
 if (strncmp(i.key(), librevenge, 10) != 0)
 {
-OUString sName(i.key(), strlen(i.key()),  RTL_TEXTENCODING_UTF8);
+size_t keyLength=strlen(i.key());
+OUString sName(i.key(), keyLength,  RTL_TEXTENCODING_UTF8);
 OUString sValue(i()-getStr().cstr(), 
strlen(i()-getStr().cstr()), RTL_TEXTENCODING_UTF8);
+
+// libodfgen xml-encodes some attribute's value, so check if the 
value is encoded or not
+for (int j=0; j9; ++j) {
+// list of the encoded attributes followed by their lengths
+static char const *(listEncoded[9])={
+draw:name, svg:font-family, style:condition, 
style:num-prefix, style:num-suffix,
+table:formula, text:bullet-char, text:label, 
xlink:href
+};
+static size_t const 
(listEncodedLength[9])={9,15,15,16,16,13,16,10,10};
+if (keyLength==listEncodedLength[j]  strncmp(i.key(), 
listEncoded[j], keyLength)==0) {
+librevenge::RVNGString decodedValue();
+unescapeXML(i()-getStr().cstr(), (unsigned long) 
strlen(i()-getStr().cstr()), decodedValue);
+sValue=OUString(decodedValue.cstr(), 
strlen(decodedValue.cstr()), RTL_TEXTENCODING_UTF8);
+break;
+

[Libreoffice-commits] core.git: writerperfect/source

2014-06-07 Thread David Tardon
 writerperfect/source/common/DocumentHandler.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f18548eb689d9e5effe0ab7c01639b4d13e2f14d
Author: David Tardon dtar...@redhat.com
Date:   Sat Jun 7 19:03:21 2014 +0200

oops, libwpd - librevenge

Change-Id: I17562f0231d54ba46d009f3270af1d5e729f40a9

diff --git a/writerperfect/source/common/DocumentHandler.cxx 
b/writerperfect/source/common/DocumentHandler.cxx
index f36bb28..be62978 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -46,8 +46,8 @@ void DocumentHandler::startElement(const char *psName, const 
librevenge::RVNGPro
 librevenge::RVNGPropertyList::Iter i(xPropList);
 for (i.rewind(); i.next(); )
 {
-// filter out libwpd elements
-if (strncmp(i.key(), libwpd, 6) != 0)
+// filter out librevenge elements
+if (strncmp(i.key(), librevenge, 10) != 0)
 {
 OUString sName(i.key(), strlen(i.key()),  RTL_TEXTENCODING_UTF8);
 OUString sValue(i()-getStr().cstr(), 
strlen(i()-getStr().cstr()), RTL_TEXTENCODING_UTF8);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2014-04-24 Thread Tor Lillqvist
 writerperfect/source/draw/ImportFilterBase.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d6aa639fbb29ee93bc8229cea9a79e5d92dcfc1e
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Apr 24 19:14:16 2014 +0300

WaE: class 'PropertyValue' was previously declared as a struct

Change-Id: If3975942dcd53b5df6612d812f2f1f25fa666ab1

diff --git a/writerperfect/source/draw/ImportFilterBase.hxx 
b/writerperfect/source/draw/ImportFilterBase.hxx
index 7287a5a..0efdc64 100644
--- a/writerperfect/source/draw/ImportFilterBase.hxx
+++ b/writerperfect/source/draw/ImportFilterBase.hxx
@@ -23,7 +23,7 @@
 namespace com { namespace sun { namespace star {
 namespace beans
 {
-class PropertyValue;
+struct PropertyValue;
 }
 namespace lang
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2014-01-15 Thread Fridrich Štrba
 writerperfect/source/common/DocumentHandler.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 9e5e7c9b556bf9386fb5ad3ecd28b3d43aeeb393
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu Jan 16 08:25:42 2014 +0100

libodfgen produces strings in utf8 encoding

Change-Id: Iad17f4b4786473205669bd5b080b0a64d4a6a441
Reviewed-on: https://gerrit.libreoffice.org/7455
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/writerperfect/source/common/DocumentHandler.cxx 
b/writerperfect/source/common/DocumentHandler.cxx
index 4fd98da..073b942 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -41,17 +41,20 @@ void DocumentHandler::startElement(const char *psName, 
const WPXPropertyList xP
 // filter out libwpd elements
 if (strncmp(i.key(), libwpd, 6) != 0)
 {
-pAttrList-AddAttribute(OUString::createFromAscii(i.key()),
-
OUString::createFromAscii(i()-getStr().cstr()));
+OUString sName(i.key(), strlen(i.key()),  RTL_TEXTENCODING_UTF8);
+OUString sValue(i()-getStr().cstr(), 
strlen(i()-getStr().cstr()), RTL_TEXTENCODING_UTF8);
+pAttrList-AddAttribute(sName, sValue);
 }
 }
 
-mxHandler-startElement(OUString::createFromAscii(psName), xAttrList);
+OUString sElementName(psName, strlen(psName), RTL_TEXTENCODING_UTF8);
+mxHandler-startElement(sElementName, xAttrList);
 }
 
 void DocumentHandler::endElement(const char *psName)
 {
-mxHandler-endElement(OUString::createFromAscii(psName));
+OUString sElementName(psName, strlen(psName), RTL_TEXTENCODING_UTF8);
+mxHandler-endElement(sElementName);
 }
 
 void DocumentHandler::characters(const WPXString sCharacters)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2014-01-13 Thread David Tardon
 writerperfect/source/common/WPXSvStream.cxx |  436 +++-
 writerperfect/source/common/WPXSvStream.hxx |   12 
 2 files changed, 371 insertions(+), 77 deletions(-)

New commits:
commit e71d6067e38e961964a5bfb836f8ef8cccf22c6d
Author: David Tardon dtar...@redhat.com
Date:   Mon Jan 13 12:27:38 2014 +0100

prepare WPXSvInputStream for librevenge

Change-Id: Iefcfe00c2febbb00bcf093acf252291409929f1a

diff --git a/writerperfect/source/common/WPXSvStream.cxx 
b/writerperfect/source/common/WPXSvStream.cxx
index beaf702..bc9354b 100644
--- a/writerperfect/source/common/WPXSvStream.cxx
+++ b/writerperfect/source/common/WPXSvStream.cxx
@@ -8,21 +8,51 @@
  */
 
 #include WPXSvStream.hxx
+
+#include rtl/string.hxx
 #include tools/stream.hxx
 #include unotools/streamwrap.hxx
 #include unotools/ucbstreamhelper.hxx
+
 #include limits
 #include vector
 
+#include boost/scoped_ptr.hpp
+#include boost/unordered_map.hpp
+
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::io;
 
 namespace
 {
-static void splitPath( std::vectorOUString rElems, const OUString rPath )
+
+class PositionHolder
+{
+// disable copying
+PositionHolder(const PositionHolder );
+PositionHolder operator=(const PositionHolder );
+
+public:
+explicit PositionHolder(const ReferenceXSeekable rxSeekable);
+~PositionHolder();
+
+private:
+const ReferenceXSeekable mxSeekable;
+const sal_uInt64 mnPosition;
+};
+
+PositionHolder::PositionHolder(const ReferenceXSeekable rxSeekable)
+: mxSeekable(rxSeekable)
+, mnPosition(rxSeekable-getPosition())
+{
+}
+
+PositionHolder::~PositionHolder() try
+{
+mxSeekable-seek(mnPosition);
+}
+catch (...)
 {
-for (sal_Int32 i = 0; i = 0;)
-rElems.push_back( rPath.getToken( 0, '/', i ) );
 }
 
 } // anonymous namespace
@@ -37,6 +67,154 @@ typedef struct
 SotStorageStreamRef ref;
 } SotStorageStreamRefWrapper;
 
+namespace
+{
+
+const rtl::OUString concatPath(const rtl::OUString lhs, const rtl::OUString 
rhs)
+{
+if (lhs.isEmpty())
+return rhs;
+return lhs + / + rhs;
+}
+
+struct StreamData
+{
+explicit StreamData(const rtl::OString rName);
+
+SotStorageStreamRefWrapper stream;
+rtl::OString name;
+};
+
+typedef boost::unordered_maprtl::OUString, std::size_t, rtl::OUStringHash 
NameMap_t;
+typedef boost::unordered_maprtl::OUString, SotStorageRefWrapper, 
rtl::OUStringHash OLEStorageMap_t;
+
+struct OLEStorageImpl
+{
+OLEStorageImpl();
+
+void initialize(SvStream *pStream);
+
+SotStorageStreamRef getStream(const rtl::OUString rPath);
+SotStorageStreamRef getStream(std::size_t nId);
+
+private:
+void traverse(const SotStorageRef rStorage, const rtl::OUString rPath);
+
+SotStorageStreamRef createStream(const rtl::OUString rPath);
+
+public:
+boost::scoped_ptrSvStream mpStream;
+SotStorageRefWrapper mxRootStorage;
+OLEStorageMap_t maStorageMap;
+::std::vector StreamData  maStreams;
+NameMap_t maNameMap;
+bool mbInitialized;
+};
+
+StreamData::StreamData(const rtl::OString rName)
+: stream()
+, name(rName)
+{
+}
+
+OLEStorageImpl::OLEStorageImpl()
+: mpStream()
+, mxRootStorage()
+, maStorageMap()
+, maStreams()
+, maNameMap()
+, mbInitialized(false)
+{
+}
+
+void OLEStorageImpl::initialize(SvStream *const pStream)
+{
+if (!pStream)
+return;
+
+mpStream.reset(pStream);
+mxRootStorage.ref = new SotStorage( pStream, sal_True );
+
+traverse(mxRootStorage.ref, );
+
+mbInitialized = true;
+}
+
+SotStorageStreamRef OLEStorageImpl::getStream(const rtl::OUString rPath)
+{
+NameMap_t::iterator aIt = maNameMap.find(rPath);
+
+// For the while don't return stream in this situation.
+// Later, given how libcdr's zip stream implementation behaves,
+// return the first stream in the storage if there is one.
+if (maNameMap.end() == aIt)
+return SotStorageStreamRef();
+
+if (!maStreams[aIt-second].stream.ref.Is())
+maStreams[aIt-second].stream.ref = createStream(rPath);
+
+return maStreams[aIt-second].stream.ref;
+}
+
+SotStorageStreamRef OLEStorageImpl::getStream(const std::size_t nId)
+{
+if (!maStreams[nId].stream.ref.Is())
+maStreams[nId].stream.ref = 
createStream(rtl::OStringToOUString(maStreams[nId].name, 
RTL_TEXTENCODING_UTF8));
+
+return maStreams[nId].stream.ref;
+}
+
+void OLEStorageImpl::traverse(const SotStorageRef rStorage, const 
rtl::OUString rPath)
+{
+SvStorageInfoList infos;
+
+rStorage-FillInfoList(infos);
+
+for (SvStorageInfoList::const_iterator aIt = infos.begin(); infos.end() != 
aIt; ++aIt)
+{
+if (aIt-IsStream())
+{
+
maStreams.push_back(StreamData(rtl::OUStringToOString(aIt-GetName(), 
RTL_TEXTENCODING_UTF8)));
+maNameMap[concatPath(rPath, aIt-GetName())] = maStreams.size() - 
1;
+}
+else if (aIt-IsStorage())
+{
+const 

[Libreoffice-commits] core.git: writerperfect/source

2014-01-06 Thread Fridrich Štrba
 writerperfect/source/common/WPXSvStream.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 4b4a870b176cf5ff9ee84fc5b16f4df1d8eeef94
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Mon Jan 6 16:43:17 2014 +0100

Avoid some memcpy when not necessary

Change-Id: I9b838fc8392bc61be4ed911fb1423a1e97af2356

diff --git a/writerperfect/source/common/WPXSvStream.cxx 
b/writerperfect/source/common/WPXSvStream.cxx
index 3b33a17..86e835b 100644
--- a/writerperfect/source/common/WPXSvStream.cxx
+++ b/writerperfect/source/common/WPXSvStream.cxx
@@ -310,9 +310,7 @@ const unsigned char *WPXSvInputStream::read(unsigned long 
numBytes, unsigned lon
 mpImpl-mnReadBufferLength = mpImpl-mnLength - curpos;
 }
 else
-mpImpl-mnReadBufferLength = numBytes;
-
-mpImpl-seek((long) curpos);
+return mpImpl-read(numBytes, numBytesRead);
 
 mpImpl-mpReadBuffer = new unsigned char[mpImpl-mnReadBufferLength];
 unsigned long tmpNumBytes(0);
@@ -360,7 +358,7 @@ int WPXSvInputStream::seek(long offset, WPX_SEEK_TYPE 
seekType)
 if (tmpOffset  mpImpl-tell()  (unsigned long)tmpOffset = (unsigned 
long)mpImpl-tell() - mpImpl-mnReadBufferLength)
 {
 mpImpl-mnReadBufferPos = (unsigned long)(tmpOffset + (long) 
mpImpl-mnReadBufferLength - (long) mpImpl-tell());
-return 0;
+return retVal;
 }
 
 mpImpl-invalidateReadBuffer();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2014-01-06 Thread Fridrich Štrba
 writerperfect/source/common/WPXSvStream.cxx |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit 6404567b0ad3dab20f39eb93114a30f0b2016f31
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Mon Jan 6 19:06:03 2014 +0100

Avoid memcpy completely

Change-Id: I3d27935918930af71f02354696134def6bd052b6

diff --git a/writerperfect/source/common/WPXSvStream.cxx 
b/writerperfect/source/common/WPXSvStream.cxx
index 86e835b..beaf702 100644
--- a/writerperfect/source/common/WPXSvStream.cxx
+++ b/writerperfect/source/common/WPXSvStream.cxx
@@ -101,8 +101,6 @@ WPXSvInputStreamImpl::WPXSvInputStreamImpl( Reference 
XInputStream  xStream )
 
 WPXSvInputStreamImpl::~WPXSvInputStreamImpl()
 {
-if (mpReadBuffer)
-delete [] mpReadBuffer;
 }
 
 const unsigned char *WPXSvInputStreamImpl::read(unsigned long numBytes, 
unsigned long numBytesRead)
@@ -252,7 +250,6 @@ void WPXSvInputStreamImpl::invalidateReadBuffer()
 if (mpReadBuffer)
 {
 seek((long) tell() + (long)mnReadBufferPos - (long)mnReadBufferLength);
-delete [] mpReadBuffer;
 mpReadBuffer = 0;
 mnReadBufferPos = 0;
 mnReadBufferLength = 0;
@@ -310,11 +307,10 @@ const unsigned char *WPXSvInputStream::read(unsigned long 
numBytes, unsigned lon
 mpImpl-mnReadBufferLength = mpImpl-mnLength - curpos;
 }
 else
-return mpImpl-read(numBytes, numBytesRead);
+mpImpl-mnReadBufferLength = numBytes;
 
-mpImpl-mpReadBuffer = new unsigned char[mpImpl-mnReadBufferLength];
 unsigned long tmpNumBytes(0);
-const unsigned char *pTmp = mpImpl-read(mpImpl-mnReadBufferLength, 
tmpNumBytes);
+mpImpl-mpReadBuffer = const_castunsigned 
char*(mpImpl-read(mpImpl-mnReadBufferLength, tmpNumBytes));
 if (tmpNumBytes != mpImpl-mnReadBufferLength)
 mpImpl-mnReadBufferLength = tmpNumBytes;
 
@@ -325,7 +321,6 @@ const unsigned char *WPXSvInputStream::read(unsigned long 
numBytes, unsigned lon
 numBytesRead = numBytes;
 
 mpImpl-mnReadBufferPos += numBytesRead;
-memcpy(mpImpl-mpReadBuffer, pTmp, mpImpl-mnReadBufferLength);
 return const_castconst unsigned char *(mpImpl-mpReadBuffer);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2013-12-20 Thread Fridrich Štrba
 writerperfect/source/common/WPXSvStream.cxx |  157 ++--
 1 file changed, 125 insertions(+), 32 deletions(-)

New commits:
commit c56c2e28ff4252aa858826416a8a57cb8c2bf100
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri Dec 20 14:49:06 2013 +0100

Buffered WPXSvInputStream

Change-Id: I8bb2632cb018093d02e21090e77bb48364f99268
Reviewed-on: https://gerrit.libreoffice.org/7146
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/writerperfect/source/common/WPXSvStream.cxx 
b/writerperfect/source/common/WPXSvStream.cxx
index dd35311..c803632 100644
--- a/writerperfect/source/common/WPXSvStream.cxx
+++ b/writerperfect/source/common/WPXSvStream.cxx
@@ -37,7 +37,7 @@ typedef struct
 SotStorageStreamRef ref;
 } SotStorageStreamRefWrapper;
 
-class WPXSvInputStreamImpl : public WPXInputStream
+class WPXSvInputStreamImpl
 {
 public :
 WPXSvInputStreamImpl( ::com::sun::star::uno::Reference
@@ -48,27 +48,35 @@ public :
 WPXInputStream * getDocumentOLEStream(const char *name);
 
 const unsigned char *read(unsigned long numBytes, unsigned long 
numBytesRead);
-int seek(long offset, WPX_SEEK_TYPE seekType);
+int seek(long offset);
 long tell();
 bool atEOS();
+void invalidateReadBuffer();
 private:
 ::std::vector SotStorageRefWrapper  mxChildrenStorages;
 ::std::vector SotStorageStreamRefWrapper  mxChildrenStreams;
 ::com::sun::star::uno::Reference
-::com::sun::star::io::XInputStream  mxStream;
+::com::sun::star::io::XInputStream  mxStream;
 ::com::sun::star::uno::Reference
-::com::sun::star::io::XSeekable  mxSeekable;
+::com::sun::star::io::XSeekable  mxSeekable;
 ::com::sun::star::uno::Sequence sal_Int8  maData;
+public:
 sal_Int64 mnLength;
+unsigned char *mpReadBuffer;
+unsigned long mnReadBufferLength;
+unsigned long mnReadBufferPos;
 };
 
 WPXSvInputStreamImpl::WPXSvInputStreamImpl( Reference XInputStream  xStream 
) :
-WPXInputStream(),
 mxChildrenStorages(),
 mxChildrenStreams(),
 mxStream(xStream),
 mxSeekable(xStream, UNO_QUERY),
-maData(0)
+maData(0),
+mnLength(0),
+mpReadBuffer(0),
+mnReadBufferLength(0),
+mnReadBufferPos(0)
 {
 if (!xStream.is() || !mxStream.is())
 mnLength = 0;
@@ -93,6 +101,8 @@ WPXSvInputStreamImpl::WPXSvInputStreamImpl( Reference 
XInputStream  xStream )
 
 WPXSvInputStreamImpl::~WPXSvInputStreamImpl()
 {
+if (mpReadBuffer)
+delete [] mpReadBuffer;
 }
 
 const unsigned char *WPXSvInputStreamImpl::read(unsigned long numBytes, 
unsigned long numBytesRead)
@@ -122,7 +132,7 @@ long WPXSvInputStreamImpl::tell()
 }
 }
 
-int WPXSvInputStreamImpl::seek(long offset, WPX_SEEK_TYPE seekType)
+int WPXSvInputStreamImpl::seek(long offset)
 {
 if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
 return -1;
@@ -131,28 +141,10 @@ int WPXSvInputStreamImpl::seek(long offset, WPX_SEEK_TYPE 
seekType)
 if ((tmpPosition  0) || (tmpPosition  
(std::numeric_limitslong::max)()))
 return -1;
 
-sal_Int64 tmpOffset = offset;
-if (seekType == WPX_SEEK_CUR)
-tmpOffset += tmpPosition;
-if (seekType == WPX_SEEK_END)
-tmpOffset += mnLength;
-
-int retVal = 0;
-if (tmpOffset  0)
-{
-tmpOffset = 0;
-retVal = -1;
-}
-if (tmpOffset  mnLength)
-{
-tmpOffset = mnLength;
-retVal = -1;
-}
-
 try
 {
-mxSeekable-seek(tmpOffset);
-return retVal;
+mxSeekable-seek(offset);
+return 0;
 }
 catch (...)
 {
@@ -255,6 +247,18 @@ WPXInputStream 
*WPXSvInputStreamImpl::getDocumentOLEStream(const char *name)
 }
 
 
+void WPXSvInputStreamImpl::invalidateReadBuffer()
+{
+if (mpReadBuffer)
+{
+seek((long) tell() + (long)mnReadBufferPos - (long)mnReadBufferLength);
+delete [] mpReadBuffer;
+mpReadBuffer = 0;
+mnReadBufferPos = 0;
+mnReadBufferLength = 0;
+}
+}
+
 WPXSvInputStream::WPXSvInputStream( Reference XInputStream  xStream ) :
 mpImpl(new WPXSvInputStreamImpl(xStream))
 {
@@ -262,36 +266,125 @@ WPXSvInputStream::WPXSvInputStream( Reference 
XInputStream  xStream ) :
 
 WPXSvInputStream::~WPXSvInputStream()
 {
-   delete mpImpl;
+   if (mpImpl)
+   delete mpImpl;
 }
 
+#define BUFFER_MAX 65536
+
 const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned 
long numBytesRead)
 {
-return mpImpl-read(numBytes, numBytesRead);
+numBytesRead = 0;
+
+if (numBytes == 0 || numBytes  (std::numeric_limitsunsigned 
long::max)()/2)
+return 0;
+
+if (mpImpl-mpReadBuffer)
+{
+if ((mpImpl-mnReadBufferPos + numBytes  mpImpl-mnReadBufferPos)  
(mpImpl-mnReadBufferPos + numBytes = mpImpl-mnReadBufferLength))
+{
+const unsigned char *pTmp = mpImpl-mpReadBuffer + 

[Libreoffice-commits] core.git: writerperfect/source

2013-12-20 Thread Fridrich Štrba
 writerperfect/source/common/WPXSvStream.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit c85456b01bd8dd12792b76fb393f893496461c5c
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri Dec 20 16:36:53 2013 +0100

Simplify this condition a bit

Change-Id: Iceef995be9ff55306550e56a0be87dddab7a78c3

diff --git a/writerperfect/source/common/WPXSvStream.cxx 
b/writerperfect/source/common/WPXSvStream.cxx
index c803632..3b33a17 100644
--- a/writerperfect/source/common/WPXSvStream.cxx
+++ b/writerperfect/source/common/WPXSvStream.cxx
@@ -365,10 +365,9 @@ int WPXSvInputStream::seek(long offset, WPX_SEEK_TYPE 
seekType)
 
 mpImpl-invalidateReadBuffer();
 
-int retVal2 = mpImpl-seek(tmpOffset);
-if (retVal)
-return retVal;
-return retVal2;
+if (mpImpl-seek(tmpOffset))
+return -1;
+return retVal;
 }
 
 bool WPXSvInputStream::atEOS()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2013-07-25 Thread Fridrich Štrba
 writerperfect/source/common/WPXSvStream.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 93d0e38ccc06060f20073a9461c53f471a1b9c03
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu Jul 25 15:43:58 2013 +0200

Use inconditionally the libwpd = 0.9.5 path

Since libwpd does not output the version number anymore

Change-Id: I1bc3f7081552795fc2ed33f033a093fa5b40fda8

diff --git a/writerperfect/source/common/WPXSvStream.cxx 
b/writerperfect/source/common/WPXSvStream.cxx
index a79ac6c..e0c8d8c 100644
--- a/writerperfect/source/common/WPXSvStream.cxx
+++ b/writerperfect/source/common/WPXSvStream.cxx
@@ -134,12 +134,8 @@ int WPXSvInputStreamImpl::seek(long offset, WPX_SEEK_TYPE 
seekType)
 sal_Int64 tmpOffset = offset;
 if (seekType == WPX_SEEK_CUR)
 tmpOffset += tmpPosition;
-#if defined(LIBWPD_STREAM_VERSION_MAJOR)  
defined(LIBWPD_STREAM_VERSION_MINOR)  defined(LIBWPD_STREAM_VERSION_REVISION) 
\
- (LIBWPD_STREAM_VERSION_MAJOR  0 || (LIBWPD_STREAM_VERSION_MAJOR == 0 
 (LIBWPD_STREAM_VERSION_MINOR  9 \
-|| (LIBWPD_STREAM_VERSION_MINOR == 9  LIBWPD_STREAM_VERSION_REVISION = 
5
 if (seekType == WPX_SEEK_END)
 tmpOffset += mnLength;
-#endif
 
 int retVal = 0;
 if (tmpOffset  0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source writerperfect/StaticLibrary_writerperfect.mk

2013-05-02 Thread Fridrich Štrba
 writerperfect/StaticLibrary_writerperfect.mk|   26 
 writerperfect/source/common/DocumentElement.cxx |   55 
 writerperfect/source/common/DocumentElement.hxx |   86 
 writerperfect/source/common/DocumentHandler.cxx |   64 
 writerperfect/source/common/DocumentHandler.hxx |   48 
 writerperfect/source/common/FilterInternal.cxx  |   29 
 writerperfect/source/common/FilterInternal.hxx  |   63 
 writerperfect/source/common/FontStyle.cxx   |   74 
 writerperfect/source/common/FontStyle.hxx   |   65 
 writerperfect/source/common/InternalHandler.cxx |   44 
 writerperfect/source/common/InternalHandler.hxx |   38 
 writerperfect/source/common/ListStyle.cxx   |  178 +
 writerperfect/source/common/ListStyle.hxx   |   69 
 writerperfect/source/common/OdfDocumentHandler.hxx  |   28 
 writerperfect/source/common/OdgGenerator.cxx| 1756 
 writerperfect/source/common/OdgGenerator.hxx|   56 
 writerperfect/source/common/OdtGenerator.cxx| 1482 +
 writerperfect/source/common/OdtGenerator.hxx|  105 
 writerperfect/source/common/PageSpan.cxx|  247 ++
 writerperfect/source/common/PageSpan.hxx|   48 
 writerperfect/source/common/SectionStyle.cxx|   75 
 writerperfect/source/common/SectionStyle.hxx|   35 
 writerperfect/source/common/Style.hxx   |   77 
 writerperfect/source/common/TableStyle.cxx  |  156 +
 writerperfect/source/common/TableStyle.hxx  |   78 
 writerperfect/source/common/TextRunStyle.cxx|  279 ++
 writerperfect/source/common/TextRunStyle.hxx|  116 +
 writerperfect/source/common/WPXSvStream.cxx |  303 ++
 writerperfect/source/common/WPXSvStream.hxx |   42 
 writerperfect/source/draw/CDRImportFilter.cxx   |6 
 writerperfect/source/draw/CMXImportFilter.cxx   |6 
 writerperfect/source/draw/MSPUBImportFilter.cxx |6 
 writerperfect/source/draw/VisioImportFilter.cxx |6 
 writerperfect/source/draw/WPGImportFilter.cxx   |6 
 writerperfect/source/filter/DocumentElement.cxx |   55 
 writerperfect/source/filter/DocumentElement.hxx |   86 
 writerperfect/source/filter/DocumentHandler.cxx |   82 
 writerperfect/source/filter/DocumentHandler.hxx |   48 
 writerperfect/source/filter/FilterInternal.cxx  |   29 
 writerperfect/source/filter/FilterInternal.hxx  |   63 
 writerperfect/source/filter/FontStyle.cxx   |   74 
 writerperfect/source/filter/FontStyle.hxx   |   65 
 writerperfect/source/filter/InternalHandler.cxx |   44 
 writerperfect/source/filter/InternalHandler.hxx |   38 
 writerperfect/source/filter/ListStyle.cxx   |  178 -
 writerperfect/source/filter/ListStyle.hxx   |   69 
 writerperfect/source/filter/OdfDocumentHandler.hxx  |   28 
 writerperfect/source/filter/OdgGenerator.cxx| 1756 
 writerperfect/source/filter/OdgGenerator.hxx|   56 
 writerperfect/source/filter/OdtGenerator.cxx| 1482 -
 writerperfect/source/filter/OdtGenerator.hxx|  105 
 writerperfect/source/filter/PageSpan.cxx|  247 --
 writerperfect/source/filter/PageSpan.hxx|   48 
 writerperfect/source/filter/SectionStyle.cxx|   75 
 writerperfect/source/filter/SectionStyle.hxx|   35 
 writerperfect/source/filter/Style.hxx   |   77 
 writerperfect/source/filter/TableStyle.cxx  |  156 -
 writerperfect/source/filter/TableStyle.hxx  |   78 
 writerperfect/source/filter/TextRunStyle.cxx|  279 --
 writerperfect/source/filter/TextRunStyle.hxx|  116 -
 writerperfect/source/stream/WPXSvStream.cxx |  303 --
 writerperfect/source/stream/WPXSvStream.h   |   42 
 writerperfect/source/writer/MSWorksImportFilter.cxx |8 
 writerperfect/source/writer/MWAWImportFilter.cxx|8 
 writerperfect/source/writer/WordPerfectImportFilter.cxx |   10 
 65 files changed, 5737 insertions(+), 5755 deletions(-)

New commits:
commit e1ffd555b5c70e4bdc693711917ebffbb2423579
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu May 2 15:04:05 2013 +0200

simplify writerperfect structure and prepare for libodfgen

Change-Id: Ib2e56280a5a6bfdfee18a5b213dd67b9fbfc8949

diff --git a/writerperfect/StaticLibrary_writerperfect.mk 
b/writerperfect/StaticLibrary_writerperfect.mk
index a936e4e..e82fd0e 100644
--- a/writerperfect/StaticLibrary_writerperfect.mk
+++ b/writerperfect/StaticLibrary_writerperfect.mk
@@ -36,19 +36,19 @@ $(eval $(call gb_StaticLibrary_use_api,writerperfect,\
 ))
 
 $(eval $(call 

[Libreoffice-commits] core.git: writerperfect/source

2013-04-18 Thread Fridrich Štrba
 writerperfect/source/stream/WPXSvStream.cxx |   93 +---
 writerperfect/source/stream/WPXSvStream.h   |   19 -
 2 files changed, 87 insertions(+), 25 deletions(-)

New commits:
commit 9d5276b3fb2de81d56e698cc8d32b2869cfb3c55
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu Apr 18 11:44:19 2013 +0200

PImpl the WPXSvInputStream class

Change-Id: I11a3d663e2f5a8f68edd66b7ba2af15cc57287a9

diff --git a/writerperfect/source/stream/WPXSvStream.cxx 
b/writerperfect/source/stream/WPXSvStream.cxx
index 640ab20..81d6b1b 100644
--- a/writerperfect/source/stream/WPXSvStream.cxx
+++ b/writerperfect/source/stream/WPXSvStream.cxx
@@ -13,6 +13,7 @@
 #include unotools/streamwrap.hxx
 #include unotools/ucbstreamhelper.hxx
 #include limits
+#include vector
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::io;
@@ -27,7 +28,42 @@ static void splitPath( std::vectorOUString rElems, const 
OUString rPath )
 
 } // anonymous namespace
 
-WPXSvInputStream::WPXSvInputStream( Reference XInputStream  xStream ) :
+typedef struct
+{
+SotStorageRef ref;
+} SotStorageRefWrapper;
+
+typedef struct
+{
+SotStorageStreamRef ref;
+} SotStorageStreamRefWrapper;
+
+class WPXSvInputStreamImpl : public WPXInputStream
+{
+public :
+WPXSvInputStreamImpl( ::com::sun::star::uno::Reference
+  ::com::sun::star::io::XInputStream  xStream );
+~WPXSvInputStreamImpl();
+
+bool isOLEStream();
+WPXInputStream * getDocumentOLEStream(const char *name);
+
+const unsigned char *read(unsigned long numBytes, unsigned long 
numBytesRead);
+int seek(long offset, WPX_SEEK_TYPE seekType);
+long tell();
+bool atEOS();
+private:
+::std::vector SotStorageRefWrapper  mxChildrenStorages;
+::std::vector SotStorageStreamRefWrapper  mxChildrenStreams;
+::com::sun::star::uno::Reference
+::com::sun::star::io::XInputStream  mxStream;
+::com::sun::star::uno::Reference
+::com::sun::star::io::XSeekable  mxSeekable;
+::com::sun::star::uno::Sequence sal_Int8  maData;
+sal_Int64 mnLength;
+};
+
+WPXSvInputStreamImpl::WPXSvInputStreamImpl( Reference XInputStream  xStream 
) :
 WPXInputStream(),
 mxChildrenStorages(),
 mxChildrenStreams(),
@@ -56,11 +92,11 @@ WPXSvInputStream::WPXSvInputStream( Reference XInputStream 
 xStream ) :
 }
 }
 
-WPXSvInputStream::~WPXSvInputStream()
+WPXSvInputStreamImpl::~WPXSvInputStreamImpl()
 {
 }
 
-const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned 
long numBytesRead)
+const unsigned char *WPXSvInputStreamImpl::read(unsigned long numBytes, 
unsigned long numBytesRead)
 {
 numBytesRead = 0;
 
@@ -74,7 +110,7 @@ const unsigned char *WPXSvInputStream::read(unsigned long 
numBytes, unsigned lon
 return (const unsigned char *)maData.getConstArray();
 }
 
-long WPXSvInputStream::tell()
+long WPXSvInputStreamImpl::tell()
 {
 if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
 return -1L;
@@ -87,7 +123,7 @@ long WPXSvInputStream::tell()
 }
 }
 
-int WPXSvInputStream::seek(long offset, WPX_SEEK_TYPE seekType)
+int WPXSvInputStreamImpl::seek(long offset, WPX_SEEK_TYPE seekType)
 {
 if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
 return -1;
@@ -130,14 +166,14 @@ int WPXSvInputStream::seek(long offset, WPX_SEEK_TYPE 
seekType)
 }
 }
 
-bool WPXSvInputStream::atEOS()
+bool WPXSvInputStreamImpl::atEOS()
 {
 if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
 return true;
 return (mxSeekable-getPosition() = mnLength);
 }
 
-bool WPXSvInputStream::isOLEStream()
+bool WPXSvInputStreamImpl::isOLEStream()
 {
 if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
 return false;
@@ -155,7 +191,7 @@ bool WPXSvInputStream::isOLEStream()
 return bAns;
 }
 
-WPXInputStream *WPXSvInputStream::getDocumentOLEStream(const char *name)
+WPXInputStream *WPXSvInputStreamImpl::getDocumentOLEStream(const char *name)
 {
 if (!name)
 return 0;
@@ -223,4 +259,45 @@ WPXInputStream 
*WPXSvInputStream::getDocumentOLEStream(const char *name)
 return 0;
 }
 
+
+WPXSvInputStream::WPXSvInputStream( Reference XInputStream  xStream ) :
+mpImpl(new WPXSvInputStreamImpl(xStream))
+{
+}
+
+WPXSvInputStream::~WPXSvInputStream()
+{
+   delete mpImpl;
+}
+
+const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned 
long numBytesRead)
+{
+return mpImpl-read(numBytes, numBytesRead);
+}
+
+long WPXSvInputStream::tell()
+{
+return mpImpl-tell();
+}
+
+int WPXSvInputStream::seek(long offset, WPX_SEEK_TYPE seekType)
+{
+return mpImpl-seek(offset, seekType);
+}
+
+bool WPXSvInputStream::atEOS()
+{
+return mpImpl-atEOS();
+}
+
+bool WPXSvInputStream::isOLEStream()
+{
+return mpImpl-isOLEStream();
+}
+
+WPXInputStream *WPXSvInputStream::getDocumentOLEStream(const char *name)
+{
+return 

[Libreoffice-commits] core.git: writerperfect/source

2013-03-19 Thread Fridrich Štrba
 writerperfect/source/draw/CDRImportFilter.cxx   |5 --
 writerperfect/source/draw/CDRImportFilter.hxx   |   16 
 writerperfect/source/draw/CMXImportFilter.cxx   |4 --
 writerperfect/source/draw/CMXImportFilter.hxx   |   16 
 writerperfect/source/draw/MSPUBImportFilter.cxx |4 --
 writerperfect/source/draw/MSPUBImportFilter.hxx |   16 
 writerperfect/source/draw/VisioImportFilter.cxx |4 --
 writerperfect/source/draw/VisioImportFilter.hxx |   16 
 writerperfect/source/draw/WPGImportFilter.cxx   |3 -
 writerperfect/source/draw/WPGImportFilter.hxx   |   16 
 writerperfect/source/filter/DocumentHandler.cxx |3 -
 writerperfect/source/stream/WPXSvStream.cxx |6 +--
 writerperfect/source/writer/MSWorksImportFilter.cxx |6 ---
 writerperfect/source/writer/MSWorksImportFilter.hxx |   16 
 writerperfect/source/writer/MWAWImportFilter.cxx|6 ---
 writerperfect/source/writer/MWAWImportFilter.hxx|   16 
 writerperfect/source/writer/WordPerfectImportFilter.cxx |3 -
 writerperfect/source/writer/WordPerfectImportFilter.hxx |   32 
 18 files changed, 82 insertions(+), 106 deletions(-)

New commits:
commit 3dfff2ea4678105a186ce9ca4a038458a57c727e
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Tue Mar 19 09:54:00 2013 +0100

::rtl::OUString - OUString in writerperfect

Change-Id: I2d0f8868779e5ac4a802f3f061704d2de5826c5d

diff --git a/writerperfect/source/draw/CDRImportFilter.cxx 
b/writerperfect/source/draw/CDRImportFilter.cxx
index ba2d19d..1a66c98 100644
--- a/writerperfect/source/draw/CDRImportFilter.cxx
+++ b/writerperfect/source/draw/CDRImportFilter.cxx
@@ -38,9 +38,6 @@ using com::sun::star::uno::Reference;
 using com::sun::star::io::XInputStream;
 using com::sun::star::io::XSeekable;
 using com::sun::star::uno::Sequence;
-using namespace ::rtl;
-using rtl::OString;
-using rtl::OUString;
 using com::sun::star::uno::Any;
 using com::sun::star::uno::UNO_QUERY;
 using com::sun::star::uno::XInterface;
@@ -134,7 +131,7 @@ throw( com::sun::star::uno::RuntimeException )
 }
 
 if (!xInputStream.is())
-return ::rtl::OUString();
+return OUString();
 
 WPXSvInputStream input( xInputStream );
 
diff --git a/writerperfect/source/draw/CDRImportFilter.hxx 
b/writerperfect/source/draw/CDRImportFilter.hxx
index 95189e8..efdfae8 100644
--- a/writerperfect/source/draw/CDRImportFilter.hxx
+++ b/writerperfect/source/draw/CDRImportFilter.hxx
@@ -38,7 +38,7 @@ protected:
 // oo.org declares
 ::com::sun::star::uno::Reference ::com::sun::star::uno::XComponentContext 
 mxContext;
 ::com::sun::star::uno::Reference ::com::sun::star::lang::XComponent  
mxDoc;
-::rtl::OUString msFilterName;
+OUString msFilterName;
 ::com::sun::star::uno::Reference 
::com::sun::star::xml::sax::XDocumentHandler  mxHandler;
 
 public:
@@ -57,7 +57,7 @@ public:
 throw (::com::sun::star::lang::IllegalArgumentException, 
::com::sun::star::uno::RuntimeException);
 
 //XExtendedFilterDetection
-virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence 
com::sun::star::beans::PropertyValue  Descriptor )
+virtual OUString SAL_CALL detect( com::sun::star::uno::Sequence 
com::sun::star::beans::PropertyValue  Descriptor )
 throw( com::sun::star::uno::RuntimeException );
 
 // XInitialization
@@ -65,22 +65,22 @@ public:
 throw (::com::sun::star::uno::Exception, 
::com::sun::star::uno::RuntimeException);
 
 // XServiceInfo
-virtual ::rtl::OUString SAL_CALL getImplementationName(  )
+virtual OUString SAL_CALL getImplementationName(  )
 throw (::com::sun::star::uno::RuntimeException);
-virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString 
ServiceName )
+virtual sal_Bool SAL_CALL supportsService( const OUString ServiceName )
 throw (::com::sun::star::uno::RuntimeException);
-virtual ::com::sun::star::uno::Sequence ::rtl::OUString  SAL_CALL 
getSupportedServiceNames(  )
+virtual ::com::sun::star::uno::Sequence OUString  SAL_CALL 
getSupportedServiceNames(  )
 throw (::com::sun::star::uno::RuntimeException);
 
 };
 
-::rtl::OUString CDRImportFilter_getImplementationName()
+OUString CDRImportFilter_getImplementationName()
 throw ( ::com::sun::star::uno::RuntimeException );
 
-sal_Bool SAL_CALL CDRImportFilter_supportsService( const ::rtl::OUString 
ServiceName )
+sal_Bool SAL_CALL CDRImportFilter_supportsService( const OUString ServiceName 
)
 throw ( ::com::sun::star::uno::RuntimeException );
 
-::com::sun::star::uno::Sequence ::rtl::OUString  SAL_CALL 
CDRImportFilter_getSupportedServiceNames(  )
+::com::sun::star::uno::Sequence OUString  SAL_CALL 
CDRImportFilter_getSupportedServiceNames(  )
 throw ( ::com::sun::star::uno::RuntimeException );
 
 ::com::sun::star::uno::Reference 

[Libreoffice-commits] core.git: writerperfect/source

2013-03-14 Thread Michael Stahl
 writerperfect/source/writer/MWAWImportFilter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2968fbc470c32ac15d29b7c704c90e49b95d6658
Author: Michael Stahl mst...@redhat.com
Date:   Thu Mar 14 17:32:26 2013 +0100

spurious warning C4701: potentially uninitialized local variable

Change-Id: I6da0eb82ad6175e8b7eb70affa5f7cf0b05252f7

diff --git a/writerperfect/source/writer/MWAWImportFilter.cxx 
b/writerperfect/source/writer/MWAWImportFilter.cxx
index c282a33..7c1d823 100644
--- a/writerperfect/source/writer/MWAWImportFilter.cxx
+++ b/writerperfect/source/writer/MWAWImportFilter.cxx
@@ -257,7 +257,7 @@ bool MWAWObjectHandlerInternal::Shape::read(const char 
*psName, WPXPropertyList
 }
 else readOk = false;
 
-long w;
+long w(0);
 if (readOk)
 {
 char *res;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2013-03-01 Thread Fridrich Štrba
 writerperfect/source/draw/CDRImportFilter.cxx   |7 ++--
 writerperfect/source/draw/CMXImportFilter.cxx   |8 ++---
 writerperfect/source/draw/MSPUBImportFilter.cxx |8 ++---
 writerperfect/source/draw/VisioImportFilter.cxx |8 ++---
 writerperfect/source/draw/WPGImportFilter.cxx   |8 ++---
 writerperfect/source/writer/MSWorksImportFilter.cxx |   24 
 writerperfect/source/writer/WordPerfectImportFilter.cxx |   21 --
 7 files changed, 17 insertions(+), 67 deletions(-)

New commits:
commit 866ebf66b3a50b2d601825e4533898949d5b86c8
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri Mar 1 23:01:28 2013 +0100

Simplify a bit the boilerplate code

The XInputStream is guaranteed to be there always
and if it is not there, do not try to create it.

Change-Id: Ie133489dfcb3d9cec0c4efe78740348a1efa2423

diff --git a/writerperfect/source/draw/CDRImportFilter.cxx 
b/writerperfect/source/draw/CDRImportFilter.cxx
index 026c7b1..216e1fd 100644
--- a/writerperfect/source/draw/CDRImportFilter.cxx
+++ b/writerperfect/source/draw/CDRImportFilter.cxx
@@ -74,16 +74,12 @@ throw (RuntimeException)
 {
 if ( pValue[i].Name == InputStream )
 pValue[i].Value = xInputStream;
-else if ( pValue[i].Name == URL )
-pValue[i].Value = sURL;
 }
 if ( !xInputStream.is() )
 {
 OSL_ASSERT( 0 );
 return sal_False;
 }
-OString sFileName;
-sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
 
 // An XML import service: what we push sax messages to..
 OUString sXMLImportService ( com.sun.star.comp.Draw.XMLOasisImporter );
@@ -142,6 +138,9 @@ throw( com::sun::star::uno::RuntimeException )
 pValue[i].Value = xInputStream;
 }
 
+if (!xInputStream.is())
+return ::rtl::OUString();
+
 WPXSvInputStream input( xInputStream );
 
 if (libcdr::CDRDocument::isSupported(input))
diff --git a/writerperfect/source/draw/CMXImportFilter.cxx 
b/writerperfect/source/draw/CMXImportFilter.cxx
index 9d53df3..8854490 100644
--- a/writerperfect/source/draw/CMXImportFilter.cxx
+++ b/writerperfect/source/draw/CMXImportFilter.cxx
@@ -39,7 +39,6 @@ using com::sun::star::io::XInputStream;
 using com::sun::star::io::XSeekable;
 using com::sun::star::uno::Sequence;
 using namespace ::rtl;
-using rtl::OString;
 using rtl::OUString;
 using com::sun::star::uno::Sequence;
 using com::sun::star::uno::Reference;
@@ -74,16 +73,12 @@ throw (RuntimeException)
 {
 if ( pValue[i].Name == InputStream )
 pValue[i].Value = xInputStream;
-else if ( pValue[i].Name == URL )
-pValue[i].Value = sURL;
 }
 if ( !xInputStream.is() )
 {
 OSL_ASSERT( 0 );
 return sal_False;
 }
-OString sFileName;
-sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
 
 // An XML import service: what we push sax messages to..
 OUString sXMLImportService ( com.sun.star.comp.Draw.XMLOasisImporter );
@@ -142,6 +137,9 @@ throw( com::sun::star::uno::RuntimeException )
 pValue[i].Value = xInputStream;
 }
 
+if (!xInputStream.is())
+return ::rtl::OUString();
+
 WPXSvInputStream input( xInputStream );
 
 if (libcdr::CMXDocument::isSupported(input))
diff --git a/writerperfect/source/draw/MSPUBImportFilter.cxx 
b/writerperfect/source/draw/MSPUBImportFilter.cxx
index 5f886ab..b80b6d6 100644
--- a/writerperfect/source/draw/MSPUBImportFilter.cxx
+++ b/writerperfect/source/draw/MSPUBImportFilter.cxx
@@ -35,7 +35,6 @@ using com::sun::star::io::XInputStream;
 using com::sun::star::io::XSeekable;
 using com::sun::star::uno::Sequence;
 using namespace ::rtl;
-using rtl::OString;
 using rtl::OUString;
 using com::sun::star::uno::Sequence;
 using com::sun::star::uno::Reference;
@@ -70,16 +69,12 @@ throw (RuntimeException)
 {
 if ( pValue[i].Name == InputStream )
 pValue[i].Value = xInputStream;
-else if ( pValue[i].Name == URL )
-pValue[i].Value = sURL;
 }
 if ( !xInputStream.is() )
 {
 OSL_ASSERT( 0 );
 return sal_False;
 }
-OString sFileName;
-sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
 
 // An XML import service: what we push sax messages to..
 OUString sXMLImportService ( com.sun.star.comp.Draw.XMLOasisImporter );
@@ -138,6 +133,9 @@ throw( com::sun::star::uno::RuntimeException )
 pValue[i].Value = xInputStream;
 }
 
+if (!xInputStream.is())
+return ::rtl::OUString();
+
 WPXSvInputStream input( xInputStream );
 
 if (libmspub::MSPUBDocument::isSupported(input))
diff --git a/writerperfect/source/draw/VisioImportFilter.cxx 
b/writerperfect/source/draw/VisioImportFilter.cxx
index 291f358..9b39b64 100644
--- a/writerperfect/source/draw/VisioImportFilter.cxx
+++ 

[Libreoffice-commits] core.git: writerperfect/source

2013-02-22 Thread Fridrich Štrba
 writerperfect/source/filter/OdgGenerator.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit ea4581a914cb1aad29f16b73e35350f05f8adc1c
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri Feb 22 10:08:44 2013 +0100

We need to escape special characters in slide names

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 4474b48..d166a09 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -665,12 +665,10 @@ void OdgGenerator::startGraphics(const ::WPXPropertyList 
propList)
 
 WPXString sValue;
 if (propList[draw:name])
-pDrawPageOpenElement-addAttribute(draw:name, 
propList[draw:name]-getStr());
+sValue = WPXString(propList[draw:name]-getStr(), true); // escape 
special xml characters
 else
-{
 sValue.sprintf(page%i, mpImpl-miPageIndex);
-pDrawPageOpenElement-addAttribute(draw:name, sValue);
-}
+pDrawPageOpenElement-addAttribute(draw:name, sValue);
 #ifdef MULTIPAGE_WORKAROUND
 pStyleMasterPageOpenElement-addAttribute(style:page-layout-name, PM0);
 pStylePageLayoutOpenElement-addAttribute(style:page-layout-name, PM0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2013-02-19 Thread Norbert Thiebaud
 writerperfect/source/filter/OdgGenerator.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit bf46dfdb45b1d6cd99a5c729ee98df89db363225
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Sun Feb 17 13:10:03 2013 -0600

coverity#983356 ressource leak

Change-Id: Idcc2d548363ddab04dd8acaa1dfb854a19ca47ef
Reviewed-on: https://gerrit.libreoffice.org/2200
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 8661138..ece259a 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -1325,7 +1325,13 @@ void OdgGeneratorPrivate::_writeGraphicsStyle()
 mGraphicsGradientStyles.push_back(new 
TagCloseElement(draw:opacity));
 }
 }
-
+else
+{
+/* if mxGradient.count() == 1 for some reason we would leak
+ * pDrawGradientElement
+ */
+delete pDrawGradientElement;
+}
 if(!bUseOpacityGradient)
 delete pDrawOpacityElement;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2013-02-19 Thread Fridrich Štrba
 writerperfect/source/filter/OdgGenerator.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit bee8ed6772f420f9eefc57fee01da29ff466a8e9
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Tue Feb 19 16:44:51 2013 +0100

Allow specifying of page names

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index ece259a..4474b48 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -664,8 +664,13 @@ void OdgGenerator::startGraphics(const ::WPXPropertyList 
propList)
 TagOpenElement *pStylePageLayoutOpenElement = new 
TagOpenElement(style:page-layout);
 
 WPXString sValue;
-sValue.sprintf(page%i, mpImpl-miPageIndex);
-pDrawPageOpenElement-addAttribute(draw:name, sValue);
+if (propList[draw:name])
+pDrawPageOpenElement-addAttribute(draw:name, 
propList[draw:name]-getStr());
+else
+{
+sValue.sprintf(page%i, mpImpl-miPageIndex);
+pDrawPageOpenElement-addAttribute(draw:name, sValue);
+}
 #ifdef MULTIPAGE_WORKAROUND
 pStyleMasterPageOpenElement-addAttribute(style:page-layout-name, PM0);
 pStylePageLayoutOpenElement-addAttribute(style:page-layout-name, PM0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerperfect/source

2013-02-18 Thread Laurent Alonso
 writerperfect/source/filter/ListStyle.cxx|   29 ++
 writerperfect/source/filter/ListStyle.hxx|   15 ---
 writerperfect/source/filter/OdtGenerator.cxx |   54 +++
 3 files changed, 44 insertions(+), 54 deletions(-)

New commits:
commit f3929090a0b12018b629d0d65b89d17d0afdc7e3
Author: Laurent Alonso laurent.alo...@inria.fr
Date:   Mon Feb 18 13:20:14 2013 +0100

Writerperfect: Improve list code

Change-Id: I21fc40a0cb16e4f8295477cc2db50a58bc7287ea

diff --git a/writerperfect/source/filter/ListStyle.cxx 
b/writerperfect/source/filter/ListStyle.cxx
index e1e5144..f765908 100644
--- a/writerperfect/source/filter/ListStyle.cxx
+++ b/writerperfect/source/filter/ListStyle.cxx
@@ -19,14 +19,6 @@ OrderedListLevelStyle::OrderedListLevelStyle(const 
WPXPropertyList xPropList) :
 {
 }
 
-void OrderedListStyle::updateListLevel(const int iLevel, const WPXPropertyList 
xPropList)
-{
-if (iLevel  0)
-return;
-if (!isListLevelDefined(iLevel))
-setListLevel(iLevel, new OrderedListLevelStyle(xPropList));
-}
-
 void OrderedListLevelStyle::write(OdfDocumentHandler *pHandler, int iLevel) 
const
 {
 WPXString sLevel;
@@ -75,14 +67,6 @@ UnorderedListLevelStyle::UnorderedListLevelStyle(const 
WPXPropertyList xPropLis
 {
 }
 
-void UnorderedListStyle::updateListLevel(const int iLevel, const 
WPXPropertyList xPropList)
-{
-if (iLevel  0)
-return;
-if (!isListLevelDefined(iLevel))
-setListLevel(iLevel, new UnorderedListLevelStyle(xPropList));
-}
-
 void UnorderedListLevelStyle::write(OdfDocumentHandler *pHandler, int iLevel) 
const
 {
 WPXString sLevel;
@@ -155,6 +139,19 @@ void ListStyle::setListLevel(int iLevel, ListLevelStyle 
*iListLevelStyle)
 mppListLevels[iLevel] = iListLevelStyle;
 }
 
+void ListStyle::updateListLevel(const int iLevel, const WPXPropertyList 
xPropList, bool ordered)
+{
+if (iLevel  0)
+return;
+if (!isListLevelDefined(iLevel))
+{
+if (ordered)
+setListLevel(iLevel, new OrderedListLevelStyle(xPropList));
+else
+setListLevel(iLevel, new UnorderedListLevelStyle(xPropList));
+}
+}
+
 void ListStyle::write(OdfDocumentHandler *pHandler) const
 {
 TagOpenElement listStyleOpenElement(text:list-style);
diff --git a/writerperfect/source/filter/ListStyle.hxx 
b/writerperfect/source/filter/ListStyle.hxx
index 44d090d..53ee67e 100644
--- a/writerperfect/source/filter/ListStyle.hxx
+++ b/writerperfect/source/filter/ListStyle.hxx
@@ -48,7 +48,7 @@ class ListStyle : public Style
 public:
 ListStyle(const char *psName, const int iListID);
 virtual ~ListStyle();
-virtual void updateListLevel(const int iLevel, const WPXPropertyList 
xPropList) = 0;
+void updateListLevel(const int iLevel, const WPXPropertyList xPropList, 
bool ordered);
 virtual void write(OdfDocumentHandler *pHandler) const;
 int getListID()
 {
@@ -64,19 +64,6 @@ private:
 const int miListID;
 };
 
-class OrderedListStyle : public ListStyle
-{
-public:
-OrderedListStyle(const char *psName, const int iListID) : 
ListStyle(psName, iListID) {}
-void updateListLevel(const int iLevel, const WPXPropertyList xPropList);
-};
-
-class UnorderedListStyle : public ListStyle
-{
-public:
-UnorderedListStyle(const char *psName, const int iListID) : 
ListStyle(psName, iListID) {}
-void updateListLevel(const int iLevel, const WPXPropertyList xPropList);
-};
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index fc4ccbb..88bcc18 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -640,15 +640,15 @@ void OdtGenerator::defineOrderedListLevel(const 
WPXPropertyList propList)
 if (propList[libwpd:id])
 id = propList[libwpd:id]-getInt();
 
-OrderedListStyle *pOrderedListStyle = 0;
+ListStyle *pListStyle = 0;
 if (mpImpl-mWriterListStates.top().mpCurrentListStyle  
mpImpl-mWriterListStates.top().mpCurrentListStyle-getListID() == id)
-pOrderedListStyle = static_castOrderedListStyle 
*(mpImpl-mWriterListStates.top().mpCurrentListStyle); // FIXME: using a 
dynamic cast here causes oo to crash?!
+pListStyle = mpImpl-mWriterListStates.top().mpCurrentListStyle;
 
 // this rather appalling conditional makes sure we only start a new list 
(rather than continue an old
 // one) if: (1) we have no prior list OR (2) the prior list is actually 
definitively different
 // from the list that is just being defined (listIDs differ) OR (3) we can 
tell that the user actually
 // is starting a new list at level 1 (and only level 1)
-if (pOrderedListStyle == 0 || pOrderedListStyle-getListID() != id  ||
+if (pListStyle == 0 || pListStyle-getListID() != id  ||
 (propList[libwpd:level]