[Libreoffice-commits] core.git: 4 commits - configure.ac writerfilter/inc writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Sat Dec 20 11:43:04 PST 2014
configure.ac | 2 +-
writerfilter/inc/dmapper/DomainMapperFactory.hxx | 8 ++++++--
writerfilter/source/dmapper/DomainMapper.cxx | 9 +++++++--
writerfilter/source/dmapper/DomainMapper.hxx | 7 ++++++-
writerfilter/source/dmapper/domainmapperfactory.cxx | 15 +++++++++++++--
writerfilter/source/filter/ImportFilter.cxx | 18 +-----------------
writerfilter/source/filter/RtfFilter.cxx | 16 +---------------
7 files changed, 35 insertions(+), 40 deletions(-)
New commits:
commit 98a8553b4f4a9af6b985b7e9ea2ed45bc496a543
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Dec 20 20:24:02 2014 +0100
configure: repor -> repo
Change-Id: I2b0d29f1fab7e81bb80f9023d609cde46d47ebe1
diff --git a/configure.ac b/configure.ac
index 276fe1c..02f5892 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12839,7 +12839,7 @@ place yourself in a working directory of you choice.
[go to Start menu, click "All Programs", click "Visual Studio 2013", click "Visual Studio Tools", double-click "VS2013 x86 Native Tools Command Prompt" or "VS2013 x64 Native Tools Comand Prompt"]
set PATH=%PATH%;C:\Cygwin\bin
[or Cygwin64, if that is what you have]
- cd path-to-make-repor-you-cloned-above
+ cd path-to-make-repo-you-cloned-above
build_w32.bat --without-guile
should result in a WinRel/gnumake.exe.
commit e02b2adbbff46678eb03c69ed36be2b47e512c71
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Dec 20 20:23:31 2014 +0100
Unused enumeration value
Change-Id: I82a1f902311fb5b1cb18460c40169cd93234bc88
diff --git a/writerfilter/inc/dmapper/DomainMapperFactory.hxx b/writerfilter/inc/dmapper/DomainMapperFactory.hxx
index 9fcd542..05cb9b5 100644
--- a/writerfilter/inc/dmapper/DomainMapperFactory.hxx
+++ b/writerfilter/inc/dmapper/DomainMapperFactory.hxx
@@ -27,7 +27,6 @@ namespace dmapper
enum SourceDocumentType
{
- DOCUMENT_DOC,
DOCUMENT_OOXML,
DOCUMENT_RTF
};
commit 27992df5f3c1c51de667e21e6122246c20d4c235
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Dec 20 16:47:23 2014 +0100
writerfilter: clean up copy&pasted dmapper_logger start / end
Change-Id: Iacae41a32acec153b1db1e1a03b2f2913d114d9b
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 14c8c5f..e6cf4fe 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -192,6 +192,10 @@ DomainMapper::~DomainMapper()
}
delete m_pImpl;
+
+#ifdef DEBUG_WRITERFILTER
+ dmapper_logger->endDocument();
+#endif
}
void DomainMapper::lcl_attribute(Id nName, Value & val)
diff --git a/writerfilter/source/dmapper/domainmapperfactory.cxx b/writerfilter/source/dmapper/domainmapperfactory.cxx
index bc59c4e..c39ede1 100644
--- a/writerfilter/source/dmapper/domainmapperfactory.cxx
+++ b/writerfilter/source/dmapper/domainmapperfactory.cxx
@@ -23,6 +23,16 @@ Stream::Pointer_t DomainMapperFactory::createMapper(css::uno::Reference<css::uno
css::uno::Reference<css::text::XTextRange> const& xInsertTextRange,
utl::MediaDescriptor& rMediaDesc)
{
+#ifdef DEBUG_WRITERFILTER
+ OUString sURL = rMediaDesc.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_URL(), OUString() );
+ ::std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr();
+
+ writerfilter::TagLogger::Pointer_t dmapper_logger(writerfilter::TagLogger::getInstance("DOMAINMAPPER"));
+ if (getenv("SW_DEBUG_WRITERFILTER"))
+ dmapper_logger->setFileName(sURLc);
+ dmapper_logger->startDocument();
+#endif
+
return Stream::Pointer_t(new DomainMapper(xContext, xInputStream, xModel, bRepairStorage, eDocumentType, xInsertTextRange, rMediaDesc));
}
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 474b79e..ed9e57d 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -34,7 +34,6 @@
#include <osl/process.h>
#endif
-#include <resourcemodel/TagLogger.hxx>
#include <oox/ole/olestorage.hxx>
#include <oox/ole/vbaproject.hxx>
#include <oox/helper/graphichelper.hxx>
@@ -77,17 +76,6 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
if ( !xInputStream.is() )
return sal_False;
-#ifdef DEBUG_WRITERFILTER
- OUString sURL = aMediaDesc.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_URL(), OUString() );
- ::std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr();
-
- writerfilter::TagLogger::Pointer_t dmapper_logger
- (writerfilter::TagLogger::getInstance("DOMAINMAPPER"));
- if (getenv("SW_DEBUG_WRITERFILTER"))
- dmapper_logger->setFileName(sURLc);
- dmapper_logger->startDocument();
-#endif
-
writerfilter::dmapper::SourceDocumentType eType = writerfilter::dmapper::DOCUMENT_OOXML;
writerfilter::Stream::Pointer_t pStream(
writerfilter::dmapper::DomainMapperFactory::createMapper(m_xContext, xInputStream, m_xDstDoc, bRepairStorage, eType, uno::Reference<text::XTextRange>(), aMediaDesc));
@@ -158,10 +146,6 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
pStream.reset();
-#ifdef DEBUG_WRITERFILTER
- dmapper_logger->endDocument();
-#endif
-
return sal_True;
}
return sal_False;
diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx
index 56ab873..2ae224d 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -22,7 +22,6 @@
#include <unotools/mediadescriptor.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <dmapper/DomainMapperFactory.hxx>
-#include <resourcemodel/TagLogger.hxx>
#include <rtftok/RTFDocument.hxx>
#include <com/sun/star/io/WrongFormatException.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
@@ -68,16 +67,6 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& aDescrip
bool bRepairStorage = aMediaDesc.getUnpackedValueOrDefault("RepairPackage", false);
bool bIsNewDoc = !aMediaDesc.getUnpackedValueOrDefault("InsertMode", false);
uno::Reference<text::XTextRange> xInsertTextRange = aMediaDesc.getUnpackedValueOrDefault("TextInsertModeRange", uno::Reference<text::XTextRange>());
-#ifdef DEBUG_WRITERFILTER
- OUString sURL = aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_URL(), OUString());
- std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr();
-
- writerfilter::TagLogger::Pointer_t dmapper_logger
- (writerfilter::TagLogger::getInstance("DOMAINMAPPER"));
- if (getenv("SW_DEBUG_WRITERFILTER"))
- dmapper_logger->setFileName(sURLc);
- dmapper_logger->startDocument();
-#endif
uno::Reference< io::XInputStream > xInputStream;
aMediaDesc.addInputStream();
@@ -118,9 +107,6 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& aDescrip
writerfilter::rtftok::RTFDocumentFactory::createDocument(m_xContext, xInputStream, m_xDstDoc, xFrame, xStatusIndicator));
pDocument->resolve(*pStream);
bResult = true;
-#ifdef DEBUG_WRITERFILTER
- dmapper_logger->endDocument();
-#endif
sal_uInt32 nEndTime = osl_getGlobalTimer();
SAL_INFO("writerfilter.profile", OSL_THIS_FUNC << " finished in " << nEndTime - nStartTime << " ms");
}
commit 7c6b273e1138e4f93b905a2db7179dcd958a6c5c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Dec 20 16:30:29 2014 +0100
writerfilter: pass the whole MediaDescriptor to dmapper
This gives dmapper access to the document URL.
Change-Id: I4844c2fe97815f788de87b53170d4a1d1faebde8
diff --git a/writerfilter/inc/dmapper/DomainMapperFactory.hxx b/writerfilter/inc/dmapper/DomainMapperFactory.hxx
index 28563ac..9fcd542 100644
--- a/writerfilter/inc/dmapper/DomainMapperFactory.hxx
+++ b/writerfilter/inc/dmapper/DomainMapperFactory.hxx
@@ -15,6 +15,11 @@
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+namespace utl
+{
+class MediaDescriptor;
+}
+
namespace writerfilter
{
namespace dmapper
@@ -38,7 +43,7 @@ public:
bool bRepairStorage,
SourceDocumentType eDocumentType,
css::uno::Reference<css::text::XTextRange> const& xInsertTextRange,
- bool bIsNewDoc = true);
+ utl::MediaDescriptor& rMediaDesc);
};
} // namespace dmapper
} // namespace writerfilter
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 2f0e43d..14c8c5f 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -63,6 +63,7 @@
#include <comphelper/types.hxx>
#include <comphelper/storagehelper.hxx>
#include <filter/msfilter/util.hxx>
+#include <unotools/mediadescriptor.hxx>
#include <TextEffectsHandler.hxx>
#include <CellColorHandler.hxx>
@@ -96,11 +97,11 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon
bool bRepairStorage,
SourceDocumentType eDocumentType,
uno::Reference<text::XTextRange> const& xInsertTextRange,
- bool bIsNewDoc ) :
+ utl::MediaDescriptor& rMediaDesc) :
LoggedProperties(dmapper_logger, "DomainMapper"),
LoggedTable(dmapper_logger, "DomainMapper"),
LoggedStream(dmapper_logger, "DomainMapper"),
- m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType, xInsertTextRange, bIsNewDoc )),
+ m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType, xInsertTextRange, !rMediaDesc.getUnpackedValueOrDefault("InsertMode", false))),
mnBackgroundColor(0), mbIsHighlightSet(false), mbIsSplitPara(false)
{
// #i24363# tab stops relative to indent
diff --git a/writerfilter/source/dmapper/DomainMapper.hxx b/writerfilter/source/dmapper/DomainMapper.hxx
index b1b0ba7..67c16f3 100644
--- a/writerfilter/source/dmapper/DomainMapper.hxx
+++ b/writerfilter/source/dmapper/DomainMapper.hxx
@@ -46,6 +46,11 @@ namespace com{ namespace sun {namespace star{
}
}}}
+namespace utl
+{
+class MediaDescriptor;
+}
+
typedef std::vector< com::sun::star::beans::PropertyValue > PropertyValueVector_t;
namespace writerfilter {
@@ -76,7 +81,7 @@ public:
bool bRepairStorage,
SourceDocumentType eDocumentType,
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > const& xInsertTextRange,
- bool bIsNewDoc = true);
+ utl::MediaDescriptor& rMediaDesc);
virtual ~DomainMapper();
// Stream
diff --git a/writerfilter/source/dmapper/domainmapperfactory.cxx b/writerfilter/source/dmapper/domainmapperfactory.cxx
index bf9810f..bc59c4e 100644
--- a/writerfilter/source/dmapper/domainmapperfactory.cxx
+++ b/writerfilter/source/dmapper/domainmapperfactory.cxx
@@ -8,6 +8,7 @@
*/
#include <DomainMapper.hxx>
+#include <unotools/mediadescriptor.hxx>
namespace writerfilter
{
@@ -20,9 +21,9 @@ Stream::Pointer_t DomainMapperFactory::createMapper(css::uno::Reference<css::uno
bool bRepairStorage,
SourceDocumentType eDocumentType,
css::uno::Reference<css::text::XTextRange> const& xInsertTextRange,
- bool bIsNewDoc)
+ utl::MediaDescriptor& rMediaDesc)
{
- return Stream::Pointer_t(new DomainMapper(xContext, xInputStream, xModel, bRepairStorage, eDocumentType, xInsertTextRange, bIsNewDoc));
+ return Stream::Pointer_t(new DomainMapper(xContext, xInputStream, xModel, bRepairStorage, eDocumentType, xInsertTextRange, rMediaDesc));
}
} // namespace dmapper
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 87a81da..474b79e 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -90,7 +90,7 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
writerfilter::dmapper::SourceDocumentType eType = writerfilter::dmapper::DOCUMENT_OOXML;
writerfilter::Stream::Pointer_t pStream(
- writerfilter::dmapper::DomainMapperFactory::createMapper(m_xContext, xInputStream, m_xDstDoc, bRepairStorage, eType, uno::Reference<text::XTextRange>()));
+ writerfilter::dmapper::DomainMapperFactory::createMapper(m_xContext, xInputStream, m_xDstDoc, bRepairStorage, eType, uno::Reference<text::XTextRange>(), aMediaDesc));
//create the tokenizer and domain mapper
writerfilter::ooxml::OOXMLStream::Pointer_t pDocStream = writerfilter::ooxml::OOXMLDocumentFactory::createStream(m_xContext, xInputStream, bRepairStorage);
uno::Reference<task::XStatusIndicator> xStatusIndicator = aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), uno::Reference<task::XStatusIndicator>());
diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx
index 1eba5b6..56ab873 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -113,7 +113,7 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& aDescrip
uno::Reference<task::XStatusIndicator>());
writerfilter::Stream::Pointer_t pStream(
- writerfilter::dmapper::DomainMapperFactory::createMapper(m_xContext, xInputStream, m_xDstDoc, bRepairStorage, writerfilter::dmapper::DOCUMENT_RTF, xInsertTextRange, bIsNewDoc));
+ writerfilter::dmapper::DomainMapperFactory::createMapper(m_xContext, xInputStream, m_xDstDoc, bRepairStorage, writerfilter::dmapper::DOCUMENT_RTF, xInsertTextRange, aMediaDesc));
writerfilter::rtftok::RTFDocument::Pointer_t const pDocument(
writerfilter::rtftok::RTFDocumentFactory::createDocument(m_xContext, xInputStream, m_xDstDoc, xFrame, xStatusIndicator));
pDocument->resolve(*pStream);
More information about the Libreoffice-commits
mailing list