Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


On 13.10.2015 11:09, Jan Holesovsky wrote:
 sw/CppunitTest_sw_ww8export.mk       |    5 ++++-
 sw/qa/extras/ww8export/ww8export.cxx |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)

New commits:
commit b630f9a36a844f46757abb6ce16fa7cd527a4341
Author: Jan Holesovsky <kendy@collabora.com>
Date:   Tue Oct 13 11:00:43 2015 +0200

    tdf#94386: Unit test stub - emulates the steps to trigger the bug.
    

@@ -53,6 +62,23 @@ protected:
         }
         return false;
     }
+
+    virtual void postLoad(const char* pFilename) SAL_OVERRIDE

i don't appreciate this attempt to obfuscate the test with an obscure
event handler that contains half of the test logic.

if the test does something more than just load and store and verify,
then it would be better to define it in e.g. uiwriter.cxx with 5 lines
of explicit and copy-pasted load-store code wrapped around the code that
modifies the document model.

+    {
+        if (OString(pFilename) == "tdf94386.odt")
+        {
+            SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
+            CPPUNIT_ASSERT(pTextDoc);
+            SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
+
+            // emulate the behavior from tdf#94386 - insert an envelope to the
+            // document
+            SfxItemSet aSet(pWrtShell->GetView().GetCurShell()->GetPool(), FN_ENVELOP, 
FN_ENVELOP);
+            aSet.Put(SwEnvItem());
+            SfxRequest aRequest(FN_ENVELOP, SfxCallMode::SYNCHRON, aSet);
+            SW_MOD()->ExecOther(aRequest);
+        }
+    }
 };



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.