clang-format fixes
Hopefully the last such commit, now that the in-gerrit verification is in place and also a warning is printed locally for those who push directly. Change-Id: Ib80cbca0b29dc7f71cbb182a38ad6839a659ff41 Reviewed-on: https://gerrit.libreoffice.org/45002 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
parent
46ab76a709
commit
b3f766154c
7 changed files with 530 additions and 356 deletions
|
@ -44,10 +44,10 @@ SVX_DLLPUBLIC void insertFullTextualRepresentationAsDocumentProperty(
|
|||
sfx::ClassificationKeyCreator const& rKeyCreator,
|
||||
std::vector<svx::ClassificationResult> const& rResults);
|
||||
|
||||
SVX_DLLPUBLIC void insertCreationOrigin(css::uno::Reference<css::beans::XPropertyContainer> const & rxPropertyContainer,
|
||||
sfx::ClassificationKeyCreator const & rKeyCreator,
|
||||
sfx::ClassificationCreationOrigin eOrigin);
|
||||
|
||||
SVX_DLLPUBLIC void
|
||||
insertCreationOrigin(css::uno::Reference<css::beans::XPropertyContainer> const& rxPropertyContainer,
|
||||
sfx::ClassificationKeyCreator const& rKeyCreator,
|
||||
sfx::ClassificationCreationOrigin eOrigin);
|
||||
}
|
||||
} // end svx::classification namespace
|
||||
|
||||
|
|
665
sc/qa/unit/pivottable_filters_test.cxx
Executable file → Normal file
665
sc/qa/unit/pivottable_filters_test.cxx
Executable file → Normal file
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,6 @@ using namespace css;
|
|||
|
||||
namespace
|
||||
{
|
||||
|
||||
class SwarmSolverTest : public CalcUnoApiTest
|
||||
{
|
||||
uno::Reference<lang::XComponent> mxComponent;
|
||||
|
|
|
@ -47,7 +47,6 @@ using namespace css;
|
|||
|
||||
namespace
|
||||
{
|
||||
|
||||
struct Bound
|
||||
{
|
||||
double lower;
|
||||
|
@ -468,16 +467,13 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
void setTimeout(double fTimeout)
|
||||
{
|
||||
mfTimeout = fTimeout;
|
||||
}
|
||||
void setTimeout(double fTimeout) { mfTimeout = fTimeout; }
|
||||
|
||||
std::vector<double> const& solve()
|
||||
{
|
||||
using std::chrono::duration_cast;
|
||||
using std::chrono::milliseconds;
|
||||
using std::chrono::high_resolution_clock;
|
||||
using std::chrono::milliseconds;
|
||||
|
||||
mrAlgorithm.initialize();
|
||||
|
||||
|
|
|
@ -11784,7 +11784,6 @@ scaddins/source/pricing/black_scholes.cxx
|
|||
scaddins/source/pricing/black_scholes.hxx
|
||||
scaddins/source/pricing/pricing.cxx
|
||||
scaddins/source/pricing/pricing.hxx
|
||||
sccomp/qa/unit/SwarmSolverTest.cxx
|
||||
sccomp/qa/unit/solver.cxx
|
||||
sccomp/source/solver/CoinMPSolver.cxx
|
||||
sccomp/source/solver/LpsolveSolver.cxx
|
||||
|
|
|
@ -106,18 +106,19 @@ void insertFullTextualRepresentationAsDocumentProperty(
|
|||
sString);
|
||||
}
|
||||
|
||||
void insertCreationOrigin(uno::Reference<beans::XPropertyContainer> const & rxPropertyContainer,
|
||||
sfx::ClassificationKeyCreator const & rKeyCreator,
|
||||
void insertCreationOrigin(uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer,
|
||||
sfx::ClassificationKeyCreator const& rKeyCreator,
|
||||
sfx::ClassificationCreationOrigin eOrigin)
|
||||
{
|
||||
// Nothing to do if origin is "NONE"
|
||||
if (eOrigin == sfx::ClassificationCreationOrigin::NONE)
|
||||
return;
|
||||
|
||||
OUString sValue = (eOrigin == sfx::ClassificationCreationOrigin::BAF_POLICY) ? OUString("BAF_POLICY") : OUString("MANUAL");
|
||||
OUString sValue = (eOrigin == sfx::ClassificationCreationOrigin::BAF_POLICY)
|
||||
? OUString("BAF_POLICY")
|
||||
: OUString("MANUAL");
|
||||
addOrInsertDocumentProperty(rxPropertyContainer, rKeyCreator.makeCreationOriginKey(), sValue);
|
||||
}
|
||||
|
||||
}
|
||||
} // end svx::classification namespace
|
||||
|
||||
|
|
194
sw/qa/extras/ooxmlexport/ooxmllinks.cxx
Executable file → Normal file
194
sw/qa/extras/ooxmlexport/ooxmllinks.cxx
Executable file → Normal file
|
@ -14,7 +14,7 @@
|
|||
#include <sfx2/docfilt.hxx>
|
||||
#include <unotools/saveopt.hxx>
|
||||
|
||||
// This file contains tests to check relative/absolute hyperlinks handling
|
||||
// This file contains tests to check relative/absolute hyperlinks handling
|
||||
|
||||
#define USE_TEMP_DIR true
|
||||
#define DONT_MODIFY_LINK false
|
||||
|
@ -24,95 +24,113 @@
|
|||
|
||||
// bAbsolute - decide if output link should be converted to absolute
|
||||
// bUseTempDir - decide if link should be modified to be placed in temp dir - for testing relative links
|
||||
#define DECLARE_LINKS_EXPORT_TEST(TestName, FileName, bAbsolute, bUseTempDir) \
|
||||
class TestName : public Test { \
|
||||
protected: \
|
||||
virtual OUString getTestName() override { return OUString(#TestName); } \
|
||||
virtual void postLoad(const char*) override \
|
||||
{ \
|
||||
if(!bUseTempDir) return; \
|
||||
\
|
||||
uno::Reference<text::XTextRange> xParagraph = getParagraph(1); \
|
||||
/* can be changed only after import */ \
|
||||
uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1); \
|
||||
\
|
||||
/* Get original link */ \
|
||||
OUString sOriginalFileName = getProperty<OUString>(xText, "HyperLinkURL"); \
|
||||
INetURLObject aOriginalURL; \
|
||||
bool bOk = aOriginalURL.setFSysPath(sOriginalFileName, FSysStyle::Detect); \
|
||||
if(!bOk) aOriginalURL = INetURLObject(sOriginalFileName); \
|
||||
OUString sFileName = aOriginalURL.GetName().isEmpty() ? sOriginalFileName : aOriginalURL.GetName(); \
|
||||
\
|
||||
/* Get temp path */ \
|
||||
OUString sTempDir = utl::TempFile::CreateTempName(); \
|
||||
INetURLObject aTempURL; \
|
||||
aTempURL.setFSysPath(sTempDir, FSysStyle::Detect); \
|
||||
/* remove file name */ \
|
||||
aTempURL.removeSegment(); \
|
||||
sTempDir = INetURLObject::GetScheme(aTempURL.GetProtocol()) + aTempURL.GetURLPath(); \
|
||||
\
|
||||
/* Create & apply new URL */ \
|
||||
OUString sOriginalFileInTempDir = sTempDir + sFileName; \
|
||||
uno::Reference<beans::XPropertySet> xPropertySet(xText, css::uno::UNO_QUERY); \
|
||||
xPropertySet->setPropertyValue("HyperLinkURL", css::uno::makeAny(sOriginalFileInTempDir)); \
|
||||
} \
|
||||
public: \
|
||||
CPPUNIT_TEST_SUITE(TestName); \
|
||||
CPPUNIT_TEST(Import_Export_Import); \
|
||||
CPPUNIT_TEST_SUITE_END(); \
|
||||
void Import_Export_Import() \
|
||||
{ \
|
||||
SvtSaveOptions aOpt; \
|
||||
if (bAbsolute) { \
|
||||
aOpt.SetSaveRelFSys(false); \
|
||||
CPPUNIT_ASSERT(!aOpt.IsSaveRelFSys()); \
|
||||
} else { \
|
||||
aOpt.SetSaveRelFSys(true); \
|
||||
CPPUNIT_ASSERT(aOpt.IsSaveRelFSys()); \
|
||||
} \
|
||||
executeImportExportImportTest(FileName); \
|
||||
} \
|
||||
void verify() override; \
|
||||
}; \
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \
|
||||
void TestName::verify()
|
||||
#define DECLARE_LINKS_EXPORT_TEST(TestName, FileName, bAbsolute, bUseTempDir) \
|
||||
class TestName : public Test \
|
||||
{ \
|
||||
protected: \
|
||||
virtual OUString getTestName() override { return OUString(#TestName); } \
|
||||
virtual void postLoad(const char*) override \
|
||||
{ \
|
||||
if (!bUseTempDir) \
|
||||
return; \
|
||||
\
|
||||
uno::Reference<text::XTextRange> xParagraph = getParagraph(1); \
|
||||
/* can be changed only after import */ \
|
||||
uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1); \
|
||||
\
|
||||
/* Get original link */ \
|
||||
OUString sOriginalFileName = getProperty<OUString>(xText, "HyperLinkURL"); \
|
||||
INetURLObject aOriginalURL; \
|
||||
bool bOk = aOriginalURL.setFSysPath(sOriginalFileName, FSysStyle::Detect); \
|
||||
if (!bOk) \
|
||||
aOriginalURL = INetURLObject(sOriginalFileName); \
|
||||
OUString sFileName \
|
||||
= aOriginalURL.GetName().isEmpty() ? sOriginalFileName : aOriginalURL.GetName(); \
|
||||
\
|
||||
/* Get temp path */ \
|
||||
OUString sTempDir = utl::TempFile::CreateTempName(); \
|
||||
INetURLObject aTempURL; \
|
||||
aTempURL.setFSysPath(sTempDir, FSysStyle::Detect); \
|
||||
/* remove file name */ \
|
||||
aTempURL.removeSegment(); \
|
||||
sTempDir = INetURLObject::GetScheme(aTempURL.GetProtocol()) + aTempURL.GetURLPath(); \
|
||||
\
|
||||
/* Create & apply new URL */ \
|
||||
OUString sOriginalFileInTempDir = sTempDir + sFileName; \
|
||||
uno::Reference<beans::XPropertySet> xPropertySet(xText, css::uno::UNO_QUERY); \
|
||||
xPropertySet->setPropertyValue("HyperLinkURL", \
|
||||
css::uno::makeAny(sOriginalFileInTempDir)); \
|
||||
} \
|
||||
\
|
||||
public: \
|
||||
CPPUNIT_TEST_SUITE(TestName); \
|
||||
CPPUNIT_TEST(Import_Export_Import); \
|
||||
CPPUNIT_TEST_SUITE_END(); \
|
||||
void Import_Export_Import() \
|
||||
{ \
|
||||
SvtSaveOptions aOpt; \
|
||||
if (bAbsolute) \
|
||||
{ \
|
||||
aOpt.SetSaveRelFSys(false); \
|
||||
CPPUNIT_ASSERT(!aOpt.IsSaveRelFSys()); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
aOpt.SetSaveRelFSys(true); \
|
||||
CPPUNIT_ASSERT(aOpt.IsSaveRelFSys()); \
|
||||
} \
|
||||
executeImportExportImportTest(FileName); \
|
||||
} \
|
||||
void verify() override; \
|
||||
}; \
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \
|
||||
void TestName::verify()
|
||||
|
||||
// bAbsolute - decide if relative link should be converted to absolute on import
|
||||
#define DECLARE_LINKS_IMPORT_TEST(TestName, FileName, bAbsolute) \
|
||||
class TestName : public Test { \
|
||||
protected: \
|
||||
virtual OUString getTestName() override { return OUString(#TestName); } \
|
||||
public: \
|
||||
CPPUNIT_TEST_SUITE(TestName); \
|
||||
CPPUNIT_TEST(Import); \
|
||||
CPPUNIT_TEST_SUITE_END(); \
|
||||
void Import() \
|
||||
{ \
|
||||
SvtSaveOptions aOpt; \
|
||||
if (bAbsolute) { \
|
||||
aOpt.SetSaveRelFSys(false); \
|
||||
CPPUNIT_ASSERT(!aOpt.IsSaveRelFSys()); \
|
||||
} else { \
|
||||
aOpt.SetSaveRelFSys(true); \
|
||||
CPPUNIT_ASSERT(aOpt.IsSaveRelFSys()); \
|
||||
} \
|
||||
executeImportTest(FileName); \
|
||||
} \
|
||||
void verify() override; \
|
||||
}; \
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \
|
||||
void TestName::verify()
|
||||
#define DECLARE_LINKS_IMPORT_TEST(TestName, FileName, bAbsolute) \
|
||||
class TestName : public Test \
|
||||
{ \
|
||||
protected: \
|
||||
virtual OUString getTestName() override { return OUString(#TestName); } \
|
||||
\
|
||||
public: \
|
||||
CPPUNIT_TEST_SUITE(TestName); \
|
||||
CPPUNIT_TEST(Import); \
|
||||
CPPUNIT_TEST_SUITE_END(); \
|
||||
void Import() \
|
||||
{ \
|
||||
SvtSaveOptions aOpt; \
|
||||
if (bAbsolute) \
|
||||
{ \
|
||||
aOpt.SetSaveRelFSys(false); \
|
||||
CPPUNIT_ASSERT(!aOpt.IsSaveRelFSys()); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
aOpt.SetSaveRelFSys(true); \
|
||||
CPPUNIT_ASSERT(aOpt.IsSaveRelFSys()); \
|
||||
} \
|
||||
executeImportTest(FileName); \
|
||||
} \
|
||||
void verify() override; \
|
||||
}; \
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \
|
||||
void TestName::verify()
|
||||
|
||||
class Test : public SwModelTestBase
|
||||
{
|
||||
public:
|
||||
Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {}
|
||||
Test()
|
||||
: SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text")
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Blacklist handling
|
||||
*/
|
||||
bool mustTestImportOf(const char* filename) const override {
|
||||
bool mustTestImportOf(const char* filename) const override
|
||||
{
|
||||
// If the testcase is stored in some other format, it's pointless to test.
|
||||
return OString(filename).endsWith(".docx");
|
||||
}
|
||||
|
@ -141,7 +159,8 @@ DECLARE_LINKS_IMPORT_TEST(testAbsoluteToAbsoluteImport, "absolute-link.docx", US
|
|||
uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
|
||||
uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1);
|
||||
// # should be encoded
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("file:///B:/Users/user/Desktop/a%23b/test.docx"), getProperty<OUString>(xText, "HyperLinkURL"));
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("file:///B:/Users/user/Desktop/a%23b/test.docx"),
|
||||
getProperty<OUString>(xText, "HyperLinkURL"));
|
||||
}
|
||||
|
||||
DECLARE_LINKS_IMPORT_TEST(testAbsoluteToRelativeImport, "absolute-link.docx", USE_RELATIVE)
|
||||
|
@ -149,12 +168,14 @@ DECLARE_LINKS_IMPORT_TEST(testAbsoluteToRelativeImport, "absolute-link.docx", US
|
|||
uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
|
||||
uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1);
|
||||
// when target file (B:\\...) & document with link (temp dir) are placed on different partitions, absolute path will be loaded
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("file:///B:/Users/user/Desktop/a%23b/test.docx"), getProperty<OUString>(xText, "HyperLinkURL"));
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("file:///B:/Users/user/Desktop/a%23b/test.docx"),
|
||||
getProperty<OUString>(xText, "HyperLinkURL"));
|
||||
}
|
||||
|
||||
/* EXPORT */
|
||||
|
||||
DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", USE_RELATIVE, DONT_MODIFY_LINK)
|
||||
DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", USE_RELATIVE,
|
||||
DONT_MODIFY_LINK)
|
||||
{
|
||||
xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
|
||||
if (!pXmlDoc)
|
||||
|
@ -163,7 +184,8 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", US
|
|||
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target", "relative.docx");
|
||||
}
|
||||
|
||||
DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", USE_ABSOLUTE, DONT_MODIFY_LINK)
|
||||
DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", USE_ABSOLUTE,
|
||||
DONT_MODIFY_LINK)
|
||||
{
|
||||
xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
|
||||
if (!pXmlDoc)
|
||||
|
@ -174,7 +196,8 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", US
|
|||
CPPUNIT_ASSERT(sTarget.endsWith("relative.docx"));
|
||||
}
|
||||
|
||||
DECLARE_LINKS_EXPORT_TEST(testAbsoluteToRelativeExport, "absolute-link.docx", USE_RELATIVE, USE_TEMP_DIR)
|
||||
DECLARE_LINKS_EXPORT_TEST(testAbsoluteToRelativeExport, "absolute-link.docx", USE_RELATIVE,
|
||||
USE_TEMP_DIR)
|
||||
{
|
||||
xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
|
||||
if (!pXmlDoc)
|
||||
|
@ -183,7 +206,8 @@ DECLARE_LINKS_EXPORT_TEST(testAbsoluteToRelativeExport, "absolute-link.docx", US
|
|||
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target", "test.docx");
|
||||
}
|
||||
|
||||
DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", USE_ABSOLUTE, DONT_MODIFY_LINK)
|
||||
DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", USE_ABSOLUTE,
|
||||
DONT_MODIFY_LINK)
|
||||
{
|
||||
xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
|
||||
if (!pXmlDoc)
|
||||
|
|
Loading…
Reference in a new issue