[Libreoffice-commits] core.git: sfx2/qa sfx2/source sw/qa

2022-12-22 Thread Andrea Gelmini (via logerrit)
 sfx2/qa/cppunit/doc.cxx |2 +-
 sfx2/source/control/unoctitm.cxx|2 +-
 sw/qa/uibase/uno/uno.cxx|2 +-
 sw/qa/uitest/writer_tests7/tdf145093.py |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit bf3562cf38c2dd7776a160ee8259a6fb97c0e7ba
Author: Andrea Gelmini 
AuthorDate: Thu Dec 22 11:32:11 2022 +0100
Commit: Andrea Gelmini 
CommitDate: Thu Dec 22 15:54:50 2022 +

Fix typo

"an other" -> "another"

Change-Id: Id0a2b8f99fd4f87e94e65570ebc75bfdf0d205ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143597
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/sfx2/qa/cppunit/doc.cxx b/sfx2/qa/cppunit/doc.cxx
index d7538925113e..902ac48646e5 100644
--- a/sfx2/qa/cppunit/doc.cxx
+++ b/sfx2/qa/cppunit/doc.cxx
@@ -92,7 +92,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTempFilePath)
 
 CPPUNIT_TEST_FIXTURE(Test, testSetDocumentPropertiesUpdate)
 {
-// Given a document with 3 custom props, 2 Zotero ones and an other:
+// Given a document with 3 custom props, 2 Zotero ones and one other:
 mxComponent = loadFromDesktop("private:factory/swriter");
 auto pBaseModel = dynamic_cast(mxComponent.get());
 CPPUNIT_ASSERT(pBaseModel);
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 6f68292f46b4..76f4c9693dc0 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -252,7 +252,7 @@ void SAL_CALL SfxOfficeDispatch::dispatch( const 
css::util::URL& aURL, const css
 {
 // Make sure that we own the solar mutex, otherwise later
 // vcl::SolarThreadExecutor::execute() will release the solar 
mutex, even if it's owned by
-// an other thread, leading to an std::abort() at the end.
+// another thread, leading to an std::abort() at the end.
 SolarMutexGuard aGuard;
 vcl::solarthread::syncExecute([this, , ]() {
 pImpl->dispatch(aURL, aArgs,
diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index 45fc50999e65..64d2a70fe4e2 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -246,7 +246,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetTextFormFields)
 
 CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetDocumentProperties)
 {
-// Given a document with 3 custom properties: 2 zotero ones and an other 
one:
+// Given a document with 3 custom properties: 2 Zotero ones and one other:
 createSwDoc();
 SwDoc* pDoc = getSwDoc();
 SwDocShell* pDocShell = pDoc->GetDocShell();
diff --git a/sw/qa/uitest/writer_tests7/tdf145093.py 
b/sw/qa/uitest/writer_tests7/tdf145093.py
index 7dcd67b378d2..59d4c3d3c15c 100644
--- a/sw/qa/uitest/writer_tests7/tdf145093.py
+++ b/sw/qa/uitest/writer_tests7/tdf145093.py
@@ -19,7 +19,7 @@ class tdf145093(UITestCase):
 
 # Move Up/Down a list item over a tracked paragraph insertion 
resulted a crash
 # (Note: not only at the end of the document, but check the 
original
-# bug report temporarily, where the problem is triggered by an 
other problem).
+# bug report temporarily, where the problem is triggered by 
another problem).
 
 self.xUITest.executeCommand(".uno:MoveDown")
 self.xUITest.executeCommand(".uno:MoveDown")


[Libreoffice-commits] core.git: sfx2/qa xmloff/qa

2022-11-03 Thread Xisco Fauli (via logerrit)
 sfx2/qa/cppunit/test_misc.cxx |6 -
 xmloff/qa/unit/draw.cxx   |8 ---
 xmloff/qa/unit/style.cxx  |8 ---
 xmloff/qa/unit/text.cxx   |   44 --
 4 files changed, 8 insertions(+), 58 deletions(-)

New commits:
commit be63419810cd6f418d33ef1b7724ba32e867e52b
Author: Xisco Fauli 
AuthorDate: Thu Nov 3 13:01:06 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Nov 3 18:32:28 2022 +0100

qa: remove duplicated code

Change-Id: I13da5ca9d07131a340dcf95ca0b980d75ca6e9d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142229
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 652533db4551..212dc1aea5bf 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -76,11 +76,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testODFCustomMetadata)
 xProps->storeToMedium(aTempFile.GetURL(), mimeArgs);
 
 // check that custom metadata is preserved
-uno::Reference const xZip(
-packages::zip::ZipFileAccess::createWithURL(m_xContext, 
aTempFile.GetURL()));
-uno::Reference const 
xInputStream(xZip->getByName("meta.xml"), uno::UNO_QUERY);
-std::unique_ptr const 
pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
-xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "meta.xml");
 assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/bork", 
"bork");
 assertXPath(pXmlDoc, "/office:document-meta/office:meta/foo:bar", 1);
 assertXPath(pXmlDoc, "/office:document-meta/office:meta/foo:bar/baz:foo", 
1);
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
index 93b230db8d72..1f41afbba3ed 100644
--- a/xmloff/qa/unit/draw.cxx
+++ b/xmloff/qa/unit/draw.cxx
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -91,12 +90,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testTdf141301_Extrusion_Angle)
 
 // Prepare use of XPath
 utl::TempFileNamed aTempFile = save("draw8");
-uno::Reference xNameAccess
-= packages::zip::ZipFileAccess::createWithURL(mxComponentContext, 
aTempFile.GetURL());
-uno::Reference 
xInputStream(xNameAccess->getByName("content.xml"),
-  uno::UNO_QUERY);
-std::unique_ptr 
pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
-xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "content.xml");
 
 // Without fix draw:extrusion-skew="50 -135" was not written to file 
although "50 -135" is not
 // default in ODF, but only default inside LO.
diff --git a/xmloff/qa/unit/style.cxx b/xmloff/qa/unit/style.cxx
index f5b42fac1fb0..a51b55b37818 100644
--- a/xmloff/qa/unit/style.cxx
+++ b/xmloff/qa/unit/style.cxx
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -89,12 +88,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testFontSorting)
 utl::TempFileNamed aTempFile = save("writer8");
 
 // Then make sure  elements are sorted (by 
style:name="..."):
-uno::Reference xNameAccess
-= packages::zip::ZipFileAccess::createWithURL(mxComponentContext, 
aTempFile.GetURL());
-uno::Reference 
xInputStream(xNameAccess->getByName("content.xml"),
-  uno::UNO_QUERY);
-std::unique_ptr 
pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
-xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "content.xml");
 xmlXPathObjectPtr pXPath
 = getXPathNode(pXmlDoc, 
"/office:document-content/office:font-face-decls/style:font-face");
 xmlNodeSetPtr pXmlNodes = pXPath->nodesetval;
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 7a78848c4b7a..64ec2500ad9f 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -17,7 +17,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -152,25 +151,10 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testParaStyleListLevel)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), nNumberingLevel);
 
 // Test the export as well:
-
-// Given a doc model that has a para style with NumberingLevel=2:
-uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
-
-// When exporting that to ODT:
-uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
-{ "FilterName", uno::Any(OUString("writer8")) },
-});
-utl::TempFileNamed aTempFile;
-aTempFile.EnableKillingFile();
-xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+utl::TempFileNamed aTempFile = save("writer8");
 
 // Then make sure we save the style's numbering level:
-uno::Reference xNameAccess
-= 

[Libreoffice-commits] core.git: sfx2/qa

2022-06-10 Thread Luboš Luňák (via logerrit)
 sfx2/qa/cppunit/test_misc.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit cd7e262f7e34786496103dbe2be16c198bf97c64
Author: Luboš Luňák 
AuthorDate: Thu Jun 2 22:15:23 2022 +0200
Commit: Luboš Luňák 
CommitDate: Fri Jun 10 11:20:24 2022 +0200

add missing 'xComponent->dispose()' to a test

Change-Id: I0ae2847e81eb2f1fba16e65d89ca1db1e55ac4b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135577
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 95ab7e927b09..1bf90cfbc218 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -218,6 +218,8 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testOverwrite)
 catch (const css::uno::Exception&)
 {
 }
+
+xComponent->dispose();
 }
 
 }


[Libreoffice-commits] core.git: sfx2/qa

2022-05-10 Thread Michael Stahl (via logerrit)
 sfx2/qa/complex/sfx2/UndoManager.java |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit cdf70b909910974cad49a5c4372d2682209cc831
Author: Michael Stahl 
AuthorDate: Tue May 10 13:16:52 2022 +0200
Commit: Michael Stahl 
CommitDate: Tue May 10 15:51:15 2022 +0200

sfx2: add config warning in UndoManager complex test

... and remove obsolete comment, that problem was fixed a decade ago.

Change-Id: I06e122128ff009778da87891739016ecc8975895
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134110
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sfx2/qa/complex/sfx2/UndoManager.java 
b/sfx2/qa/complex/sfx2/UndoManager.java
index a455a5eb4ca0..12f13ada10a1 100644
--- a/sfx2/qa/complex/sfx2/UndoManager.java
+++ b/sfx2/qa/complex/sfx2/UndoManager.java
@@ -224,7 +224,9 @@ public class UndoManager
 };
 events.replaceByName( "OnViewCreated", scriptDescriptor );
 
-// The below doesn't work: event notification is broken in m96, see 
https://bz.apache.org/ooo/show_bug.cgi?id=116313
+// note: this may be prevented from working by setting
+// Office::Common::Security::Scripting::AllowedDocumentEventURLs
+// (checked in SfxEvents_Impl::isScriptURLAllowed())
 m_callbackCalled = false;
 m_currentDocument.getCurrentView().dispatch( ".uno:NewWindow" );
 assertTrue( "triggering an event did not work as expected - basic 
script not called", m_callbackCalled );


[Libreoffice-commits] core.git: sfx2/qa sfx2/source

2022-05-03 Thread Stephan Bergmann (via logerrit)
 sfx2/qa/cppunit/test_classification.cxx   |   12 +++---
 sfx2/qa/cppunit/test_misc.cxx |6 +--
 sfx2/source/appl/appdata.cxx  |2 -
 sfx2/source/appl/appopen.cxx  |6 +--
 sfx2/source/appl/appserv.cxx  |   10 ++---
 sfx2/source/appl/childwin.cxx |2 -
 sfx2/source/appl/fileobj.cxx  |2 -
 sfx2/source/appl/macroloader.cxx  |2 -
 sfx2/source/appl/newhelp.cxx  |   28 +++
 sfx2/source/appl/sfxhelp.cxx  |2 -
 sfx2/source/bastyp/fltfnc.cxx |   10 ++---
 sfx2/source/dialog/basedlgs.cxx   |2 -
 sfx2/source/dialog/dinfdlg.cxx|2 -
 sfx2/source/dialog/documentfontsdialog.cxx|   10 ++---
 sfx2/source/dialog/filedlghelper.cxx  |   40 +++---
 sfx2/source/dialog/splitwin.cxx   |2 -
 sfx2/source/dialog/srchdlg.cxx|2 -
 sfx2/source/dialog/tabdlg.cxx |4 +-
 sfx2/source/dialog/templdlg.cxx   |2 -
 sfx2/source/dialog/versdlg.cxx|2 -
 sfx2/source/doc/DocumentMetadataAccess.cxx|   18 -
 sfx2/source/doc/SfxDocumentMetaData.cxx   |8 ++--
 sfx2/source/doc/SfxRedactionHelper.cxx|   18 -
 sfx2/source/doc/autoredactdialog.cxx  |2 -
 sfx2/source/doc/docfac.cxx|4 +-
 sfx2/source/doc/docfile.cxx   |   26 +++---
 sfx2/source/doc/docmacromode.cxx  |4 +-
 sfx2/source/doc/doctempl.cxx  |2 -
 sfx2/source/doc/doctemplates.cxx  |   22 ++--
 sfx2/source/doc/guisaveas.cxx |   16 
 sfx2/source/doc/new.cxx   |2 -
 sfx2/source/doc/objmisc.cxx   |8 ++--
 sfx2/source/doc/objserv.cxx   |   32 -
 sfx2/source/doc/objstor.cxx   |   32 -
 sfx2/source/doc/sfxbasemodel.cxx  |8 ++--
 sfx2/source/doc/templatedlg.cxx   |6 +--
 sfx2/source/doc/watermarkitem.cxx |   10 ++---
 sfx2/source/notebookbar/NotebookbarTabControl.cxx |4 +-
 sfx2/source/notebookbar/SfxNotebookBar.cxx|2 -
 sfx2/source/sidebar/ControllerFactory.cxx |   18 -
 sfx2/source/sidebar/ResourceManager.cxx   |6 +--
 sfx2/source/sidebar/SidebarController.cxx |   18 -
 sfx2/source/view/classificationcontroller.cxx |4 +-
 sfx2/source/view/classificationhelper.cxx |4 +-
 sfx2/source/view/ipclient.cxx |4 +-
 sfx2/source/view/sfxbasecontroller.cxx|2 -
 sfx2/source/view/viewfrm.cxx  |6 +--
 sfx2/source/view/viewprn.cxx  |   12 +++---
 sfx2/source/view/viewsh.cxx   |4 +-
 49 files changed, 225 insertions(+), 225 deletions(-)

New commits:
commit 0bfa6a180850898ec5038ad70e09a2ff7baafa1a
Author: Stephan Bergmann 
AuthorDate: Tue May 3 23:21:30 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 4 06:54:23 2022 +0200

Just use Any ctor instead of makeAny in sfx2

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

diff --git a/sfx2/qa/cppunit/test_classification.cxx 
b/sfx2/qa/cppunit/test_classification.cxx
index c086d2e973cb..45d2947882f3 100644
--- a/sfx2/qa/cppunit/test_classification.cxx
+++ b/sfx2/qa/cppunit/test_classification.cxx
@@ -62,8 +62,8 @@ void ClassificationTest::testClassification()
 {
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(
 {
-{"Name", uno::makeAny(OUString("Non-Business"))},
-{"Type", uno::makeAny(OUString("urn:bails:ExportControl:"))},
+{"Name", uno::Any(OUString("Non-Business"))},
+{"Type", uno::Any(OUString("urn:bails:ExportControl:"))},
 }));
 dispatchCommand(mxComponent, ".uno:ClassificationApply", aPropertyValues);
 
@@ -76,8 +76,8 @@ void ClassificationTest::testClassification()
 
 aPropertyValues = comphelper::InitPropertySequence(
 {
-{"Name", uno::makeAny(OUString("Confidential"))},
-{"Type", uno::makeAny(OUString("urn:bails:NationalSecurity:"))},
+{"Name", uno::Any(OUString("Confidential"))},
+{"Type", uno::Any(OUString("urn:bails:NationalSecurity:"))},
 });
 dispatchCommand(mxComponent, ".uno:ClassificationApply", aPropertyValues);
 aAny = 
xPropertySet->getPropertyValue("urn:bails:NationalSecurity:BusinessAuthorizationCategory:Identifier");
@@ -85,8 +85,8 @@ void ClassificationTest::testClassification()
 
 

[Libreoffice-commits] core.git: sfx2/qa

2022-02-23 Thread Xisco Fauli (via logerrit)
 sfx2/qa/cppunit/test_classification.cxx |   15 ---
 1 file changed, 15 deletions(-)

New commits:
commit cba4282c3ab554db5416f8949d447bae4ec28170
Author: Xisco Fauli 
AuthorDate: Wed Feb 23 00:32:21 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 23 09:08:05 2022 +0100

CppunitTest_sfx2_classification: remove duplicated dispatchCommand

it's already defined in unotest::MacrosTest

Change-Id: I34645b95d83ca1ed167c99bd12c9b6ffebef032c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130400
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/qa/cppunit/test_classification.cxx 
b/sfx2/qa/cppunit/test_classification.cxx
index 49664aca6f2f..c086d2e973cb 100644
--- a/sfx2/qa/cppunit/test_classification.cxx
+++ b/sfx2/qa/cppunit/test_classification.cxx
@@ -27,7 +27,6 @@ namespace
 class ClassificationTest : public test::BootstrapFixture, public 
unotest::MacrosTest
 {
 uno::Reference mxComponent;
-void dispatchCommand(const uno::Reference& xComponent, 
const OUString& rCommand, const uno::Sequence& 
rPropertyValues);
 void testClassification();
 
 public:
@@ -59,20 +58,6 @@ void ClassificationTest::tearDown()
 test::BootstrapFixture::tearDown();
 }
 
-void ClassificationTest::dispatchCommand(const 
uno::Reference& xComponent, const OUString& rCommand, const 
uno::Sequence& rPropertyValues)
-{
-uno::Reference xController = 
uno::Reference(xComponent, 
uno::UNO_QUERY_THROW)->getCurrentController();
-CPPUNIT_ASSERT(xController.is());
-uno::Reference xFrame(xController->getFrame(), 
uno::UNO_QUERY);
-CPPUNIT_ASSERT(xFrame.is());
-
-uno::Reference xContext = 
::comphelper::getProcessComponentContext();
-uno::Reference 
xDispatchHelper(frame::DispatchHelper::create(xContext));
-CPPUNIT_ASSERT(xDispatchHelper.is());
-
-xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, 
rPropertyValues);
-}
-
 void ClassificationTest::testClassification()
 {
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(


[Libreoffice-commits] core.git: sfx2/qa sw/qa

2021-04-16 Thread Miklos Vajna (via logerrit)
 sfx2/qa/cppunit/doc.cxx  |2 --
 sw/qa/core/draw/draw.cxx |1 -
 sw/qa/core/fields/fields.cxx |9 +
 3 files changed, 1 insertion(+), 11 deletions(-)

New commits:
commit 53782068bd3550336b7dddb7251606222482da3c
Author: Miklos Vajna 
AuthorDate: Thu Apr 15 21:03:43 2021 +0200
Commit: Miklos Vajna 
CommitDate: Fri Apr 16 09:12:59 2021 +0200

Remove some unused includes

See tdf#42949 for motivation.

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

diff --git a/sfx2/qa/cppunit/doc.cxx b/sfx2/qa/cppunit/doc.cxx
index 058bf4788d67..7e62652b5bbb 100644
--- a/sfx2/qa/cppunit/doc.cxx
+++ b/sfx2/qa/cppunit/doc.cxx
@@ -17,8 +17,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 
 using namespace com::sun::star;
diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx
index c4654dde8127..97b6a2bb7d79 100644
--- a/sw/qa/core/draw/draw.cxx
+++ b/sw/qa/core/draw/draw.cxx
@@ -10,7 +10,6 @@
 #include 
 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/sw/qa/core/fields/fields.cxx b/sw/qa/core/fields/fields.cxx
index 8d82344a24af..74b94d7a3f8e 100644
--- a/sw/qa/core/fields/fields.cxx
+++ b/sw/qa/core/fields/fields.cxx
@@ -9,20 +9,13 @@
 
 #include 
 
-#include 
+#include 
 
 #include 
-#include 
-#include 
 
-#include 
-#include 
-#include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2021-04-08 Thread Miklos Vajna (via logerrit)
 sfx2/qa/uitest/doc/objserv.py |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d1a84b927b1203857d3d91ac5ddf0f1835ca1a48
Author: Miklos Vajna 
AuthorDate: Thu Apr 8 17:07:54 2021 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 8 18:17:55 2021 +0200

sfx2 objserv uitest: fix missing newline

PEP8 suggests two newlines after the module import list, restore that.

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

diff --git a/sfx2/qa/uitest/doc/objserv.py b/sfx2/qa/uitest/doc/objserv.py
index 58ac79aebe20..369c2a4393fd 100644
--- a/sfx2/qa/uitest/doc/objserv.py
+++ b/sfx2/qa/uitest/doc/objserv.py
@@ -7,6 +7,7 @@
 from uitest.framework import UITestCase
 from uitest.uihelper.common import get_url_for_data_file
 
+
 # Test for sfx2/source/doc/objserv.cxx.
 class Test(UITestCase):
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa sw/qa

2021-04-07 Thread Xisco Fauli (via logerrit)
 sfx2/qa/uitest/doc/objserv.py   |8 +---
 sw/qa/uitest/writer_tests4/tdf138546.py |6 ++
 sw/qa/uitest/writer_tests7/tdf137803.py |8 +---
 sw/qa/uitest/writer_tests7/tdf140117.py |8 +---
 sw/qa/uitest/writer_tests7/tdf141158.py |8 +---
 sw/qa/uitest/writer_tests7/tdf46561.py  |7 +--
 6 files changed, 7 insertions(+), 38 deletions(-)

New commits:
commit bd78ce123cd65fb8d0843df1d2530a168d5d464d
Author: Xisco Fauli 
AuthorDate: Wed Apr 7 10:31:13 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Apr 7 18:20:17 2021 +0200

uitest: remove duplicated code

Change-Id: I86a4cd75e103445a288ad52a8c2167fa5b20c794
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113720
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/qa/uitest/doc/objserv.py b/sfx2/qa/uitest/doc/objserv.py
index 692d0fb88e17..58ac79aebe20 100644
--- a/sfx2/qa/uitest/doc/objserv.py
+++ b/sfx2/qa/uitest/doc/objserv.py
@@ -5,13 +5,7 @@
 #
 
 from uitest.framework import UITestCase
-import org.libreoffice.unotest
-import pathlib
-
-
-def get_url_for_data_file(file_name):
-return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
+from uitest.uihelper.common import get_url_for_data_file
 
 # Test for sfx2/source/doc/objserv.cxx.
 class Test(UITestCase):
diff --git a/sw/qa/uitest/writer_tests4/tdf138546.py 
b/sw/qa/uitest/writer_tests4/tdf138546.py
index c94f7eed3d48..0513d8c7600c 100644
--- a/sw/qa/uitest/writer_tests4/tdf138546.py
+++ b/sw/qa/uitest/writer_tests4/tdf138546.py
@@ -8,10 +8,8 @@ from uitest.framework import UITestCase
 from uitest.uihelper.common import change_measurement_unit
 from uitest.uihelper.common import get_state_as_dict, type_text
 from uitest.uihelper.common import select_pos
-import org.libreoffice.unotest
-import pathlib
-def get_url_for_data_file(file_name):
-return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_url_for_data_file
+
 class tdf138546(UITestCase):
 def test_tdf138546(self):
 self.ui_test.load_file(get_url_for_data_file("tdf138546.odt"))
diff --git a/sw/qa/uitest/writer_tests7/tdf137803.py 
b/sw/qa/uitest/writer_tests7/tdf137803.py
index 2c3f0fcb3713..d3eef57ead81 100644
--- a/sw/qa/uitest/writer_tests7/tdf137803.py
+++ b/sw/qa/uitest/writer_tests7/tdf137803.py
@@ -7,13 +7,7 @@
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict
-import importlib
-import time
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_url_for_data_file
 
 class tdf137803(UITestCase):
 def test_tdf137803(self):
diff --git a/sw/qa/uitest/writer_tests7/tdf140117.py 
b/sw/qa/uitest/writer_tests7/tdf140117.py
index c86d11091364..58db4c4caf79 100644
--- a/sw/qa/uitest/writer_tests7/tdf140117.py
+++ b/sw/qa/uitest/writer_tests7/tdf140117.py
@@ -9,13 +9,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.common import type_text
-import importlib
-import time
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_url_for_data_file
 
 class tdf140117(UITestCase):
 def test_tdf140117(self):
diff --git a/sw/qa/uitest/writer_tests7/tdf141158.py 
b/sw/qa/uitest/writer_tests7/tdf141158.py
index 906035e37e89..e29c36418958 100644
--- a/sw/qa/uitest/writer_tests7/tdf141158.py
+++ b/sw/qa/uitest/writer_tests7/tdf141158.py
@@ -3,16 +3,10 @@
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict
-import importlib
-import pathlib
-import org.libreoffice.unotest
 from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import get_url_for_data_file
 import time
 
-def get_url_for_data_file(file_name):
-return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
-
 class TestTdf141158(UITestCase):
 def test_tdf141158(self):
 # load the desired bugdoc
diff --git a/sw/qa/uitest/writer_tests7/tdf46561.py 
b/sw/qa/uitest/writer_tests7/tdf46561.py
index 235136524903..1c90dc3c404a 100644
--- a/sw/qa/uitest/writer_tests7/tdf46561.py
+++ b/sw/qa/uitest/writer_tests7/tdf46561.py
@@ -8,12 +8,7 @@ from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.common import type_text
-import importlib
-import 

[Libreoffice-commits] core.git: sfx2/qa sfx2/source

2020-07-01 Thread Stephan Bergmann (via logerrit)
 sfx2/qa/cppunit/test_controlleritem.cxx |2 
 sfx2/source/appl/appuno.cxx |  124 ++--
 sfx2/source/appl/childwin.cxx   |2 
 sfx2/source/appl/shutdownicon.cxx   |2 
 sfx2/source/appl/workwin.cxx|   10 +-
 sfx2/source/bastyp/fltfnc.cxx   |4 
 sfx2/source/bastyp/frmhtml.cxx  |8 -
 sfx2/source/bastyp/frmhtmlw.cxx |4 
 sfx2/source/bastyp/sfxhtml.cxx  |2 
 sfx2/source/control/recentdocsview.cxx  |4 
 sfx2/source/control/templatedefaultview.cxx |4 
 sfx2/source/dialog/dockwin.cxx  |2 
 sfx2/source/dialog/filtergrouping.cxx   |2 
 sfx2/source/dialog/mailmodel.cxx|2 
 sfx2/source/doc/DocumentMetadataAccess.cxx  |8 -
 sfx2/source/doc/Metadatable.cxx |4 
 sfx2/source/doc/SfxDocumentMetaData.cxx |2 
 sfx2/source/doc/objxtor.cxx |2 
 sfx2/source/notebookbar/SfxNotebookBar.cxx  |4 
 sfx2/source/sidebar/DeckLayouter.cxx|2 
 sfx2/source/sidebar/DeckTitleBar.cxx|4 
 sfx2/source/sidebar/PanelTitleBar.cxx   |4 
 sfx2/source/sidebar/SidebarController.cxx   |8 -
 sfx2/source/sidebar/TitleBar.cxx|4 
 sfx2/source/view/lokhelper.cxx  |4 
 25 files changed, 109 insertions(+), 109 deletions(-)

New commits:
commit 69861703cb40a27ed0427313a2ab0237140d54a8
Author: Stephan Bergmann 
AuthorDate: Wed Jul 1 22:39:03 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 1 23:48:44 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: sfx2

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

diff --git a/sfx2/qa/cppunit/test_controlleritem.cxx 
b/sfx2/qa/cppunit/test_controlleritem.cxx
index 9576e7b192a5..75d220536712 100644
--- a/sfx2/qa/cppunit/test_controlleritem.cxx
+++ b/sfx2/qa/cppunit/test_controlleritem.cxx
@@ -30,7 +30,7 @@ public:
 private:
 };
 
-static bool bDeleted = false;
+bool bDeleted = false;
 
 class FooController : public SfxControllerItem {
 public:
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 1bdb0c0e9831..7ac8358696be 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -92,68 +92,68 @@ SfxFormalArgument const aFormalArgs[] = {
 { reinterpret_cast(_Impl), "RedactionStyle", 
SID_REDACTION_STYLE },
 };
 
-static sal_uInt16 const nMediaArgsCount = SAL_N_ELEMENTS(aFormalArgs);
-
-static char const sTemplateRegionName[] = "TemplateRegionName";
-static char const sTemplateName[] = "TemplateName";
-static char const sAsTemplate[] = "AsTemplate";
-static char const sOpenNewView[] = "OpenNewView";
-static char const sViewId[] = "ViewId";
-static char const sPluginMode[] = "PluginMode";
-static char const sReadOnly[] = "ReadOnly";
-static char const sDdeReconnect[] = "DDEReconnect";
-static char const sStartPresentation[] = "StartPresentation";
-static char const sFrameName[] = "FrameName";
-static char const sMediaType[] = "MediaType";
-static char const sPostData[] = "PostData";
-static char const sCharacterSet[] = "CharacterSet";
-static char const sInputStream[] = "InputStream";
-static char const sStream[] = "Stream";
-static char const sOutputStream[] = "OutputStream";
-static char const sHidden[] = "Hidden";
-static char const sPreview[] = "Preview";
-static char const sViewOnly[] = "ViewOnly";
-static char const sDontEdit[] = "DontEdit";
-static char const sSilent[] = "Silent";
-static char const sJumpMark[] = "JumpMark";
-static char const sSalvagedFile[] = "SalvagedFile";
-static char const sStatusInd[] = "StatusIndicator";
-static char const sModel[] = "Model";
-static char const sFrame[] = "Frame";
-static char const sViewData[] = "ViewData";
-static char const sFilterData[] = "FilterData";
-static char const sSelectionOnly[] = "SelectionOnly";
-static char const sMacroExecMode[] = "MacroExecutionMode";
-static char const sUpdateDocMode[] = "UpdateDocMode";
-static char const sMinimized[] = "Minimized";
-static char const sInteractionHdl[] = "InteractionHandler";
-static char const sUCBContent[] = "UCBContent";
-static char const sRepairPackage[] = "RepairPackage";
-static char const sDocumentTitle[] = "DocumentTitle";
-static char const sComponentData[] = "ComponentData";
-static char const sComponentContext[] = "ComponentContext";
-static char const sDocumentBaseURL[] = "DocumentBaseURL";
-static char const sHierarchicalDocumentName[] = "HierarchicalDocumentName";
-static char const sCopyStreamIfPossible[] = "CopyStreamIfPossible";
-static char const sNoAutoSave[] = "NoAutoSave";
-static char const sFolderName[] = "FolderName";
-static char const sUseSystemDialog[] = "UseSystemDialog";
-static char const sStandardDir[] = "StandardDir";
-static char const sBlackList[] 

[Libreoffice-commits] core.git: sfx2/qa vcl/source

2020-06-16 Thread Miklos Vajna (via logerrit)
 sfx2/qa/uitest/doc/objserv.py |2 +
 vcl/source/gdi/pdfwriter_impl.cxx |   51 +-
 2 files changed, 26 insertions(+), 27 deletions(-)

New commits:
commit c43e62f26f8d51c2ad97f6c93877ce9d3ae9639e
Author: Miklos Vajna 
AuthorDate: Tue Jun 16 18:05:50 2020 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 16 18:53:01 2020 +0200

vcl: namespace PDFWriterImpl consistently

We had a mix of 'using namespace vcl;' and 'namespace vcl {',
standardize on the later.

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

diff --git a/sfx2/qa/uitest/doc/objserv.py b/sfx2/qa/uitest/doc/objserv.py
index af00590736ea..692d0fb88e17 100644
--- a/sfx2/qa/uitest/doc/objserv.py
+++ b/sfx2/qa/uitest/doc/objserv.py
@@ -8,9 +8,11 @@ from uitest.framework import UITestCase
 import org.libreoffice.unotest
 import pathlib
 
+
 def get_url_for_data_file(file_name):
 return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
+
 # Test for sfx2/source/doc/objserv.cxx.
 class Test(UITestCase):
 
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 6400198890a5..304ae011ee72 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -93,7 +93,6 @@
 #include 
 #endif
 
-using namespace vcl;
 using namespace::com::sun::star;
 
 static bool g_bDebugDisableCompression = 
getenv("VCL_DEBUG_DISABLE_PDFCOMPRESSION");
@@ -121,12 +120,6 @@ static const double fDivisor = 1000.0;
 static double pixelToPoint( double px ) { return px/fDivisor; }
 static sal_Int32 pointToPixel( double pt ) { return sal_Int32(pt*fDivisor); }
 
-const sal_uInt8 PDFWriterImpl::s_nPadString[32] =
-{
-0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 
0xFF, 0xFA, 0x01, 0x08,
-0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 
0x64, 0x53, 0x69, 0x7A
-};
-
 static void appendHex( sal_Int8 nInt, OStringBuffer& rBuffer )
 {
 static const char pHexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7',
@@ -270,6 +263,29 @@ static void appendDestinationName( const OUString& 
rString, OStringBuffer& rBuff
 }
 }
 
+namespace vcl
+{
+const sal_uInt8 PDFWriterImpl::s_nPadString[32] =
+{
+0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 
0xFF, 0xFA, 0x01, 0x08,
+0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 
0x64, 0x53, 0x69, 0x7A
+};
+
+template < class GEOMETRY >
+static GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, 
OutputDevice* _pPixelConversion, const GEOMETRY& _rObject )
+{
+GEOMETRY aPoint;
+if ( MapUnit::MapPixel == _rSource.GetMapUnit() )
+{
+aPoint = _pPixelConversion->PixelToLogic( _rObject, _rDest );
+}
+else
+{
+aPoint = OutputDevice::LogicToLogic( _rObject, _rSource, _rDest );
+}
+return aPoint;
+}
+
 void PDFWriter::AppendUnicodeTextString(const OUString& rString, 
OStringBuffer& rBuffer)
 {
 rBuffer.append( "FEFF" );
@@ -777,24 +793,6 @@ bool PDFPage::emit(sal_Int32 nParentObject )
 return m_pWriter->writeBuffer( aLine.getStr(), aLine.getLength() );
 }
 
-namespace vcl
-{
-template < class GEOMETRY >
-static GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, 
OutputDevice* _pPixelConversion, const GEOMETRY& _rObject )
-{
-GEOMETRY aPoint;
-if ( MapUnit::MapPixel == _rSource.GetMapUnit() )
-{
-aPoint = _pPixelConversion->PixelToLogic( _rObject, _rDest );
-}
-else
-{
-aPoint = OutputDevice::LogicToLogic( _rObject, _rSource, _rDest );
-}
-return aPoint;
-}
-}
-
 void PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rBuffer ) const
 {
 Point aPoint( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
@@ -5440,7 +5438,6 @@ void PDFWriterImpl::sortWidgets()
 // FIXME: implement tab order in structure tree for PDF 1.5
 }
 
-namespace vcl {
 class PDFStreamIf :
 public cppu::WeakImplHelper< css::io::XOutputStream >
 {
@@ -5453,7 +5450,6 @@ class PDFStreamIf :
 virtual void SAL_CALL flush() override;
 virtual void SAL_CALL closeOutput() override;
 };
-}
 
 void SAL_CALL  PDFStreamIf::writeBytes( const css::uno::Sequence< sal_Int8 >& 
aData )
 {
@@ -11220,5 +11216,6 @@ sal_Int32 ReferenceXObjectEmit::getObject() const
 else
 return m_nBitmapObject;
 }
+}
 
 /* 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: sfx2/qa sfx2/source

2020-06-05 Thread Stephan Bergmann (via logerrit)
 sfx2/qa/cppunit/test_metadatable.cxx|9 +++--
 sfx2/source/dialog/dockwin.cxx  |3 +--
 sfx2/source/dialog/mailmodel.cxx|3 +--
 sfx2/source/dialog/partwnd.cxx  |3 +--
 sfx2/source/doc/SfxDocumentMetaData.cxx |4 +---
 sfx2/source/doc/doctemplates.cxx|3 +--
 sfx2/source/doc/guisaveas.cxx   |3 +--
 sfx2/source/doc/templatedlg.cxx |3 +--
 sfx2/source/view/viewsh.cxx |3 +--
 9 files changed, 11 insertions(+), 23 deletions(-)

New commits:
commit 7653e4f209a5e81860d029c8a6c5436c0b25efdb
Author: Stephan Bergmann 
AuthorDate: Fri Jun 5 07:36:56 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 5 14:20:51 2020 +0200

Upcoming loplugin:elidestringvar: sfx2

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

diff --git a/sfx2/qa/cppunit/test_metadatable.cxx 
b/sfx2/qa/cppunit/test_metadatable.cxx
index 06b18edfec43..7508d467a7ac 100644
--- a/sfx2/qa/cppunit/test_metadatable.cxx
+++ b/sfx2/qa/cppunit/test_metadatable.cxx
@@ -84,15 +84,12 @@ void MetadatableTest::test()
 MockMetadatable m5(*pReg);
 OUString empty;
 OUString content( "content.xml" );
-OUString const styles( "styles.xml" );
-OUString const sid1( "id1" );
-OUString const sid2( "id2" );
 OUString sid3( "id3" );
 OUString sid4( "id4" );
-beans::StringPair id1(content, sid1);
-beans::StringPair id2(content, sid2);
+beans::StringPair id1(content, "id1");
+beans::StringPair id2(content, "id2");
 beans::StringPair id3(content, sid3);
-beans::StringPair id4(styles,  sid4);
+beans::StringPair id4("styles.xml",  sid4);
 beans::StringPair id3e(empty,  sid3);
 beans::StringPair id4e(empty,  sid4);
 m1.SetMetadataReference(id1);
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 926a68ab8bfa..0287b1ac1fb8 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -128,7 +128,6 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* 
pParentWnd ,
 : SfxChildWindow( pParentWnd , nId )
 {
 uno::Reference< uno::XComponentContext > xContext = 
::comphelper::getProcessComponentContext();
-const OUString aDockWindowResourceURL( "private:resource/dockingwindow/" );
 
 VclPtr pTitleDockWindow = 
VclPtr::Create( pBindings, this, pParentWnd,
 WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | 
WB_ROLLABLE);
@@ -141,7 +140,7 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* 
pParentWnd ,
 SfxDispatcher* pDispatcher = pBindings->GetDispatcher();
 uno::Reference< frame::XFrame > xFrame = 
pDispatcher->GetFrame()->GetFrame().GetFrameInterface();
 // create a resource URL from the nId provided by the sfx2
-OUString aResourceURL =  aDockWindowResourceURL + OUString::number(nId);
+OUString aResourceURL =  "private:resource/dockingwindow/" + 
OUString::number(nId);
 uno::Sequence aArgs(comphelper::InitAnyPropertySequence(
 {
 {"Frame", uno::Any(xFrame)},
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 63e29270d6c2..a58080b601ee 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -432,8 +432,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
 if ( !bHasLocation )
 {
 // Create a noname file name with the correct extension
-const OUString aNoNameFileName( "noname" );
-aFileName = aNoNameFileName;
+aFileName = "noname";
 }
 else
 {
diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx
index 367eb49e0d93..e387d2c5ba1c 100644
--- a/sfx2/source/dialog/partwnd.cxx
+++ b/sfx2/source/dialog/partwnd.cxx
@@ -105,8 +105,7 @@ SfxPartDockWnd_Impl::SfxPartDockWnd_Impl
 {
 css::uno::Reference< css::beans::XPropertySet > xLMPropSet( 
xFrame->getLayoutManager(), css::uno::UNO_QUERY_THROW );
 
-const OUString aAutomaticToolbars( "AutomaticToolbars" );
-xLMPropSet->setPropertyValue( aAutomaticToolbars, css::uno::Any( false 
));
+xLMPropSet->setPropertyValue( "AutomaticToolbars", css::uno::Any( 
false ));
 }
 catch( css::uno::RuntimeException& )
 {
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx 
b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 8c2e577eda67..c8638a52fa33 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1054,13 +1054,11 @@ void SfxDocumentMetaData::init(
 // NB: we do not handle the single-XML-file ODF variant, which would
 // have the root element office:document.
 // The root of such documents must be converted in the importer!
-

[Libreoffice-commits] core.git: sfx2/qa

2019-10-09 Thread Caolán McNamara (via logerrit)
 sfx2/qa/cppunit/test_misc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6067362bd4f5d16d3d72ac4a8f4895341b543cf1
Author: Caolán McNamara 
AuthorDate: Wed Oct 9 09:00:42 2019 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 9 12:29:52 2019 +0200

this text -> this test

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 13f5a68128fa..768a017f03ac 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -171,7 +171,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
 xStorable->store();
 
 struct stat buf;
-// coverity[fs_check_call] - this is legitimate in the context of this text
+// coverity[fs_check_call] - this is legitimate in the context of this test
 nRet = stat(aOld.getStr(), );
 CPPUNIT_ASSERT_EQUAL(0, nRet);
 // This failed: hard link count was 1, the hard link broke on store.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sfx2/qa

2019-07-11 Thread Andrea Gelmini (via logerrit)
 sfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 677e2d6bf2b121b6c7b6faec8c08c08fb9ceec08
Author: Andrea Gelmini 
AuthorDate: Thu Jul 11 08:19:32 2019 +0200
Commit: Julien Nabet 
CommitDate: Thu Jul 11 10:55:49 2019 +0200

Fix typo

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

diff --git a/sfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java 
b/sfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java
index 67dbb17295d1..37b5d0d9cd7c 100644
--- a/sfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java
+++ b/sfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java
@@ -79,7 +79,7 @@ public abstract class DrawingOrPresentationDocumentTest 
extends DocumentTestBase
 final Object shape = firstPageShapes.getByIndex(0);
 verifyShapeGeometry( shape, BIG_CIRCLE_SIZE, BIG_CIRCLE_SIZE );
 final XPropertySet shapeProps = UnoRuntime.queryInterface( 
XPropertySet.class, shape );
-assertEquals( "wrong circle tpye", CIRCLE_TYPE.getValue(), 
((CircleKind)shapeProps.getPropertyValue( "CircleKind" )).getValue() );
+assertEquals( "wrong circle type", CIRCLE_TYPE.getValue(), 
((CircleKind)shapeProps.getPropertyValue( "CircleKind" )).getValue() );
 //assertEquals( "wrong circle fill color", FILL_COLOR, 
((Integer)shapeProps.getPropertyValue( "FillColor" )).intValue() );
 // disable this particular check: A bug in the drawing layer API 
restores the FillColor to its
 // default value upon re-insertion. This is issue #i115080#
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sfx2/qa

2019-05-12 Thread Jan-Marek Glogowski (via logerrit)
 sfx2/qa/cppunit/test_misc.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit ce76026231d9536d2025a1e69f435bcbf39fe4f8
Author: Jan-Marek Glogowski 
AuthorDate: Sat May 11 18:49:54 2019 +
Commit: Jan-Marek Glogowski 
CommitDate: Mon May 13 06:08:29 2019 +0200

Handle *link return value in sfx2 test

Change-Id: I63008858558312b5fb7378249c56fbc3729c9a19
Reviewed-on: https://gerrit.libreoffice.org/72180
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 7022641db583..13f5a68128fa 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -161,7 +161,8 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
 OString aOld = aTargetPath.toUtf8();
 aTargetPath += ".2";
 OString aNew = aTargetPath.toUtf8();
-link(aOld.getStr(), aNew.getStr());
+int nRet = link(aOld.getStr(), aNew.getStr());
+CPPUNIT_ASSERT_EQUAL(0, nRet);
 
 uno::Reference xComponent = loadFromDesktop(aURL, 
"com.sun.star.text.TextDocument");
 CPPUNIT_ASSERT(xComponent.is());
@@ -171,7 +172,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
 
 struct stat buf;
 // coverity[fs_check_call] - this is legitimate in the context of this text
-int nRet = stat(aOld.getStr(), );
+nRet = stat(aOld.getStr(), );
 CPPUNIT_ASSERT_EQUAL(0, nRet);
 // This failed: hard link count was 1, the hard link broke on store.
 CPPUNIT_ASSERT(buf.st_nlink > 1);
@@ -179,7 +180,8 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
 // Test that symlinks are preserved as well.
 nRet = remove(aNew.getStr());
 CPPUNIT_ASSERT_EQUAL(0, nRet);
-symlink(aOld.getStr(), aNew.getStr());
+nRet = symlink(aOld.getStr(), aNew.getStr());
+CPPUNIT_ASSERT_EQUAL(0, nRet);
 xStorable->storeToURL(aURL + ".2", {});
 nRet = lstat(aNew.getStr(), );
 CPPUNIT_ASSERT_EQUAL(0, nRet);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sfx2/qa

2018-11-07 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |   19 +++
 1 file changed, 3 insertions(+), 16 deletions(-)

New commits:
commit caec23449a21c0eacbb593330a5b22f8c60d58e8
Author: Miklos Vajna 
AuthorDate: Tue Nov 6 21:46:03 2018 +0100
Commit: Miklos Vajna 
CommitDate: Wed Nov 7 13:13:32 2018 +0100

CppunitTest_sfx2_misc: use CPPUNIT_TEST_FIXTURE()

Allows not spelling out the test names 3 times.

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 2f419103cbd8..7022641db583 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -50,9 +50,6 @@ class MiscTest
 {
 public:
 virtual void setUp() override;
-void testODFCustomMetadata();
-void testNoThumbnail();
-void testHardLinks();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx) override
 {
@@ -64,14 +61,6 @@ public:
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("foo"), 
BAD_CAST("http://foo.net;));
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("baz"), 
BAD_CAST("http://baz.net;));
 }
-
-CPPUNIT_TEST_SUITE(MiscTest);
-CPPUNIT_TEST(testODFCustomMetadata);
-CPPUNIT_TEST(testNoThumbnail);
-CPPUNIT_TEST(testHardLinks);
-CPPUNIT_TEST_SUITE_END();
-
-private:
 };
 
 void MiscTest::setUp()
@@ -81,7 +70,7 @@ void MiscTest::setUp()
 SfxApplication::GetOrCreate();
 }
 
-void MiscTest::testODFCustomMetadata()
+CPPUNIT_TEST_FIXTURE(MiscTest, testODFCustomMetadata)
 {
 uno::Reference const xProps(
 ::com::sun::star::document::DocumentProperties::create(m_xContext));
@@ -110,7 +99,7 @@ void MiscTest::testODFCustomMetadata()
 aTempFile.EnableKillingFile();
 }
 
-void MiscTest::testNoThumbnail()
+CPPUNIT_TEST_FIXTURE(MiscTest, testNoThumbnail)
 {
 // Load a document.
 const OUString 
aURL(m_directories.getURLFromSrc("/sfx2/qa/cppunit/misc/hello.odt"));
@@ -160,7 +149,7 @@ void MiscTest::testNoThumbnail()
 xComponent->dispose();
 }
 
-void MiscTest::testHardLinks()
+CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks)
 {
 #ifndef _WIN32
 OUString aSourceDir = 
m_directories.getURLFromSrc("/sfx2/qa/cppunit/misc/");
@@ -201,8 +190,6 @@ void MiscTest::testHardLinks()
 #endif
 }
 
-CPPUNIT_TEST_SUITE_REGISTRATION(MiscTest);
-
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2018-09-26 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 619cda0fce93dde1dcda9353270c1a001bf339a8
Author: Andrea Gelmini 
AuthorDate: Wed Sep 26 16:52:41 2018 +0200
Commit: Julien Nabet 
CommitDate: Wed Sep 26 21:16:29 2018 +0200

Fix typo

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index cf9fcdb3e0be..2f419103cbd8 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -187,7 +187,7 @@ void MiscTest::testHardLinks()
 // This failed: hard link count was 1, the hard link broke on store.
 CPPUNIT_ASSERT(buf.st_nlink > 1);
 
-// Test that symlinks are presreved as well.
+// Test that symlinks are preserved as well.
 nRet = remove(aNew.getStr());
 CPPUNIT_ASSERT_EQUAL(0, nRet);
 symlink(aOld.getStr(), aNew.getStr());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2018-09-22 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9b1af015fba717db26e6419365b25b4c274fedea
Author: Caolán McNamara 
AuthorDate: Sat Sep 22 14:37:32 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sat Sep 22 16:43:53 2018 +0200

try other markup

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index c86eca8262a2..cf9fcdb3e0be 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -181,7 +181,7 @@ void MiscTest::testHardLinks()
 xStorable->store();
 
 struct stat buf;
-// coverity[toctou] - this is legitimate in the context of this text
+// coverity[fs_check_call] - this is legitimate in the context of this text
 int nRet = stat(aOld.getStr(), );
 CPPUNIT_ASSERT_EQUAL(0, nRet);
 // This failed: hard link count was 1, the hard link broke on store.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2018-09-21 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ed480e918b6c1d3566ebfdfae6687bc4a4a06c10
Author: Caolán McNamara 
AuthorDate: Fri Sep 21 09:12:24 2018 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 21 11:28:21 2018 +0200

coverity#1439338 silence Time of check time of use

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 4f4920185e0d..c86eca8262a2 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -181,6 +181,7 @@ void MiscTest::testHardLinks()
 xStorable->store();
 
 struct stat buf;
+// coverity[toctou] - this is legitimate in the context of this text
 int nRet = stat(aOld.getStr(), );
 CPPUNIT_ASSERT_EQUAL(0, nRet);
 // This failed: hard link count was 1, the hard link broke on store.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2018-09-15 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 1c7cd5cfba5d3a0812cf205057806f046a088d9d
Author: Caolán McNamara 
AuthorDate: Sat Sep 15 13:28:57 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sat Sep 15 18:17:01 2018 +0200

coverity#1439340 Unchecked return value from library

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 83c4c8db77f7..4f4920185e0d 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -187,7 +187,8 @@ void MiscTest::testHardLinks()
 CPPUNIT_ASSERT(buf.st_nlink > 1);
 
 // Test that symlinks are presreved as well.
-remove(aNew.getStr());
+nRet = remove(aNew.getStr());
+CPPUNIT_ASSERT_EQUAL(0, nRet);
 symlink(aOld.getStr(), aNew.getStr());
 xStorable->storeToURL(aURL + ".2", {});
 nRet = lstat(aNew.getStr(), );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa sfx2/source

2018-09-04 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |9 +
 sfx2/source/doc/docfile.cxx   |   11 ++-
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 72be5ac08aa963bdd42d2e56a62f43e69f728caa
Author: Miklos Vajna 
AuthorDate: Mon Sep 3 21:07:00 2018 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 4 14:33:37 2018 +0200

tdf#119381 sfx2 store: don't break symlink targets

osl::File::move() would not follow symlinks for the target, so don't
move the file in that case.

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index fa3a2c1bca6d..83c4c8db77f7 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -186,6 +186,15 @@ void MiscTest::testHardLinks()
 // This failed: hard link count was 1, the hard link broke on store.
 CPPUNIT_ASSERT(buf.st_nlink > 1);
 
+// Test that symlinks are presreved as well.
+remove(aNew.getStr());
+symlink(aOld.getStr(), aNew.getStr());
+xStorable->storeToURL(aURL + ".2", {});
+nRet = lstat(aNew.getStr(), );
+CPPUNIT_ASSERT_EQUAL(0, nRet);
+// This failed, the hello.odt.2 symlink was replaced with a real file.
+CPPUNIT_ASSERT(bool(S_ISLNK(buf.st_mode)));
+
 xComponent->dispose();
 #endif
 }
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f8f5c85f757b..5d1888a60d5c 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -200,8 +200,8 @@ sal_uInt64 GetDefaultFileAttributes(const OUString& rURL)
 return nRet;
 }
 
-/// Determines if rURL is a non-hard-linked file:// URL.
-bool IsNotHardLinkedFile(const OUString& rURL)
+/// Determines if rURL is a non-linked (symlink or hardlink) file:// URL.
+bool IsNotLinkedFile(const OUString& rURL)
 {
 if (!comphelper::isFileUrl(rURL))
 return false;
@@ -212,10 +212,11 @@ bool IsNotHardLinkedFile(const OUString& rURL)
 return false;
 
 struct stat buf;
-if (stat(rPath.toUtf8().getStr(), ) != 0)
+if (lstat(rPath.toUtf8().getStr(), ) != 0)
 return false;
 
-if (buf.st_nlink > 1)
+// Hardlink or symlink: osl::File::move() doesn't play with these nicely.
+if (buf.st_nlink > 1 || S_ISLNK(buf.st_mode))
 return false;
 #endif
 
@@ -1843,7 +1844,7 @@ void SfxMedium::TransactedTransferForFS_Impl( const 
INetURLObject& aSource,
 OUString aDestMainURL = 
aDest.GetMainURL(INetURLObject::DecodeMechanism::NONE);
 
 sal_uInt64 nAttributes = 
GetDefaultFileAttributes(aDestMainURL);
-if (IsNotHardLinkedFile(aDestMainURL) && 
osl::File::move(aSourceMainURL, aDestMainURL) == osl::FileBase::E_None)
+if (IsNotLinkedFile(aDestMainURL) && 
osl::File::move(aSourceMainURL, aDestMainURL) == osl::FileBase::E_None)
 {
 if (nAttributes)
 // Adjust attributes, source might be created with
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa sfx2/source

2018-08-28 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |8 
 sfx2/source/doc/docfile.cxx   |4 +++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 38afe2976eea427999c39ee3a73e7938ec8d5f7b
Author: Miklos Vajna 
AuthorDate: Tue Aug 28 09:05:06 2018 +0200
Commit: Miklos Vajna 
CommitDate: Tue Aug 28 15:28:09 2018 +0200

tdf#119050 sfx2 store: don't inherit temp file permissions when overwriting

The too aggressive error handling in commit
fb04780cf8523ad4e900ae8b9cecbe7a2697a12a (tdf#116117 sfx2 store: don't
inherit temp file permissions when renaming, 2018-03-12) means that if
the file is already there, then we don't try to stat() it; even if there
is no problem with that.

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 9c21ae95d704..fa3a2c1bca6d 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -146,6 +146,14 @@ void MiscTest::testNoThumbnail()
 // umask requested so:
 CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_GrpRead);
 CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_OthRead);
+
+// Now "save as" again to trigger the "overwrite" case.
+xStorable->storeToURL(aTempFile.GetURL(), {});
+CPPUNIT_ASSERT_EQUAL(osl::DirectoryItem::E_None, 
aItem.getFileStatus(aStatus));
+// The following check used to fail in the past, result had temp file
+// permissions.
+CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_GrpRead);
+
 umask(nMask);
 #endif
 
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 638ecb5fc2f0..f8f5c85f757b 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -180,8 +180,10 @@ sal_uInt64 GetDefaultFileAttributes(const OUString& rURL)
 if (!comphelper::isFileUrl(rURL))
 return nRet;
 
+// Make sure the file exists (and create it if not).
 osl::File aFile(rURL);
-if (aFile.open(osl_File_OpenFlag_Create) != osl::File::E_None)
+osl::File::RC nRes = aFile.open(osl_File_OpenFlag_Create);
+if (nRes != osl::File::E_None && nRes != osl::File::E_EXIST)
 return nRet;
 
 aFile.close();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2018-08-09 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit bab5511870e8ad847020645628df8090116f0e8b
Author: Stephan Bergmann 
AuthorDate: Thu Aug 9 13:13:40 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 9 16:57:00 2018 +0200

Set umask /before/ using it

The test used to fail when umask originally was e.g. 077.

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 7162dfc58581..9c21ae95d704 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -119,6 +119,9 @@ void MiscTest::testNoThumbnail()
 CPPUNIT_ASSERT(xComponent.is());
 
 // Save it with the NoThumbnail option and assert that it has no thumbnail.
+#ifndef _WIN32
+mode_t nMask = umask(022);
+#endif
 uno::Reference xStorable(xComponent, uno::UNO_QUERY);
 CPPUNIT_ASSERT(xStorable.is());
 utl::TempFile aTempFile;
@@ -132,7 +135,6 @@ void MiscTest::testNoThumbnail()
 
 #ifndef _WIN32
 // Check permissions of the URL after store.
-mode_t nMask = umask(022);
 osl::DirectoryItem aItem;
 CPPUNIT_ASSERT_EQUAL(osl::DirectoryItem::E_None,
  osl::DirectoryItem::get(aTempFile.GetURL(), aItem));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2018-08-09 Thread Libreoffice Gerrit user
 sfx2/qa/cppunit/test_misc.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7cb07a7a7cb2b05be3f698daccf8bfaef427a728
Author: Stephan Bergmann 
AuthorDate: Thu Aug 9 13:23:37 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 9 15:22:18 2018 +0200

Improve wording of comment

...as discussed on #libreoffice-dev

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 88764a63f842..7162dfc58581 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -140,8 +140,8 @@ void MiscTest::testNoThumbnail()
 osl::FileStatus aStatus(osl_FileStatus_Mask_Attributes);
 CPPUNIT_ASSERT_EQUAL(osl::DirectoryItem::E_None, 
aItem.getFileStatus(aStatus));
 
-// This failed, osl_File_Attribute_GrpRead was not set even if umask
-// requested so.
+// The following checks used to fail in the past, 
osl_File_Attribute_GrpRead was not set even if
+// umask requested so:
 CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_GrpRead);
 CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_OthRead);
 umask(nMask);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa sfx2/source

2018-03-26 Thread Miklos Vajna
 sfx2/qa/cppunit/test_misc.cxx |   32 
 sfx2/source/doc/docfile.cxx   |   28 +++-
 2 files changed, 59 insertions(+), 1 deletion(-)

New commits:
commit 546ed01e62c9a36a675c7390371aaec7f1647a33
Author: Miklos Vajna 
Date:   Mon Mar 26 10:40:52 2018 +0200

sfx2 store: avoid rename() for files with >1 hard link count

Rename would break the hard link; in practice e.g. Online's 'make run'
debug feature depends on not breaking hardlinks.

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index a1ecc01a7c61..72f21fc66c3a 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -11,6 +11,7 @@
 
 #ifndef _WIN32
 #include 
+#include 
 #endif
 #include 
 
@@ -51,6 +52,7 @@ public:
 virtual void setUp() override;
 void testODFCustomMetadata();
 void testNoThumbnail();
+void testHardLinks();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx) override
 {
@@ -66,6 +68,7 @@ public:
 CPPUNIT_TEST_SUITE(MiscTest);
 CPPUNIT_TEST(testODFCustomMetadata);
 CPPUNIT_TEST(testNoThumbnail);
+CPPUNIT_TEST(testHardLinks);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -147,6 +150,35 @@ void MiscTest::testNoThumbnail()
 xComponent->dispose();
 }
 
+void MiscTest::testHardLinks()
+{
+#ifndef _WIN32
+OUString aSourceDir = 
m_directories.getURLFromSrc("/sfx2/qa/cppunit/misc/");
+OUString aTargetDir = 
m_directories.getURLFromWorkdir("/CppunitTest/sfx2_misc.test.user/");
+const OUString aURL(aTargetDir + "hello.odt");
+osl::File::copy(aSourceDir + "hello.odt", aURL);
+OUString aTargetPath;
+osl::FileBase::getSystemPathFromFileURL(aURL, aTargetPath);
+OString aOld = aTargetPath.toUtf8();
+aTargetPath += ".2";
+OString aNew = aTargetPath.toUtf8();
+link(aOld.getStr(), aNew.getStr());
+
+uno::Reference xComponent = loadFromDesktop(aURL, 
"com.sun.star.text.TextDocument");
+CPPUNIT_ASSERT(xComponent.is());
+
+uno::Reference xStorable(xComponent, uno::UNO_QUERY);
+xStorable->store();
+
+struct stat buf;
+stat(aOld.getStr(), );
+// This failed: hard link count was 1, the hard link broke on store.
+CPPUNIT_ASSERT(buf.st_nlink > 1);
+
+xComponent->dispose();
+#endif
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(MiscTest);
 
 }
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 63ce058f0a47..d3f78d2d6078 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -19,6 +19,10 @@
 
 #include 
 
+#ifdef UNX
+#include 
+#endif
+
 #include 
 #include 
 
@@ -190,6 +194,28 @@ sal_uInt64 GetDefaultFileAttributes(const OUString& rURL)
 return nRet;
 }
 
+/// Determines if rURL is a non-hard-linked file:// URL.
+bool IsNotHardLinkedFile(const OUString& rURL)
+{
+if (!comphelper::isFileUrl(rURL))
+return false;
+
+#ifdef UNX
+OUString rPath;
+if (osl::FileBase::getSystemPathFromFileURL(rURL, rPath) != 
osl::FileBase::E_None)
+return false;
+
+struct stat buf;
+if (stat(rPath.toUtf8().getStr(), ) != 0)
+return false;
+
+if (buf.st_nlink > 1)
+return false;
+#endif
+
+return true;
+}
+
 } // anonymous namespace
 
 class SfxMedium_Impl
@@ -1812,7 +1838,7 @@ void SfxMedium::TransactedTransferForFS_Impl( const 
INetURLObject& aSource,
 OUString aDestMainURL = 
aDest.GetMainURL(INetURLObject::DecodeMechanism::NONE);
 
 sal_uInt64 nAttributes = 
GetDefaultFileAttributes(aDestMainURL);
-if (comphelper::isFileUrl(aDestMainURL) && 
osl::File::move(aSourceMainURL, aDestMainURL) == osl::FileBase::E_None)
+if (IsNotHardLinkedFile(aDestMainURL) && 
osl::File::move(aSourceMainURL, aDestMainURL) == osl::FileBase::E_None)
 {
 if (nAttributes)
 // Adjust attributes, source might be created with
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa sfx2/source

2018-03-13 Thread Miklos Vajna
 sfx2/qa/cppunit/test_misc.cxx |   22 ++
 sfx2/source/doc/docfile.cxx   |   34 ++
 2 files changed, 56 insertions(+)

New commits:
commit fb04780cf8523ad4e900ae8b9cecbe7a2697a12a
Author: Miklos Vajna 
Date:   Mon Mar 12 21:24:09 2018 +0100

tdf#116117 sfx2 store: don't inherit temp file permissions when renaming

This has to be handled explicitly, otherwise the tempfile permissions
(which intentionally don't respect umask()) would be preserved on
rename().

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

diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 5f36b438f089..a1ecc01a7c61 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -9,6 +9,9 @@
 
 #include 
 
+#ifndef _WIN32
+#include 
+#endif
 #include 
 
 #include 
@@ -31,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 using namespace ::com::sun::star;
@@ -117,11 +121,29 @@ void MiscTest::testNoThumbnail()
 utl::TempFile aTempFile;
 uno::Sequence aProperties(
 comphelper::InitPropertySequence({ { "NoThumbnail", uno::makeAny(true) 
} }));
+osl::File::remove(aTempFile.GetURL());
 xStorable->storeToURL(aTempFile.GetURL(), aProperties);
 uno::Reference xZipFile
 = packages::zip::ZipFileAccess::createWithURL(m_xContext, 
aTempFile.GetURL());
 CPPUNIT_ASSERT(!xZipFile->hasByName("Thumbnails/thumbnail.png"));
 
+#ifndef _WIN32
+// Check permissions of the URL after store.
+mode_t nMask = umask(022);
+osl::DirectoryItem aItem;
+CPPUNIT_ASSERT_EQUAL(osl::DirectoryItem::E_None,
+ osl::DirectoryItem::get(aTempFile.GetURL(), aItem));
+
+osl::FileStatus aStatus(osl_FileStatus_Mask_Attributes);
+CPPUNIT_ASSERT_EQUAL(osl::DirectoryItem::E_None, 
aItem.getFileStatus(aStatus));
+
+// This failed, osl_File_Attribute_GrpRead was not set even if umask
+// requested so.
+CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_GrpRead);
+CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_OthRead);
+umask(nMask);
+#endif
+
 xComponent->dispose();
 }
 
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 9635f872b210..916acba81659 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -165,6 +165,32 @@ bool IsLockingUsed()
 
 #endif
 
+/// Gets default attributes of a file:// URL.
+sal_uInt64 GetDefaultFileAttributes(const OUString& rURL)
+{
+sal_uInt64 nRet = 0;
+
+if (!comphelper::isFileUrl(rURL))
+return nRet;
+
+osl::File aFile(rURL);
+if (aFile.open(osl_File_OpenFlag_Create) != osl::File::E_None)
+return nRet;
+
+aFile.close();
+
+osl::DirectoryItem aItem;
+if (osl::DirectoryItem::get(rURL, aItem) != osl::DirectoryItem::E_None)
+return nRet;
+
+osl::FileStatus aStatus(osl_FileStatus_Mask_Attributes);
+if (aItem.getFileStatus(aStatus) != osl::DirectoryItem::E_None)
+return nRet;
+
+nRet = aStatus.getAttributes();
+return nRet;
+}
+
 } // anonymous namespace
 
 class SfxMedium_Impl
@@ -1785,8 +1811,16 @@ void SfxMedium::TransactedTransferForFS_Impl( const 
INetURLObject& aSource,
 {
 OUString aSourceMainURL = 
aSource.GetMainURL(INetURLObject::DecodeMechanism::NONE);
 OUString aDestMainURL = 
aDest.GetMainURL(INetURLObject::DecodeMechanism::NONE);
+
+sal_uInt64 nAttributes = 
GetDefaultFileAttributes(aDestMainURL);
 if (comphelper::isFileUrl(aDestMainURL) && 
osl::File::move(aSourceMainURL, aDestMainURL) == osl::FileBase::E_None)
+{
+if (nAttributes)
+// Adjust attributes, source might be created with
+// the osl_File_OpenFlag_Private flag.
+osl::File::setAttributes(aDestMainURL, nAttributes);
 bResult = true;
+}
 else
 {
 if (bOverWrite && 
::utl::UCBContentHelper::IsDocument(aDestMainURL))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2017-09-21 Thread Stephan Bergmann
 sfx2/qa/complex/sfx2/DocumentMetadataAccess.java |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit fafeedc865821b1b0dc25b66afd54757d6440b16
Author: Stephan Bergmann 
Date:   Thu Sep 21 13:49:26 2017 +0200

Fix creation of array clone

The original code caused ClassCastException when the return value of 
toArray()
was actually of type Object[] instead of Statement[].

Change-Id: I6cd451404b7bd22a9a0c3490b6982cc38e79d1b2

diff --git a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java 
b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java
index 4c23235c3baf..9a0e7b8170a7 100644
--- a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java
+++ b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java
@@ -1006,8 +1006,7 @@ public class DocumentMetadataAccess
 i_Expected.length);
 return false;
 }
-Statement[] expected = (Statement[])
-java.util.Arrays.asList(i_Expected).toArray();
+Statement[] expected = i_Expected.clone();
 java.util.Arrays.sort(i_Result, new StmtComp());
 java.util.Arrays.sort(expected, new StmtComp());
 for (int i = 0; i < expected.length; ++i)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa sfx2/source

2017-06-26 Thread Noel Grandin
 sfx2/qa/cppunit/test_metadatable.cxx   |6 -
 sfx2/source/appl/appdispatchprovider.cxx   |5 
 sfx2/source/appl/appserv.cxx   |  149 ++---
 sfx2/source/appl/shutdownicon.cxx  |8 -
 sfx2/source/control/dispatch.cxx   |3 
 sfx2/source/control/emojiviewitem.cxx  |3 
 sfx2/source/control/recentdocsviewitem.cxx |3 
 sfx2/source/control/templatelocalview.cxx  |3 
 sfx2/source/control/templateviewitem.cxx   |3 
 sfx2/source/dialog/dinfdlg.cxx |3 
 sfx2/source/dialog/filedlghelper.cxx   |3 
 sfx2/source/dialog/printopt.cxx|3 
 sfx2/source/dialog/templdlg.cxx|8 -
 sfx2/source/doc/docfilt.cxx|3 
 sfx2/source/doc/doctempl.cxx   |6 -
 sfx2/source/doc/doctemplates.cxx   |   15 --
 sfx2/source/doc/guisaveas.cxx  |4 
 sfx2/source/doc/objserv.cxx|   22 
 sfx2/source/doc/objstor.cxx|7 -
 sfx2/source/doc/sfxbasemodel.cxx   |   17 ---
 sfx2/source/doc/templatedlg.cxx|9 -
 sfx2/source/inet/inettbc.cxx   |4 
 sfx2/source/sidebar/Theme.cxx  |3 
 sfx2/source/view/frame2.cxx|3 
 sfx2/source/view/sfxbasecontroller.cxx |5 
 sfx2/source/view/viewfrm2.cxx  |3 
 sfx2/source/view/viewprn.cxx   |3 
 sfx2/source/view/viewsh.cxx|   12 --
 28 files changed, 119 insertions(+), 197 deletions(-)

New commits:
commit 2dbe6a2d57956be392966c363d03f54cb68dd4fa
Author: Noel Grandin 
Date:   Sun Jun 25 19:11:12 2017 +0200

loplugin:oncevar in sfx2

Change-Id: I9aadcb9a12ef9b0c3f93ea255f2542e51d31fbf7
Reviewed-on: https://gerrit.libreoffice.org/39242
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/sfx2/qa/cppunit/test_metadatable.cxx 
b/sfx2/qa/cppunit/test_metadatable.cxx
index bb883b6a9cc2..d469859c4cf0 100644
--- a/sfx2/qa/cppunit/test_metadatable.cxx
+++ b/sfx2/qa/cppunit/test_metadatable.cxx
@@ -88,9 +88,9 @@ void MetadatableTest::test()
 MockMetadatable m5(*pReg);
 OUString empty;
 OUString content( "content.xml" );
-OUString styles( "styles.xml" );
-OUString sid1( "id1" );
-OUString sid2( "id2" );
+OUString const styles( "styles.xml" );
+OUString const sid1( "id1" );
+OUString const sid2( "id2" );
 OUString sid3( "id3" );
 OUString sid4( "id4" );
 beans::StringPair id1(content, sid1);
diff --git a/sfx2/source/appl/appdispatchprovider.cxx 
b/sfx2/source/appl/appdispatchprovider.cxx
index e840361d2b3f..e7e70a878cf2 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -205,7 +205,6 @@ Sequence< frame::DispatchInformation > SAL_CALL 
SfxAppDispatchProvider::getConfi
 SfxSlotPool& rAppSlotPool = SfxGetpApp()->GetAppSlotPool_Impl();
 
 const SfxSlotMode nMode( 
SfxSlotMode::TOOLBOXCONFIG|SfxSlotMode::ACCELCONFIG|SfxSlotMode::MENUCONFIG );
-OUString aCmdPrefix( ".uno:" );
 
 // Select group ( group 0 is internal )
 for (sal_uInt16 i=0; i< rAppSlotPool.GetGroupCount(); ++i)
@@ -222,9 +221,7 @@ Sequence< frame::DispatchInformation > SAL_CALL 
SfxAppDispatchProvider::getConfi
 if ( pSfxSlot->GetMode() & nMode )
 {
 frame::DispatchInformation aCmdInfo;
-OUStringBuffer aBuf( aCmdPrefix );
-aBuf.appendAscii( pSfxSlot->GetUnoName() );
-aCmdInfo.Command = aBuf.makeStringAndClear();
+aCmdInfo.Command = ".uno:" + 
OUString::createFromAscii(pSfxSlot->GetUnoName());
 aCmdInfo.GroupId = nCommandGroup;
 aCmdList.push_back( aCmdInfo );
 }
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 4ee7dc17a2fe..efdd469b424e 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -791,7 +791,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 css::uno::Sequence aUserToolbars;
 std::vector aBackupList;
 OUString aSidebarMode;
-bool bCorrectMode = true;
 
 OUStringBuffer aPath = OUStringBuffer( 
"org.openoffice.Office.UI.ToolbarMode/Applications/" );
 aPath.append( lcl_getAppName( eApp ) );
@@ -828,103 +827,100 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 }
 }
 
-if ( bCorrectMode )
+// Backup visible toolbar list and hide all toolbars
+Sequence aUIElements = 
xLayoutManager->getElements();
+for ( sal_Int32 i 

[Libreoffice-commits] core.git: sfx2/qa

2017-05-04 Thread Tor Lillqvist
 sfx2/qa/python/check_sidebar_registry.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0a63c091b47f3566c55a828229c91efbe0a08406
Author: Tor Lillqvist 
Date:   Thu May 4 15:32:17 2017 +0300

Fix spelling

Alternatively, we could build a higher wall.

Change-Id: Id2ba91c85557ed6ac9e45ba2d9f51ca0e019cd32

diff --git a/sfx2/qa/python/check_sidebar_registry.py 
b/sfx2/qa/python/check_sidebar_registry.py
index 97cc1aa3c30e..24713d6f26d4 100644
--- a/sfx2/qa/python/check_sidebar_registry.py
+++ b/sfx2/qa/python/check_sidebar_registry.py
@@ -27,7 +27,7 @@ class CheckSidebarRegistry(unittest.TestCase):
 
 def test_sidebar_registry(self):
 
-# assert(result) after whole processing to list defected nodes at once
+# assert(result) after whole processing to list defective nodes at once
 result = True
 
 #open registry node in Sidebar.xcu
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2017-01-12 Thread Michael Stahl
 sfx2/qa/complex/sfx2/UndoManager.java |5 +
 1 file changed, 5 insertions(+)

New commits:
commit e19cdeaf7ddbcf39da47d9685d8e79e775dde7f4
Author: Michael Stahl 
Date:   Thu Jan 12 22:09:27 2017 +0100

sfx2: fix race in JunitTest UndoManager.checkBrokenScripts()

1) checkBrokenScripts(complex.sfx2.UndoManager)
java.lang.NullPointerException
at complex.sfx2.UndoManager.impl_clickButton(UndoManager.java:432)
at complex.sfx2.UndoManager.checkBrokenScripts(UndoManager.java:188)

impl_clickButton() gets the wrong accessible object and throws.

The .uno:SwitchControlDesignMode is dispatched async, so make sure
it's processesed before trying to click the button.

See UnoControl::getAccessibleContext() "in design mode, use a fallback".

This was running in "rr record --chaos".

Change-Id: Iee9f25c2fff56d32e6b579b5d44ee6df9870fd8b

diff --git a/sfx2/qa/complex/sfx2/UndoManager.java 
b/sfx2/qa/complex/sfx2/UndoManager.java
index ad82ca4..a8e6bcd 100644
--- a/sfx2/qa/complex/sfx2/UndoManager.java
+++ b/sfx2/qa/complex/sfx2/UndoManager.java
@@ -24,6 +24,7 @@ import com.sun.star.awt.Point;
 import com.sun.star.awt.Size;
 import com.sun.star.awt.XControl;
 import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XToolkitExperimental;
 import com.sun.star.beans.NamedValue;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.container.NoSuchElementException;
@@ -182,6 +183,10 @@ public class UndoManager
 
 // switch the doc's view to form alive mode (so the button will 
actually work)
 m_currentDocument.getCurrentView().dispatch( 
".uno:SwitchControlDesignMode" );
+XToolkitExperimental xToolkit = UnoRuntime.queryInterface(
+XToolkitExperimental.class,
+getORB().createInstance("com.sun.star.awt.Toolkit"));
+xToolkit.processEventsToIdle();
 
 // click the button
 m_callbackCalled = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2017-01-09 Thread kerem
 sfx2/qa/python/check_sidebar.py  |   10 +-
 sfx2/qa/python/check_sidebar_registry.py |6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 9f18ee7fd912a6ba600985c5fcbe1e8672dfa993
Author: kerem 
Date:   Sun Jan 8 13:15:53 2017 +0200

tdf#97361: Changed method calls in sfx2 python tests

Change-Id: Id47bf9c6bb6330bf964ca3272487a077fb664137
Reviewed-on: https://gerrit.libreoffice.org/32838
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py
index 40ca194..e8fd503 100644
--- a/sfx2/qa/python/check_sidebar.py
+++ b/sfx2/qa/python/check_sidebar.py
@@ -59,10 +59,10 @@ class CheckSidebar(unittest.TestCase):
 assert ( first_deck_name in deck_element_names )
 assert ( xDecks.hasByName(first_deck_name) )
 
-decks_count = xDecks.getCount()
+decks_count = len(xDecks)
 self.assertEqual ( 5, decks_count )
 
-xDeck = xDecks.getByName(first_deck_name)
+xDeck = xDecks[first_deck_name]
 assert ( xDeck )
 assert ( xDeck.getId() == first_deck_name )
 
@@ -91,7 +91,7 @@ class CheckSidebar(unittest.TestCase):
 
 xPanels = xDeck.getPanels()
 
-panels_count = xPanels.getCount()
+panels_count = len(xPanels)
 self.assertEqual ( panels_count, 5 )
 
 first_panel_name = self.getFirstPanel(xPanels)
@@ -100,7 +100,7 @@ class CheckSidebar(unittest.TestCase):
 assert ( first_panel_name in panel_element_names )
 assert ( xPanels.hasByName(first_panel_name) )
 
-xPanel = xPanels.getByName(first_panel_name)
+xPanel = xPanels[first_panel_name]
 assert ( xPanel )
 assert ( xPanel.getId() == first_panel_name )
 
@@ -129,7 +129,7 @@ class CheckSidebar(unittest.TestCase):
 
 last_panel_name = self.getLastPanel(xPanels)
 
-other_panel = xPanels.getByName(last_panel_name)
+other_panel = xPanels[last_panel_name]
 other_panel.expand(False)
 assert( other_panel.isExpanded() )
 
diff --git a/sfx2/qa/python/check_sidebar_registry.py 
b/sfx2/qa/python/check_sidebar_registry.py
index e77c08f..97cc1aa 100644
--- a/sfx2/qa/python/check_sidebar_registry.py
+++ b/sfx2/qa/python/check_sidebar_registry.py
@@ -45,7 +45,7 @@ class CheckSidebarRegistry(unittest.TestCase):
 (param, ))
 for nodeName in sidebar_decks_settings:
 
-node = sidebar_decks_settings.getByName(nodeName)
+node = sidebar_decks_settings[nodeName]
 
 if (node.Id != nodeName):
 print("\nNon-consistent sidebar.xcu Deck registry names", 
nodeName, node.Id)
@@ -59,7 +59,7 @@ class CheckSidebarRegistry(unittest.TestCase):
 (param, ))
 for nodeName in sidebar_panels_settings:
 
-node = sidebar_panels_settings.getByName(nodeName)
+node = sidebar_panels_settings[nodeName]
 
 if (node.Id != nodeName):
 print("\nNon-consistent sidebar.xcu Panel registry names", 
nodeName, node.Id)
@@ -68,7 +68,7 @@ class CheckSidebarRegistry(unittest.TestCase):
 # is panel bound to an existing Deck ?
 FoundDeckId = False
 for deckNodeName in sidebar_decks_settings:
-deck_node = sidebar_decks_settings.getByName(deckNodeName)
+deck_node = sidebar_decks_settings[deckNodeName]
 if (node.DeckId == deck_node.Id):
 FoundDeckId = True
 if not FoundDeckId:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2016-12-20 Thread kerem
 sfx2/qa/python/check_sidebar.py  |  112 +++
 sfx2/qa/python/check_sidebar_registry.py |   20 ++---
 2 files changed, 66 insertions(+), 66 deletions(-)

New commits:
commit 027a41959cc722fb9e3e7e2375eac9a3703d4799
Author: kerem 
Date:   Sat Dec 17 15:53:34 2016 +0200

tdf#97361: Changed naming in sfx2 python tests

Change-Id: Iabacaff8fd7f282a903885954a7d725ceb6f6c16
Reviewed-on: https://gerrit.libreoffice.org/32118
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py
index 1795832..40ca194 100644
--- a/sfx2/qa/python/check_sidebar.py
+++ b/sfx2/qa/python/check_sidebar.py
@@ -53,116 +53,116 @@ class CheckSidebar(unittest.TestCase):
 
 xDecks = xSidebar.getDecks()
 
-firstDeckName = "PropertyDeck";
+first_deck_name = "PropertyDeck";
 
-deckElementNames = xDecks.getElementNames()
-assert ( firstDeckName in deckElementNames )
-assert ( xDecks.hasByName(firstDeckName) )
+deck_element_names = xDecks.getElementNames()
+assert ( first_deck_name in deck_element_names )
+assert ( xDecks.hasByName(first_deck_name) )
 
-decksCount = xDecks.getCount()
-self.assertEqual ( 5, decksCount )
+decks_count = xDecks.getCount()
+self.assertEqual ( 5, decks_count )
 
-xDeck = xDecks.getByName(firstDeckName)
+xDeck = xDecks.getByName(first_deck_name)
 assert ( xDeck )
-assert ( xDeck.getId() == firstDeckName )
+assert ( xDeck.getId() == first_deck_name )
 
-newDeckTitle = "New title"
-xDeck.setTitle(newDeckTitle)
-assert ( xDeck.getTitle() == newDeckTitle )
+new_deck_title = "New title"
+xDeck.setTitle(new_deck_title)
+assert ( xDeck.getTitle() == new_deck_title )
 
 xDeck.moveFirst()
-initialIndex = xDeck.getOrderIndex()
-self.assertEqual(100, initialIndex)
+initial_index = xDeck.getOrderIndex()
+self.assertEqual(100, initial_index)
 
 xDeck.moveLast()
-assert ( xDeck.getOrderIndex() > initialIndex )
+assert ( xDeck.getOrderIndex() > initial_index )
 
-initialIndex = xDeck.getOrderIndex()
+initial_index = xDeck.getOrderIndex()
 xDeck.moveFirst()
-assert ( xDeck.getOrderIndex() < initialIndex )
+assert ( xDeck.getOrderIndex() < initial_index )
 
-initialIndex = xDeck.getOrderIndex()
+initial_index = xDeck.getOrderIndex()
 xDeck.moveDown()
-assert ( xDeck.getOrderIndex() > initialIndex )
+assert ( xDeck.getOrderIndex() > initial_index )
 
-initialIndex = xDeck.getOrderIndex()
+initial_index = xDeck.getOrderIndex()
 xDeck.moveUp()
-assert ( xDeck.getOrderIndex() < initialIndex )
+assert ( xDeck.getOrderIndex() < initial_index )
 
 xPanels = xDeck.getPanels()
 
-panelsCount = xPanels.getCount()
-self.assertEqual ( panelsCount, 5 )
+panels_count = xPanels.getCount()
+self.assertEqual ( panels_count, 5 )
 
-firstPanelName = self.getFirstPanel(xPanels)
+first_panel_name = self.getFirstPanel(xPanels)
 
-panelElementNames = xPanels.getElementNames()
-assert ( firstPanelName in panelElementNames )
-assert ( xPanels.hasByName(firstPanelName) )
+panel_element_names = xPanels.getElementNames()
+assert ( first_panel_name in panel_element_names )
+assert ( xPanels.hasByName(first_panel_name) )
 
-xPanel = xPanels.getByName(firstPanelName)
+xPanel = xPanels.getByName(first_panel_name)
 assert ( xPanel )
-assert ( xPanel.getId() == firstPanelName )
+assert ( xPanel.getId() == first_panel_name )
 
-newTitle = "New title"
-xPanel.setTitle(newTitle)
-assert ( xPanel.getTitle() == newTitle )
+new_title = "New title"
+xPanel.setTitle(new_title)
+assert ( xPanel.getTitle() == new_title )
 
-initialIndex = xPanel.getOrderIndex()
+initial_index = xPanel.getOrderIndex()
 xPanel.moveLast()
-assert ( xPanel.getOrderIndex() > initialIndex )
+assert ( xPanel.getOrderIndex() > initial_index )
 
-initialIndex = xPanel.getOrderIndex()
+initial_index = xPanel.getOrderIndex()
 xPanel.moveFirst()
-assert ( xPanel.getOrderIndex() < initialIndex )
+assert ( xPanel.getOrderIndex() < initial_index )
 
-initialIndex = xPanel.getOrderIndex()
+initial_index = xPanel.getOrderIndex()
 xPanel.moveDown()
-assert ( xPanel.getOrderIndex() > initialIndex )
+assert ( xPanel.getOrderIndex() > initial_index )
 
-initialIndex = xPanel.getOrderIndex()
+initial_index = xPanel.getOrderIndex()
  

[Libreoffice-commits] core.git: sfx2/qa

2016-12-05 Thread kerem
 sfx2/qa/python/check_sidebar.py  |2 --
 sfx2/qa/python/check_sidebar_registry.py |2 --
 2 files changed, 4 deletions(-)

New commits:
commit 25cc8979c5e6238bb76c9d751f3fa3433f48542c
Author: kerem 
Date:   Mon Dec 5 00:11:57 2016 +0200

tdf#97361 remove = None assignments in sfx2 python unit tests

Change-Id: Iba3926d1b044ade69e1306941ed70b644dc577d6
Reviewed-on: https://gerrit.libreoffice.org/31602
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py
index 4dd3a5d..1795832 100644
--- a/sfx2/qa/python/check_sidebar.py
+++ b/sfx2/qa/python/check_sidebar.py
@@ -19,8 +19,6 @@ from com.sun.star.ui import XPanels
 from com.sun.star.ui import XPanel
 
 class CheckSidebar(unittest.TestCase):
-_uno = None
-_xDoc = None
 
 @classmethod
 def setUpClass(cls):
diff --git a/sfx2/qa/python/check_sidebar_registry.py 
b/sfx2/qa/python/check_sidebar_registry.py
index 70b679a..19a8ae7 100644
--- a/sfx2/qa/python/check_sidebar_registry.py
+++ b/sfx2/qa/python/check_sidebar_registry.py
@@ -14,8 +14,6 @@ from org.libreoffice.unotest import UnoInProcess
 import uno
 
 class CheckSidebarRegistry(unittest.TestCase):
-_uno = None
-_xDoc = None
 
 @classmethod
 def setUpClass(cls):
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa sot/qa

2016-11-13 Thread Miklos Vajna
 sfx2/qa/cppunit/test_metadatable.cxx |   40 +--
 sot/qa/cppunit/test_sot.cxx  |   18 +++
 2 files changed, 29 insertions(+), 29 deletions(-)

New commits:
commit c622982a7a85007b4f40b101643c638adb8651db
Author: Miklos Vajna 
Date:   Fri Nov 11 08:58:43 2016 +0100

sot: fix loplugin:cppunitassertequals warnings

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

diff --git a/sfx2/qa/cppunit/test_metadatable.cxx 
b/sfx2/qa/cppunit/test_metadatable.cxx
index 91d3872..895b6a7 100644
--- a/sfx2/qa/cppunit/test_metadatable.cxx
+++ b/sfx2/qa/cppunit/test_metadatable.cxx
@@ -100,24 +100,24 @@ void MetadatableTest::test()
 beans::StringPair id3e(empty,  sid3);
 beans::StringPair id4e(empty,  sid4);
 m1.SetMetadataReference(id1);
-CPPUNIT_ASSERT_MESSAGE("set failed", m1.GetMetadataReference() == id1);
+CPPUNIT_ASSERT_MESSAGE("set failed", bool(m1.GetMetadataReference() == 
id1));
 try {
 m2.SetMetadataReference(id1);
 CPPUNIT_ASSERT_MESSAGE("set duplicate succeeded", false);
 } catch (const lang::IllegalArgumentException &) { }
 m1.SetMetadataReference(id1);
 CPPUNIT_ASSERT_MESSAGE("set failed (existing)",
-m1.GetMetadataReference() == id1);
+bool(m1.GetMetadataReference() == id1));
 m1.EnsureMetadataReference();
 CPPUNIT_ASSERT_MESSAGE("ensure failed (existing)",
-m1.GetMetadataReference() == id1);
+bool(m1.GetMetadataReference() == id1));
 
 m2.EnsureMetadataReference();
 beans::StringPair m2id(m2.GetMetadataReference());
 CPPUNIT_ASSERT_MESSAGE("ensure failed", !m2id.Second.isEmpty());
 m2.EnsureMetadataReference();
 CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)",
-m2.GetMetadataReference() == m2id);
+bool(m2.GetMetadataReference() == m2id));
 
 m1.m_bInUndo = true;
 CPPUNIT_ASSERT_MESSAGE("move to undo failed",
@@ -125,7 +125,7 @@ void MetadatableTest::test()
 
 m1.m_bInUndo = false;
 CPPUNIT_ASSERT_MESSAGE("move from undo failed",
-m1.GetMetadataReference() == id1);
+bool(m1.GetMetadataReference() == id1));
 
 m1.m_bInUndo = true;
 try {
@@ -138,23 +138,23 @@ void MetadatableTest::test()
 m1.GetMetadataReference().Second.isEmpty());
 
 m3.RegisterAsCopyOf(m2);
-CPPUNIT_ASSERT_MESSAGE("copy: source", m2.GetMetadataReference() == id1);
+CPPUNIT_ASSERT_MESSAGE("copy: source", bool(m2.GetMetadataReference() == 
id1));
 CPPUNIT_ASSERT_MESSAGE("copy: duplicate",
 m3.GetMetadataReference().Second.isEmpty());
 m4.RegisterAsCopyOf(m3);
-CPPUNIT_ASSERT_MESSAGE("copy: source", m2.GetMetadataReference() == id1);
+CPPUNIT_ASSERT_MESSAGE("copy: source", bool(m2.GetMetadataReference() == 
id1));
 CPPUNIT_ASSERT_MESSAGE("copy: duplicate",
 m3.GetMetadataReference().Second.isEmpty());
 CPPUNIT_ASSERT_MESSAGE("copy: duplicate",
 m4.GetMetadataReference().Second.isEmpty());
 m2.m_bInUndo = true;
 CPPUNIT_ASSERT_MESSAGE("duplicate to undo",
-m3.GetMetadataReference() == id1);
+bool(m3.GetMetadataReference() == id1));
 CPPUNIT_ASSERT_MESSAGE("duplicate to undo",
 m2.GetMetadataReference().Second.isEmpty());
 m2.m_bInUndo = false;
 CPPUNIT_ASSERT_MESSAGE("duplicate from undo",
-m2.GetMetadataReference() == id1);
+bool(m2.GetMetadataReference() == id1));
 CPPUNIT_ASSERT_MESSAGE("duplicate from undo",
 m3.GetMetadataReference().Second.isEmpty());
 
@@ -171,23 +171,23 @@ void MetadatableTest::test()
 MockMetadatable m3p(*pReg);
 
 mc1.SetMetadataReference(id2);
-CPPUNIT_ASSERT_MESSAGE("set failed", mc1.GetMetadataReference() == id2);
+CPPUNIT_ASSERT_MESSAGE("set failed", bool(mc1.GetMetadataReference() == 
id2));
 try {
 mc2.SetMetadataReference(id2);
 CPPUNIT_FAIL("set duplicate succeeded");
 } catch (const lang::IllegalArgumentException &) { }
 mc1.SetMetadataReference(id2);
 CPPUNIT_ASSERT_MESSAGE("set failed (existing)",
-mc1.GetMetadataReference() == id2);
+bool(mc1.GetMetadataReference() == id2));
 mc1.EnsureMetadataReference();
 CPPUNIT_ASSERT_MESSAGE("ensure failed (existing)",
-mc1.GetMetadataReference() == id2);
+bool(mc1.GetMetadataReference() == id2));
 mc2.EnsureMetadataReference();
 beans::StringPair mc2id(mc2.GetMetadataReference());
 CPPUNIT_ASSERT_MESSAGE("ensure failed", !mc2id.Second.isEmpty());
 mc2.EnsureMetadataReference();
 CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)",
-mc2.GetMetadataReference() == 

[Libreoffice-commits] core.git: sfx2/qa

2015-09-02 Thread Laurent Godard
 sfx2/qa/python/check_sidebar.py |   33 -
 1 file changed, 28 insertions(+), 5 deletions(-)

New commits:
commit c94a1fdc4443e11d19d12acd8883f9b9494e
Author: Laurent Godard 
Date:   Tue Sep 1 15:28:39 2015 +0200

sideber uno api test less dependant to panels order

Change-Id: I3a4ef006becbce70897505a6f3367c4b004e13b0
Reviewed-on: https://gerrit.libreoffice.org/18239
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py
index 26a76bd..7599e4d 100644
--- a/sfx2/qa/python/check_sidebar.py
+++ b/sfx2/qa/python/check_sidebar.py
@@ -96,7 +96,7 @@ class CheckSidebar(unittest.TestCase):
 panelsCount = xPanels.getCount()
 self.assertEqual ( panelsCount, 5 )
 
-firstPanelName = "StylesPropertyPanel"
+firstPanelName = self.getFirstPanel(xPanels)
 
 panelElementNames = xPanels.getElementNames()
 assert ( firstPanelName in panelElementNames )
@@ -110,10 +110,7 @@ class CheckSidebar(unittest.TestCase):
 xPanel.setTitle(newTitle)
 assert ( xPanel.getTitle() == newTitle )
 
-xPanel.moveFirst()
 initialIndex = xPanel.getOrderIndex()
-assert ( initialIndex == 100 )
-
 xPanel.moveLast()
 assert ( xPanel.getOrderIndex() > initialIndex )
 
@@ -132,7 +129,9 @@ class CheckSidebar(unittest.TestCase):
 xPanel.collapse()
 assert( not xPanel.isExpanded() )
 
-otherPanel = xPanels.getByName("NumberFormatPropertyPanel")
+lastPanelName = self.getLastPanel(xPanels)
+
+otherPanel = xPanels.getByName(lastPanelName)
 otherPanel.expand(False)
 assert( otherPanel.isExpanded() )
 
@@ -143,6 +142,30 @@ class CheckSidebar(unittest.TestCase):
 # close the document
 xDoc.dispose()
 
+def getFirstPanel(self, xPanels):
+
+panelName = ""
+curIndex = 1
+
+for panel in xPanels:
+if panel.getOrderIndex() < curIndex:
+panelName = panel.getId()
+curIndex = panel.getOrderIndex()
+
+return panelName
+
+def getLastPanel(self, xPanels):
+
+panelName = ""
+curIndex = 0
+
+for panel in xPanels:
+if panel.getOrderIndex() > curIndex:
+panelName = panel.getId()
+curIndex = panel.getOrderIndex()
+
+return panelName
+
 if __name__ == "__main__":
 unittest.main()
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2015-09-01 Thread Miklos Vajna
 sfx2/qa/python/check_sidebar.py |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 31657493553b8b9bc6db06ee0df3c0e585eeec1b
Author: Miklos Vajna 
Date:   Tue Sep 1 10:33:04 2015 +0200

Fix PythonTest_sfx2_python

Adapt to 1ba1a21aa6b77ef8d3d59b3658dfd2aa87d0dee2 (tdf#73071 Enable
styles content panel in calc and fix spacing issue), but the second
assert should be ideally 100 and not 99 what it is actually, so comment
that out for now.

Change-Id: I551640c9db57285942a897eeb57515939ed3510d

diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py
index 355951a..a55d63f 100644
--- a/sfx2/qa/python/check_sidebar.py
+++ b/sfx2/qa/python/check_sidebar.py
@@ -94,7 +94,7 @@ class CheckSidebar(unittest.TestCase):
 xPanels = xDeck.getPanels()
 
 panelsCount = xPanels.getCount()
-self.assertEqual ( panelsCount, 4 )
+self.assertEqual ( panelsCount, 5 )
 
 firstPanelName = "TextPropertyPanel"
 
@@ -112,7 +112,7 @@ class CheckSidebar(unittest.TestCase):
 
 xPanel.moveFirst()
 initialIndex = xPanel.getOrderIndex()
-assert ( initialIndex == 120 )
+#assert ( initialIndex == 120 )
 
 xPanel.moveLast()
 assert ( xPanel.getOrderIndex() > initialIndex )
@@ -146,4 +146,4 @@ class CheckSidebar(unittest.TestCase):
 if __name__ == "__main__":
 unittest.main()
 
-# vim: set noet sw=4 ts=4:
\ No newline at end of file
+# vim: set noet sw=4 ts=4:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2015-09-01 Thread Maxim Monastirsky
 sfx2/qa/python/check_sidebar.py |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f4e9e76aa63c93372a60f4c55692c6aedbf044cd
Author: Maxim Monastirsky 
Date:   Tue Sep 1 14:03:20 2015 +0300

PythonTest_sfx2_python: StylesPropertyPanel is the first panel now

Change-Id: I352f14741dd9346bb41d4e3233b256898809773e

diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py
index a55d63f..26a76bd 100644
--- a/sfx2/qa/python/check_sidebar.py
+++ b/sfx2/qa/python/check_sidebar.py
@@ -96,7 +96,7 @@ class CheckSidebar(unittest.TestCase):
 panelsCount = xPanels.getCount()
 self.assertEqual ( panelsCount, 5 )
 
-firstPanelName = "TextPropertyPanel"
+firstPanelName = "StylesPropertyPanel"
 
 panelElementNames = xPanels.getElementNames()
 assert ( firstPanelName in panelElementNames )
@@ -112,7 +112,7 @@ class CheckSidebar(unittest.TestCase):
 
 xPanel.moveFirst()
 initialIndex = xPanel.getOrderIndex()
-#assert ( initialIndex == 120 )
+assert ( initialIndex == 100 )
 
 xPanel.moveLast()
 assert ( xPanel.getOrderIndex() > initialIndex )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa

2015-07-08 Thread Noel Grandin
 sfx2/qa/complex/sfx2/DocumentMetadataAccess.java |  622 ++---
 sfx2/qa/complex/sfx2/DocumentProperties.java |  657 +++
 sfx2/qa/complex/sfx2/UndoManager.java|   58 +-
 sfx2/qa/complex/sfx2/tools/WriterHelper.java |   22 
 sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java |   23 
 5 files changed, 665 insertions(+), 717 deletions(-)

New commits:
commit 3c4da0f6fda6d6cf376cae77417d813e1d21d740
Author: Noel Grandin n...@peralex.com
Date:   Tue Jul 7 16:37:59 2015 +0200

java: let the unit-test framework catch exceptions

and report them for us, instead of inventing our own mechanisms

Change-Id: Id9186a2b01dad33c377e4785e1ca07bccea48b07

diff --git a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java 
b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java
index 5b6bc0c..b871a1c 100644
--- a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java
+++ b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java
@@ -18,55 +18,58 @@
 
 package complex.sfx2;
 
-import com.sun.star.beans.Pair;
-import com.sun.star.rdf.Literal;
-import com.sun.star.rdf.XLiteral;
-import com.sun.star.rdf.XNamedGraph;
-import com.sun.star.rdf.BlankNode;
-import com.sun.star.rdf.XQuerySelectResult;
-import com.sun.star.rdf.XNode;
-import com.sun.star.rdf.XDocumentRepository;
-import com.sun.star.rdf.XMetadatable;
-import com.sun.star.rdf.Statement;
-import com.sun.star.rdf.FileFormat;
-import com.sun.star.rdf.URIs;
-import com.sun.star.rdf.URI;
-import com.sun.star.rdf.XDocumentMetadataAccess;
-import com.sun.star.rdf.XRepositorySupplier;
-import com.sun.star.rdf.XRepository;
-import com.sun.star.rdf.XBlankNode;
-import com.sun.star.rdf.XURI;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import helper.StreamSimulator;
 
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XComponentContext;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
+import java.io.IOException;
 
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.lang.IllegalArgumentException;
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.StringPair;
-import com.sun.star.container.XEnumerationAccess;
-import com.sun.star.container.XEnumeration;
-import com.sun.star.io.XInputStream;
-import com.sun.star.util.XCloseable;
-import com.sun.star.frame.XStorable;
-import com.sun.star.text.XTextDocument;
-import com.sun.star.text.XTextRange;
-import com.sun.star.text.XText;
-import complex.sfx2.tools.TestDocument;
 import lib.TestParameters;
 
-
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.openoffice.test.OfficeConnection;
-import static org.junit.Assert.*;
+
+import com.sun.star.beans.Pair;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.StringPair;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.frame.XStorable;
+import com.sun.star.io.XInputStream;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.rdf.BlankNode;
+import com.sun.star.rdf.FileFormat;
+import com.sun.star.rdf.Literal;
+import com.sun.star.rdf.Statement;
+import com.sun.star.rdf.URI;
+import com.sun.star.rdf.URIs;
+import com.sun.star.rdf.XBlankNode;
+import com.sun.star.rdf.XDocumentMetadataAccess;
+import com.sun.star.rdf.XDocumentRepository;
+import com.sun.star.rdf.XLiteral;
+import com.sun.star.rdf.XMetadatable;
+import com.sun.star.rdf.XNamedGraph;
+import com.sun.star.rdf.XNode;
+import com.sun.star.rdf.XQuerySelectResult;
+import com.sun.star.rdf.XRepository;
+import com.sun.star.rdf.XRepositorySupplier;
+import com.sun.star.rdf.XURI;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.util.XCloseable;
+import complex.sfx2.tools.TestDocument;
 
 /**
  * Test case for interface com.sun.star.rdf.XDocumentMetadataAccess
@@ -119,58 +122,52 @@ public class DocumentMetadataAccess
  */
 private static TestParameters param = null;
 
-@Before public void before()
+@Before public void before() throws Exception
 {
-try {
-
-xMSF = getMSF();
-param = new TestParameters();
-param.put(ServiceFactory, xMSF);  // important for param.getMSF()
-
-assertNotNull(could not create MultiServiceFactory., xMSF);
-XPropertySet xPropertySet = 
UnoRuntime.queryInterface(XPropertySet.class, xMSF);
-Object defaultCtx = 

[Libreoffice-commits] core.git: sfx2/qa

2015-06-03 Thread Stephan Bergmann
 sfx2/qa/cppunit/test_controlleritem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6ce92bc266785b5347c0757e1245187e2c00cfaf
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jun 3 11:09:54 2015 +0200

loplugin:saloverride

Change-Id: I1d3cd2ff9a2c579d23b97a6ab8e9cf2baadf0439

diff --git a/sfx2/qa/cppunit/test_controlleritem.cxx 
b/sfx2/qa/cppunit/test_controlleritem.cxx
index ee48f46..fe9637f 100644
--- a/sfx2/qa/cppunit/test_controlleritem.cxx
+++ b/sfx2/qa/cppunit/test_controlleritem.cxx
@@ -39,7 +39,7 @@ static bool bDeleted = false;
 class FooController : public SfxControllerItem {
 public:
 FooController() : SfxControllerItem() {}
-~FooController() { bDeleted = true; }
+virtual ~FooController() { bDeleted = true; }
 };
 
 void ControllerItemTest::test()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/qa sfx2/source

2013-10-07 Thread Stephan Bergmann
 sfx2/qa/complex/sfx2/DocumentProperties.java |3 ++-
 sfx2/source/doc/SfxDocumentMetaData.cxx  |   15 +++
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 6adddbc2a80456cc2ad3b62deada7ecd4a6cf641
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Oct 7 12:10:14 2013 +0200

Use URL as fallback for DocumentBaseURL in css.document.MediaDescriptor

...in SfxDocumentMetaData::getURLProperties, to avoid
tools/source/fsys/urlobj.cxx:1741: cannot make [...] absolute against 
broken
base  warnings when SvXMLImport::GetAbsoluteReference tries to make 
absolute
against an erroneously empty base URI any relative URIs contained in the
document's meta data.

As a consequence, such relative URIs contained in the document's meta data 
will
now be made absolute upon loading in SfxDocumentMetaData::getURLProperties.
However, I saw no negative consequences of that (other than having to adapt
sfx2/qa/complex/sfx2/DocumentProperties.java in the obvious way).  Whether a
document written out again contains such meta data URIs as absolute or 
relative
is only controlled by Tools - Options... - Load/Save - General - Save - 
Save
URLs relative to file system and not affected by this fix.  (I verified 
that by
loading sfx2/qa/complex/sfx2/testdocuments/TEST.odt, which contains a 
relative
meta:auto-reload xlink:href=../TEST.odt in its meta.xml, and saving it as 
a
new file, with and without Save URLs relative to file system checked, and
inspecting the resulting documen's meta.xml entries.)

Change-Id: Ia1b6004c8597a726eb59c6b2234fd3ecb0bdcc09

diff --git a/sfx2/qa/complex/sfx2/DocumentProperties.java 
b/sfx2/qa/complex/sfx2/DocumentProperties.java
index 88f0f4c..0588979 100644
--- a/sfx2/qa/complex/sfx2/DocumentProperties.java
+++ b/sfx2/qa/complex/sfx2/DocumentProperties.java
@@ -199,7 +199,8 @@ public class DocumentProperties
 assertTrue(TemplateURL,
 xDP.getTemplateURL().endsWith(memmodern.ott));
 assertEquals(TemplateDate, 17, xDP.getTemplateDate().Hours);
-assertEquals(AutoloadURL, ../TEST.odt, xDP.getAutoloadURL());
+assertTrue(
+AutoloadURL, xDP.getAutoloadURL().endsWith(/TEST.odt));
 assertEquals(AutoloadSecs, 0, xDP.getAutoloadSecs());
 assertEquals(DefaultTarget, _blank, xDP.getDefaultTarget());
 assertEquals(EditingCycles, 3, xDP.getEditingCycles());
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx 
b/sfx2/source/doc/SfxDocumentMetaData.cxx
index fe9cc58..4e89b6a 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -649,12 +649,14 @@ SfxDocumentMetaData::getURLProperties(
 {
 css::uno::Reference css::beans::XPropertyBag xPropArg = 
css::beans::PropertyBag::createDefault( m_xContext );
 try {
+css::uno::Any baseUri;
 for (sal_Int32 i = 0; i  i_rMedium.getLength(); ++i) {
 if (i_rMedium[i].Name == DocumentBaseURL) {
-xPropArg-addProperty(
-OUString(BaseURI),
-css::beans::PropertyAttribute::MAYBEVOID,
-i_rMedium[i].Value);
+baseUri = i_rMedium[i].Value;
+} else if (i_rMedium[i].Name == URL) {
+if (!baseUri.hasValue()) {
+baseUri = i_rMedium[i].Value;
+}
 } else if (i_rMedium[i].Name == HierarchicalDocumentName) {
 xPropArg-addProperty(
 OUString(StreamRelPath),
@@ -662,6 +664,11 @@ SfxDocumentMetaData::getURLProperties(
 i_rMedium[i].Value);
 }
 }
+if (baseUri.hasValue()) {
+xPropArg-addProperty(
+BaseURI, css::beans::PropertyAttribute::MAYBEVOID,
+baseUri);
+}
 xPropArg-addProperty(OUString(StreamName),
 css::beans::PropertyAttribute::MAYBEVOID,
 css::uno::makeAny(OUString(s_meta)));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits