diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-12-18 08:18:14 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-12-18 08:18:14 +0100 |
commit | d94d6900669aca6c3076adc3f7227c90f467a569 (patch) | |
tree | aef4d7d3cf474f2827ba14433b1a4530286fa001 | |
parent | 8303359a6c40f3f787af12c53c35737f9850ceb3 (diff) | |
parent | f5331b17cb71096ee6f149db841b7802efa0c4c4 (diff) |
Merge branch 'libreoffice-7-1'distro/lhm/libreoffice-7-1+backports
into distro/lhm/libreoffice-7-1+backports
Change-Id: Ib4434f11e9ee1b1d4b3607206da01d7fb3120924
Conflicts:
dictionaries
helpcontent2
translations
2061 files changed, 8795 insertions, 5357 deletions
diff --git a/basic/qa/vba_tests/cint.vb b/basic/qa/vba_tests/cint.vb index 6c1d53c93c61..a178a0f97d62 100644 --- a/basic/qa/vba_tests/cint.vb +++ b/basic/qa/vba_tests/cint.vb @@ -73,6 +73,10 @@ REM TestLog_ASSERT nr1 = nr2, "the return CInt is: " & nr1 nr1 = CInt("&H754") TestLog_ASSERT nr1 = nr2, "the return CInt is: " & nr1 + nr2 = 21 + nr1 = CInt("+21") + TestLog_ASSERT nr1 = nr2, "the return CInt is:" & nr1 + result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10) verify_testCInt = result diff --git a/basic/qa/vba_tests/isnumeric.vb b/basic/qa/vba_tests/isnumeric.vb index 2383f4bfe299..511a51bd9106 100644 --- a/basic/qa/vba_tests/isnumeric.vb +++ b/basic/qa/vba_tests/isnumeric.vb @@ -51,6 +51,10 @@ rem TestLog_ASSERT date1 = date2, "the return IsNumeric is: " & date1 date1 = IsNumeric("123") TestLog_ASSERT date1 = date2, "the return IsNumeric is: " & date1 + date2 = True + date1 = IsNumeric("+123") + TestLog_ASSERT date1 = date2, "the return IsNumeric is: " & date1 + result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10) verify_testIsNumeric = result diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 46b3b924798e..a4e7befe94b1 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -26,7 +26,6 @@ #include <stdio.h> #include <rtl/character.hxx> #include <basic/sberrors.hxx> -#include <tools/long.hxx> // All symbol names are laid down int the symbol-pool's stringpool, so that // all symbols are handled in the same case. On saving the code-image, the @@ -70,7 +69,8 @@ short SbiStringPool::Add( double n, SbxDataType t ) // tdf#131296 - store numeric value including its type character // See GetSuffixType in basic/source/comp/scanner.cxx for type characters case SbxINTEGER: snprintf( buf, sizeof(buf), "%d%%", static_cast<short>(n) ); break; - case SbxLONG: snprintf( buf, sizeof(buf), "%ld&", static_cast<tools::Long>(n) ); break; + case SbxLONG: + snprintf( buf, sizeof(buf), "%" SAL_PRIdINT32 "&", static_cast<sal_Int32>(n) ); break; case SbxSINGLE: snprintf( buf, sizeof(buf), "%.6g!", static_cast<float>(n) ); break; case SbxDOUBLE: snprintf( buf, sizeof(buf), "%.16g", n ); break; // default processing in SbiRuntime::StepLOADNC - no type character case SbxCURRENCY: snprintf(buf, sizeof(buf), "%.16g@", n); break; diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 0606b78ca420..dd39a133a450 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -4177,14 +4177,8 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 ) } else if( eType != SbxVARIANT && static_cast<SbxDataType>(pVar->GetType() & 0x0FFF ) != eType ) { - SbxVariable* q = new SbxVariable( eType ); - aRefSaved.emplace_back(q ); - *q = *pVar; - pVar = q; - if ( nIdx ) - { - refParams->Put32( pVar, nIdx ); - } + // tdf#43003 - convert parameter to the requested type + pVar->Convert(eType); } SetupArgs( pVar, nOp1 ); PushVar( CheckArray( pVar ) ); diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index d2f5c91e3483..de3d50dbed38 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -108,7 +108,9 @@ ErrCode ImpScan( const OUString& rWSrc, double& nVal, SbxDataType& rType, SbxDataType eScanType = SbxSINGLE; while( *p == ' ' || *p == '\t' ) p++; - if( *p == '-' ) + if (*p == '+') + p++; + else if( *p == '-' ) { p++; bMinus = true; diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index 52309c6ec617..90c414290c1a 100644 --- a/bridges/source/cpp_uno/shared/vtablefactory.cxx +++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx @@ -85,7 +85,21 @@ extern "C" void * allocExec( p = mmap( nullptr, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON | MAP_JIT, -1, 0); -#else + if (p != MAP_FAILED) { + goto done; + } + { + auto const e = errno; + SAL_INFO("bridges.osx", "mmap failed with " << e); + if (e != EINVAL) { + p = nullptr; + goto done; + } + } + // At least some macOS 10.13 machines are reported to fail the above mmap with EINVAL (see + // tdf#134754 "Crash on macOS 10.13 opening local HSQLDB-based odb file in Base on LibreOffice 7 + // rc1", so in that case retry with the "traditional" approach: +#endif p = mmap( nullptr, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); @@ -97,6 +111,8 @@ extern "C" void * allocExec( munmap (p, n); p = nullptr; } +#if defined MACOSX +done: #endif #elif defined _WIN32 p = VirtualAlloc(nullptr, n, MEM_COMMIT, PAGE_EXECUTE_READWRITE); diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index a39b36234862..d92e06cdc01c 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -184,6 +184,7 @@ public: void testTdf137917(); void testTdf138204(); void testTdf138181(); + void testCustomShapeText(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -330,6 +331,7 @@ public: CPPUNIT_TEST(testTdf137917); CPPUNIT_TEST(testTdf138204); CPPUNIT_TEST(testTdf138181); + CPPUNIT_TEST(testCustomShapeText); CPPUNIT_TEST_SUITE_END(); @@ -3016,7 +3018,7 @@ void Chart2ExportTest::testTdf138181() { load("/chart2/qa/extras/data/xlsx/", "piechart_deleted_legendentry.xlsx"); Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent), - UNO_QUERY_THROW); + UNO_QUERY_THROW); Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); @@ -3038,6 +3040,22 @@ void Chart2ExportTest::testTdf138181() CPPUNIT_ASSERT(xLegendEntry3.is()); } +void Chart2ExportTest::testCustomShapeText() +{ + load("/chart2/qa/extras/data/ods/", "tdf72776.ods"); + reload("calc8"); + Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + // test that the text of custom shape exists inside the chart + Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference<drawing::XShape> xCustomShape(xDrawPage->getByIndex(1), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xCustomShape.is()); + + Reference< text::XText > xRange(xCustomShape, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(!xRange->getString().isEmpty()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 483a862fee1c..fa3fe8fef6e2 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -30,9 +30,9 @@ #include <com/sun/star/chart2/data/XTextualDataSequence.hpp> #include <com/sun/star/chart/DataLabelPlacement.hpp> #include <com/sun/star/text/XTextRange.hpp> -#include <com/sun/star/text/XText.hpp> -#include <com/sun/star/text/XTextCursor.hpp> #include <iterator> +#include <vcl/outdev.hxx> +#include <vcl/svapp.hxx> #include <com/sun/star/util/Color.hpp> #include <com/sun/star/awt/Gradient.hpp> @@ -172,6 +172,7 @@ public: void testTdf137505(); void testTdf137734(); void testTdf137874(); + void testTdfCustomShapePos(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -291,6 +292,7 @@ public: CPPUNIT_TEST(testTdf137505); CPPUNIT_TEST(testTdf137734); CPPUNIT_TEST(testTdf137874); + CPPUNIT_TEST(testTdfCustomShapePos); CPPUNIT_TEST_SUITE_END(); @@ -2610,6 +2612,12 @@ void Chart2ImportTest::testTdf134225() void Chart2ImportTest::testTdf136105() { + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (Application::GetDefaultDevice()->GetDPIX() != 96 + || Application::GetDefaultDevice()->GetDPIY() != 96) + return; + load("/chart2/qa/extras/data/xlsx/", "tdf136105.xlsx"); // 1st chart with fix inner position and size { @@ -2764,6 +2772,34 @@ void Chart2ImportTest::testTdf137874() CPPUNIT_ASSERT(xLegendEntry.is()); } +void Chart2ImportTest::testTdfCustomShapePos() +{ + load("/chart2/qa/extras/data/docx/", "testcustomshapepos.docx"); + Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), UNO_QUERY_THROW); + Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + // test position and size of a custom shape within a chart, rotated by 0 degree. + { + Reference<drawing::XShape> xCustomShape(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + awt::Point aPosition = xCustomShape->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(8845, aPosition.X, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(855, aPosition.Y, 300); + awt::Size aSize = xCustomShape->getSize(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(4831, aSize.Width, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1550, aSize.Height, 300); + } + // test position and size of a custom shape within a chart, rotated by 90 degree. + { + Reference<drawing::XShape> xCustomShape(xDrawPage->getByIndex(1), UNO_QUERY_THROW); + awt::Point aPosition = xCustomShape->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1658, aPosition.X, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(6119, aPosition.Y, 300); + awt::Size aSize = xCustomShape->getSize(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(4165, aSize.Width, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1334, aSize.Height, 300); + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/docx/testcustomshapepos.docx b/chart2/qa/extras/data/docx/testcustomshapepos.docx Binary files differnew file mode 100644 index 000000000000..640c48ea4627 --- /dev/null +++ b/chart2/qa/extras/data/docx/testcustomshapepos.docx diff --git a/chart2/qa/extras/data/ods/tdf72776.ods b/chart2/qa/extras/data/ods/tdf72776.ods Binary files differnew file mode 100644 index 000000000000..4ddad64a5ef5 --- /dev/null +++ b/chart2/qa/extras/data/ods/tdf72776.ods diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 1953bf9e6f59..defde0487db7 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1108,8 +1108,8 @@ void SAL_CALL ChartController::dispatch( if (rArgs.getLength() > 0) { sal_uInt32 nColor; - rArgs[0].Value >>= nColor; - this->executeDispatch_FillColor(nColor); + if (rArgs[0].Value >>= nColor) + this->executeDispatch_FillColor(nColor); } } else if(aCommand.startsWith("FillGradient")) diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 2a2048c35016..5a2ad59f9cc5 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -1000,8 +1000,6 @@ void VLegend::createShapes( std::vector<ViewLegendEntry> aNewEntries = pLegendEntryProvider->createLegendEntries( aMaxSymbolExtent, eLegendPosition, xLegendProp, xLegendContainer, m_xShapeFactory, m_xContext, mrModel); - if (aNewEntries.size() == 0) - return; aViewEntries.insert( aViewEntries.end(), aNewEntries.begin(), aNewEntries.end() ); } } @@ -1042,17 +1040,14 @@ void VLegend::createShapes( // create the buttons pButton->createShapes(xModelPage); } - } - Reference< drawing::XShape > xBorder = - pShapeFactory->createRectangle( xLegendContainer, - aLegendSize, - awt::Point(0,0), - aLineFillProperties.first, - aLineFillProperties.second, ShapeFactory::StackPosition::Bottom ); + Reference<drawing::XShape> xBorder = pShapeFactory->createRectangle( + xLegendContainer, aLegendSize, awt::Point(0, 0), aLineFillProperties.first, + aLineFillProperties.second, ShapeFactory::StackPosition::Bottom); - //because of this name this border will be used for marking the legend - ShapeFactory::setShapeName( xBorder, "MarkHandles" ); + //because of this name this border will be used for marking the legend + ShapeFactory::setShapeName(xBorder, "MarkHandles"); + } } } catch( const uno::Exception & ) diff --git a/comphelper/qa/unit/parallelsorttest.cxx b/comphelper/qa/unit/parallelsorttest.cxx index 90dcb3c235ba..a3618244ab8d 100644 --- a/comphelper/qa/unit/parallelsorttest.cxx +++ b/comphelper/qa/unit/parallelsorttest.cxx @@ -53,7 +53,7 @@ void ParallelSortTest::setUp() void ParallelSortTest::tearDown() { if (pThreadPool) - pThreadPool->joinAll(); + pThreadPool->joinThreadsIfIdle(); } void ParallelSortTest::fillRandomUptoN(std::vector<size_t>& rVector, size_t N) diff --git a/comphelper/qa/unit/threadpooltest.cxx b/comphelper/qa/unit/threadpooltest.cxx index 03bd4a33d69c..695aca5b421a 100644 --- a/comphelper/qa/unit/threadpooltest.cxx +++ b/comphelper/qa/unit/threadpooltest.cxx @@ -24,10 +24,16 @@ class ThreadPoolTest : public CppUnit::TestFixture public: void testPreferredConcurrency(); void testWorkerUsage(); + void testTasksInThreads(); + void testNoThreads(); + void testDedicatedPool(); CPPUNIT_TEST_SUITE(ThreadPoolTest); CPPUNIT_TEST(testPreferredConcurrency); CPPUNIT_TEST(testWorkerUsage); + CPPUNIT_TEST(testTasksInThreads); + CPPUNIT_TEST(testNoThreads); + CPPUNIT_TEST(testDedicatedPool); CPPUNIT_TEST_SUITE_END(); }; @@ -98,6 +104,62 @@ void ThreadPoolTest::testWorkerUsage() rSharedPool.waitUntilDone(pTag); } +namespace +{ +class CheckThreadTask : public comphelper::ThreadTask +{ + oslThreadIdentifier mThreadId; + bool mCheckEqual; + +public: + CheckThreadTask(oslThreadIdentifier threadId, bool checkEqual, + const std::shared_ptr<comphelper::ThreadTaskTag>& pTag) + : ThreadTask(pTag) + , mThreadId(threadId) + , mCheckEqual(checkEqual) + { + } + virtual void doWork() + { + assert(mCheckEqual ? osl::Thread::getCurrentIdentifier() == mThreadId + : osl::Thread::getCurrentIdentifier() != mThreadId); + } +}; +} // namespace + +void ThreadPoolTest::testTasksInThreads() +{ + // Check that all tasks are run in worker threads, not this thread. + comphelper::ThreadPool& pool = comphelper::ThreadPool::getSharedOptimalPool(); + std::shared_ptr<comphelper::ThreadTaskTag> pTag = comphelper::ThreadPool::createThreadTaskTag(); + for (int i = 0; i < 8; ++i) + pool.pushTask( + std::make_unique<CheckThreadTask>(osl::Thread::getCurrentIdentifier(), false, pTag)); + pool.waitUntilDone(pTag); +} + +void ThreadPoolTest::testNoThreads() +{ + // No worker threads, tasks will be run in this thread. + comphelper::ThreadPool pool(0); + std::shared_ptr<comphelper::ThreadTaskTag> pTag = comphelper::ThreadPool::createThreadTaskTag(); + for (int i = 0; i < 8; ++i) + pool.pushTask( + std::make_unique<CheckThreadTask>(osl::Thread::getCurrentIdentifier(), true, pTag)); + pool.waitUntilDone(pTag); +} + +void ThreadPoolTest::testDedicatedPool() +{ + // Test that a separate thread pool works. The tasks themselves do not matter. + comphelper::ThreadPool pool(4); + std::shared_ptr<comphelper::ThreadTaskTag> pTag = comphelper::ThreadPool::createThreadTaskTag(); + for (int i = 0; i < 8; ++i) + pool.pushTask( + std::make_unique<CheckThreadTask>(osl::Thread::getCurrentIdentifier(), false, pTag)); + pool.waitUntilDone(pTag); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ThreadPoolTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx index 3c335e7f4761..1ef0eeaaba5c 100644 --- a/comphelper/source/misc/threadpool.cxx +++ b/comphelper/source/misc/threadpool.cxx @@ -76,6 +76,7 @@ public: std::unique_ptr<ThreadTask> pTask = mpPool->popWorkLocked( aGuard, true ); if( pTask ) { + std::shared_ptr<ThreadTaskTag> pTag(pTask->mpTag); mpPool->incBusyWorker(); aGuard.unlock(); @@ -84,6 +85,7 @@ public: aGuard.lock(); mpPool->decBusyWorker(); + pTag->onTaskWorkerDone(); } } } @@ -162,12 +164,23 @@ void ThreadPool::shutdownLocked(std::unique_lock<std::mutex>& aGuard) { // no threads at all -> execute the work in-line std::unique_ptr<ThreadTask> pTask; while ( ( pTask = popWorkLocked(aGuard, false) ) ) + { + std::shared_ptr<ThreadTaskTag> pTag(pTask->mpTag); pTask->exec(); + pTag->onTaskWorkerDone(); + } } else { while( !maTasks.empty() ) + { maTasksChanged.wait( aGuard ); + // In the (unlikely but possible?) case pushTask() gets called meanwhile, + // its notify_one() call is meant to wake a up a thread and process the task. + // But if this code gets woken up instead, it could lead to a deadlock. + // Pass on the notification. + maTasksChanged.notify_one(); + } } assert( maTasks.empty() ); @@ -243,7 +256,7 @@ void ThreadPool::decBusyWorker() --mnBusyWorkers; } -void ThreadPool::waitUntilDone(const std::shared_ptr<ThreadTaskTag>& rTag, bool bJoinAll) +void ThreadPool::waitUntilDone(const std::shared_ptr<ThreadTaskTag>& rTag, bool bJoin) { #if defined DBG_UTIL && (defined LINUX || defined _WIN32) assert(!gbIsWorkerThread && "cannot wait for tasks from inside a task"); @@ -258,21 +271,23 @@ void ThreadPool::waitUntilDone(const std::shared_ptr<ThreadTaskTag>& rTag, bool std::unique_ptr<ThreadTask> pTask = popWorkLocked(aGuard, false); if (!pTask) break; + std::shared_ptr<ThreadTaskTag> pTag(pTask->mpTag); pTask->exec(); + pTag->onTaskWorkerDone(); } } } rTag->waitUntilDone(); - if (bJoinAll) - joinAll(); + if (bJoin) + joinThreadsIfIdle(); } -void ThreadPool::joinAll() +void ThreadPool::joinThreadsIfIdle() { std::unique_lock< std::mutex > aGuard( maMutex ); - if (maTasks.empty()) // check if there are still tasks from another tag + if (isIdle()) // check if there are still tasks from another tag { shutdownLocked(aGuard); } @@ -295,7 +310,6 @@ ThreadTask::ThreadTask(const std::shared_ptr<ThreadTaskTag>& pTag) void ThreadTask::exec() { - std::shared_ptr<ThreadTaskTag> pTag(mpTag); try { doWork(); } @@ -311,8 +325,6 @@ void ThreadTask::exec() { SAL_WARN("comphelper", "unknown exception in thread worker while calling doWork()"); } - - pTag->onTaskWorkerDone(); } ThreadTaskTag::ThreadTaskTag() : mnTasksWorking(0) diff --git a/config_host/config_oauth2.h.in b/config_host/config_oauth2.h.in index f3616ee38162..a95015b41f3e 100644 --- a/config_host/config_oauth2.h.in +++ b/config_host/config_oauth2.h.in @@ -35,13 +35,13 @@ /* OneDrive */ -#define ONEDRIVE_BASE_URL "https://apis.live.net/v5.0" +#define ONEDRIVE_BASE_URL "https://graph.microsoft.com/v1.0" #define ONEDRIVE_CLIENT_ID "" #define ONEDRIVE_CLIENT_SECRET "" -#define ONEDRIVE_AUTH_URL "https://login.live.com/oauth20_authorize.srf" -#define ONEDRIVE_TOKEN_URL "https://login.live.com/oauth20_token.srf" -#define ONEDRIVE_REDIRECT_URI "https://login.live.com/oauth20_desktop.srf" -#define ONEDRIVE_SCOPE "wl.skydrive_update wl.offline_access" +#define ONEDRIVE_AUTH_URL "https://login.microsoftonline.com/common/oauth2/v2.0/authorize" +#define ONEDRIVE_TOKEN_URL "https://login.microsoftonline.com/common/oauth2/v2.0/token" +#define ONEDRIVE_REDIRECT_URI "http://localhost/LibreOffice" +#define ONEDRIVE_SCOPE "Files.ReadWrite offline_access" #endif diff --git a/configure.ac b/configure.ac index 956b16fb313f..3428679fd82f 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([LibreOffice],[7.1.0.0.beta1+],[],[],[http://documentfoundation.org/]) +AC_INIT([LibreOffice],[7.1.0.1.0+],[],[],[http://documentfoundation.org/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard @@ -3118,7 +3118,7 @@ if test $_os = Darwin; then # higher than or equal to the minimum required should be found. AC_MSG_CHECKING([what macOS SDK to use]) - for _macosx_sdk in ${with_macosx_sdk-11.0 10.15 10.14 10.13}; do + for _macosx_sdk in ${with_macosx_sdk-11.1 11.0 10.15 10.14 10.13}; do MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null` if test -d "$MACOSX_SDK_PATH"; then with_macosx_sdk="${_macosx_sdk}" @@ -3150,8 +3150,11 @@ if test $_os = Darwin; then 11.0) MACOSX_SDK_VERSION=110000 ;; + 11.1) + MACOSX_SDK_VERSION=110100 + ;; *) - AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.13--11.0]) + AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.13--11.1]) ;; esac @@ -3213,8 +3216,11 @@ if test $_os = Darwin; then 11.0) MAC_OS_X_VERSION_MIN_REQUIRED="110000" ;; + 11.1) + MAC_OS_X_VERSION_MIN_REQUIRED="110100" + ;; *) - AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--11.0]) + AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--11.1]) ;; esac @@ -3275,8 +3281,11 @@ if test $_os = Darwin; then 11.0) MAC_OS_X_VERSION_MAX_ALLOWED="110000" ;; + 11.1) + MAC_OS_X_VERSION_MAX_ALLOWED="110100" + ;; *) - AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--11.0]) + AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--11.1]) ;; esac @@ -3384,8 +3393,8 @@ dnl =================================================================== if test $_os = iOS; then AC_MSG_CHECKING([what iOS SDK to use]) - current_sdk_ver=14.2 - older_sdk_vers="14.1 14.0 13.7 13.6 13.5 13.4 13.2 13.1 13.0 12.4 12.2" + current_sdk_ver=14.3 + older_sdk_vers="14.2 14.1 14.0 13.7 13.6 13.5 13.4 13.2 13.1 13.0 12.4 12.2" if test "$enable_ios_simulator" = "yes"; then platform=iPhoneSimulator versionmin=-mios-simulator-version-min=12.2 diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index e86af9673052..03724d669704 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -72,6 +72,11 @@ public: } virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override { + // tdf#137745, perhaps connectivity::OTableHelper::disposing() has been called + // which called OTableContainerListener::clear(), so m_pComponent may be null + if (m_pComponent == nullptr) + return; + OUString sName; Event.Accessor >>= sName; if ( m_aRefNames.find(sName) != m_aRefNames.end() ) diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx index 9aabd39cb52a..d06e7cc71985 100644 --- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx @@ -1194,7 +1194,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( // result field may be filled with spaces sCharsetName = sCharsetName.trim(); ColumnTypeInfo aInfo(aType, xRow->getShort(7), aScale, - xRow->getString(13)); + sCharsetName); aCurrentRow[5] = new ORowSetValueDecorator(aInfo.getSdbcType()); // 6. Typename (SQL_*) diff --git a/cui/inc/tipoftheday.hrc b/cui/inc/tipoftheday.hrc index f5d06db9657e..95806eb9bff1 100644 --- a/cui/inc/tipoftheday.hrc +++ b/cui/inc/tipoftheday.hrc @@ -47,13 +47,13 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] = { { NC_("RID_CUI_TIPOFTHEDAY", "%PRODUCTNAME offers a variety of user interface options to make you feel at home"), ".uno:ToolbarModeUI", "toolbarmode.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Need to allow changes to parts of a read-only document in Writer? Insert frames or sections that can authorize changes."), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/swriter/guide/section_edit.html", "tipoftheday_w.png"}, //local help missing - { NC_("RID_CUI_TIPOFTHEDAY", "To print the notes of your slides go to File ▸ Print ▸ Impress tab and select Notes under Document ▸ Type."), "", "tipoftheday_i.png"}, + { NC_("RID_CUI_TIPOFTHEDAY", "To print the notes of your slides go to File ▸ Print ▸ Impress tab and select Notes under Document ▸ Type."), "", "printnote.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "To start temporarily with a fresh user profile, or to restore a non-working %PRODUCTNAME, use Help ▸ Restart in Safe Mode."), "svx/ui/safemodedialog/SafeModeDialog", ""}, //https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/shared/01/profile_safe_mode.html { NC_("RID_CUI_TIPOFTHEDAY", "Writing a book? %PRODUCTNAME master document lets you manage large documents as a container for individual %PRODUCTNAME Writer files."), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/swriter/guide/globaldoc.html", "tipoftheday_w.png"}, //local help missing { NC_("RID_CUI_TIPOFTHEDAY", "Create editable Hybrid PDFs with %PRODUCTNAME."), "https://wiki.documentfoundation.org/Documentation/HowTo/CreateAHybridPDF", ""}, { NC_("RID_CUI_TIPOFTHEDAY", "Explore the ten different functions in the status bar (at the bottom of the document window). Place the cursor over each field for an explanation. If not visible, use View ▸ Status Bar."), "", "tipoftheday_w.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Want to sum a cell through several sheets? Refer to the range of sheets e.g. =SUM(Sheet1.A1:Sheet3.A1)."), "", "tipoftheday_c.png"}, - { NC_("RID_CUI_TIPOFTHEDAY", "Create fillable form documents (even PDFs) with %PRODUCTNAME."), "https://www.techrepublic.com/article/how-to-create-interactive-pdfs-with-libreoffice", ""}, + { NC_("RID_CUI_TIPOFTHEDAY", "Create fillable form documents (even PDFs) with %PRODUCTNAME."), "https://www.techrepublic.com/article/how-to-create-interactive-pdfs-with-libreoffice", "formdocuments.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Cannot see all the text in a cell? Expand the input line in the formula bar and you can scroll."), "", "tipoftheday_c.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Optimize your table layout with Table ▸ Size ▸ Distribute Rows / Columns Evenly."), "", "tipoftheday_w.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Find all expressions in brackets per Edit ▸ Find and Replace ▸ Find ▸ \\([^)]+\\) (check “Regular expressions”)"), "", "tipoftheday_w.png"}, @@ -66,7 +66,7 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] = { NC_("RID_CUI_TIPOFTHEDAY", "You can restart the slide show after a pause specified at Slide Show ▸ Slide Show Settings ▸ Loop and repeat."), "", "tipoftheday_i.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "To distribute some text in multi-columns select the text and apply Format ▸ Columns."), "", "tipoftheday_w.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Use View ▸ Value Highlighting to display cell contents in colors: Text/black, Formulas/green, Numbers/blue, Protected cells/grey background."), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/scalc/01/03080000.html", "tipoftheday_c.png"}, //local help missing - { NC_("RID_CUI_TIPOFTHEDAY", "Create different master pages in a presentation template: View ▸ Master Slide and Slide ▸ New Master (or per toolbar or right click in slide pane)."), "", "tipoftheday_i.png"}, + { NC_("RID_CUI_TIPOFTHEDAY", "Create different master pages in a presentation template: View ▸ Master Slide and Slide ▸ New Master (or per toolbar or right click in slide pane)."), "", "masterdocument.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Want to sort a pivot table? Click on drop-list’s arrow in the row/col header and select sort method: ascending, descending, or custom."), "", "tipoftheday_c.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Display photos or images with different shapes in Writer. Insert and select shape, then Insert ▸ Image. To adjust image, right-click on selected shape and choose Area."), "", "tipoftheday_w.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Use Page/Slide ▸ Properties ▸ “Fit object to paper format” in Draw/Impress to resize the objects so that they fit on your chosen paper format."), "", "tipoftheday_d.png"}, @@ -76,7 +76,7 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] = { NC_("RID_CUI_TIPOFTHEDAY", "To automatically number table rows in Writer, select the relevant column, then apply a numbering style from List Styles."), "", "tipoftheday_w.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "%PRODUCTNAME allows you to use assistive tools, such as external screen readers, Braille devices or speech recognition input devices."), "https://www.libreoffice.org/get-help/accessibility/", ""}, { NC_("RID_CUI_TIPOFTHEDAY", "Want to sort a series in %PRODUCTNAME Calc such as A1, A2, A3, A11, A15, not in alphabetical order but on the number? Enable natural sort in the Options tab."), "modules/scalc/ui/sortoptionspage/SortOptionsPage", "tipoftheday_c.png"}, //https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/scalc/01/12030200.html - { NC_("RID_CUI_TIPOFTHEDAY", "You can change the default function in the status bar: right click on the area."), "", "tipoftheday_c.png"}, + { NC_("RID_CUI_TIPOFTHEDAY", "You can change the default function in the status bar: right click on the area."), "", "statusbar.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Want to add many of the same shapes in Draw/Impress? Double-click a tool in the drawing toolbar to use it for repeated tasks."), "", "tipoftheday_d.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "%MOD1+Shift+F9 recalculates all formulas in all spreadsheets."), "", "tipoftheday_c.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Want to keep a part of an editable document as read-only? Insert ▸ Section. Add text to the section, then right-click “Edit Section” and check “Protect”."), "", "tipoftheday_w.png"}, diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx index 3c745692f7ea..fda8b4ce1385 100644 --- a/cui/source/dialogs/sdrcelldlg.cxx +++ b/cui/source/dialogs/sdrcelldlg.cxx @@ -27,6 +27,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemS : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr) , mrOutAttrs(*pAttr) , mpColorTab(rModel.GetColorList()) + , mnColorTabState ( ChangeType::NONE ) , mpGradientList(rModel.GetGradientList()) , mpHatchingList(rModel.GetHatchList()) , mpBitmapList(rModel.GetBitmapList()) @@ -36,6 +37,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemS AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS); AddTabPage("border", RID_SVXPAGE_BORDER ); AddTabPage("area", RID_SVXPAGE_AREA); + AddTabPage("shadow", SvxShadowTabPage::Create, nullptr); } void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage) @@ -55,6 +57,11 @@ void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage) SvxBorderTabPage& rBorderPage = static_cast<SvxBorderTabPage&>(rPage); rBorderPage.SetTableMode(); } + else if (rId == "shadow") + { + static_cast<SvxShadowTabPage&>(rPage).SetColorList( mpColorTab ); + static_cast<SvxShadowTabPage&>(rPage).SetColorChgd( &mnColorTabState ); + } else SfxTabDialogController::PageCreated(rId, rPage); } diff --git a/cui/source/inc/optpath.hxx b/cui/source/inc/optpath.hxx index 4447c98425b9..ac8747088e90 100644 --- a/cui/source/inc/optpath.hxx +++ b/cui/source/inc/optpath.hxx @@ -48,6 +48,7 @@ private: DECL_LINK(StandardHdl_Impl, weld::Button&, void); DECL_LINK(PathSelect_Impl, weld::TreeView&, void); + DECL_LINK(HeaderBarClick, int, void); DECL_LINK(DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void); diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx index a9f6183bd1d1..5b7e9ca71a20 100644 --- a/cui/source/inc/sdrcelldlg.hxx +++ b/cui/source/inc/sdrcelldlg.hxx @@ -22,6 +22,7 @@ #include <sfx2/tabdlg.hxx> #include <svx/xtable.hxx> +#include <svx/tabarea.hxx> class SdrModel; class SvxFormatCellsDialog : public SfxTabDialogController @@ -30,6 +31,7 @@ private: const SfxItemSet& mrOutAttrs; XColorListRef mpColorTab; + ChangeType mnColorTabState; XGradientListRef mpGradientList; XHatchListRef mpHatchingList; XBitmapListRef mpBitmapList; diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index b067aaf05f80..d94112822f65 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -227,7 +227,7 @@ void SvxFontSubstTabPage::Reset( const SfxItemSet* ) m_xCheckLB->set_sort_column(2); m_xCheckLB->set_sort_indicator(TRISTATE_TRUE, 2); - CheckEnable(); + SelectHdl(m_xFont1CB.get()); //fill font name box first m_xNonPropFontsOnlyCB->set_active( @@ -271,7 +271,7 @@ namespace { for (int i = 0, nEntryCount = rTreeView.n_children(); i < nEntryCount; ++i) { - if (rTreeView.get_text(i, 3) == rCol) + if (rTreeView.get_text(i, 2) == rCol) return i; } return -1; @@ -282,7 +282,7 @@ namespace int nRow = findText(rTreeView, rCol1); if (nRow == -1) return false; - return rTreeView.get_text(nRow, 4) == rCol2; + return rTreeView.get_text(nRow, 3) == rCol2; } } @@ -323,12 +323,18 @@ void SvxFontSubstTabPage::SelectHdl(const weld::Widget* pWin) if (pWin == m_xCheckLB.get()) { - if (m_xCheckLB->count_selected_rows() == 1) + const int nSelectedRowCount = m_xCheckLB->count_selected_rows(); + if (nSelectedRowCount == 1) { int nRow = m_xCheckLB->get_selected_index(); m_xFont1CB->set_entry_text(m_xCheckLB->get_text(nRow, 2)); m_xFont2CB->set_entry_text(m_xCheckLB->get_text(nRow, 3)); } + else if (nSelectedRowCount > 1) + { + m_xFont1CB->set_entry_text(OUString()); + m_xFont2CB->set_entry_text(OUString()); + } } if (pWin == m_xFont1CB.get()) @@ -344,6 +350,8 @@ void SvxFontSubstTabPage::SelectHdl(const weld::Widget* pWin) m_xCheckLB->select(nPos); } } + else + m_xCheckLB->unselect_all(); } CheckEnable(); @@ -370,13 +378,15 @@ void SvxFontSubstTabPage::CheckEnable() { bool bEnableAll = m_xUseTableCB->get_active(); m_xCheckLB->set_sensitive(bEnableAll); + m_xFont1CB->set_sensitive(bEnableAll); + m_xFont2CB->set_sensitive(bEnableAll); + + bool bApply = bEnableAll, bDelete = bEnableAll; + if (bEnableAll) { - bool bApply, bDelete; - int nEntry = m_xCheckLB->get_selected_index(); - // because of OS/2 optimization error (Bug #56267) a bit more intricate: if (m_xFont1CB->get_active_text().isEmpty() || m_xFont2CB->get_active_text().isEmpty()) bApply = false; else if (m_xFont1CB->get_active_text() == m_xFont2CB->get_active_text()) @@ -389,27 +399,10 @@ void SvxFontSubstTabPage::CheckEnable() bApply = true; bDelete = nEntry != -1; - - m_xApply->set_sensitive(bApply); - m_xDelete->set_sensitive(bDelete); } - if (bEnableAll) - { - if (!m_xCheckLB->get_sensitive()) - { - m_xCheckLB->set_sensitive(true); - SelectHdl(m_xFont1CB.get()); - } - } - else - { - if (m_xCheckLB->get_sensitive()) - { - m_xCheckLB->set_sensitive(false); - m_xCheckLB->unselect_all(); - } - } + m_xApply->set_sensitive(bApply); + m_xDelete->set_sensitive(bDelete); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 6b71b125e078..07435990a234 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -101,90 +101,6 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::util; using namespace ::utl; -namespace svt { - -class SkiaCfg -{ -private: - bool mbUseSkia; - bool mbForceSkiaRaster; - bool mbModified; - -public: - SkiaCfg(); - ~SkiaCfg(); - - bool useSkia() const; - bool forceSkiaRaster() const; - - void setUseSkia(bool bSkia); - void setForceSkiaRaster(bool bSkia); - - void reset(); -}; - -SkiaCfg::SkiaCfg(): - mbModified(false) -{ - reset(); -} - -void SkiaCfg::reset() -{ - mbUseSkia = officecfg::Office::Common::VCL::UseSkia::get(); - mbForceSkiaRaster = officecfg::Office::Common::VCL::ForceSkiaRaster::get(); - mbModified = false; -} - -SkiaCfg::~SkiaCfg() -{ - if (!mbModified) - return; - - try - { - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); - if (!officecfg::Office::Common::VCL::UseSkia::isReadOnly()) - officecfg::Office::Common::VCL::UseSkia::set(mbUseSkia, batch); - if (!officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly()) - officecfg::Office::Common::VCL::ForceSkiaRaster::set(mbForceSkiaRaster, batch); - batch->commit(); - } - catch (...) - { - } -} - -bool SkiaCfg::useSkia() const -{ - return mbUseSkia; -} - -bool SkiaCfg::forceSkiaRaster() const -{ - return mbForceSkiaRaster; -} - -void SkiaCfg::setUseSkia(bool bSkia) -{ - if (bSkia != mbUseSkia) - { - mbUseSkia = bSkia; - mbModified = true; - } -} - -void SkiaCfg::setForceSkiaRaster(bool bSkia) -{ - if (mbForceSkiaRaster != bSkia) - { - mbForceSkiaRaster = bSkia; - mbModified = true; - } -} - -} - // class OfaMiscTabPage -------------------------------------------------- DeactivateRC OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ ) @@ -551,11 +467,6 @@ CanvasSettings::CanvasSettings() : bool CanvasSettings::IsHardwareAccelerationAvailable() const { - if (SkiaHelper::isVCLSkiaEnabled() && Application::GetToolkitName() != "gtk3") - { - mbHWAccelAvailable = false; - return false; - } #if HAVE_FEATURE_OPENGL if (OpenGLWrapper::isVCLOpenGLEnabled() && Application::GetToolkitName() != "gtk3") { @@ -661,7 +572,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p , pAppearanceCfg(new SvtTabAppearanceCfg) , pCanvasSettings(new CanvasSettings) , mpDrawinglayerOpt(new SvtOptionsDrawinglayer) - , mpSkiaConfig(new svt::SkiaCfg) , m_xIconSizeLB(m_xBuilder->weld_combo_box("iconsize")) , m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box("sidebariconsize")) , m_xNotebookbarIconSizeLB(m_xBuilder->weld_combo_box("notebookbariconsize")) @@ -716,8 +626,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p m_xMoreIcons->set_from_icon_name("cmd/sc_additionsdialog.png"); m_xMoreIcons->connect_clicked(LINK(this, OfaViewTabPage, OnMoreIconsClick)); - - UpdateSkiaStatus(); } OfaViewTabPage::~OfaViewTabPage() @@ -779,6 +687,10 @@ void OfaViewTabPage::UpdateSkiaStatus() // FIXME: should really add code to show a 'lock' icon here. m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly()); m_xForceSkiaRaster->set_sensitive(m_xUseSkia->get_active() && !officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly()); + + // Technically the 'use hardware acceleration' option could be used to mean !forceSkiaRaster, but the implementation + // of the option is so tied to the implementation of the canvas module that it's simpler to ignore it. + UpdateHardwareAccelStatus(); #else HideSkiaWidgets(); #endif @@ -944,8 +856,10 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) if (m_xUseSkia->get_state_changed_from_saved() || m_xForceSkiaRaster->get_state_changed_from_saved()) { - mpSkiaConfig->setUseSkia(m_xUseSkia->get_active()); - mpSkiaConfig->setForceSkiaRaster(m_xForceSkiaRaster->get_active()); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::VCL::UseSkia::set(m_xUseSkia->get_active(), batch); + officecfg::Office::Common::VCL::ForceSkiaRaster::set(m_xForceSkiaRaster->get_active(), batch); + batch->commit(); bModified = true; } @@ -992,7 +906,6 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) void OfaViewTabPage::Reset( const SfxItemSet* ) { SvtMiscOptions aMiscOptions; - mpSkiaConfig->reset(); if (aMiscOptions.GetSymbolsSize() != SFX_SYMBOLS_SIZE_AUTO) { @@ -1058,20 +971,8 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) m_xContextMenuShortcutsLB->set_active(bContextMenuShortcutsNonDefault ? eContextMenuShortcuts + 1 : 0); m_xContextMenuShortcutsLB->save_value(); - { // #i95644# HW accel (unified to disable mechanism) - if(pCanvasSettings->IsHardwareAccelerationAvailable()) - { - m_xUseHardwareAccell->set_active(pCanvasSettings->IsHardwareAccelerationEnabled()); - m_xUseHardwareAccell->set_sensitive(!pCanvasSettings->IsHardwareAccelerationRO()); - } - else - { - m_xUseHardwareAccell->set_active(false); - m_xUseHardwareAccell->set_sensitive(false); - } - - m_xUseHardwareAccell->save_state(); - } + UpdateHardwareAccelStatus(); + m_xUseHardwareAccell->save_state(); { // #i95644# AntiAliasing if(mpDrawinglayerOpt->IsAAPossibleOnThisSystem()) @@ -1086,17 +987,36 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) m_xUseAntiAliase->save_state(); } - m_xUseSkia->set_active(mpSkiaConfig->useSkia()); - m_xForceSkiaRaster->set_active(mpSkiaConfig->forceSkiaRaster()); + + m_xUseSkia->set_active(officecfg::Office::Common::VCL::UseSkia::get()); + m_xForceSkiaRaster->set_active(officecfg::Office::Common::VCL::ForceSkiaRaster::get()); + m_xUseSkia->save_state(); + m_xForceSkiaRaster->save_state(); m_xFontAntiAliasing->save_state(); m_xAAPointLimit->save_value(); m_xFontShowCB->save_state(); - m_xUseSkia->save_state(); - m_xForceSkiaRaster->save_state(); - OnAntialiasingToggled(*m_xFontAntiAliasing); + UpdateSkiaStatus(); +} + +void OfaViewTabPage::UpdateHardwareAccelStatus() +{ + // #i95644# HW accel (unified to disable mechanism) + if(pCanvasSettings->IsHardwareAccelerationAvailable()) + { + m_xUseHardwareAccell->set_active(pCanvasSettings->IsHardwareAccelerationEnabled()); + m_xUseHardwareAccell->set_sensitive(!pCanvasSettings->IsHardwareAccelerationRO()); + } + else + { + m_xUseHardwareAccell->set_active(false); + m_xUseHardwareAccell->set_sensitive(false); + } +#if HAVE_FEATURE_SKIA + m_xUseHardwareAccell->set_sensitive(!m_xUseSkia->get_active()); +#endif } struct LanguageConfig_Impl diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index 93dc5280b98e..07d3cca86fb7 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -28,10 +28,6 @@ namespace vcl { class IconThemeInfo; } -namespace svt { - class SkiaCfg; -} - class OfaMiscTabPage : public SfxTabPage { private: @@ -88,7 +84,6 @@ private: std::unique_ptr<SvtTabAppearanceCfg> pAppearanceCfg; std::unique_ptr<CanvasSettings> pCanvasSettings; std::unique_ptr<SvtOptionsDrawinglayer> mpDrawinglayerOpt; - std::unique_ptr<svt::SkiaCfg> mpSkiaConfig; std::vector<vcl::IconThemeInfo> mInstalledIconThemes; @@ -125,6 +120,7 @@ private: DECL_STATIC_LINK(OfaViewTabPage, OnMoreIconsClick, weld::Button&, void); void UpdateSkiaStatus(); void HideSkiaWidgets(); + void UpdateHardwareAccelStatus(); public: OfaViewTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 45b2c14d5c0d..eef4935480e4 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -195,12 +195,20 @@ SvxPathTabPage::SvxPathTabPage(weld::Container* pPage, weld::DialogController* p m_xPathBox->get_height_rows(20)); m_xPathBox->connect_row_activated( LINK( this, SvxPathTabPage, DoubleClickPathHdl_Impl ) ); + m_xPathBox->connect_column_clicked(LINK(this, SvxPathTabPage, HeaderBarClick)); m_xPathBox->connect_changed( LINK( this, SvxPathTabPage, PathSelect_Impl ) ); m_xPathBox->set_selection_mode(SelectionMode::Multiple); xDialogListener->SetDialogClosedLink( LINK( this, SvxPathTabPage, DialogClosedHdl ) ); } +IMPL_LINK(SvxPathTabPage, HeaderBarClick, int, nColumn, void) +{ + bool bSortAtoZ = !m_xPathBox->get_sort_order(); + m_xPathBox->set_sort_order(bSortAtoZ); + m_xPathBox->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, nColumn); +} + SvxPathTabPage::~SvxPathTabPage() { for (int i = 0, nEntryCount = m_xPathBox->n_children(); i < nEntryCount; ++i) @@ -228,6 +236,7 @@ bool SvxPathTabPage::FillItemSet( SfxItemSet* ) void SvxPathTabPage::Reset( const SfxItemSet* ) { m_xPathBox->clear(); + m_xPathBox->make_unsorted(); std::unique_ptr<weld::TreeIter> xIter = m_xPathBox->make_iterator(); for( sal_uInt16 i = 0; i <= sal_uInt16(SvtPathOptions::PATH_CLASSIFICATION); ++i ) @@ -319,6 +328,7 @@ void SvxPathTabPage::Reset( const SfxItemSet* ) } m_xPathBox->columns_autosize(); + m_xPathBox->make_sorted(); PathSelect_Impl(*m_xPathBox); } diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 6e822e974c5e..3c8fcdadeff1 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -724,13 +724,18 @@ IMPL_LINK(OfaTreeOptionsDialog, ApplyHdl_Impl, weld::Button&, rButton, void) m_xDialog->response(RET_OK); else { - // tdf#137930 rebuild the in and out itemsets - // to reflect the current post-apply state + // tdf#137930 rebuild the in and out itemsets to reflect the current + // post-apply state if (pGroupInfo && pGroupInfo->m_pInItemSet) { - pGroupInfo->m_pInItemSet.reset(); - pGroupInfo->m_pOutItemSet.reset(); - InitItemSets(*pGroupInfo); + // tdf#138596 seeing as the SfxTabPages keep pointers to the m_pInItemSet + // we update the contents of the existing SfxItemSets to match + // the current settings, rather than create new ones + auto xInItemSet = pGroupInfo->m_pShell + ? pGroupInfo->m_pShell->CreateItemSet( pGroupInfo->m_nDialogId ) + : CreateItemSet( pGroupInfo->m_nDialogId ); + pGroupInfo->m_pInItemSet->Set(*xInItemSet, false); + pGroupInfo->m_pOutItemSet->ClearItem(); } // for the Apply case, now that the settings are saved to config, diff --git a/cui/uiconfig/ui/formatcellsdialog.ui b/cui/uiconfig/ui/formatcellsdialog.ui index 32c9b0558c4e..3ac39e087551 100644 --- a/cui/uiconfig/ui/formatcellsdialog.ui +++ b/cui/uiconfig/ui/formatcellsdialog.ui @@ -285,6 +285,54 @@ <property name="tab_fill">False</property> </packing> </child> + <child> + <!-- n-columns=1 n-rows=1 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="position">4</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="shadow"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="formatcellsdialog|shadow">Shadow</property> + </object> + <packing> + <property name="position">5</property> + <property name="tab_fill">False</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> diff --git a/cui/uiconfig/ui/optfontspage.ui b/cui/uiconfig/ui/optfontspage.ui index 854ac5055ae7..4f716f6b584d 100644 --- a/cui/uiconfig/ui/optfontspage.ui +++ b/cui/uiconfig/ui/optfontspage.ui @@ -258,6 +258,7 @@ </child> <child> <object class="GtkComboBoxText" id="font2"> + <property name="sensitive">False</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> @@ -281,6 +282,7 @@ </child> <child> <object class="GtkComboBoxText" id="font1"> + <property name="sensitive">False</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> @@ -311,7 +313,7 @@ <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> @@ -332,7 +334,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">1</property> + <property name="position">0</property> </packing> </child> </object> diff --git a/cui/uiconfig/ui/optpathspage.ui b/cui/uiconfig/ui/optpathspage.ui index 7b436abaed43..b469c0bd98fc 100644 --- a/cui/uiconfig/ui/optpathspage.ui +++ b/cui/uiconfig/ui/optpathspage.ui @@ -80,6 +80,8 @@ <property name="resizable">True</property> <property name="spacing">6</property> <property name="title" translatable="yes" context="optpathspage|type">Type</property> + <property name="clickable">True</property> + <property name="sort-indicator">True</property> <child> <object class="GtkCellRendererPixbuf" id="cellrenderertext1"/> <attributes> @@ -100,7 +102,6 @@ <property name="resizable">True</property> <property name="spacing">6</property> <property name="title" translatable="yes" context="optpathspage|user_paths">User Paths</property> - <property name="clickable">True</property> <child> <object class="GtkCellRendererText" id="cellrenderer9"/> <attributes> @@ -115,7 +116,6 @@ <property name="resizable">True</property> <property name="spacing">6</property> <property name="title" translatable="yes" context="optpathspage|internal_paths">Internal Paths</property> - <property name="clickable">True</property> <child> <object class="GtkCellRendererText" id="cellrenderer1"/> <attributes> diff --git a/cui/uiconfig/ui/toolbarmodedialog.ui b/cui/uiconfig/ui/toolbarmodedialog.ui index 89eb9d62c2a1..dc88d3e18864 100644 --- a/cui/uiconfig/ui/toolbarmodedialog.ui +++ b/cui/uiconfig/ui/toolbarmodedialog.ui @@ -1,39 +1,39 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.38.1 --> +<!-- Generated with glade 3.38.2 --> <interface domain="cui"> <requires lib="gtk+" version="3.20"/> <object class="GtkImage" id="imgApply"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="stock">gtk-apply</property> </object> <object class="GtkDialog" id="ToolbarmodeDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> + <property name="can-focus">False</property> + <property name="border-width">6</property> <property name="title" translatable="yes" context="ToolbarmodeDialog|Name">Select Your Preferred User Interface</property> <property name="resizable">False</property> <property name="modal">True</property> - <property name="window_position">center-on-parent</property> - <property name="type_hint">dialog</property> + <property name="window-position">center-on-parent</property> + <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="layout_style">end</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="btnApplyAll"> - <property name="label">A_pply to All</property> + <property name="label" translatable="yes" context="ToolbarmodeDialog|applyall">A_pply to All</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> - <property name="use_underline">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> + <property name="use-underline">True</property> </object> <packing> <property name="expand">False</property> @@ -43,14 +43,14 @@ </child> <child> <object class="GtkButton" id="btnApply"> - <property name="label">A_pply to %MODULE</property> + <property name="label" translatable="yes" context="ToolbarmodeDialog|applymodule">A_pply to %MODULE</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> <property name="image">imgApply</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> </object> <packing> <property name="expand">False</property> @@ -62,11 +62,11 @@ <object class="GtkButton" id="btnClose"> <property name="label">gtk-close</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> + <property name="use-stock">True</property> </object> <packing> <property name="expand">False</property> @@ -78,44 +78,44 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">1</property> </packing> </child> <child> <object class="GtkBox"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <child> <object class="GtkFrame"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_start">12</property> - <property name="margin_end">12</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-end">12</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> <object class="GtkAlignment"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="top_padding">6</property> - <property name="left_padding">12</property> + <property name="can-focus">False</property> + <property name="top-padding">6</property> + <property name="left-padding">12</property> <child> <object class="GtkBox"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">3</property> <child> <object class="GtkRadioButton" id="rbButton1"> <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton1">Standard Toolbar</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> </object> <packing> <property name="expand">False</property> @@ -124,147 +124,147 @@ </packing> </child> <child> - <object class="GtkRadioButton" id="rbButton2"> - <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton2">Single Toolbar</property> + <object class="GtkRadioButton" id="rbButton4"> + <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton4">Tabbed</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <property name="group">rbButton1</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">9</property> + <property name="position">3</property> </packing> </child> <child> - <object class="GtkRadioButton" id="rbButton3"> - <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton3">Sidebar</property> + <object class="GtkRadioButton" id="rbButton5"> + <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton5">Tabbed Compact</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <property name="group">rbButton1</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">10</property> + <property name="position">4</property> </packing> </child> <child> - <object class="GtkRadioButton" id="rbButton4"> - <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton4">Tabbed</property> + <object class="GtkRadioButton" id="rbButton7"> + <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton7">Groupedbar</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <property name="group">rbButton1</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">3</property> + <property name="position">5</property> </packing> </child> <child> - <object class="GtkRadioButton" id="rbButton5"> - <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton5">Tabbed Compact</property> + <object class="GtkRadioButton" id="rbButton6"> + <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton6">Groupedbar Compact</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <property name="group">rbButton1</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">4</property> + <property name="position">6</property> </packing> </child> <child> - <object class="GtkRadioButton" id="rbButton6"> - <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton6">Groupedbar Compact</property> + <object class="GtkRadioButton" id="rbButton8"> + <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton8">Contextual Single</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <property name="group">rbButton1</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">6</property> + <property name="position">7</property> </packing> </child> <child> - <object class="GtkRadioButton" id="rbButton7"> - <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton7">Groupedbar</property> + <object class="GtkRadioButton" id="rbButton9"> + <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton9">Contextual Groups</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <property name="group">rbButton1</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">5</property> + <property name="position">8</property> </packing> </child> <child> - <object class="GtkRadioButton" id="rbButton8"> - <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton8">Contextual Single</property> + <object class="GtkRadioButton" id="rbButton2"> + <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton2">Single Toolbar</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <property name="group">rbButton1</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">7</property> + <property name="position">9</property> </packing> </child> <child> - <object class="GtkRadioButton" id="rbButton9"> - <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton9">Contextual Groups</property> + <object class="GtkRadioButton" id="rbButton3"> + <property name="label" translatable="yes" context="ToolbarmodeDialog|radiobutton3">Sidebar</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> <property name="valign">start</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> <property name="group">rbButton1</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">8</property> + <property name="position">10</property> </packing> </child> </object> @@ -274,7 +274,7 @@ <child type="label"> <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="ToolbarmodeDialog|leftframe">UI variants</property> <attributes> <attribute name="weight" value="bold"/> @@ -291,29 +291,29 @@ <child> <object class="GtkFrame"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_start">12</property> - <property name="margin_end">12</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-end">12</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> <object class="GtkAlignment"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="top_padding">6</property> - <property name="left_padding">12</property> + <property name="can-focus">False</property> + <property name="top-padding">6</property> + <property name="left-padding">12</property> <child> <object class="GtkBox"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> - <property name="baseline_position">top</property> + <property name="baseline-position">top</property> <child> <object class="GtkImage" id="imImage"> - <property name="width_request">436</property> + <property name="width-request">436</property> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="valign">start</property> <property name="vexpand">True</property> <property name="stock">gtk-missing-image</property> @@ -326,23 +326,23 @@ </child> <child> <object class="GtkScrolledWindow"> - <property name="height_request">100</property> + <property name="height-request">100</property> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <child> <object class="GtkViewport"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <child> <object class="GtkLabel" id="lbInfo"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="valign">start</property> <property name="vexpand">True</property> <property name="label">Information:</property> <property name="wrap">True</property> - <property name="wrap_mode">word-char</property> - <property name="max_width_chars">50</property> + <property name="wrap-mode">word-char</property> + <property name="max-width-chars">50</property> <property name="xalign">0</property> </object> </child> @@ -362,7 +362,7 @@ <child type="label"> <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="ToolbarmodeDialog|rightframe">Preview</property> <attributes> <attribute name="weight" value="bold"/> diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 41a30c9df178..f5c909600f54 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -1046,6 +1046,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) { Reference< XPropertySet > xDataSource = getDataSource(); OSL_ENSURE(xDataSource.is(), "SbaGridControl::DoColumnDrag : invalid data source !"); + ::dbtools::ensureRowSetConnection(Reference< XRowSet >(getDataSource(),UNO_QUERY), getContext(), nullptr); Reference< XPropertySet > xAffectedCol; Reference< XPropertySet > xAffectedField; diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index f0d9b9ee4468..2e0813d5ff61 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -78,7 +78,8 @@ OFieldDescControl::OFieldDescControl(weld::Container* pPage, OTableDesignHelpBar , m_nEditWidth(50) , pActFieldDescr(nullptr) { - m_pHelp->connect_focus_out(LINK(this, OFieldDescControl, HelpFocusOut)); + if (m_pHelp) + m_pHelp->connect_focus_out(LINK(this, OFieldDescControl, HelpFocusOut)); } OFieldDescControl::~OFieldDescControl() diff --git a/dictionaries b/dictionaries -Subproject 7417829a9350fe6a52b30cf134950b0d5586784 +Subproject d5296e8ca56cd284f421cb79e89ebbf09090e68 diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 0aceee40a631..ebbc41744734 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -20,6 +20,7 @@ #include "vclpixelprocessor2d.hxx" #include "vclhelperbufferdevice.hxx" #include "helperwrongspellrenderer.hxx" +#include <comphelper/lok.hxx> #include <sal/log.hxx> #include <vcl/BitmapBasicMorphologyFilter.hxx> @@ -695,31 +696,50 @@ void VclPixelProcessor2D::processControlPrimitive2D( if (xNewGraphics.is()) { - // link graphics and view - xControlView->setGraphics(xNewGraphics); - - // get position - const basegfx::B2DHomMatrix aObjectToPixel(maCurrentTransformation - * rControlPrimitive.getTransform()); - const basegfx::B2DPoint aTopLeftPixel(aObjectToPixel * basegfx::B2DPoint(0.0, 0.0)); - // find out if the control is already visualized as a VCL-ChildWindow. If yes, // it does not need to be painted at all. uno::Reference<awt::XWindow2> xControlWindow(rXControl, uno::UNO_QUERY_THROW); - const bool bControlIsVisibleAsChildWindow(rXControl->getPeer().is() - && xControlWindow->isVisible()); + bool bControlIsVisibleAsChildWindow(rXControl->getPeer().is() + && xControlWindow->isVisible()); + + // tdf#131281 The FormControls are not painted when using the Tiled Rendering for a simple + // reason: when e.g. bControlIsVisibleAsChildWindow is true. This is the case because the + // office is in non-layout mode (default for controls at startup). For the common office + // this means that there exists a real VCL-System-Window for the control, so it is *not* + // painted here due to being exactly obscured by that real Window (and creates danger of + // flickering, too). + // Tiled Rendering clients usually do *not* have real VCL-Windows for the controls, but + // exactly that would be needed on each client displaying the tiles (what would be hard + // to do but also would have advantages - the clients would have real controls in the + // shape of their traget system which could be interacted with...). It is also what the + // office does. + // For now, fallback to just render these controls when Tiled Rendering is active to just + // have them displayed on all clients. + if (bControlIsVisibleAsChildWindow && comphelper::LibreOfficeKit::isActive()) + { + // Do force paint when we are in Tiled Renderer and FormControl is 'visible' + bControlIsVisibleAsChildWindow = false; + } if (!bControlIsVisibleAsChildWindow) { - // draw it. Do not forget to use the evtl. offsetted origin of the target device, + // Needs to be drawn. Link new graphics and view + xControlView->setGraphics(xNewGraphics); + + // get position + const basegfx::B2DHomMatrix aObjectToPixel(maCurrentTransformation + * rControlPrimitive.getTransform()); + const basegfx::B2DPoint aTopLeftPixel(aObjectToPixel * basegfx::B2DPoint(0.0, 0.0)); + + // Do not forget to use the evtl. offsetted origin of the target device, // e.g. when used with mask/transparence buffer device const Point aOrigin(mpOutputDevice->GetMapMode().GetOrigin()); xControlView->draw(aOrigin.X() + basegfx::fround(aTopLeftPixel.getX()), aOrigin.Y() + basegfx::fround(aTopLeftPixel.getY())); - } - // restore original graphics - xControlView->setGraphics(xOriginalGraphics); + // restore original graphics + xControlView->setGraphics(xOriginalGraphics); + } } } catch (const uno::Exception&) diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index cee32beafcc2..3598036e2240 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -454,7 +454,7 @@ void EditEngine::DumpData(const EditEngine* pEE, bool bInfoBox) fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) ); fprintf( fp, "\nRefMapMode: %i", int( pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) ); fprintf( fp, "\nPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, sal_Int64(pEE->GetPaperSize().Width()), sal_Int64(pEE->GetPaperSize().Height()) ); - fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() ); + fprintf( fp, "\nMaxAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, sal_Int64(pEE->GetMaxAutoPaperSize().Width()), sal_Int64(pEE->GetMaxAutoPaperSize().Height()) ); fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64 , sal_Int64(pEE->GetMinAutoPaperSize().Width()), sal_Int64(pEE->GetMinAutoPaperSize().Height()) ); fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() ); fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() ); diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx index 29c084874b6d..e8d4833e6424 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -50,6 +50,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools, public unotest: void TestDrawLine(); void TestLinearGradient(); void TestTextMapMode(); + void TestEnglishMapMode(); void TestCreatePen(); void TestPdfInEmf(); @@ -67,6 +68,7 @@ public: CPPUNIT_TEST(TestDrawLine); CPPUNIT_TEST(TestLinearGradient); CPPUNIT_TEST(TestTextMapMode); + CPPUNIT_TEST(TestEnglishMapMode); CPPUNIT_TEST(TestCreatePen); CPPUNIT_TEST(TestPdfInEmf); CPPUNIT_TEST_SUITE_END(); @@ -272,6 +274,40 @@ void Test::TestTextMapMode() assertXPath(pDocument, "/primitive2D/metafile/transform/polygonstroke[20]/line", "width", "11"); } +void Test::TestEnglishMapMode() +{ + // Check import of EMF image with records: SETMAPMODE with MM_ENGLISH MapMode, STROKEANDFILLPATH, EXTTEXTOUTW, SETTEXTALIGN, STRETCHDIBITS + // MM_LOENGLISH is mapped to 0.01 inch. Positive x is to the right; positive y is up.M + Primitive2DSequence aSequence = parseEmf("/emfio/qa/cppunit/emf/data/test_mm_hienglish_ref.emf"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence)); + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygon", 1); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygon[1]", "path", "m0 0h29699v20999h-29699z"); + + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygoncolor", 3); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygoncolor[1]", "color", "#ffffad"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygoncolor[1]/polypolygon", "path", "m-1-1h29699v21005h-29699z"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygoncolor[2]/polypolygon", "path", "m1058 7937v5293h3175v-1059h-2118v-4234z"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygoncolor[3]/polypolygon", "path", "m12699 1058h4234v1060h-1587v4231h-1059v-4231h-1588z"); + + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion", 4); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion[1]", "text", "UL"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion[1]", "fontcolor", "#000000"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion[1]", "x", "106"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion[1]", "y", "459"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion[1]", "width", "424"); + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion[1]", "height", "424"); + + assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline", 3); + assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[1]/polygon", "-1,-1 29698,-1 29698,21004 -1,21004"); + assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[2]/polygon", "1058,7937 1058,13230 4233,13230 4233,12171 2115,12171 2115,7937"); + assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[3]/polygon", "12699,1058 16933,1058 16933,2118 15346,2118 15346,6349 14287,6349 14287,2118 12699,2118"); + + +} void Test::TestCreatePen() { diff --git a/emfio/qa/cppunit/emf/data/test_mm_hienglish_ref.emf b/emfio/qa/cppunit/emf/data/test_mm_hienglish_ref.emf Binary files differnew file mode 100644 index 000000000000..28f4f1fc7fa0 --- /dev/null +++ b/emfio/qa/cppunit/emf/data/test_mm_hienglish_ref.emf diff --git a/emfio/qa/cppunit/emf/data/test_mm_himetric_ref.emf b/emfio/qa/cppunit/emf/data/test_mm_himetric_ref.emf Binary files differnew file mode 100644 index 000000000000..86c568fc17e7 --- /dev/null +++ b/emfio/qa/cppunit/emf/data/test_mm_himetric_ref.emf diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index e376e6f501c1..778adeb429ba 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -320,10 +320,16 @@ namespace emfio { fX2 -= mnWinOrgX; fY2 = mnWinOrgY-fY2; - fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*10; - fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*10; - fX2 += mnDevOrgX; - fY2 += mnDevOrgY; + fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH * 10; + fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH * 10; + double nDevOrgX = mnDevOrgX; + if (mnPixX) + nDevOrgX *= static_cast<double>(mnMillX) * 100.0 / static_cast<double>(mnPixX); + fX2 += nDevOrgX; + double nDevOrgY = mnDevOrgY; + if (mnPixY) + nDevOrgY *= static_cast<double>(mnMillY) * 100.0 / static_cast<double>(mnPixY); + fY2 += nDevOrgY; } break; case MM_HIENGLISH : @@ -332,18 +338,30 @@ namespace emfio fY2 = mnWinOrgY-fY2; fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH; fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH; - fX2 += mnDevOrgX; - fY2 += mnDevOrgY; + double nDevOrgX = mnDevOrgX; + if (mnPixX) + nDevOrgX *= static_cast<double>(mnMillX) * 100.0 / static_cast<double>(mnPixX); + fX2 += nDevOrgX; + double nDevOrgY = mnDevOrgY; + if (mnPixY) + nDevOrgY *= static_cast<double>(mnMillY) * 100.0 / static_cast<double>(mnPixY); + fY2 += nDevOrgY; } break; case MM_TWIPS: { fX2 -= mnWinOrgX; fY2 = mnWinOrgY-fY2; - fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH/MILLIINCH_PER_TWIPS; - fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH/MILLIINCH_PER_TWIPS; - fX2 += mnDevOrgX; - fY2 += mnDevOrgY; + fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH / MILLIINCH_PER_TWIPS; + fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH / MILLIINCH_PER_TWIPS; + double nDevOrgX = mnDevOrgX; + if (mnPixX) + nDevOrgX *= static_cast<double>(mnMillX) * 100.0 / static_cast<double>(mnPixX); + fX2 += nDevOrgX; + double nDevOrgY = mnDevOrgY; + if (mnPixY) + nDevOrgY *= static_cast<double>(mnMillY) * 100.0 / static_cast<double>(mnPixY); + fY2 += nDevOrgY; } break; case MM_LOMETRIC : @@ -352,16 +370,28 @@ namespace emfio fY2 = mnWinOrgY-fY2; fX2 *= 10; fY2 *= 10; - fX2 += mnDevOrgX; - fY2 += mnDevOrgY; + double nDevOrgX = mnDevOrgX; + if (mnPixX) + nDevOrgX *= static_cast<double>(mnMillX) * 100.0 / static_cast<double>(mnPixX); + fX2 += nDevOrgX; + double nDevOrgY = mnDevOrgY; + if (mnPixY) + nDevOrgY *= static_cast<double>(mnMillY) * 100.0 / static_cast<double>(mnPixY); + fY2 += nDevOrgY; } break; case MM_HIMETRIC : // in hundredth of a millimeter { fX2 -= mnWinOrgX; fY2 = mnWinOrgY-fY2; - fX2 += mnDevOrgX; - fY2 += mnDevOrgY; + double nDevOrgX = mnDevOrgX; + if (mnPixX) + nDevOrgX *= static_cast<double>(mnMillX) * 100.0 / static_cast<double>(mnPixX); + fX2 += nDevOrgX; + double nDevOrgY = mnDevOrgY; + if (mnPixY) + nDevOrgY *= static_cast<double>(mnMillY) * 100.0 / static_cast<double>(mnPixY); + fY2 += nDevOrgY; } break; default : diff --git a/extensions/source/macosx/spotlight/OOoContentDataParser.h b/extensions/source/macosx/spotlight/OOoContentDataParser.h index 7112497cf7de..dc07a3166122 100644 --- a/extensions/source/macosx/spotlight/OOoContentDataParser.h +++ b/extensions/source/macosx/spotlight/OOoContentDataParser.h @@ -19,7 +19,7 @@ #import <Cocoa/Cocoa.h> -@interface OOoContentDataParser : NSObject { +@interface OOoContentDataParser : NSObject <NSXMLParserDelegate> { // indicates if we are interested in an element's content BOOL shouldReadCharacters; diff --git a/extensions/source/macosx/spotlight/OOoContentDataParser.m b/extensions/source/macosx/spotlight/OOoContentDataParser.m index d3ecf16ffaab..e1f51e5b90c7 100644 --- a/extensions/source/macosx/spotlight/OOoContentDataParser.m +++ b/extensions/source/macosx/spotlight/OOoContentDataParser.m @@ -47,12 +47,7 @@ NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; - // Once again... - // class 'OOoContentDataParser' does not implement the 'NSXMLParserDelegate' protocol - // So instead of this: - // [parser setDelegate:self]; - // do this: - ((id (*)(id, SEL, ...))objc_msgSend)(parser, @selector(setDelegate:), self); + [parser setDelegate:self]; [parser setShouldResolveExternalEntities:NO]; [parser parse]; diff --git a/extensions/source/macosx/spotlight/OOoMetaDataParser.h b/extensions/source/macosx/spotlight/OOoMetaDataParser.h index 5db7634cce0c..85d48b1735d7 100644 --- a/extensions/source/macosx/spotlight/OOoMetaDataParser.h +++ b/extensions/source/macosx/spotlight/OOoMetaDataParser.h @@ -20,7 +20,7 @@ #import <Cocoa/Cocoa.h> -@interface OOoMetaDataParser : NSObject { +@interface OOoMetaDataParser : NSObject <NSXMLParserDelegate> { //indicates if content should be read BOOL shouldReadCharacters; //indicates if the current element is a custom metadata tag diff --git a/extensions/source/macosx/spotlight/OOoMetaDataParser.m b/extensions/source/macosx/spotlight/OOoMetaDataParser.m index 2b4dac82c555..1e7cac685b88 100644 --- a/extensions/source/macosx/spotlight/OOoMetaDataParser.m +++ b/extensions/source/macosx/spotlight/OOoMetaDataParser.m @@ -91,11 +91,7 @@ static NSDictionary *metaXML2MDIKeys; NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; - // class 'OOoMetaDataParser' does not implement the 'NSXMLParserDelegate' protocol - // So instead of this: - // [parser setDelegate:self]; - // do this: - ((id (*)(id, SEL, ...))objc_msgSend)(parser, @selector(setDelegate:), self); + [parser setDelegate:self]; [parser setShouldResolveExternalEntities:NO]; [parser parse]; diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 436f5b412e27..c5b03aa270e5 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -587,7 +587,10 @@ namespace pcr { OUString sText; _rValue >>= sText; - getTypedControlWindow()->set_entry_text( sText ); + weld::ComboBox* pControlWindow = getTypedControlWindow(); + // tdf#138701 leave current cursor valid if the contents won't change + if (pControlWindow->get_active_text() != sText) + pControlWindow->set_entry_text(sText); } Any SAL_CALL OComboboxControl::getValue() diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index 65e170299013..74390e1fcde2 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -81,6 +81,8 @@ namespace pcr { Formatter& rFieldFormatter = m_xSpinButton->GetFormatter(); rFieldFormatter.TreatAsNumber(true); + rFieldFormatter.ClearMinValue(); + rFieldFormatter.ClearMaxValue(); m_xEntry->connect_key_press(LINK(this, OFormatSampleControl, KeyInputHdl)); } diff --git a/external/libcmis/UnpackedTarball_libcmis.mk b/external/libcmis/UnpackedTarball_libcmis.mk index c648a7b02f00..a5be3078c95a 100644 --- a/external/libcmis/UnpackedTarball_libcmis.mk +++ b/external/libcmis/UnpackedTarball_libcmis.mk @@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libcmis,1)) $(eval $(call gb_UnpackedTarball_add_patches,libcmis, \ external/libcmis/libcmis-libxml2_compatibility.patch \ external/libcmis/0001-rename-class-GetObject-to-avoid-name-clash-on-Window.patch \ + external/libcmis/libcmis_onedrive.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libcmis/libcmis_onedrive.patch b/external/libcmis/libcmis_onedrive.patch new file mode 100644 index 000000000000..60d7e7b3be69 --- /dev/null +++ b/external/libcmis/libcmis_onedrive.patch @@ -0,0 +1,445 @@ +diff --git a/src/libcmis/http-session.cxx b/src/libcmis/http-session.cxx +index 2638482..227667e 100644 +--- a/src/libcmis/http-session.cxx ++++ b/src/libcmis/http-session.cxx +@@ -293,6 +293,94 @@ libcmis::HttpResponsePtr HttpSession::httpGetRequest( string url ) + return response; + } + ++libcmis::HttpResponsePtr HttpSession::httpPatchRequest( string url, istream& is, vector< string > headers ) ++{ ++ checkOAuth2( url ); ++ ++ // Duplicate istream in case we need to retry ++ string isStr( static_cast< stringstream const&>( stringstream( ) << is.rdbuf( ) ).str( ) ); ++ ++ istringstream isOriginal( isStr ), isBackup( isStr ); ++ ++ // Reset the handle for the request ++ curl_easy_reset( m_curlHandle ); ++ initProtocols( ); ++ ++ libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) ); ++ ++ curl_easy_setopt( m_curlHandle, CURLOPT_WRITEFUNCTION, lcl_bufferData ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_WRITEDATA, response->getData( ).get( ) ); ++ ++ curl_easy_setopt( m_curlHandle, CURLOPT_HEADERFUNCTION, &lcl_getHeaders ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_WRITEHEADER, response.get() ); ++ ++ curl_easy_setopt( m_curlHandle, CURLOPT_MAXREDIRS, 20); ++ ++ // Get the stream length ++ is.seekg( 0, ios::end ); ++ long size = is.tellg( ); ++ is.seekg( 0, ios::beg ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_INFILESIZE, size ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_READDATA, &isOriginal ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_READFUNCTION, lcl_readStream ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_UPLOAD, 1 ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_CUSTOMREQUEST, "PATCH" ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLFUNCTION, lcl_ioctlStream ); ++ curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLDATA, &isOriginal ); ++ ++ // If we know for sure that 100-Continue won't be accepted, ++ // don't even try with it to save one HTTP request. ++ if ( m_no100Continue ) ++ headers.push_back( "Expect:" ); ++ try ++ { ++ httpRunRequest( url, headers ); ++ response->getData( )->finish(); ++ } ++ catch ( const CurlException& ) ++ { ++ long status = getHttpStatus( ); ++ /** If we had a HTTP 417 response, this is likely to be due to some ++ HTTP 1.0 proxy / server not accepting the "Expect: 100-continue" ++ header. Try to disable this header and try again. ++ */ ++ if ( status == 417 && !m_no100Continue) ++ { ++ // Remember that we don't want 100-Continue for the future requests ++ m_no100Continue = true; ++ response = httpPutRequest( url, isBackup, headers ); ++ } ++ ++ // If the access token is expired, we get 401 error, ++ // Need to use the refresh token to get a new one. ++ if ( status == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) ++ { ++ ++ // Refresh the token ++ oauth2Refresh(); ++ ++ // Resend the query ++ try ++ { ++ // Avoid infinite recursive call ++ m_refreshedToken = true; ++ response = httpPutRequest( url, isBackup, headers ); ++ m_refreshedToken = false; ++ } ++ catch (const CurlException&) ++ { ++ m_refreshedToken = false; ++ throw; ++ } ++ } ++ // Has tried but failed ++ if ( ( status != 417 || m_no100Continue ) && ++ ( status != 401 || getRefreshToken( ).empty( ) || m_refreshedToken ) ) throw; ++ } ++ m_refreshedToken = false; ++ return response; ++} ++ + libcmis::HttpResponsePtr HttpSession::httpPutRequest( string url, istream& is, vector< string > headers ) + { + checkOAuth2( url ); +diff --git a/src/libcmis/http-session.hxx b/src/libcmis/http-session.hxx +index 851d52d..29de64d 100644 +--- a/src/libcmis/http-session.hxx< |