summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-24 11:57:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-04-01 20:48:36 +0100
commitd8c5cc7c4bc34436dd95f923dca852b335a5f1e3 (patch)
treecf6664b002e73a469c23b3a26a9567f434eaa1a4 /sw
parent6a9478481c42a717191cc6beb8534e263b98036d (diff)
add rtf fuzzer
Change-Id: I36a6294c158232bef8fceeaf5159527f467f5786
Diffstat (limited to 'sw')
-rw-r--r--sw/Library_sw.mk12
-rw-r--r--sw/inc/shellio.hxx4
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx6
-rw-r--r--sw/source/uibase/app/apphdl.cxx4
-rw-r--r--sw/source/uibase/inc/uivwimp.hxx4
-rw-r--r--sw/source/uibase/uiview/uivwimp.cxx2
-rw-r--r--sw/source/uibase/uiview/view0.cxx4
7 files changed, 12 insertions, 24 deletions
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 811c8c629ef6..847d061af188 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -571,6 +571,11 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/uibase/app/swmodul1 \
sw/source/uibase/app/swmodule \
sw/source/uibase/app/swwait \
+ sw/source/uibase/dbui/dbmgr \
+ sw/source/uibase/dbui/dbui \
+ sw/source/uibase/dbui/maildispatcher \
+ sw/source/uibase/dbui/mailmergehelper \
+ sw/source/uibase/dbui/mmconfigitem \
sw/source/uibase/cctrl/actctrl \
sw/source/uibase/chrdlg/ccoll \
sw/source/uibase/config/StoredChapterNumbering \
@@ -722,6 +727,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/uibase/uno/unodispatch \
sw/source/uibase/uno/unodoc \
sw/source/uibase/uno/unofreg \
+ sw/source/uibase/uno/unomailmerge \
sw/source/uibase/uno/unomod \
sw/source/uibase/uno/unomodule \
sw/source/uibase/uno/unotxdoc \
@@ -768,14 +774,8 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
ifneq (,$(filter DBCONNECTIVITY,$(BUILD_TYPE)))
$(eval $(call gb_Library_add_exception_objects,sw,\
- sw/source/uibase/dbui/dbmgr \
sw/source/uibase/dbui/dbtree \
- sw/source/uibase/dbui/dbui \
- sw/source/uibase/dbui/maildispatcher \
- sw/source/uibase/dbui/mailmergehelper \
sw/source/uibase/dbui/mailmergetoolbarcontrols \
- sw/source/uibase/dbui/mmconfigitem \
- sw/source/uibase/uno/unomailmerge \
))
endif
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 3a05a064c199..283422710fc2 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -178,13 +178,13 @@ protected:
#define SW_STORAGE_READER 2
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(const OUString &rUrl, const OUString &rFltName);
-extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(const OUString &rUrl);
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(SvStream &rStream);
class SW_DLLPUBLIC Reader
{
friend class SwReader;
friend bool TestImportDOC(const OUString &rUrl, const OUString &rFltName);
- friend bool TestImportRTF(const OUString &rUrl);
+ friend bool TestImportRTF(SvStream &rStream);
rtl::Reference<SwDoc> mxTemplate;
OUString aTemplateNm;
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 1b6955acd873..cdcff0f3d0ab 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -158,10 +158,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL ImportRTF()
return new SwRTFReader;
}
-extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(const OUString& rURL)
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(SvStream &rStream)
{
- SvFileStream aFileStream(rURL, StreamMode::READ);
-
SwGlobals::ensure();
SfxObjectShellLock xDocSh(new SwDocShell(SfxObjectCreateMode::INTERNAL));
@@ -177,7 +175,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(const OUString& rURL
uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW);
uno::Sequence<beans::PropertyValue> aDescriptor(1);
aDescriptor[0].Name = "InputStream";
- uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(aFileStream));
+ uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(rStream));
aDescriptor[0].Value <<= xStream;
bool bRet = true;
try
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index ef5ac4a90984..6babf28f7df5 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -241,8 +241,6 @@ void SwModule::StateOther(SfxItemSet &rSet)
// start field dialog
void NewXForms( SfxRequest& rReq ); // implementation: below
-#if HAVE_FEATURE_DBCONNECTIVITY
-
std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const SfxItemSet* pArgs, sal_uInt16 nWizardRestartPage)
{
// create if it does not exist yet
@@ -305,6 +303,8 @@ std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const S
return xMMConfig;
}
+#if HAVE_FEATURE_DBCONNECTIVITY
+
namespace
{
diff --git a/sw/source/uibase/inc/uivwimp.hxx b/sw/source/uibase/inc/uivwimp.hxx
index c47056c6eb9a..68c3707be574 100644
--- a/sw/source/uibase/inc/uivwimp.hxx
+++ b/sw/source/uibase/inc/uivwimp.hxx
@@ -101,11 +101,9 @@ class SwView_Impl
mxClipEvtLstnr;
ShellMode eShellMode;
-#if HAVE_FEATURE_DBCONNECTIVITY
std::shared_ptr<SwMailMergeConfigItem>
xConfigItem;
sal_uInt16 nMailMergeRestartPage;
-#endif
sfx2::DocumentInserter* m_pDocInserter;
SfxRequest* m_pRequest;
@@ -137,14 +135,12 @@ public:
void AddTransferable(SwTransferable& rTransferable);
-#if HAVE_FEATURE_DBCONNECTIVITY
void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem>& rItem, sal_uInt16 nRestart)
{
xConfigItem = rItem;
nMailMergeRestartPage = nRestart;
}
std::shared_ptr<SwMailMergeConfigItem> GetMailMergeConfigItem() {return xConfigItem;}
-#endif
//#i33307# restore editing position
void SetRestorePosition(const Point& rCursorPos, bool bSelectObj)
diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx
index 98a69adce690..b1ff6e0794c6 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -56,9 +56,7 @@ SwView_Impl::SwView_Impl(SwView* pShell)
: mxXTextView()
, pView(pShell)
, eShellMode(ShellMode::Text)
-#if HAVE_FEATURE_DBCONNECTIVITY
, nMailMergeRestartPage(0)
-#endif
, m_pDocInserter(nullptr)
, m_pRequest(nullptr)
, m_nParam(0)
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index 6c14a72f9c6c..791af4811fb2 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -131,8 +131,6 @@ void SwView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOpt
}
-#if HAVE_FEATURE_DBCONNECTIVITY
-
void SwView::SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem>& rConfigItem,
sal_uInt16 nRestart)
{
@@ -145,8 +143,6 @@ std::shared_ptr<SwMailMergeConfigItem> SwView::GetMailMergeConfigItem() const
return m_pViewImpl->GetMailMergeConfigItem();
}
-#endif
-
static bool lcl_IsViewMarks( const SwViewOption& rVOpt )
{
return rVOpt.IsHardBlank() &&