From a9add111c812c42ea2c07a4e06784fdaaeef8bb6 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:08:12 +0000 Subject: import libreoffice-5.0.6.2-3.el7 --- diff --git a/.gitignore b/.gitignore index 5f39b3c..6db8906 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,13 @@ SOURCES/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz SOURCES/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip SOURCES/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip SOURCES/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip -SOURCES/libreoffice-4.3.7.2.tar.xz -SOURCES/libreoffice-help-4.3.7.2.tar.xz -SOURCES/libreoffice-translations-4.3.7.2.tar.xz +SOURCES/libreoffice-5.0.6.2.tar.xz +SOURCES/libreoffice-base-symbolic.svg +SOURCES/libreoffice-calc-symbolic.svg +SOURCES/libreoffice-draw-symbolic.svg +SOURCES/libreoffice-help-5.0.6.2.tar.xz +SOURCES/libreoffice-impress-symbolic.svg +SOURCES/libreoffice-main-symbolic.svg +SOURCES/libreoffice-math-symbolic.svg +SOURCES/libreoffice-translations-5.0.6.2.tar.xz +SOURCES/libreoffice-writer-symbolic.svg diff --git a/.libreoffice.metadata b/.libreoffice.metadata index 4a11338..6e0dadc 100644 --- a/.libreoffice.metadata +++ b/.libreoffice.metadata @@ -5,6 +5,13 @@ 1acea86fd399ed7817879d36370d3d1f8b109050 SOURCES/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip 8a90669029e107b61953b90ba11545fef586c2ca SOURCES/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip 2d49e11b0b711970f494294dc3698f05eb294853 SOURCES/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip -2d1906b6c8e4ce84c5000094108bc2cf95cb49ff SOURCES/libreoffice-4.3.7.2.tar.xz -9901a6a0cbfbf840a38c4d14b709364541aec2c8 SOURCES/libreoffice-help-4.3.7.2.tar.xz -10d9764a854247b05c96c95b6ead9c186022a1b6 SOURCES/libreoffice-translations-4.3.7.2.tar.xz +ba2784668b0cbded6595904207912e5f3d1905c1 SOURCES/libreoffice-5.0.6.2.tar.xz +54fc749ba924f9ca4e0391caaf579ab344302038 SOURCES/libreoffice-base-symbolic.svg +9de544172d736d59589767000c1f657034a5d53d SOURCES/libreoffice-calc-symbolic.svg +0f6dc4726da0920869354fbe4b2924f9ac569b4a SOURCES/libreoffice-draw-symbolic.svg +0ee2fa2cd239171796951e6d30537f7236d479cc SOURCES/libreoffice-help-5.0.6.2.tar.xz +8c74dd667c660cc643c4d715dd50491ba92146d5 SOURCES/libreoffice-impress-symbolic.svg +c77acd04a7647b09745f9424ab0f65d52dfcd397 SOURCES/libreoffice-main-symbolic.svg +3857a55644148eb25ed1a594bd00d1262761fb39 SOURCES/libreoffice-math-symbolic.svg +9e945fc4f220d4198f67a8bb88619dcf23c3d201 SOURCES/libreoffice-translations-5.0.6.2.tar.xz +d4f0674ad46a832120db956cc01a27fdc2060458 SOURCES/libreoffice-writer-symbolic.svg diff --git a/SOURCES/0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch b/SOURCES/0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch deleted file mode 100644 index b79228a..0000000 --- a/SOURCES/0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch +++ /dev/null @@ -1,103 +0,0 @@ -From bb21f53e6c9b6b3f4a2d8c5e55ebc3a08caa69ba Mon Sep 17 00:00:00 2001 -From: Miklos Vajna -Date: Thu, 18 Sep 2014 15:47:59 +0200 -Subject: [PATCH] DOCX import: fix handling of dropdown SDT around cell - -There were two problems here: - -1) The CT_SdtContentCell handlers didn't emit the usual -NS_ooxml::LN_CT_SdtBlock_sdtContent / -NS_ooxml::LN_CT_SdtBlock_sdtEndContent tokens, so the dropdown control -was not created (and then was created with the wrong anchor). - -2) In case the SDT was around the cell, the newline character was also -added to the text of the currently selected entry, resulting in an -invalid argument of SwXText::convertToTable(), so no table was created. - -(cherry picked from commit 419054c0f19acb323a0e51c7ef49a1a2d9f42ac8) - -Conflicts: - sw/qa/extras/ooxmlexport/ooxmlexport.cxx - writerfilter/source/dmapper/DomainMapper.cxx - writerfilter/source/ooxml/model.xml - -Change-Id: I4806626181f40c6d26ff7b25f5dbb863967d8077 ---- - sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 --------- - writerfilter/source/dmapper/DomainMapper.cxx | 14 +++++++++++--- - writerfilter/source/ooxml/model.xml | 5 ++++- - 3 files changed, 15 insertions(+), 13 deletions(-) - -diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx -index a443d58..24459d1 100644 ---- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx -+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx -@@ -3566,15 +3566,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79822, "fdo79822.docx") - return; - } - --DECLARE_OOXMLEXPORT_TEST(testfdo79817,"fdo79817.docx") --{ -- xmlDocPtr pXmlDoc = parseExport("word/document.xml"); -- if (!pXmlDoc) -- return; -- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:dataBinding", "storeItemID","{9222E47B-A68B-4AEB-9855-21C912B9D3D2}"); -- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:dataBinding", "xpath","/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]"); --} -- - DECLARE_OOXMLEXPORT_TEST(testfdo80522,"fdo80522.docx") - { - xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml"); -diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx -index 44efb59..baf91d9 100644 ---- a/writerfilter/source/dmapper/DomainMapper.cxx -+++ b/writerfilter/source/dmapper/DomainMapper.cxx -@@ -2768,10 +2768,18 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) - aBuffer.append( (const sal_Unicode *) data_, len); - sText = aBuffer.makeStringAndClear(); - -+ -+ bool bNewLine = len == 1 && (sText[0] == 0x0d || sText[0] == 0x07); - if (!m_pImpl->m_pSdtHelper->getDropDownItems().empty()) - { -- m_pImpl->m_pSdtHelper->getSdtTexts().append(sText); -- return; -+ if (bNewLine) -+ // Dropdown control has single-line texts, so in case of newline, create the control. -+ m_pImpl->m_pSdtHelper->createDropDownControl(); -+ else -+ { -+ m_pImpl->m_pSdtHelper->getSdtTexts().append(sText); -+ return; -+ } - } - else if (!m_pImpl->m_pSdtHelper->getDateFormat().isEmpty()) - { -@@ -2814,7 +2822,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) - { - m_pImpl->getTableManager().utext(data_, len); - -- if(len == 1 && (sText[0] == 0x0d || sText[0] == 0x07)) -+ if (bNewLine) - { - if (m_pImpl->m_bIgnoreNextPara) - { -diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml -index 69ac296..3f4e71c 100644 ---- a/writerfilter/source/ooxml/model.xml -+++ b/writerfilter/source/ooxml/model.xml -@@ -25033,7 +25033,10 @@ - - - -- -+ -+ -+ -+ - - - --- -2.1.0 - diff --git a/SOURCES/0001-During-DocumentRedlineManager-SetRedlineMode-the-arr.patch b/SOURCES/0001-During-DocumentRedlineManager-SetRedlineMode-the-arr.patch deleted file mode 100644 index bbd9f86..0000000 --- a/SOURCES/0001-During-DocumentRedlineManager-SetRedlineMode-the-arr.patch +++ /dev/null @@ -1,414 +0,0 @@ -From f3974a01283674f016ebd564652964302b1ab1e8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 30 Jan 2015 15:34:30 +0000 -Subject: [PATCH] During DocumentRedlineManager::SetRedlineMode the array - becomes unsorted -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -so GetPos cannot be used safely, so pass down the known index -of the redline and propogate it everywhere the redline goes - -This reverts - -commit 36e158ce7a0effb130936ba4598a193102faa6a1 -Author: Caolán McNamara -Date: Mon Jan 19 12:09:17 2015 +0000 - - if we change the keys we have to resort based on the new keys - -which tried to keep the table sorted, but thats no use because -DocumentRedlineManager::SetRedlineMode loops over by index -so sorting the table during the process busts that. - -Taking a copy of the entries and looping over that shows another -gadzillion problems. - -So try this approach instead. - -I imagine it should be possible to calculate the correct -current index of pRedl in DocumentRedlineManager::AppendRedline -but for now assume that we are sorted correctly at that -point and can use GetPos - -(cherry picked from commit a5a20187c3a5e5956492f932c49501f9547e4915) - -Conflicts: - sw/source/core/doc/DocumentRedlineManager.cxx - sw/source/core/doc/docredln.cxx - sw/source/core/undo/unredln.cxx - -Change-Id: If092dce185e3b36fd256db390132358cba155847 ---- - sw/inc/docary.hxx | 1 + - sw/inc/redline.hxx | 12 +++--- - sw/source/core/doc/docredln.cxx | 90 ++++++++++++++++++++--------------------- - sw/source/core/undo/unredln.cxx | 2 +- - 4 files changed, 51 insertions(+), 54 deletions(-) - -diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx -index 94f8229..34f22ed 100644 ---- a/sw/inc/docary.hxx -+++ b/sw/inc/docary.hxx -@@ -195,6 +195,7 @@ public: - using _SwRedlineTbl::size; - using _SwRedlineTbl::operator[]; - using _SwRedlineTbl::empty; -+ using _SwRedlineTbl::Resort; - }; - - /// Table that holds 'extra' redlines, such as 'table row insert\delete', 'paragraph moves' etc... -diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx -index ab1945b..b639063 100644 ---- a/sw/inc/redline.hxx -+++ b/sw/inc/redline.hxx -@@ -190,8 +190,8 @@ class SW_DLLPUBLIC SwRangeRedline : public SwPaM - - void MoveToSection(); - void CopyToSection(); -- void DelCopyOfSection(); -- void MoveFromSection(); -+ void DelCopyOfSection(size_t nMyPos); -+ void MoveFromSection(size_t nMyPos); - - public: - SwRangeRedline( RedlineType_t eType, const SwPaM& rPam ); -@@ -263,10 +263,10 @@ public: - // hide the Del-Redlines via Copy and Delete. - // Otherwise at Move the attribution would be handled incorrectly. - // All other callers must always give 0. -- void CallDisplayFunc( sal_uInt16 nLoop = 0 ); -- void Show( sal_uInt16 nLoop = 0 ); -- void Hide( sal_uInt16 nLoop = 0 ); -- void ShowOriginal( sal_uInt16 nLoop = 0 ); -+ void CallDisplayFunc(sal_uInt16 nLoop, size_t nMyPos); -+ void Show(sal_uInt16 nLoop , size_t nMyPos); -+ void Hide(sal_uInt16 nLoop , size_t nMyPos); -+ void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos); - - /// Calculates the intersection with text node number nNdIdx. - void CalcStartEnd(sal_uLong nNdIdx, sal_Int32& rStart, sal_Int32& rEnd) const; -diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx -index 8d3d704..fd2730e 100644 ---- a/sw/source/core/doc/docredln.cxx -+++ b/sw/source/core/doc/docredln.cxx -@@ -157,7 +157,7 @@ void SwDoc::SetRedlineMode( RedlineMode_t eMode ) - bool bSaveInXMLImportFlag = IsInXMLImport(); - SetInXMLImport( false ); - // and then hide/display everything -- void (SwRangeRedline::*pFnc)( sal_uInt16 ) = 0; -+ void (SwRangeRedline::*pFnc)(sal_uInt16, size_t) = 0; - - switch( nsRedlineMode_t::REDLINE_SHOW_MASK & eMode ) - { -@@ -179,10 +179,17 @@ void SwDoc::SetRedlineMode( RedlineMode_t eMode ) - - _CHECK_REDLINE( this ) - -- if( pFnc ) -- for( sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop ) -- for( sal_uInt16 i = 0; i < mpRedlineTbl->size(); ++i ) -- ((*mpRedlineTbl)[ i ]->*pFnc)( nLoop ); -+ if (pFnc) -+ { -+ for (sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop) -+ for (size_t i = 0; i < mpRedlineTbl->size(); ++i) -+ ((*mpRedlineTbl)[i]->*pFnc)(nLoop, i); -+ -+ //SwRangeRedline::MoveFromSection routinely changes -+ //the keys that mpRedlineTbl is sorted by -+ mpRedlineTbl->Resort(); -+ } -+ - _CHECK_REDLINE( this ) - SetInXMLImport( bSaveInXMLImportFlag ); - } -@@ -705,7 +712,7 @@ bool SwDoc::AppendRedline( SwRangeRedline* pNewRedl, bool bCallDelete ) - // We insert temporarily so that pNew is - // also dealt with when moving the indices. - mpRedlineTbl->Insert( pNewRedl ); -- pRedl->Show(); -+ pRedl->Show(0, mpRedlineTbl->GetPos(pRedl)); - mpRedlineTbl->Remove( pNewRedl ); - pRStt = pRedl->Start(); - pREnd = pRedl->End(); -@@ -882,7 +889,7 @@ bool SwDoc::AppendRedline( SwRangeRedline* pNewRedl, bool bCallDelete ) - pRedl->PushData( *pNewRedl ); - delete pNewRedl, pNewRedl = 0; - if( IsHideChanges( meRedlineMode )) -- pRedl->Hide(); -+ pRedl->Hide(0, mpRedlineTbl->GetPos(pRedl)); - bCompress = true; - } - break; -@@ -946,7 +953,7 @@ bool SwDoc::AppendRedline( SwRangeRedline* pNewRedl, bool bCallDelete ) - if( IsHideChanges( meRedlineMode )) - { - mpRedlineTbl->Insert( pNewRedl ); -- pRedl->Hide(); -+ pRedl->Hide(0, mpRedlineTbl->GetPos(pRedl)); - mpRedlineTbl->Remove( pNewRedl ); - } - } -@@ -974,7 +981,7 @@ bool SwDoc::AppendRedline( SwRangeRedline* pNewRedl, bool bCallDelete ) - if( IsHideChanges( meRedlineMode )) - { - mpRedlineTbl->Insert( pNewRedl ); -- pRedl->Hide(); -+ pRedl->Hide(0, mpRedlineTbl->GetPos(pRedl)); - mpRedlineTbl->Remove( pNewRedl ); - } - } -@@ -1255,7 +1262,7 @@ void SwDoc::CompressRedlines() - { - _CHECK_REDLINE( this ) - -- void (SwRangeRedline::*pFnc)(sal_uInt16) = 0; -+ void (SwRangeRedline::*pFnc)(sal_uInt16, size_t) = 0; - switch( nsRedlineMode_t::REDLINE_SHOW_MASK & meRedlineMode ) - { - case nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE: -@@ -1283,14 +1290,15 @@ void SwDoc::CompressRedlines() - !pCurEnd->nNode.GetNode().StartOfSectionNode()->IsTableNode() ) - { - // we then can merge them -- pPrev->Show(); -- pCur->Show(); -+ size_t nPrevIndex = n-1; -+ pPrev->Show(0, nPrevIndex); -+ pCur->Show(0, n); - - pPrev->SetEnd( *pCur->End() ); - mpRedlineTbl->DeleteAndDestroy( n ); - --n; - if( pFnc ) -- (pPrev->*pFnc)(0); -+ (pPrev->*pFnc)(0, nPrevIndex); - } - } - _CHECK_REDLINE( this ) -@@ -2751,8 +2759,10 @@ bool SwRedlineTbl::Insert( SwRangeRedline* p, bool bIns ) - bool bRet = false; - if( p->HasValidRange() ) - { -- bRet = insert( p ).second; -- p->CallDisplayFunc(); -+ std::pair<_SwRedlineTbl::const_iterator, bool> rv = insert( p ); -+ size_t nP = rv.first - begin(); -+ bRet = rv.second; -+ p->CallDisplayFunc(0, nP); - } - else if( bIns ) - bRet = InsertWithValidRanges( p ); -@@ -2771,7 +2781,7 @@ bool SwRedlineTbl::Insert( SwRangeRedline* p, sal_uInt16& rP, bool bIns ) - std::pair<_SwRedlineTbl::const_iterator, bool> rv = insert( p ); - rP = rv.first - begin(); - bRet = rv.second; -- p->CallDisplayFunc(); -+ p->CallDisplayFunc(0, rP); - } - else if( bIns ) - bRet = InsertWithValidRanges( p, &rP ); -@@ -2873,7 +2883,7 @@ bool SwRedlineTbl::InsertWithValidRanges( SwRangeRedline* p, sal_uInt16* pInsPos - pNew->HasValidRange() && - Insert( pNew, nInsPos ) ) - { -- pNew->CallDisplayFunc(); -+ pNew->CallDisplayFunc(0, nInsPos); - bAnyIns = true; - pNew = 0; - if( pInsPos && *pInsPos < nInsPos ) -@@ -3382,23 +3392,23 @@ bool SwRangeRedline::HasValidRange() const - return false; - } - --void SwRangeRedline::CallDisplayFunc( sal_uInt16 nLoop ) -+void SwRangeRedline::CallDisplayFunc(sal_uInt16 nLoop, size_t nMyPos) - { - switch( nsRedlineMode_t::REDLINE_SHOW_MASK & GetDoc()->GetRedlineMode() ) - { - case nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE: -- Show( nLoop ); -+ Show(nLoop, nMyPos); - break; - case nsRedlineMode_t::REDLINE_SHOW_INSERT: -- Hide( nLoop ); -+ Hide(nLoop, nMyPos); - break; - case nsRedlineMode_t::REDLINE_SHOW_DELETE: -- ShowOriginal( nLoop ); -+ ShowOriginal(nLoop, nMyPos); - break; - } - } - --void SwRangeRedline::Show( sal_uInt16 nLoop ) -+void SwRangeRedline::Show(sal_uInt16 nLoop, size_t nMyPos) - { - if( 1 <= nLoop ) - { -@@ -3411,12 +3421,12 @@ void SwRangeRedline::Show( sal_uInt16 nLoop ) - { - case nsRedlineType_t::REDLINE_INSERT: // Content has been inserted - bIsVisible = true; -- MoveFromSection(); -+ MoveFromSection(nMyPos); - break; - - case nsRedlineType_t::REDLINE_DELETE: // Content has been deleted - bIsVisible = true; -- MoveFromSection(); -+ MoveFromSection(nMyPos); - break; - - case nsRedlineType_t::REDLINE_FORMAT: // Attributes have been applied -@@ -3430,7 +3440,7 @@ void SwRangeRedline::Show( sal_uInt16 nLoop ) - } - } - --void SwRangeRedline::Hide( sal_uInt16 nLoop ) -+void SwRangeRedline::Hide(sal_uInt16 nLoop, size_t nMyPos) - { - SwDoc* pDoc = GetDoc(); - RedlineMode_t eOld = pDoc->GetRedlineMode(); -@@ -3442,7 +3452,7 @@ void SwRangeRedline::Hide( sal_uInt16 nLoop ) - case nsRedlineType_t::REDLINE_INSERT: // Content has been inserted - bIsVisible = true; - if( 1 <= nLoop ) -- MoveFromSection(); -+ MoveFromSection(nMyPos); - break; - - case nsRedlineType_t::REDLINE_DELETE: // Content has been deleted -@@ -3451,7 +3461,7 @@ void SwRangeRedline::Hide( sal_uInt16 nLoop ) - { - case 0: MoveToSection(); break; - case 1: CopyToSection(); break; -- case 2: DelCopyOfSection(); break; -+ case 2: DelCopyOfSection(nMyPos); break; - } - break; - -@@ -3466,7 +3476,7 @@ void SwRangeRedline::Hide( sal_uInt16 nLoop ) - pDoc->SetRedlineMode_intern( eOld ); - } - --void SwRangeRedline::ShowOriginal( sal_uInt16 nLoop ) -+void SwRangeRedline::ShowOriginal(sal_uInt16 nLoop, size_t nMyPos) - { - SwDoc* pDoc = GetDoc(); - RedlineMode_t eOld = pDoc->GetRedlineMode(); -@@ -3487,14 +3497,14 @@ void SwRangeRedline::ShowOriginal( sal_uInt16 nLoop ) - { - case 0: MoveToSection(); break; - case 1: CopyToSection(); break; -- case 2: DelCopyOfSection(); break; -+ case 2: DelCopyOfSection(nMyPos); break; - } - break; - - case nsRedlineType_t::REDLINE_DELETE: // Inhalt wurde eingefuegt - bIsVisible = true; - if( 1 <= nLoop ) -- MoveFromSection(); -+ MoveFromSection(nMyPos); - break; - - case nsRedlineType_t::REDLINE_FORMAT: // Attributes have been applied -@@ -3725,7 +3735,7 @@ void SwRangeRedline::CopyToSection() - } - } - --void SwRangeRedline::DelCopyOfSection() -+void SwRangeRedline::DelCopyOfSection(size_t nMyPos) - { - if( pCntntSect ) - { -@@ -3772,7 +3782,7 @@ void SwRangeRedline::DelCopyOfSection() - // bDelLastPara condition above), only redlines before the - // current ones can be affected. - const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl(); -- sal_uInt16 n = rTbl.GetPos( this ); -+ sal_uInt16 n = nMyPos; - OSL_ENSURE( n != USHRT_MAX, "How strange. We don't exist!" ); - for( bool bBreak = false; !bBreak && n > 0; ) - { -@@ -3813,16 +3823,13 @@ void SwRangeRedline::DelCopyOfSection() - } - } - --void SwRangeRedline::MoveFromSection() -+void SwRangeRedline::MoveFromSection(size_t nMyPos) - { - if( pCntntSect ) - { - SwDoc* pDoc = GetDoc(); - const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl(); - std::vector aBeforeArr, aBehindArr; -- typedef std::map IndexAndRange; -- IndexAndRange aIndexAndRangeMap; -- sal_uInt16 nMyPos = rTbl.GetPos( this ); - OSL_ENSURE( this, "this is not in the array?" ); - bool bBreak = false; - sal_uInt16 n; -@@ -3834,14 +3841,12 @@ void SwRangeRedline::MoveFromSection() - { - SwRangeRedline* pRedl = rTbl[n]; - aBehindArr.push_back(&pRedl->GetBound(true)); -- aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); - bBreak = false; - } - if( rTbl[ n ]->GetBound(false) == *GetPoint() ) - { - SwRangeRedline* pRedl = rTbl[n]; - aBehindArr.push_back(&pRedl->GetBound(false)); -- aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); - bBreak = false; - } - } -@@ -3853,14 +3858,12 @@ void SwRangeRedline::MoveFromSection() - { - SwRangeRedline* pRedl = rTbl[n]; - aBeforeArr.push_back(&pRedl->GetBound(true)); -- aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); - bBreak = false; - } - if( rTbl[ n ]->GetBound(false) == *GetPoint() ) - { - SwRangeRedline* pRedl = rTbl[n]; - aBeforeArr.push_back(&pRedl->GetBound(false)); -- aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); - bBreak = false; - } - } -@@ -3935,13 +3938,6 @@ void SwRangeRedline::MoveFromSection() - *aBeforeArr[ n ] = *Start(); - for( n = 0; n < aBehindArr.size(); ++n ) - *aBehindArr[ n ] = *End(); -- SwRedlineTbl& rResortTbl = const_cast(rTbl); -- for (auto& a : aIndexAndRangeMap) -- { -- // re-insert -- rResortTbl.Remove(a.first); -- rResortTbl.Insert(a.second); -- } - } - else - InvalidateRange(); -diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx -index 283bf30..48b80c7 100644 ---- a/sw/source/core/undo/unredln.cxx -+++ b/sw/source/core/undo/unredln.cxx -@@ -243,7 +243,7 @@ void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) - OSL_ENSURE( USHRT_MAX != nFnd && nFnd+1 < (sal_uInt16)rDoc.GetRedlineTbl().size(), - "could not find an Insert object" ); - ++nFnd; -- rDoc.GetRedlineTbl()[nFnd]->Show( 1 ); -+ rDoc.GetRedlineTbl()[nFnd]->Show(1, nFnd); - } - - { --- -1.9.3 - diff --git a/SOURCES/0001-Fix-export-of-tdf-93675-to-.docx-as-much-as-is-possi.patch b/SOURCES/0001-Fix-export-of-tdf-93675-to-.docx-as-much-as-is-possi.patch new file mode 100644 index 0000000..4e29046 --- /dev/null +++ b/SOURCES/0001-Fix-export-of-tdf-93675-to-.docx-as-much-as-is-possi.patch @@ -0,0 +1,1328 @@ +From b8e0c4739524504385955180df09f67887b3cb10 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 3 Sep 2015 15:07:49 +0100 +Subject: [PATCH] Fix export of tdf#93675 to .docx as much as is possible + +convert Axis constants to an enum and hilight suspicious absence + +that compiler warnings then shows (which I saw manually in the first place) +of AXIS_SECONDARY_X + +Change-Id: I873623141020633ea73f14f5c93322c2346b8efb +(cherry picked from commit 90ea1221856340860c406357e274000771b5b127) + +Related: tdf#93676 'new' ms-alike numbering has same problem as old numbering + +when it comes to nodes which were numbered, but have their number deleted, +where the indent from the numbering is still in effect in writer, but not +in msoffice. + +(cherry picked from commit 54f9576aa43e3d6d687469aa0b2ea56ce0bbaca3) + +Change-Id: I700f34171d8c9e9f6fb725d115ff1fe704ceb4bb + +Related: tdf#93676 unwanted duplicate axis title exported + +translateFromChart2AxisIndexToOox toggles between just two +states, so convert consumers/suppliers of that to bool + +Then in exportAxesId toggle between primary/seconday pairs based on that, vs +always exporting AXIS_PRIMARY_X + primary/secondary y + +Change-Id: I2649f5fc07323a73a3a215fdc52d5f1a5c31c349 +(cherry picked from commit 24560df316de86cea93a37edd38e02a2f2d9c0c2) + +use correct axis type in secondary x axis export + +Change-Id: Ic21d88b55b22c650de4fd69479b51d0f640fec6f +(cherry picked from commit befef6a79feae0490bd3a1cf72b1134e5ff86111) + +that change looked wrong + +Change-Id: Id40a6802536120501133968d003267f21aaf5c27 +(cherry picked from commit cfb717133c7276a7b154379d049e6fac0e5a49da) + +related tdf#93676: make the bold property explicit for run export + +Change-Id: I5f7f993f2cf0604ec62cea3460b651c07a7b4383 +(cherry picked from commit a052479f3c85bdedddfa38cb03b0858003c965c3) + +foo + +Change-Id: I6e175b3f3b031535488660d45dbb62b998d47e66 + +related tdf#93676, we want to export all significant digits + +The code comment mentions correctly that we want to show all significant +digits but a value of -1 means that the last digit before the decimal +point is rounded away. + +Change-Id: Id91a6076e37629502281c5dda426018f93d1e465 +(cherry picked from commit 442eb1ab9d8c1ad970993ef6c8a49e89601b7432) + +related tdf#93676, also fix chart::CommonFunctors::DoubleToOUString + +Change-Id: I8d63d942c7cb7876b864a9720e9a8adbc7345172 +(cherry picked from commit bb5d638065590cba700ff46f5a0a1ffbe03b6f1a) + +Related: tdf#93676 in msword chart appears with axis positioned between ticks + +(cherry picked from commit 694419d813c14f6135aa4463d77f72c3a24a5cc5) + +Change-Id: Ibd16d255a45a220faf7681a74785549c32969f78 +--- + chart2/qa/extras/chart2export.cxx | 9 ++ + chart2/qa/extras/data/odt/axis-position.odt | Bin 0 -> 21224 bytes + chart2/source/inc/CommonFunctors.hxx | 8 +- + include/oox/export/chartexport.hxx | 29 +++-- + oox/source/export/chartexport.cxx | 136 +++++++++++++-------- + oox/source/export/drawingml.cxx | 2 +- + .../ooxmlexport/data/no-numlevel-but-indented.odt | Bin 0 -> 19535 bytes + sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 9 ++ + sw/source/filter/ww8/wrtw8nds.cxx | 18 +-- + 9 files changed, 140 insertions(+), 71 deletions(-) + create mode 100644 chart2/qa/extras/data/odt/axis-position.odt + create mode 100644 sw/qa/extras/ooxmlexport/data/no-numlevel-but-indented.odt + +diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx +index 5b40560..c30ee91 100644 +--- a/chart2/qa/extras/chart2export.cxx ++++ b/chart2/qa/extras/chart2export.cxx +@@ -98,6 +98,7 @@ public: + void testPlotVisOnlyXLSX(); + void testBarChartVaryColorsXLSX(); + void testMultipleAxisXLSX(); ++ void testAxisCrossBetweenXSLX(); + + CPPUNIT_TEST_SUITE(Chart2ExportTest); + CPPUNIT_TEST(testErrorBarXLSX); +@@ -160,6 +161,7 @@ public: + CPPUNIT_TEST(testPlotVisOnlyXLSX); + CPPUNIT_TEST(testBarChartVaryColorsXLSX); + CPPUNIT_TEST(testMultipleAxisXLSX); ++ CPPUNIT_TEST(testAxisCrossBetweenXSLX); + CPPUNIT_TEST_SUITE_END(); + + protected: +@@ -1462,6 +1464,13 @@ void Chart2ExportTest::testMultipleAxisXLSX() + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:axPos[@val='r']", 1); + } + ++void Chart2ExportTest::testAxisCrossBetweenXSLX() ++{ ++ load("/chart2/qa/extras/data/odt/", "axis-position.odt"); ++ xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); ++ assertXPath(pXmlDoc, "(//c:crossBetween)[1]", "val", "midCat"); ++} ++ + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); + + CPPUNIT_PLUGIN_IMPLEMENT(); +diff --git a/chart2/qa/extras/data/odt/axis-position.odt b/chart2/qa/extras/data/odt/axis-position.odt +new file mode 100644 +index 0000000000000000000000000000000000000000..35ea152aa0d9cd16783e5b021b05a68da0cbdf96 +GIT binary patch +literal 21224 +zcmb5W1C%Apwl=!Twr$(CjjpOL+qTtZciFaWqs!{DZQFXi_j&j2^Zs$q8RO3}GBYA` +zB4TDnu9#oUxfEqUKv4kzNC4nnl0rgvh#8gw008{8|G5OPv9K|5_OLfGu(!9iFfwqq +zu(M@wwKb-oep400=-)Rz(b6 +z)R#!gTUf+IOwC(G#_YSYosO5Ip@^EZf{u-ijhB}fkXQ(~R2YnGB!XfTvT_W%YAmK& +z9G+$Zok|dqP7;G|9GQL!xj`z8aXPbEETdTli)9wKZ5F$AE|*O%pF_TwL!^*%p}2dA +zq(_O2SDCVJsZF4sUxKS@V3kf#u0~L$W=O40c%4yHqvg*Av)C4k*k-GQR>!1fhm;QI +zv`){gF0brfpWNPD5$;$q(NtB{P-~Ak3x_5(sbWjZW*gHj5xg;B@&RT3Sz+Q8MW!QR +ztS@2scWJCM4c2RUl20|tFCE4&Q|d1h?k^{%Xj-ea;bo&eJ~3a6Ha(eJ-$kE^>V>^DT|qe~qf#%}T#7 +z3VyDLe6GrTuB#o**`3cj-mTbv&D(x%8a{72e{Gw5?O1;9I(_bY1qB5~Mn)!tBqt^& +zW@Kdi$Y?7~&MmEtC@3hXsHkYGXl!U`=;-JOD*P2%Iuubl7*#P6Up1UmKapBHoYpvz +z)$%*5^><qt%SKzZL{)xdIn|7_jhO7rM?$H+qa#75WjcK7e?>70!I +zx|XjD|Lxqwui~hWip2N&tjnH;&$gnW$+m;#)cehl=gs7c&HT^7rmwZ4&zaVzotV#q +zz|X_Tuj8ouorJrc%;$r+uaktY)69$A=9`_OyZy44qr9*4g0IWUkIROy>*lYUj)8%J +z@$vEAvE}KxjoI1RxwVb8wY7n{-I1mJiPgiYwd1+9-MP(^wXMCyowK$5i=(Nr%lXOk +z<%O@Q-p{#_&-J<8ozb(S<-60Nx5Krs+y2k{@z2Mly}iA|qvPZK?TfSh^Yin))0^YV +zyNlb$kF&$a+x>^T)32M0ujjq5*Yo@P``d@-$LH72`oV2 +zef1&}#u?|kra#QM5fQ>#KkH$k+{mu~sF72ri?Y6lfHgG|`g!88hC1Z3mAOTcj##ba +zYC~&sqJEZG1B*dcto6o5F`O=E9=mA=PU!`h#~R6SHdhwjQMOsDL)#sDndRxKU2w(TcFn|#N3jpc;Pp7mD-SvjK8-z?)u;JUNAOf!yMl_Yb1$f4h%+Z^DG*pnX(9E~Wp#HJJ6K$(wB +zOAU}w|KWw#yAkg{V|L{LFtd5$^#8~Zzl6g>%$U~enQngCj0H>!e!kk^k-=aMmX*VS +z>KnjaO!H{n`6=?ZU%W)^4rtlgVge{CZZDn`UJ!EZJ8l;hRz~tBnDlAh%G1^?8dTRC +z>*3WY>11e=ls_IHiyP7g?-#eO(nhSn#z%3qN>Z+q7J04XsR*(>uN$HKzxAOU_IDPM +z=6(pReV+@4*D8tgD9uN8Jzsy-oZ6%t===1ZbQOHM;!U8xtioEc*w@|4j%Si138245 +zI%!p81?1P``d_?@EXa^}=#8da^BJ5~uFHtqsG5`#iYJTy!XdanvTExJiJeGI3Y(xRI<9QXe$r5R$vLgc@$LXD~J> +zYk`7>1s3-`CA!dsP_mB+8B|EJoq|PH>LtoM9ev7iIKq%yQ9E-l2s{XL#VO1!C70O9c#JnG51uW4J34?&J%-|x6vyVXUt+Yc8QIME_cyO6n|Iih5WKBxV(F~tyc +zlt3g!76h%P9Hd7!&RjmY~`vr0kWq6rO9#=53Dh9x@+j`;$a8!aw{qz@Y`9qfe?hVECM}@^VG1f< +z?N0r+qj#EKRY3e(X+|TRkZ)Q3O@X85E|PCwk_9bVCxxyUM0fDorE}cD*!$6bz{>KH>K5%|ZJyHxo&}!D6@AU=g6RTdO2-gjd1yGJ? +zqWYaD<{Jb*NQxutiO1^6NOQ~Jn+N1Dl%Ug@?CkJK#Fwzv&X?6+OCx(8#})NnZma=a +zCv89Ut^z*J=;zmPPJKqOfl3<+YUR%mn@0v$)3CCPf1A4DgjeKr`4`DFU8CV6>^t66L_q^T@0qIls-AIht +zp~DkiK*y6#;&L|ZkZ$kVrNjXP-qqE(PS~q+a5=kn0G-zq2Ud2xkHc#XG@Yi5iXOfL +zK<4ilYpXa{Uo~_qX#6O>%`M*{1ZPZC6X^0laJQ&Hdu1~2WO^-u8na@FGbz;tflV*6 +zc%b9_Ctt{N4OIcGbhATZobvSm|B45^H)sH2lbnfa(1bl>i6_XhfA)|t;F*E|a})zX +zp=vB26%D}orNNzB*1-tisUPTzWg=nLfdt6SFCzKRlAB5i<^fz|_Hls0r2L1fC;+qK +zY(FQ`0NB;3Zq-C|ZzSp!l(xn0Sp1OUYPPa&A7PI$mVEo(vgUwgs>iH*ejYq{3Hy$Ay` +zr@{5tX-L^FD!_9~D99GVx~l>6vH}1=VvP^K@oWwa5V^nVWGJEk-g-PuCG;5;P=KH# +zX)XYO;;Rjt%t8{dc8W@k3H;fL8J^k~+t@9wsKNqt&x#J38%*lBYcTzuPAWKqrusc9 +zf4(^znGpHp3*etadOI}G!40Dr;H^%T4S#GgKVGu9{;0SO4^TscI|7bd$8hrKp7>;Oy2&CKk-FSL#e_dv`8?mNbQ4PgNSpChHRKB`hL`+w*JJmOUpggA}P+AlLCFYJ`Q{KkxUOlt1Zhz%PvNz$24={zn`m5qCsD +z3fD1!c`V+ +z;M@6;`g>DEchp%4764->djG;V2Pf{{t4yt8`Dmh~Mnr!xK2(@$Si(z^s_h-HPW-)h +zuPoJZouz8K&W${VvEENf{k +z9u(by`u%VY8NpOSq}!L_Wh0i$fHl>M*Ki84shstr5)4p^Ju|$qpD;WNAkX)3CWKuC +z;?TYCT-qQoXIsc20_ynU*8=YJ*{6tl6AA1KkCHF;WZ55H`1M1#62W&88bF$_<8+qe +ze0E@W>U{Qa*0y$G6szsl9q^KN_DNB*SNg+yD^lI5nAhs4By;ceCw{?7cghgo$*Yv+ +z(rrA3@)w82YdzW_hl(XdX6Y7N0?c;2AJ8mOL!&>#my72QC>@1kvaB?o +z(D(2Rf!ngRRJd;MHNFJKGd)+sES}5k8I1K7ofaY=3|=8Lf~)>_% +zD*Ni&0)fA7!oQe+COiUC6t&D&YkJAzQ^KLPqj5zb0Ri_^nys&k&agXH7bVFIj6t6u +z^9rx5I(8^GHy&-JfcTt9q+vauN%4@{wGge7MDgC*nIR|tY!hY!O#j@MTKmBjZGh4} +zO8ho^k?Rj&eq(%?9c<(<%(wh~CO(v>WEt*Dj^BN!>GA#x9OdPp<^|i +z0{s!{Z-xp(b}JBmc3b{iEKbl+tX +z_%$mP1{|to{=8SB!qf!m?*Y>LM?vaE`|Iu +z*7tAxWluTb0nP|&UL?>6ASzG=yuVQld0{8y_%+Icr?(DO-Qvs|?X?Ez!8*>?ae;hT=P(q2md +zX6_vdDK4{D;)9FcI}ni{IYepV4!6^xGooxv0#$OrAoyBZ>zR4S7=Cqo2S8W|*(pex +zS0xw1u&rRf2t>H2YGDAiS=>+j697stm00Uf5N5!;APM?SX%KA^mm;FIS^*IVb{Ga3 +zO2Rljg0XbXSo;-oXN@rlEN0lq;JXqkDm_&Y2`_>k`XSc>Ga%}XZOC4>NTvtF?Dd74 +zX#7d~$k|8{hs{&mx>97%liI2rYl4EMJFgWWO1(G6iyGR_!|tr1RV^i+&R0s&k89PRW~tLRd+A%jSNc*S=Cx3kyDqr1{!$! +z3>~0fiH&{@H^JPc-KlusE*i9n5+hO`tS}PMh7cZfZ=$RMmccpKOQaUm4fD9M6>nD+ei_q&O!p&xR4K$>#4JMBZuw)#&lmKI|(%Q +zgD^h;^#mJStgllv=R6iMX(%!x_s1^)m}Ff<3K-ITE{wH7B9@z*77(8;~185ko`a%!GRw1UVeKMm(Rr$pava +zPhe$quO}VPFB}V~43mZU?{LL`gEIav?)7f0ePR&5xlIbAohSbVW=e_4i&hKk2mA{m +zg@lCs8*csU&i`yMe+ou+w$6WHsqQw`Ro`Wt_E{0T?`X7(BQnGt`h^XdS3qFERH0PJ +z@**mTN1J<-gGi^1{63mV*NhZ~!bKjL!#jF>OZ6;u{MOlA>UV~q$(Agdxn)r3%M68+ +z&+co6^=3?7Zw@o8R8a$NGpSbDwYf!;oUb{6EG+IubV{n?+KAPbwc|t9)@QUW=)KCk +zqox9@B6>l*iXT2z*eDC+ku+71BtGAts^GQoW40o>>e^U6C}RZ4k;r_to{ +zxE^&C!S8NaYEvh;dl#-9tGbnmR1U5#F2Nvf_Nnlk8|mD+n1h{%o2i2<)B}9YJ2A8m +z(?-Meqs<<>rVi#|B-8bl90$7*%ZV&`d1y?LRwVu7Xgvhwsdc#H$n +z8y9)#vJLae!}7vn(Z3^qV$B$N6wPm!V}!wBuk#7;yx|XDA$h(Lds_wVnSz!u^i!3c +zAUZ5$LSt_;!$SVz=#~xbfBI3&0(`_-4^eBtI!>aVtF;BWq1-IOECvDOVGua7z+a +z^7f8kl#gL8Jyk>CNUS@3*u5Hvo7)0UB?<)w|l#? +zgLYhF>GgdB3&6_gGKra+LJFB}#i*1DFt1j&W!)jwKlNa0vWV=a!=(tB3|!!5oxc=T_%Fn%i4$G%u(G^hAMoN^?ra+BpcdxJ-ta +zs1~IW{QxfX5lnPT0mY7b-&Y7r@-uJ$59o5Zwk~k=x)Fwxx}%nW7c`y@Z6D5YbChs2 +z43h(xOYeuh1B7gBR=<$QxSK2i&7&x2wfJl9F`5AbEUg`LZlJX|{3^|vQ$beG_#dZ}h|k5*HhUP09(Nta?9l0w9t~#%W4xu1w0`#Tq-%b3RXjK>!{Ok4h4w +zn?)tZ8iomR6#|h)4YPk+e_*~JjSI~9T;HwrbnaB3MUN8iIK;)v5|uqhjUYjqIU0oj +z6e6kz8;&0n3;9NjL9Kh8X)JHPCOiPWIDc#2hmRXdz%Pg{P>xhNoVTz}OpMtDkug`fgU~%wSGI#8`5nz)L40Dcex0!ciDs=iN +z^Qky;C3oQ;YkQk`CR%L?3w70E@y_)DTn$i#*r432%Jpwl<|+5y*nKi6}yBP%I?P=H}N0Q8z3q$zH)Fc}jv* +z2J|8oWG>}9xJAe_u)qmNFbeHTbcLB^^iMu7Hu)BkSNMtq;~t%IEYO?nc#eYxZrVGk +zxk0~VyM2skwAgs-{j5j`0uj7L7LEywBUw6!0z&#ABhrlIsn!I*{RX&F{Op`oXY_BQ +ze4$O2{drzt%`0CQS}l+*tKYA#Fx(oVE4(7-;l*MLoNu)^coy>N^XxrHmDzRGvWmVtgr>mQlnYDVXn-mT&AB8a!g +z3fZ!#DP87=s>0Uw>_+013iEy^w_}O9-zo}Q-wwJ$RHq3SR`}WH%o{l;zuPUQ@|%4>%(OyeBOa{3eM&;fZAU>Gy%ToJagjW$#Yf|*c-$&A9ZCky?}`DGt{f2spVBu)=H~$JU_l<+Sf%P +zLnjf!1{V4-iAXUxYj24JiV>BWyX9<(Yq?=?hQU?K;)ZZD$nOC^qJf_6cENy!K-K +z@EJ|;Nzs^AZAFEl6aZ*ckB{;)zxnZX?@ON~us4Dm6iPiBqlxqm_`yu9^4J}K&T$$S +zJM>zIKHauy&VMtP?YTOgcv$;zmC9JM@U~T@j;0KzzpT&7@77(LIU{>e9hqu^qj4>g +zLc2>d%hVLQvZRjre3%#eUQ;UnWH#GLBA}&T$#gm#rAyhroCPT(9BVcV1TY_A0bSrimSC>v!kdc9<*|Kb{ +z;D;=F@6lUcN=gSWs%)SXfY-GzW3}2TA6)cP09H-|6;4ccU=z+t@{g{Yhwa6e5W|>8 +zC(h!Np6!UxbS~ofBYUHGIE!($E%0j0XS(!eTn}v9_i0b)%+-F8Xi`aBCRYXYD6|_g +z-Ufa=wyBqY87#52G}(K;0aL_Tg@`Oa$`?SoBA?0ae1~mhOVP_K{2Eo?^npfwDRv9-CT$j?_fW*Sl(x>v&HYer|n&)>Lw+vS< +zCPN()esrOSjFflg*GNmxG#hy%r_8TE4G0a2ayl@SxI-Dw0Zy*8+UJ|qr8i9N2eI~e +zuIC-?7;I2=!8i98A`>&VIwd#S-@=BlKwc7u%0`eZGkGxJ=J|Oci1E6p3kPmkJ1<06 +zOIW9K$aYR8r**MrXLJyL&**SWnZBPgPU~S!aLjZ<9Hq|!uOe5++)vVoyk1^*L!6|~ +z3jclKqC%J(TfuB&ElaLsO1?YF +zNQxeM^}E_9JssLe$u!M5h;~dg_e%i>xhRSFpod06dPCU@4@*IsId4!Qx>xovQpxvN +zk{xi)r)= +zPW4(6BZIsXn5IViDvYK>K{srqkF-qZpO`GqP;7DhDF+o69Pba5K8!-*h2q!C8uVp% +zAieYycKL(FWPoKj-XCu$&$s(%KKd*$WU~B!{@9OF<8b1fxe{fEwYFb&0Ma;L|E9Oq +zu7@N$DWGd}?AoYx5u*PwSomVJE3yrTPhBo@%Lpzb9AQ#akY0s5pPpV5SoPg@%ap;j +zOU1k_$NB5}>4M;|Ss}z1Vf`l5pOp;W|28Z9J37e3+2F4^VRYiOZ6+h)(3KCgs2A9p +zpnjdYqxr(OSv5=Q2Xv1MjYYcUkyJ9DOnw=?%0s>SjumM%3R7Q}EslY(-N&-BE|OGv +z%ccjZFdqceCE;?*Ge56qOzZcxTe-X^uhAdSlW*XOaM-mIPDSMfPL^j+;!2a;D@udd +z$E61RspVEIYx8!sJ^uI>!rZ@4-s|Dt +z01-eXZ;=`5P(R8pm24)Ha~C0O?^(rKz#)}dC=~-GRRCPIJo2@6Ealh?(VwQKO6bWF +zo~(yI!Z+GYud7=$UGdDIEAl-a#uIA#{4ULPvFW&Se-pLE`nyQ4OU?PBo1WLE!9e+U +zp{_Te^=hSh(KVD?GE;REb+1-g*wwJ{=J#!L+dggb#I+CmSoHQ}hmxCgk#TD@O2#?% +ztNp3oqZ4QTUZjnn%Yco6)5qSC4xX~tlHse2dnUO~l>0h1&rCQmi)IDJA7SCBj8iB; +z4lza;^i@WiXjxV+tAa(XnOb!7BH)mPmFkny*t$dJl^!M|lSt+FI +zTSC=(5)HV}@o?+0>q%;TZI%BuLqa*Jqzh4ECm%o(OC+vMUma*Sw|Nt~ZFE*clR51H +zISDyH3uF<)hAGl=Oya41YU=yKJ(6fmJg3b;CL_opxBLrr|FQ1yt|Mbg<8xBezO579 +z&}i1QpiZ-DvvRXrsL4E2S67#Pec_^tXpBp*b5Ygz$?1F8^Zp2bEW;2N4-XfY-ToJZ +z#2|4_@FA_a&0ej~$D-;E;TPv2I5JK~!LC(DZCl@1amhS1r5`OWOFvq^Y;TkmC`?YQtKY<@4d+t2#+8-`wtn@^LREN{*(&WTsj +zp#@Cha;D=US$e@M_f#TieP(m4q&@@w*ZKncq8)e=$_9Qj;hxoZhyGb3dJ=V!duH`F +zmEeVhqd46)=99a)S;nnW$zuE5qxxOs-X +zS))9mCcldmh>+qM3PM6w#0OL#hu*O#@0U!iF?tN=rY~^I=o-7?7mPH+5Y4+B=LICB +zR4l4_DzILWsZ5`743fj5pZjMNYk27N7|<+j<1;Q?C&XkZ!8LB?GT}o-b_ky3LR%|e +zmFn1czn5;16!Xf(K7E1o@;CJQSmu2Jr^~9V|x38aElUl*=}=h;W&(IG&5aB +zbEYMeGW;LVQeH|t?XA~9FsK2Yy(Oe<8T60_dFp<>m#N`AvVnNN)&dv`H-^f#xl1Cxt{;%~&oNNU4t2B{F4N}Nh%BZc>#Nb{+ga80h(3(S)m0WfSyuv2c3Z{s21I>P*L`Xw-{`v +zBZ-L6wnVmM-_jxPm*wobBALSuA*L2|fN0!w+|ervA#)*4e?}`?ml_imFyS%yd9AS> +z#fJn5W`9!Fc#mnVhHntTMS2!GqJF3IAnO6GNwArf(^bX1Ycu?O%tuJ%o%q`X_Y}&VxLi?dd +zoP!*LXht6+A<-1m%T@L5u)L`B>ZNU2(G|>+U@hlSE^0aosJn~$SW^sL!g2APt_+rxgDi3y8QMKuNc{EJ9A +zUD)cSfFC0@BCA*^1y7QD>dweg3EM)Lu_1u=HgH*%s=TWT(2#>Nq2k^OYXy^@tm87b +zy<)-~G@F$cas0BOD@(>bb>`O5m*|O&yr2FabPa;4T<(`}U};!!ArJ1DB_^N4&g!BE +z-}*R{7inapEFB{0f9(g8p~Io#gmHvNpSId*YlQW!;uz*#&d_AxWKRDGh=5W`=#w@m +zk5rn3{|<@XkyU(sQq-i4n+XT#72i&Oig|}*##MCW&G^M(?1x#FElo(dn<3*ybKGl# +zci@wGx9RHj%g|z+?>2e25wlUg(GxS@uZcF?KyahDWp?ouizL)syaOM|biMFwP|beh +zMv2TePoCO&@R59`I85mq;1id@%5mim0o&1>+|tlldC4!W-g3O~nf>l7+H(Y{-}tDF +z4+)E#me~+uE!4Aowt+L_Q=iRr`~~_912tBdi>h)02=>Eo(HK41R*4_gwGRw`%{vP&ba#;o$$*9mY +z{i|~`wZigB5uy5A+@Gt*5XOOV(O?-0F`DL*hSEoYb;* +zjtisMQ{a<*f|Yl!!Frspo5!NSFf^x^l(O(E4Ks=cTi#B}tCyU{SFPC(hnPIt8qG07 +zk}WSVaGyRF6-$fF|_55@RpaF!Ws5iYo>l-FkOD-DZqx#?LaEFnr8E~iF5x33nu}3w4KN+rQ+*sJVqV=IyoOJj>=@&zX5cDEmwGU|wYL`hg(Xnq~ixvfpnU +ziWKbeK5rb5Uy>fVoIDf~vAi&#gL1YOyQN4W$C_f*mGc=bi@+_nTEa^=AD?2V9Zx@} +z`OKW9iQu-_n~C5yS;&C(i-y|nwzJ+`J2!Mi*wIwq9O?E$)%5nEHi- +zNvIE|co`VJWO=1zrHo>vaz%ZXcq$v&v~rfzAQ-8E7Uh;czY@87-Z^fJZLw3@s_41h +zdp4u|zDJf~i7e7G@ZijIX)?9$I1OvueB*&??x37K-!QH2S6FkUWl5{Bp_%$_a%q3q +zYY7mcKv@)N)uKitOZ{=2NxLMLp12`|#({-*Zg#v>hH<}|G&%>h<(jG{1u~u~FLbas +z4<-c*AqcIqWxPNVv(dsrj~q>|FEN|*e1Pce40h}YA2WS?Rt`SiO9KJfcd$^})@!La +zUJgd(`b)Ou1h_gZ(ZM?Lw0&diHFmupId9aFc&x*wqN7%5WH=48&Mum#*FnDnZMr6Q +zT!_7vi9@dxOutS!-De{hOnBb>qTq>T-Z*cFo;M-YI^N^V#JjZI-p)L1+%jg#s5c73 +zD{I1}0yuNvsk9Q&bqR5WFYY5*$H6s4M~C9cSftY)%1{uleqJGEU+?ubsJF5kh+Lm* +z`J%d0zJxuK#>j=-DA8RZg>ozcp-s;kE8^JfZ(0?I929w`GWb<%KBjr@mQR}Ki`Bi} +zIf^aL#8=z6?~hjdDO!29T1_Z^s8yKLg@YGMn48JakjuaeHBD-4%an5mXVyqJx8|g8 +z7#VGC@=oQKTe9Uop8r|?h^>5XFREmrkHD#`L3nKF*omH|{LZANv`~m1Fhf%F +zeKNnOFHQb8OkKjKftT*ny3}bJ5S*SQb;Q1+t4#`-^t;D|2UWkCN+je^GO@*S1Jtps +z(Vpie5zbO$_)|diwYoy}@6%r?8d5oI2bJd1k2Vyp1)(l!he~ZM%>!f3n)TX^V~*JR +zg*t*B$W&5j5?E(#OBQsKZAdhXQpZ4bLGl6OK}5yXshVV_XQ4HQI|%}+w1;BKA1_mu +zqi*Q>vs&5ezv5G7q0;xawwAy-gZAw&I +zanyD$Q=uVLiQ|I74>G#_WQjI)iE=(a-$?hA95vC#ndQLEZV@u6etr&&w?J+QItjn8 +z)IK|#da}s9W4X}Ber*AN>rRt=5-1J;QleH15U#E+a4&-Aojs-X7LxFdsi#oGGK)U_ +zZlcm7U2y7ZilvzTV>smZo=|myP;eQWLS%c5<)Un=x1)dym49vA1CJ!WF3k%C*-MEP +z=@)CvzFC#pq0JK1mj=|=3-*q{9#l_wy|p@H`xYU3+Hy#USD*i~T|qyTsCJ`fPa}klO;7lAAx#NNLsNY7ysHXC8dH39y?kV059vk$)zY5R{ +zBg0T^y9!VFanr_H=1PH9mQJbncvICf5gv9=*zc3GqV-cEtz#9fj@j8|a*3bcpTciS=onYZxl^DKKH{QrjxSa44cD#a}+8Yvo%+RpVE(x4F +zF!4{5vILls-q;BIx#|#b-Mzt!Urc2 +zKrgex3fQBc0&m^@*3Yo0oxJ{YY|VnVsCnXJC?sDfcNfE~iJ^EV^i2P?$>p$B4`R7e +z9hrF14RdwpU&^ohlItNBwvSe=mfB`c;WCeggSS4R)o)Jtx{pryn*ROSoQ-f{mNX)X +zJnmZmyE)|E56F3*0UBc5sxU!mTG5kgkNoKU@MaMkl+1Sa=>j26l4rz->#{**R)7zj +zVBvuEa8ce#fK3-!6a>+AKY$_brco69ic_wFxVCfSvF!7x1 +zGzF0b;Grpli6EN0i8zT8-b{ep_z`P46mW18gYs$$Xx>a_#113sgP2)>N8WHc3bWgG +z$_Q+7Q^E*Y&G6_XQMwRCoqTE34k12Zp1%=J@W+t(V`f+|TMnR^#m(1D4}`ndWz!Hs +zwQ&kk%y5!&kBbda87w5p<7jm^+ES?>0S749u|L2`7jekF4p(2PEM%|{BrmFAH%+h< +zI&SufHiBERVvW(=iz_^gMgHQ8Q-7idb!LH+ESwmcp@-x&#{i{tF>SW6>Z{C)f*|b_ +z2!t{&1qyezcH$x2ApEWO*_?>-W9> +zge~M=AB5dZZr_pR@F4xB&I?Xg=q)fX!+Gg25>XI-m>bRj1mYM4Eu_zdd!Gc%LbYq> +zb_^t8r(7T;;S7Bua^qVV2R8w<_7Cj$dvOs=B=O@=_a|ms*QN{dl#Z>z6OLdGOT@f} +zrn@T^lWVQ#^?fwrhkZBU-uzmkC`gif!A=}3f-|}6w`)Q76mU51X=kc+5S_yJYc;no +zn +zX08|XH~Bs}VDqrS$k6nnx3|v|!=j@aN}+k-E{PCdnL6wKw@;7i+e6ZZn=U>t`jq>l4>wngKv()5%t`Q=3J$+Z#RkcKbZ*EZK +zSS0rAb|DtZfE7?{#KNRy2hzhSOnsUaVy_7#A{5`+?N4))z;4f5j6!poq_iNFaRz>4 +zik#I)b8O!(n<|%}#d2D+JVLYR+~B;Ic$R_<9s3%)BfmggO7n({C|WW2{jEDj1OLH;%fGs2K&*8WM&_{X5A>;z@PL^+y4a1UY +ztlS2`tIEy6!|<0ii&iY(JCF26R*`uU3{GKvJ4+~ky6tt$32<~sWGI+JXfwwmwk4r8 +zNBhBgz431NMSIDNI*;F2Art4%@OE-D5>Tnl;iF=LBc(9DTq-}ok((clDz-6fFVjL! +zPS8*)%>Bf-*bES}>H1khP)L2z2*!im&ub_W;~OP#0p3Z(K4i^4goI>b5S6ZBH?V2# +zY#-Ct&%aA$5yD3nZADb!h*}gK&%jDm2VdwD$VOLH>+@MFVAM3t;nmTZv#>Hypa6Ks +z-3Zl0BQqtHDqtB&?~&z1YvKwhR!vt>uA)MSdqLaR%Kcy$4cT6C&94yZkb{fy5~;9V@lGt5vNUzC&@A?VqjL&K1HYf`Uu4Y)I2u?T3X}O$6l)eTfx;pDqBY{?|n=nFUsF&&ig-hl! +zitO@ixMl@HupfH*v~MuDDd%$VZ28{afvekcLlo1A=4oE(0kLC`NHH9y2-zC-BbGHD +zv6vKhEHRX|ND3KL3YK}G$C2fI09x;jWsu@8({BdM6Z8H-gB|{u|391lFErT3z}CXl +z#L1c7(b#k{VbV5`5i#hBH`ruqS&#t?%#m`e%`&H#EkqrR;Wiz4vpXh1O{uW_G-rOV +zTAXDorZMBf0Cyy^zO+w;)rg90OwzpRgoe9=zO87Ddv&>)h9Dj9#xk%dhq~R(mYPd1 +zIhc+E)_S@jpVB@3j#r_RxNm{eK@xVTF$NL}KU&!0Vc#2@YibwD^t+PtS#GSy6Cq#Z +z26tI*J+wiya#v_GVcZYFXeimSAm>2bc6pgWmgGAnuD-mB-C_N%xxjp0{cD<->E+EZ +z*y01-?XKEO?Z7SXBy-P8BTtvP!J93TMEy+WONG-89*?i1Px|REtlgSMS5a%hsRFat +z*rUc<0#%8czs%S8WIhY_$9#c*@}K{+`Tk1L7O}H6wJ>vW{5vt*iJ8H`$jHRnhYoa{b9BcQG{hZ(Icbi!KWr12YpR24M?l8v}c%|Dy7L +z>!7`zy^H-{djAU_?*F3H-qFs?(ZtE=zc=@PGtFNn{qJ1=TRWYc4V+#6P22w#M~e2R +zopNF-LUdB{;tc=a`1-R-*Ob_2+s_Caa>Xl_bT)5npH2-OD%ByMz6=sHPbUiQ`DJzP+`X=qa6u?~QEU9|bAnm$fI3=kl>fWk3yc;$xf6}j5@H!A +zUHv2O5I?O3v^po23$3DN7+6`qNAFmfF;LmFh8}L#>oKtY5PHJ-`FAT24=;Y)sRb8i +z@~3!qG87TwqsCzA@l1GpY4R=(O)1OqU+^@(pob}$nfeN{Q3mQZ@j3v55`UWvAafj`{cG+;=trlCbI^fz-JeY(KJ2)3hDen$(T +zZk1VcZ#zZ$vZMVxHMG0Vb$xtAII*hneQQv~!4mIY`xX;g-re6?<%#`aQUh8IZf*k8k`4uU{d=Fcc)`2$)0 +z=TVCD=V|;4u2eR$w>B^``SX@JJ2CtZf_af;WsUnCZTPCX>#^ExX=+>wcj?B-s)JqX +z@x-OqHZxkJvbDJ^g`6%7(Hy$iBER?`uhHAyey-ethI${G=mAOWUS=Tx67>f_D3^D= +zR0tYb1*{3ViWpP{bS4=A$Z0xrW#ZxCoD^kR&MviK_Izc-BlC{u>ucF)dMZl`x_|?% +z1wuW3hol!f?U`~P6KAt;c@Apm6AGpe$DIko@ElW*cSIl~C+Dyx8LGl&PbN!2Q>L+& +za1zO(C^HVj1LJbwrYF8kpq}XU`#)p{}o#w~??* +zU7RZJ!G2SBYFQV}>WZ-}4J~aYNI7V_>OeY!+vApW9$)|G4abA^(=SDbVdI;_o2&sZ +z@=$?#v$N|^i6KUuKY!VfJ@?)g@sSsO=gP9EXfvpH3(v=7F818nn7KksL+=ZU-l?Uy +z3qt&=QyK6lDhVmcdLy5=2qI!sYv$L$m{=7i{+g*4R;5F4o5!B`6w;mt**@bbbjCwS +zm!147d$|1dQ;UHPVp3nElyiWfDw9V%4#~1LoKnfyvxa}74I{L7& +z?E_NK8lZO$BXtZ>lk2}(__ZVdp}MLZXeXo&Oi4iO1i!AK{kKXP+CMD5u4Mmc`Ff)M +zyRBSMeO7?4x`ltpJ}Inf|397HRv`cIm+@-m_o-+-Pz8+v@*Psps;yRsU7N@%)G7 +zy`bwK{htH`|0X#B=ijUuneh*gx5!xM5J%Ciup!mo_Bdeur`3KWf&Wh(ttX7PRj|Up&n|}N2wQE&QtU8oIgDhR+4?YyX+UV{Yo-}oh&iO +zcI#)0PcptH-cyQhMnm%na;&LQi_Bu@_5JfPTO0$rLVMoi)h0(5liOoS_mn<0C?!Rb +zb_D93lW)8)oqL_t(yA+%*xvK+zv{KfNDDW)K>P6v%JIcZ_FE-%dmWOg&T5i_|7h$b +zzEBVJ=pT6jBaX#les1~AKsu#b@8)r~K`f@P!T_UedD$>AMl1OxCLve0=;yvBy@;Fr +zh=7xQo>E9jvOY!QhJv3*G}65)Ta6lVjt^qFlM_4-0$`yyaar~rL6kZ9wm3{5C77onLZ$fgQF8owHz|IEUK~zLfh){9IDFJ0 +z35Qa%LXIUp#^+*~Q&m3?OYWYI*q?%Hz#c<$_j8Y)j>owZEs*NwG|sRsIw7AkGi*zb +z^CoIOxF?2GhjWFlJBK9~VaOX2(_|V`_D8NHN}hj^>8(1tID50r8%rPY>6Zlk`7-GM{kUW5_P$H2bo5A(K%x`iL?Cn=)oZ2GD=cR@% +zdRhtZpS=2}RwzdH`qUU?!bnnOT__ZL9_2~yx^Pz7YGQZ!WdFp??Ug}omxNBT1KPjV +z`eFWAd^fIgJcBgtNi91=En}9%?i`eOT&Q{GT}LuqXpJ_v-O1NRA-b;=d8X3Dx{NfyPC~NFGAb>WtW9SI$aj(Um0QO3z^<% +z2Y7izP8HubCt|pa5TE6OqIJyb9|t9-MI{kArF`Ew@Q91O6N=U~t8Wb+k>zKi%d1ed +zduTU7gzLZ^kUQ`G9q`3g{nRl9R3=VeE?*sfpXpW5Ky)N$eNyT1%;r$4j1q@{HX@X0SBTo +zTR#dXSdci%A3w8s7QLiMU{9#-S}&OBS$B)SKzkr +zh&2UX`Yd6LwMeBsV$G=lCY`puq&nX5m7b&>V2S(l_wc5ESHHx!PjO*adQ~Dm2P531 +zc+b4XD!i!o&QR|$kIcnIem3%VJn83{xbI?bN&85tmv4cWuiqb$)WndEk~_>2DT9`J +zFN!2Xyt{axq0GxT_LDd^(JM(w(5l2M87NcA)Ke1J8%vkoh_8NEb#kyS6gF=!gQ}~( +zHB0R?7e7R`Yw&^u+YMb9Pbo74wCTLZ^vISGJFvo$&{$u9w{@!8=k}!hLYWk!>gCJGRap +zd>(8{`r;md`67pkSK-K^=dRS#!cfUmAq^47O$QnMGTN1wXfq*=9U&HTEg7SGr9Uq% +zA!MXp=5@TyYtz{lK2$W%8H}QC_0VrQ@+zyN(Nnc0S0~N1iC{YEYnb3mpDaiY6v*V^ +zLW>c{ODwam@MdLaau!R6bM4f;I;PJ5=Z15~?!{;F_CCq4uNF*j(w?4LE!;760 +zml-Q1)j#YFz*rSOf-8b8VsbE`SOHjeZ?v%*uq+UX)os?+tJd$J21#sy=GoOv)Yk2% +zw(7FFIu!lP2mHzqia=noC{jbQUMN}#3VsCy#dctI3i09fI?-ytuh`*lq3QvE`K(a3 +z^(xW&50DK(aYkcp-QaqqDBK3?L!ijiUR{2ztrl7DAPNgX2oA**Ld0S7DT^X6kSRjJ +zHWD$|Z0@4SXYJfQfhyd;SMdNPTR(E}LaS51O9w?I{*Lx + +literal 0 +HcmV?d00001 + +diff --git a/chart2/source/inc/CommonFunctors.hxx b/chart2/source/inc/CommonFunctors.hxx +index c7bcff1..390f13f 100644 +--- a/chart2/source/inc/CommonFunctors.hxx ++++ b/chart2/source/inc/CommonFunctors.hxx +@@ -85,9 +85,9 @@ struct OOO_DLLPUBLIC_CHARTTOOLS AnyToString : public ::std::unary_function< ::co + return ::rtl::math::doubleToUString( + * pDouble, + rtl_math_StringFormat_Automatic, +- -1, // use maximum decimal places available ++ rtl_math_DecimalPlaces_Max, // use maximum decimal places available + sal_Char( '.' ), // decimal separator +- false // do not erase trailing zeros ++ true // remove trailing zeros + ); + } + else if( eClass == ::com::sun::star::uno::TypeClass_STRING ) +@@ -128,9 +128,9 @@ struct OOO_DLLPUBLIC_CHARTTOOLS DoubleToOUString : public ::std::unary_function< + return ::rtl::math::doubleToUString( + fNumber, + rtl_math_StringFormat_Automatic, +- -1, // use maximum number of decimal places ++ rtl_math_DecimalPlaces_Max, // use maximum decimal places available + static_cast< sal_Char >( '.' ), +- false // do not erase trailing zeros ++ true + ); + } + }; +diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx +index c043fd7..7a4f2f7 100644 +--- a/include/oox/export/chartexport.hxx ++++ b/include/oox/export/chartexport.hxx +@@ -64,18 +64,25 @@ namespace com { namespace sun { namespace star { + + namespace oox { namespace drawingml { + +-const sal_Int32 AXIS_PRIMARY_X = 1; +-const sal_Int32 AXIS_PRIMARY_Y = 2; +-const sal_Int32 AXIS_PRIMARY_Z = 3; +-const sal_Int32 AXIS_SECONDARY_X = 4; +-const sal_Int32 AXIS_SECONDARY_Y = 5; ++enum AxesType ++{ ++ AXIS_PRIMARY_X = 1, ++ AXIS_PRIMARY_Y = 2, ++ AXIS_PRIMARY_Z = 3, ++ AXIS_SECONDARY_X = 4, ++ AXIS_SECONDARY_Y = 5 ++}; + + struct AxisIdPair{ +- sal_Int32 nAxisType; ++ AxesType nAxisType; + sal_Int32 nAxisId; + sal_Int32 nCrossAx; + +- AxisIdPair( sal_Int32 nType, sal_Int32 nId, sal_Int32 nAx ): nAxisType( nType ),nAxisId( nId ),nCrossAx( nAx ) {} ++ AxisIdPair(AxesType nType, sal_Int32 nId, sal_Int32 nAx) ++ : nAxisType(nType) ++ , nAxisId(nId) ++ , nCrossAx(nAx) ++ {} + }; + + class OOX_DLLPUBLIC ChartExport : public DrawingML { +@@ -145,14 +152,14 @@ private: + void exportHiLowLines(); + void exportUpDownBars(css::uno::Reference< css::chart2::XChartType > xChartType ); + +- void exportAllSeries(css::uno::Reference xChartType, sal_Int32& nAttachedAxis); ++ void exportAllSeries(css::uno::Reference xChartType, bool& rPrimaryAxes); + void exportSeries(css::uno::Reference< css::chart2::XChartType > xChartType, +- css::uno::Sequence >& rSeriesSeq, sal_Int32& nAttachedAxis ); ++ css::uno::Sequence >& rSeriesSeq, bool& rPrimaryAxes); + void exportCandleStickSeries( + const css::uno::Sequence< + css::uno::Reference< + css::chart2::XDataSeries > > & aSeriesSeq, +- bool bJapaneseCandleSticks, sal_Int32& nAttachedAxis ); ++ bool bJapaneseCandleSticks, bool& rPrimaryAxes ); + void exportSeriesText( + const css::uno::Reference< css::chart2::data::XDataSequence >& xValueSeq ); + void exportSeriesCategory( +@@ -186,7 +193,7 @@ private: + sal_Int32 nAxisType, + const char* sAxisPos, + const AxisIdPair& rAxisIdPair ); +- void exportAxesId( sal_Int32 nAttachedAxis ); ++ void exportAxesId(bool bPrimaryAxes); + void exportView3D(); + bool isDeep3dChart(); + +diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx +index 2f0853b..d0fa7dc 100644 +--- a/oox/source/export/chartexport.cxx ++++ b/oox/source/export/chartexport.cxx +@@ -119,12 +119,12 @@ namespace oox { namespace drawingml { + + namespace { + +-sal_Int32 translateFromChart2AxisIndexToOox(sal_Int32 nIndex) ++bool isPrimaryAxes(sal_Int32 nIndex) + { + assert(nIndex == 0 || nIndex == 1); + if (nIndex == 1) +- return AXIS_SECONDARY_Y; +- return AXIS_PRIMARY_Y; ++ return false; ++ return true; + } + + } +@@ -1533,9 +1533,9 @@ void ChartExport::exportAreaChart( Reference< chart2::XChartType > xChartType ) + FSEND ); + + exportGrouping( ); +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportAllSeries( xChartType, nAttachedAxis ); +- exportAxesId( nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportAllSeries(xChartType, bPrimaryAxes); ++ exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, nTypeId ) ); + } +@@ -1566,8 +1566,8 @@ void ChartExport::exportBarChart( Reference< chart2::XChartType > xChartType ) + XML_val, varyColors, + FSEND ); + +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportAllSeries( xChartType, nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportAllSeries(xChartType, bPrimaryAxes); + + Reference< XPropertySet > xTypeProp( xChartType, uno::UNO_QUERY ); + +@@ -1626,7 +1626,7 @@ void ChartExport::exportBarChart( Reference< chart2::XChartType > xChartType ) + } + } + +- exportAxesId( nAttachedAxis ); ++ exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, nTypeId ) ); + } +@@ -1642,14 +1642,14 @@ void ChartExport::exportBubbleChart( Reference< chart2::XChartType > xChartType + XML_val, varyColors, + FSEND ); + +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportAllSeries( xChartType, nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportAllSeries(xChartType, bPrimaryAxes); + + pFS->singleElement(FSNS(XML_c, XML_bubble3D), + XML_val, "0", + FSEND); + +- exportAxesId( nAttachedAxis ); ++ exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, XML_bubbleChart ) ); + } +@@ -1660,8 +1660,8 @@ void ChartExport::exportDoughnutChart( Reference< chart2::XChartType > xChartTyp + pFS->startElement( FSNS( XML_c, XML_doughnutChart ), + FSEND ); + +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportAllSeries( xChartType, nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportAllSeries(xChartType, bPrimaryAxes); + // firstSliceAng + exportFirstSliceAng( ); + //FIXME: holeSize +@@ -1734,8 +1734,8 @@ void ChartExport::exportLineChart( Reference< chart2::XChartType > xChartType ) + + exportGrouping( ); + // TODO: show marker symbol in series? +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportSeries( xChartType, *itr, nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportSeries(xChartType, *itr, bPrimaryAxes); + + // show marker? + sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE; +@@ -1753,7 +1753,7 @@ void ChartExport::exportLineChart( Reference< chart2::XChartType > xChartType ) + FSEND ); + } + +- exportAxesId( nAttachedAxis ); ++ exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, nTypeId ) ); + } +@@ -1779,8 +1779,8 @@ void ChartExport::exportPieChart( Reference< chart2::XChartType > xChartType ) + XML_val, varyColors, + FSEND ); + +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportAllSeries( xChartType, nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportAllSeries(xChartType, bPrimaryAxes); + + if( !mbIs3DChart ) + { +@@ -1807,9 +1807,9 @@ void ChartExport::exportRadarChart( Reference< chart2::XChartType > xChartType) + pFS->singleElement( FSNS( XML_c, XML_radarStyle ), + XML_val, radarStyle, + FSEND ); +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportAllSeries( xChartType, nAttachedAxis ); +- exportAxesId( nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportAllSeries(xChartType, bPrimaryAxes); ++ exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, XML_radarChart ) ); + } +@@ -1848,9 +1848,9 @@ void ChartExport::exportScatterChart( Reference< chart2::XChartType > xChartType + FSEND ); + + // FIXME: should export xVal and yVal +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportSeries( xChartType, *itr, nAttachedAxis ); +- exportAxesId( nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportSeries(xChartType, *itr, bPrimaryAxes); ++ exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, XML_scatterChart ) ); + } +@@ -1862,8 +1862,7 @@ void ChartExport::exportStockChart( Reference< chart2::XChartType > xChartType ) + pFS->startElement( FSNS( XML_c, XML_stockChart ), + FSEND ); + +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- ++ bool bPrimaryAxes = true; + bool bJapaneseCandleSticks = false; + Reference< beans::XPropertySet > xCTProp( xChartType, uno::UNO_QUERY ); + if( xCTProp.is()) +@@ -1872,7 +1871,7 @@ void ChartExport::exportStockChart( Reference< chart2::XChartType > xChartType ) + Reference< chart2::XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY ); + if(xDSCnt.is()) + exportCandleStickSeries( +- xDSCnt->getDataSeries(), bJapaneseCandleSticks, nAttachedAxis ); ++ xDSCnt->getDataSeries(), bJapaneseCandleSticks, bPrimaryAxes ); + + // export stock properties + Reference< css::chart::XStatisticDisplay > xStockPropProvider( mxDiagram, uno::UNO_QUERY ); +@@ -1882,7 +1881,7 @@ void ChartExport::exportStockChart( Reference< chart2::XChartType > xChartType ) + exportUpDownBars(xChartType); + } + +- exportAxesId( nAttachedAxis ); ++ exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, XML_stockChart ) ); + } +@@ -1961,14 +1960,14 @@ void ChartExport::exportSurfaceChart( Reference< chart2::XChartType > xChartType + nTypeId = XML_surface3DChart; + pFS->startElement( FSNS( XML_c, nTypeId ), + FSEND ); +- sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; +- exportAllSeries( xChartType, nAttachedAxis ); +- exportAxesId( nAttachedAxis ); ++ bool bPrimaryAxes = true; ++ exportAllSeries(xChartType, bPrimaryAxes); ++ exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, nTypeId ) ); + } + +-void ChartExport::exportAllSeries(Reference xChartType, sal_Int32& rAttachedAxis) ++void ChartExport::exportAllSeries(Reference xChartType, bool& rPrimaryAxes) + { + Reference< chart2::XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY ); + if( ! xDSCnt.is()) +@@ -1976,11 +1975,11 @@ void ChartExport::exportAllSeries(Reference xChartType, sal_ + + // export dataseries for current chart-type + Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries()); +- exportSeries(xChartType, aSeriesSeq, rAttachedAxis); ++ exportSeries(xChartType, aSeriesSeq, rPrimaryAxes); + } + + void ChartExport::exportSeries( Reference xChartType, +- Sequence >& rSeriesSeq, sal_Int32& rAttachedAxis ) ++ Sequence >& rSeriesSeq, bool& rPrimaryAxes ) + { + OUString aLabelRole = xChartType->getRoleOfSequenceForSeriesLabel(); + OUString aChartType( xChartType->getChartType()); +@@ -2048,7 +2047,7 @@ void ChartExport::exportSeries( Reference xChartType, + { + sal_Int32 nLocalAttachedAxis = 0; + mAny >>= nLocalAttachedAxis; +- rAttachedAxis = translateFromChart2AxisIndexToOox(nLocalAttachedAxis); ++ rPrimaryAxes = isPrimaryAxes(nLocalAttachedAxis); + } + + // export shape properties +@@ -2181,12 +2180,12 @@ void ChartExport::exportSeries( Reference xChartType, + void ChartExport::exportCandleStickSeries( + const Sequence< Reference< chart2::XDataSeries > > & aSeriesSeq, + bool /*bJapaneseCandleSticks*/, +- sal_Int32& rAttachedAxis ) ++ bool& rPrimaryAxes) + { + for( sal_Int32 nSeriesIdx=0; nSeriesIdx xSeries( aSeriesSeq[nSeriesIdx] ); +- rAttachedAxis = lcl_isSeriesAttachedToFirstAxis( xSeries ) ? AXIS_PRIMARY_Y : AXIS_SECONDARY_Y; ++ rPrimaryAxes = lcl_isSeriesAttachedToFirstAxis(xSeries) ? true : false; + + Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY ); + if( xSource.is()) +@@ -2456,6 +2455,21 @@ void ChartExport::exportAxes( ) + } + } + ++namespace { ++ ++sal_Int32 getXAxisType(sal_Int32 eChartType) ++{ ++ if( (eChartType == chart::TYPEID_SCATTER) ++ || (eChartType == chart::TYPEID_BUBBLE) ) ++ return XML_valAx; ++ else if( eChartType == chart::TYPEID_STOCK ) ++ return XML_dateAx; ++ ++ return XML_catAx; ++} ++ ++} ++ + void ChartExport::exportAxis(const AxisIdPair& rAxisIdPair) + { + // get some properties from document first +@@ -2519,12 +2533,8 @@ void ChartExport::exportAxis(const AxisIdPair& rAxisIdPair) + if( bHasXAxisMinorGrid ) + xMinorGrid.set( xAxisXSupp->getXHelpGrid(), uno::UNO_QUERY ); + +- sal_Int32 eChartType = getChartType( ); +- if( (eChartType == chart::TYPEID_SCATTER) +- || (eChartType == chart::TYPEID_BUBBLE) ) +- nAxisType = XML_valAx; +- else if( eChartType == chart::TYPEID_STOCK ) +- nAxisType = XML_dateAx; ++ sal_Int32 eChartType = getChartType(); ++ nAxisType = getXAxisType(eChartType); + // FIXME: axPos, need to check axis direction + sAxPos = "b"; + break; +@@ -2568,6 +2578,23 @@ void ChartExport::exportAxis(const AxisIdPair& rAxisIdPair) + sAxPos = "b"; + break; + } ++ case AXIS_SECONDARY_X: ++ { ++ Reference< css::chart::XTwoAxisXSupplier > xAxisTwoXSupp( mxDiagram, uno::UNO_QUERY ); ++ if( xAxisTwoXSupp.is()) ++ xAxisProp = xAxisTwoXSupp->getSecondaryXAxis(); ++ if( bHasSecondaryXAxisTitle ) ++ { ++ Reference< css::chart::XSecondAxisTitleSupplier > xAxisSupp( mxDiagram, uno::UNO_QUERY ); ++ xAxisTitle.set( xAxisSupp->getSecondXAxisTitle(), uno::UNO_QUERY ); ++ } ++ ++ sal_Int32 eChartType = getChartType(); ++ nAxisType = getXAxisType(eChartType); ++ // FIXME: axPos, need to check axis direction ++ sAxPos = "t"; ++ break; ++ } + case AXIS_SECONDARY_Y: + { + Reference< css::chart::XTwoAxisYSupplier > xAxisTwoYSupp( mxDiagram, uno::UNO_QUERY ); +@@ -2869,6 +2896,17 @@ void ChartExport::_exportAxis( + FSEND ); + } + ++ // TODO: MSO does not support random axis cross position for ++ // category axis, so we ideally need an algorithm that decides ++ // when to map the crossing to the tick mark and when to the ++ // middle of the category ++ if (nAxisType == XML_valAx) ++ { ++ pFS->singleElement( FSNS( XML_c, XML_crossBetween ), ++ XML_val, "midCat", ++ FSEND ); ++ } ++ + // majorUnit + bool bAutoStepMain = false; + if(GetProperty( xAxisProp, "AutoStepMain" ) ) +@@ -3179,12 +3217,14 @@ void ChartExport::exportDataPoints( + } + } + +-void ChartExport::exportAxesId( sal_Int32 nAttachedAxis ) ++void ChartExport::exportAxesId(bool bPrimaryAxes) + { + sal_Int32 nAxisIdx = lcl_generateRandomValue(); + sal_Int32 nAxisIdy = lcl_generateRandomValue(); +- maAxes.push_back( AxisIdPair( AXIS_PRIMARY_X, nAxisIdx, nAxisIdy ) ); +- maAxes.push_back( AxisIdPair( nAttachedAxis, nAxisIdy, nAxisIdx ) ); ++ AxesType eXAxis = bPrimaryAxes ? AXIS_PRIMARY_X : AXIS_SECONDARY_X; ++ AxesType eYAxis = bPrimaryAxes ? AXIS_PRIMARY_Y : AXIS_SECONDARY_Y; ++ maAxes.push_back( AxisIdPair( eXAxis, nAxisIdx, nAxisIdy ) ); ++ maAxes.push_back( AxisIdPair( eYAxis, nAxisIdy, nAxisIdx ) ); + FSHelperPtr pFS = GetFS(); + pFS->singleElement( FSNS( XML_c, XML_axId ), + XML_val, I32S( nAxisIdx ), +@@ -3192,7 +3232,7 @@ void ChartExport::exportAxesId( sal_Int32 nAttachedAxis ) + pFS->singleElement( FSNS( XML_c, XML_axId ), + XML_val, I32S( nAxisIdy ), + FSEND ); +- if( mbHasZAxis ) ++ if (mbHasZAxis) + { + sal_Int32 nAxisIdz = 0; + if( isDeep3dChart() ) +diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx +index 878276a..ba32712 100644 +--- a/oox/source/export/drawingml.cxx ++++ b/oox/source/export/drawingml.cxx +@@ -1206,7 +1206,7 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel + PropertyState eState; + SvtScriptType nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() ); + bool bComplex = ( nScriptType == SvtScriptType::COMPLEX ); +- const char* bold = NULL; ++ const char* bold = "0"; + const char* italic = NULL; + const char* underline = NULL; + const char* strikeout = NULL; +diff --git a/sw/qa/extras/ooxmlexport/data/no-numlevel-but-indented.odt b/sw/qa/extras/ooxmlexport/data/no-numlevel-but-indented.odt +new file mode 100644 +index 0000000000000000000000000000000000000000..e435acdad35e581e1eb627d054951a4c81697712 +GIT binary patch +literal 19535 +zcmeFXbC9O7wlCb%wx?~|wvA~|+qP{?+qP}nwr$(y*R#L9Z=G{$pHp@JySM5-RjGw! +ztxA4x-ehGZza)WxkpTd}0RR^CNJX^<8K6l40091$Zxw*0simQVtBs+qjg5t=zOI9* +zwH2+Cl>v>luDz)}jkS%Tm4UUsqotvh1C4{Bi^H$~0N`&y`*x;i;%KR7 +zrE6+oPwVh6md3`)IOLa%C=4V9*M}hCx@al8@$`gseU^bgCmis4@CDXC_`ocf5e)eeIq2kSHvvJO|xc0Hy +zndW#2w|UQLR)WH?&cqCFoGOPkl^@12xyCkh3x^DRec3HcKa>c4p_%mo#Q?|KrwStw|R3T5? +zMN^cNBB$Y@)Y3FL_2mW6i=wni*D-lObyA^SV{&y#VRtsjyg}{BbhU76TusINAw1)2 +zo5^jxgH1YZ+JxO23w-AjIor6DY{5(3a^n1Q +zicG2$r#@%KvbftAA23-C@edRL>K3>ed$$Gbb)%p0;?d~|&rBM9A52zG_* +zB|uY>A&`ghNnlKSq7p2|czAZ@o#dhbC3*cg_w+Ri<^0w#_pqb!!g>Oz1(n}-mBYE> +z-ec@_znMYp+#lSPvmK7y7{wMfPZdN7iGPW +z>!{sH2?`k`wGGo{Q=!R)rTGYR<;ahM0Q%8}&^>s!S|pv+GW$o?72qF1E63EukSgD3 +zY(QW2Xmg_wPNgpwS6l2!F~7v|doQCu3?=aD1cdh_4kB*nkg;|-W;(f_Fi1|6#hz&; +zM3*$q(iOjp0QZ!YZH%`CP6T(@o8rf_mMJql>;=LxAYz&Z-h}K(>a4Ahuenw3<_)3A +zYb|c|)UpH-rqF5s`ML~GG@`6=LDtq +zkN2CZDcr9{o{!J9BHqvSG)`1iG5Xp{gt$d@5#3S}uOegWac-;_dx`^;wHeDV{i>qyNRgV>SvWXGA4MaZR{3^!jr4utvE?75WHYJU=S +zxT;HQ=BL*LAMW`@Nwd)(6PP2mFcf(_s_~3Gpe(F5EKQCpW*^gqj@atf5=s}R=6Z!XetXXO@9AX+~J7&*n{`za9oe~T&Y +zGpk+*e-_e^ggqoKSIgZUC^Kz>dSF&Ve=`1l6uywtK|cpcR2%LG)tlM@94dmx)qSY^ +ziWe8oW0p5~ +z4hXnrebfvH;wA{G)-_Ht^Rp5TclVWYGGWI}MYjn2>}eokv{Jcj){087=h*EDbO@$5 +zfU=-#zZ96{*RD|fD7taK26X~!lH@^;cq!G0erN@$*5{N#DfB__M+_D>69ir}obOW( +z4kIEkW4(<$(?(^2G7+`1S6KO)`cwOKqTXv+wYxkO#xDOfZgN@!g63O|@FrX?9^WPk +z=+fabHB8VC^bCud2Uc^W-9%7XTRInx)!yw@@cNnUMkFV1-bGM+Z8^6e6qP1S+5X{R_HX($~^Z4@t!&z6&uZdx;@ +zB%!fqpuB|)UmNqkNu#{jxM5{P{pa>_Sg-x#;$p6{;?*W_-abFBDJ0+Z*M9B&5=Pu} +zb)Kc-og7P8X+?eY7)HfpgFe42YgY#f7p7O`U?%U;R*j>I45_8_mGz4%N8CfMas2od +zcBE3ptI^TX?(%YZ5Qw6zOh1pPkpmg~v$yV)mvXaB#KMa4k{dy#bWxN1__XB3yyeat +z;FlyAxLTpE(<>+dfYtZ8=D*)E|8d|kbkO~~Uq-}@S*6pV1wMH~3blb~H^ZO^qC}L^ +z#5T$o$vemBf9aZ_W1>&dd8YG7YEvDqigSeZhT3=bdG{c*9trMcbUQRCt7io)Kk-3O +zn=4s3;~g0Vs+b12`deen4jTB=%qS44k7dM4VCM(f;0#% +z6Hg2Z#MxPyJ=mXJRal}6cy9giL^e~vk3C|?*Z@h;J6O##6_J1hhJpUcAtd03;&goN +zorbYImRP@Np7SFs6=zH?T%U=X*1<5}q7r6%8N3Cy<)Eh|=(FN#Vo#eY{q>-BBPXI3 +zEe!#**->b__m{lXE`aC{8K-y##5yv_IJTZWrEJQO6KXv3GadsxuMp7I*!&gfE(WdH +zTa!W71nuDqnz!U__tuwJie?6ddO#4F>B9ChTo@0Wqn1D<34tbM=exoU``gP(<)OR2 +zC+XMd!A+3YX^an`0AZ$yOg$+dyA;4dS1SBb+kJyx!q_;fJSIv0$&2?2b+MjAP2wMu +zK0{k8&-^*TVjmE(q6_8adn747afA-K&ugbm4aK4(2wmnQ75u`p4$r)yQ=e1eLhtSkA6gDMlOafZQ9`$EN+(jxibzZ1DiX&eyZ3K +z#*!^_(^uwDnqz^KcW@y!QKNtzY+lE!Ra!hif9DRV=J-4)AOHXv@c%S-pufW{dqW2Y +zQ!8Wpzw>87ZNmz4=x67ZLa`8JJ)faOJ(YU7uz$XkC<`$H(a$_nclvd1BG%Ll)$#FE +zf=~cV_8+lK6L8ajme{1y@>{4EhGLl4c_z3z+BwEf;;K1fk}C%QCke$HEA~c{Q_i1< +zj~V(&m0W=M*prR+XG@EAl-*QToaId!oEA&U)(4mIUQTJwZIK|tY3iL&QWX-vAd`lF +zzNe4q-MVoeK`HMGanue6L)8|S6Fm7y^HOGNYlf!~%SM*;MK;=d7PRZ}@S;Ii!c=PS +z9;=RH?*FF#X_N2_)-F3e0uv+iD)&k5PYFWLCz;JsAvY#DD +zoSm^+Z%%6G+c}Op9+$S{FV)U?9xs>jCfV!^u1-`~^lt$dEoF6G^t$bcNW|2?dQ1aj +zPC%D>_PXI2vpKL8@%^sM4}d#yIj;@f27+*34-%el3mB!0({>DLI;F#m?CB&ce_=uK +z_TR)0QbBsDKiwyrQC4McTwh +zvZ8T9a_F_Fr_><7oFvs+Ztl#Cd|pd$vm|0RxACM=B#|nO!+%mrP}nl8^Wx6Qv>U4` +zR$=2+OV!tomyGxw8usG8B|)C5xdI582-rq)%^#XE~Y3 +zp}d84HFEe$|KaZE;yJ|7@PTG1ecCJ%`9#ZcLoiKs74AJyAq-m)+bOa(bp@@0XCWq +zr|78qAZ5dxa-;1vWn@{UYs`l+vjS +z&N9r9d?($`GV^GNJTOv;=jEUpt8KX8VvpSknGxdyEYP2ji8AK+=ic}jX{>z7mu~pc +z#)fz)eitYZ*&UuMG+Vw48>QV5P;jU_8ff9PG?H{bg;0&{%Ci#PpJWS>%^toN2n$v4 +z5UudE3PnQ>q{c56qfW7RI1X*eOsT~Wh8Ye%mr`zWg}I2qQX@USRrT3tXluvT*x8Lt +z=%UW<;ZViw0;L>w8v_(RC7MRD2RX(_ARKq5{%3OUmcv7o$xm45{k-KzFWW!5d-tgc +zeb#iY;GxBj-BPG1X6UVcC#FOQ=!zmLFjZVqk0L(BUo@n}gEkm~CC^$&36L|9#zEZvxv`s`*G +zya4`Yq`mGGO9NcE1&Fg3@Ng&t5b^R +z=CSi7FK=McI+eFYj;Qmp)+p@aXM|96r(4FA^T|uO>y>YaCaYZ{LDm!~ueM5WKH+LrY +zT1>Ba7@o)xJRu@kB6;3Id89MPXC_RMgR*%ytTWGTCht`y?^JG|O84()#{;|yg{M`F +zIkT8u?;BTN&$n$!Q!@Tt8KBxhJ%4nsZP7dsL9>E-j&!e+OzypyUg`djt9$erBk`FJv;MbOzLv>mQw<(7z0}m +z!c;dD(24zXN(@!ZSU*mvd}6O&>Zx)3y45{gHwi%vOb@dJtE>~g_}&!1>Z`Gtw*0=j2nEl}N**0O#++Hd`cbDEfkImdLvQew1X +z0O=)u$#6H4C)HZg)*3@3k@gL{b85j;o1%zwK8OgHqqIvjS=K~YwjX+!%4h``LZVGi +zl{{xH^UaG3kx_S;SIDjWPP6x%o!QI6hFrR0GGs#tc`sbc=D~2JT!M?+VBt8bk__(m +zo}QM8jLwRcl25XG#;#~?b|y>GfvPIcgewlD1_j+!$dRJRVc%S{3#@+xliXf#jw27$D&*EolF9a{E8p{Y`HFS34sMYh4FJyZ=qA?@YR*p6>sy)!#n;&sJFf +zriV6m*2Z>*_V)j?<-fzk-a*&F@jux8yZqDN8-)LgiLSoBp@rc$wAOaC`i^#X|IAH& +zC-=YOtiOPMhgtvl{(GqZU3YA(Z5(a>BKJRljr;BQzjnveQrFnfo>sur!BW@8{-4JG +zZY+O;J4;^Lv#dj9ZcQX&1U!!(p|>J&H{F$N(XLN;++iCWCE2x*x{dN3e;V;(eEA|Eq(%cA{IObPBnKE1@8sBfaxQj%O|+%EOq9OnjZwg}^O(itvgPunroPa3 +ztLmMEEchn#j9;UV>ThwCM63S(X7x`dvmieJ0Q|piYX19k)z5GEq=gmvsl{bPX#W?E +z-$8Oke2-Nh9(2%^XK3&l^0Hg%uQ(iv3y4-Qoqq9{ZXuo0#|zQi#uFw-v-))l{m-ws +znq>>wNfc4=8JF^9Om9Pw?8k_nO1-SNsM`$7vxPx&CTgMBrR?D+y3N_p0-xD3lU$(# +zJc-%aC!dI=ksq<|E3~3T>P}$QMh~UQ?`rxv<4=9Ar&e(dhE>PE=x@XfC^${RDNfb} +z2Nbu|^L`$%*!BlSb-!oEA*Bb0utUEI+G!VuNBC9ZU)8vG>!hFZK_As=)Qe&~-(ul{ +z!|m&_WfowbSm4vpocYY(mh;7<+Pki13@tj4ho>Pd37Ep5*q!=MlLvHxeeqV2sxXsa +z!MiYMY*CJTBuYm7DfH}RbMDXxYC-7w^m)bn3-1FM;UBDTczOQEqsQNSGkXVD3&VdL +zJT5#XqxOcK4mZ2}hD9)+dId?gq8yCTH5W9S)`m+jOUlo*pu+(ba^>5lV*tesl^0KY +z(Z=n3dH@);T%cW8>TXBFR-Tu}dnLEJ=t%wGZV>oEaAU>9H8qJtYPx&pZMs7$@^0-%ion0(2L@u!| +zElo{L_0|yp@9Z@gs4g2LP}3wh3Rc2-vf +zS1EVIUqvi4%4sw5nh0o3<^}g_FCi1m&2Da~B`aMTxdME!Cw#F#9+dfwm&F`AWnrCY +z&-FVd8Ps8x`PcO%65?DqhY+nawQ3t|h9mr-t02lbC}cC?(P=}t3XW#SFEf!>w8$Z`z$G>68Rn7oPg==r;=2sR)1>HHt0 +z@tsH1gklimw%?w2FbZypp8(#H7Zr|~4$4$i;ab46oi&yj|73A8(z-oJ>#f`lY20Em +z-#(s_nml}ro#F!^08%E(RcKrl#5Pj{r<4r)I(Z%D5k0iF#A;`+@o%^a73U>4QtMp| +zGFEHJIvtbf%@?_yz9DQ@-{8;-zR~j?)LyZbhaIBwtQNk|1zH-kInk>mE`%luljl~^8P@*-1_|N +z`ds6Euj)y)Z%S#gPit%X2!89h>V=<+DW)cbXJjIBbIL0Q!McCt+~JR&3w&Eix!Mnh +z@+YYcZ_ocRXdx}NdY9F7T36-!@l)>N{x +zQu%Y!)#)pq{(gnxh#~)py_x4wk@U8R&HW~~~RfqreN +z&3&an#vM$sF2e|arZ6Ce;r<*c*;qhg8=DMZtlnLB=?=Ie#Qo4XV^vl$r$enh7M+bJZkrKF?=jMYXvF +z<6ZCLI*3mz6N{OSspU3Vgyxj`A?|-nB?bF*z`Rzn90#zFl%P(vx-@GQ*U!pNA?A-omXW6(i6e?O +zgkm$j4hF76_Vm@Dur|X3;iyXEg95CwkEOYZ_2pqx^eMC{-JE}AwPL%&GE3XevP@Id +z3?hvU0mf2X?!`^*SBJD7KK6bF*84tmm?AmEq +zqPq)E{+M%^(KrPwUmbE^;7d?MdN-DV9>PsU1J}a`q$U=T9)bebtjE<=F)~2i7t=p^ +zzCQ!k!rJ$jbaOzb<$K_nE1e`kPxx?4K;jzWqG}nw95YOV3Axf(G@C66A(C0nlDr{^ +z=P^Le@JZq@Cd#Z!wGBn}u)J?k>);6u_23PbDN*sQzKaXenJqX?8#Y$p8xuIK$)goG?bMKS6piv2x~$WW)7}&$&GOkjG%N +z7|);qLH%WXM!r%M$&d|kOT=W-q7VeZMfp3qIT-|{(y`gT3|2qPvbpx;`lhv!pj!$k +zn^(B3SlSV)R7s-JNb#+*m2;dyX!w{hDrI7siC+NUcZ7bKAUpw4_+hf0jNkz<0OI~G +zpUMU}&LG0cB>P3=ag2x9Z7D1$4@wII2%19N2b=&nXv*;`6+)IB=uX663oLYokINBg +zq%ypJMF_G44Xd5u9Ym%NNU&*I5Q!L*&EJnnsUCpxXXdF74h52uA4MDy%qon>pHu34 +zVgWK8M_({5kE|c$)nMiY{d+{z#i6KS?UXQ-wdLhg#ScEpDAx=!8T +z&bURB@vRw`S-#X<k?hln-HyN!`ZB;Ghycs}d$^rv$|x$hO2 +zcdt~_VaxIaJ-VGtRx+&Kvv$GyHy{ntjMv1Bh-=%RxbVBUKP2Ryre@qAuT*diL{|)0 +z*bY$pr5Tfj!Y$H2w!Hm_@-n_^4k%e>gcFx1m|L;su&cBCL7>O` +zuT+HQ&vkxEQxj{x8^c-=Bg^m$u;?@$>>P5Sjum!xGv^CSmKY$5YlPB}Jzj)Fw)J>a +zV3SOGc#?FS7VT)8u`@K@JBu${ecoQep&>YjpS8@5+voNwKt@yCmLj#mD3a^~HT1{M91|tTtrQpRh +z6IJ|^9MTa2uO0_C89Be$4>36Y;Ca9ita~&(-pr23XuhY4jJ=2H{poz!JV>=cxhY7KUKy+;s#o&)q0Gf`Pr +zPa8x`n39uOKpevuF=?vP7pGLdSwpop3J!VMoV(_v<&~mw*-*^>R+7af7e(U7WY%24 +zcj(d)$fiV*Q)%^lgzu+cg%83dP4hPD=6+sZ-gNRwDaMU8pLe9i-hb}usO_&hISn`D +zNzo}LcoqD$HHx96^yjHTNJ&m@Wjvncq~fmWP?$e{JYLt|`AK2sF@Rgq(%2;;y>TyW +z|HZUwb`WuUNmuzK3U6T;`x<^+yH;Rq6F{ivXWUycw|Lpehk<6;=_}(nhrQOhed!~d +zFDvbV7$Spf39)RpGklsG*ig|Utoi~i1A**dxlUpOXY!o`0zqteq2GQE0XlGr@RiJp +zexu|`TluImztQ17CT3eT>TCCOUEGSu%gcXj~U08K*-e%@z>&Y1HTX3s-iF +zy{&6R9-2on5&Nx=r?wnVU_ZIb@7RoBc;^Xv8M*zr8spYl+0$ZqNEwb`HG{cX9VC4l +zt|N$vjJweoLyDi*W3-2F6B4s-a5f-H%4Gf;{D=>SzL$%%z8?zj{&nC2U^mC~uHmG6 +z%e?3MU)2}fYqSV!bjy6+W_hxXN%YI?rBo4%^G-pzR44P6wr%8(bM$Ba7?pmp!xIt& +zxC-L?o)jTRRJ*H8bW-`1w@eG9sSQ%?bs;4oXR}jKD95Gz9cOVxj?ApQX7QW3lqsQ +z>WMt-YY7b$VpL@r8_o@a%}0ZQhuu;N-YZ%{$%* +z`)Fy|V2S=PA(>EtZs{yhZ4t;hzDl_;j%)o9&KS<_IV292*UKq^7U{pFNJSak{ +zkBh*LSPd{l=z7Lu)oZ!mIhq3`GzJ1yDbRo$W6sn`iJWfP^}u*eCWox4O=SjX6OB#W +zv81mK6B^a54rtvV1A>qN`=l=R1ZKSB13n%UqqGVNT9-jSUT7R%7(I28cCmxsL|*-< +z{aZRl^X2z4h{{C|9fC^!F|d4^0=zJ{3CGp6aYonm<5SunUbZ@H=wkSWogaZS%xlU8 +zYXh~F##OJ>{q2q1wBYYXHR2(Uq%6#7nZmo}srUQ@4$ArUZqGGj`JAvK^6GtjwWwdh +zWpPnkuXyz^b^Pg@mK0(fWwrL*l8i5)XY0|m1Ejc3xDHXWe{9=`ju*G>1)Z|OaQi3W +zvGg8W9i9$rr$o)%?M6hWpAec`Rjk=A2$wJ1uAcatYq|4#c=b+*%WMS(62#pc1;ZuC +z8OICOuCBMvs62$^wbk)V)VPzI=bO~HUBdR+y&whPj1v8u<4v%OSLb~{&sQ!ZZ*WOY +zcwZ&OS8>KiV%4w$byec?{-B!a65X7WsKOP5FK>crBv}qJ&(IAYKz-%l=a8K-r)!8%*lhG=BtIRPp +zHF4HGx9C=$;PIZx)re}#Q+ib`Yu#2`>u)D(yg?0BA&p37;gzSb&M7WR5BLu2LQ77mJ{=Bp-LQ(3Z +zQy{m*Z6zKp(h1^YWT3=3Kas)_Ls%(06uFIsgiiUlioumb)Xw(v5hKP&Gu9NX4o +ztk#VW&jaqi-6{Mzue`+J;OL)qKp_)6)-(PLM5xC{o4pKH$j~oH(3ihijLK8nPfM#} +zv%sDCnaD+k9XR1+2#-HzPvu-W9VXQ8w{q^_fsK=Ou42u|R4)6%C;X86SPnMxDdr#+ +zBDYnu6XFChLx+|dn~jVprZAZkh)0AV60KJti}r|1oq#`2XcIh5Kg=eM64eQKkFTUlS32fout0@NP=$;5(Q;y6K_V%*^`O=h-0t> +zm_%#MR4Wpbo@~{2^i`a_40~1VrCjaQ(8nofs?j;tG*`}wT9ZpgWo2=I=b-F +znk1=ZKP9M0z3))*GLICiI2I +z1#A)qJA~RLkWsrMfqo;hSE_a)riOV%Kvsf&NZhm@FM$KR&D`nK{#@0(3cgsj+~oYs +z0TPfggr0l2HxVTYO|vDVsekY1BZX5#l?A*QRIIsm!WK9yJbnbooB`1_(Qdlu+r|p4 +zSB3?bIILWP1VVJyBkJ!&))kT2GB8+bvBqbij%d>dy>vPLWs?kiG--663TT-}wv +z4$`1QC^$E=el5;(@OX|8qfGJ~`Q^CIcn#>L>QW~A1k012(bUZNCMS3t8+clNu80GV +z5vw|pWhmEN32Q4Q6?vgXPgyv1MQA0{6^H>R?b5A4ss}cGmA8qN@!6~Z(pn4RKnuP1 +zba1j&G98Yp;Qa|pKS_T-R_^|&K}96;G&i6nm%xRkAd47!us!ecr~awC`L3!23rbMK +z3T5|j4Qvh7BN{#z4Cr&g;bnij*>wR4`avanLM8e_B|5Xj;NdZ7;GOpqEhQS~Jlv<@ +z6cqZarY^nus_wo|x5r_g+sc8U`TZ!m7$`?#VxzNULQ~ob2NC=UYVaUzjIFQ9Ief}L +z*o6k9xPGW+eK3{Wh(a`O5>Gw(Mo8}%)+QEOV`PyN$%%;3^twZRgGp7+r?K=prv)JU +z$<-0X!}JEE=y7&)(hD?uC!9FJ$;wzf=S1L^I-=nWV*X1i2s>l(XiiDLbyY-@xN=Ej +z`pijzoMS9T5osK>-+vI$~XLalv3-70_%&eIUpS%B@3b%$dwI1J3^O32lup +zgo;Ucy)V?*N4$mo*)l3ilfE9J#6#bf-w8Lre?H`bfo;>fzT4KUYf`aJaJRX~=Q-ju +zm}Q7os2$0bExOK^{%6tc1~972dxkb|@rPxW*Ga__O^qcg4Fx^QJZKRXyDcUS|HXDZ +zBZsq@$dSy%@p=h*1}Af#eUXvF<$U;LM(Rw9LLT*K_5L{pgpsj0-S^N|R1wD~V|APo +zf$Qpsk~4^N-d3X)R1wR+b&iR^WpzZqGl+XmsUVb%#j95(d!0vOx@IFhkB8QL8mTEJ +zYC77YC}(RI-v~L<&p1~=8?{Fq4HY$F0ve{qb4|joxAf$|wIUc4{pt4JF&#KitZ8IS +zbGz-2kP$rqsKY7*^2IQt!*QmcG;6AxCd`A8rJ;!@){DL@cy}lKu5K<(8I}-WR7l8f +zxI9IcuNTRrVP>yMeph5u3BC5Hvi-UYx4We;*f%r47Li|AmK*Rzrl-agZD<|*v|b;M +z$Z)lbH=}%TRxFWav}w8DdWiNy%HKkUqdYu!|2?O^aZ~v?3($pw0X$=y;7a}mP3)R_ +zr60}`J#KoqWVy?K#E^P%=22HqP7xnMp1U7vfL&DV-U(SFzk@~tY|vyf;G#KEY;hHW +z0~ps0)=>j-w{9r`M3EAg-MS|*EykLWuUxVN8@GX+zzJ*OoKCl8%V&BTKto@w6&R!) +zta_~lc8AK+A{gJ7;^)7~MbyO0sMMk7FqBeK+LN;U&>O&d;nI1=1M9!9*!xuWfVeCi +za+y4BtCXt@l)a}>61`bHUdTj#QvkK$jjGmNV2YfGZ`aSi%>BCgmbq!v)8|;dv9zW| +zgR0Px*f3&O-_=*53v6E>rlJ0z0Q0MQ8roq`gV$c8b)rF)w6UpG#u{9(o#WcB%1roo +zlueaco6YG2V5qoTioTMNH~66oR?@{m&O({9&uuQAglaNmq9mWQ+S%asdH;^vU|I%a +zyORZm^5MR+R@=G!CboWHd}-2t#y)kOv7@^=POAUqymYSJFYXqY$(w$pET@@~ObaSOD*32ZABFr=KVGK%L9O(CYCy!N{5JcLvX2oE`Reg50C +z=k*@Cc{TV2NyACBqe6c)JH>YAcgLjpX3x=+T|(W8@-;Fl2TE(t+VZytIqiGX_Gp&0 +z6x9BZHR~~$&valJu{}JFM&#h8CV+s48By@h-)od9gwk}TkRXhCFp9=kU-7OTW4}3q +zInx|FAqw4UZiChDI0crk6^=V_)!XoL29$V(9=kg~REOA5uWwAM>V>pUIaKeDW!KXs +zm0-*{MfR=TRy9`D>pCRVC#qU(7K}Mtu>{#oyTno*1fvY?y^JRmlWe~YI*TZ+g|UkH +zFb~%jbeY%OAypj4xzr2{3(7{ZX4O^8Uw;%J>z$$pBif-=9(-Tum*YriaN6_GQVXPs +zyG&`e*wz5x1U5mk=n^B}A(?HCKSqxLbb_6!2?PuLvEKVp&}3+6FvjKQC@=6rQY%1F +zfM(SBMWbsvaf<8raEEHr*T~5Rd*p7Ho-xO};pwe=`%7xjVr2Ik$t5FSLkZlr`!gPk +z)Bxdqt~+Hw*WsfYsX8)>1*&?BtleQ}2hfs15P#SXPj0`XzL6qvAm4$lXYCWK4G9a! +z5w}St^8;Yy8Bw5KI!MtXkcb+SR|7Z`l?$jDj#eDHd)bT3CVH7gtiU!j=8qi`TmcG~ +zROko?i-uc3D6jq|g>-v@`<*g6y){&V@yuRH2DyRc8A!I3svhZ9Q-`sblEDDn}yflGPsm>?|L>-mxRWiDC +z@<|6hBS}~a4VeLV9I)iPShA@fzUiOtaf{yZg@$J(Y(G6H +zumm7N3k2I3s=|Vzj@->aRg%APK#%$e=c4ygjrD93yl}boFl*BOf$eilbxJW38u^sPK<`g3|0`)rrtkImsT +zLo+x@f@e~wTf*)ZgU8b*5fKbdq{8kRgU2lqFOYsZUL(tW|wIm8@78(quT~fqD5@`a6-N3ig<3qvI2Vs;(W6eI- +zidO)d&$gr}*fphlX^Mm-ZM!?D-&O=3nP1yUF+~4v!IP!{q?m_wWdXo6!eGU>g3Vn7 +zT5MRqI88Lx{KIkwmxEeJiJxAr)FknMEV%KGe4|Gn>nR;&gEo{sDnVh%B<~^VT{g-ZE9g8fXk=ib&RU7d523IRe_Q*EjkKw^v;o{0ppbn +z3GFq#MqS)u$&}%00W(S=1Q8XKGvOFt7u1>J<7oskBpLU%!WC!43%rne8p(-58eQVF +z765(pX6@1owt!qvTvMT_{{x*n{v%y{F0gilRSei3qqFC4U7t8yu842k4ck%xwxmK( +z++|31H#>-|5bw~e!%jTrqYlzeysEQ~>~am0A=`wM +zPAW}i1s9m;9j1dl6*){K@qtccLD!dc+)vn=4-s!$M9dHOmZZ-iUTL)HM$C@^a*O+` +z1HIPcqi2AN1CwvMynX%;`d2plr~H@xl`Z}$|E1sZkyR_%aq)&sJm2KH_9RKv#`?$_PDZt7rSJWpg6lCSAI=j&^;y$oRfO_t~J +zUN$>SFiA~VcGTX1kWOl^ayidse4Nj>p?e0n*d8v&y`4uoumloUwlD-i1UAO~^Nb)T +z)8~$NB)o@m)e`aP)Ciwz$g918jaKewI$C;CG4J=o!*8`|x68L$?H_9Rf2e`~s!McS +zN9DY|UIu`{3pO!zYwbFN<0Z>a32utI-n!y`LWoDhgbE!)9;gwf>yyQ>g+rZ;|4IOf +zI7H9SPCZ1UEhUnbk1SmWT=-&CRs8AerVa+Oz%=x$_!Dqr59?Fp?U6hqrPa*Oq!EZ^ +zf?ms!xFyL>QOQWre?+eo3eqx+9c1pib#f;JOU_xqy8DspYSYlkICKsEas3N5$Qsj7 +zF%134lY>#vGO|=EYAB#Zs(yP=^1dGjr65&^pOC%obRnB*VojP}tnBHyR1FaX1@$5{ +z%m&k#OE~?BghOi222c8@;ZdtjN(Gp>cw)x(MYB>%oPEht!J{hs{N;W8^!HeHEvX6> +zJK+Cx+_(3r(dW_jk17efO;QJvDAAar=0%#*kspc +z54wI!gg4`7(A}~`p27wpk~$aLDo%=L1tin6`u&{hPqs8^I%8AxqV}!>XzIQDrpojJ +z!}RCM_`3RVg-si~pu`*C#@O@%({>BQmS?Hf7pZVxmJl>*mJknh4{!!#PJG;s=el)a +zM(N`Sa_E +zm`|9zcISQI>g7sqm7eT!31bNTWf;A9XMc@tHUKOb8Hl|09{pRJUr~s2D3Piv;;_}a +zePq_l%{n#KR2c2xBCcNp`!(6to79DhD7mo#W0|4$k8lQ$rQeJb4shK$|L;GrgI~Nc +z0lU_+l4PONQI0aJ+Z=T2>D)E4b5C_$@FZZ@)Hk}KrWQyD8?!>V+<_7Fgd>m1+9Cm +zuFaAwA}gen>K;))_W&kg>jqBZks89^pdV}jP(xOBgGWtQ1`Ek>koSh$`S*6E*oBQp +z;hec7PR__(WrJVCI=x~iWUGLzKgAn)Vm!!r*E7(r-@<^}WSvJqIy1tIV4ksEX2Kt6 +zvg?3t-Y;nu+q@?cd0x$a_0{A9Re{!QKHC=pTv9gP@?=n;K0ApxC(WahFSJxl-dL2 +z*lMPU2jiT&-rC}vLehfqjKGc?J)9b3#U0}1epUG$Ic}m^dvNCNwL&wL+Z(~fYNj#$ +zV?Ua~>=-9D*^}$a`HFNT%C4X%M`M{@rs&uEqK*(C7ZvA0V+e6{$EkhMw;uc3IS?rK +z1Gnr>dbiXw-cMl{N@pBe-;7qgQ5Up;6RTP3cnHRmt1izP#jjL#G7m`$Lh$G&)t7`q +z61X#JnXDq1CEyhbYi48fk+U9kf)KwPH0)G@m^4JtsRXC)I5$FN9VNNmSzFws-^TkE +zY;R?IIM0f#%R%sfC~D!y|W&Hsjiu(}BQ|FJ@EY5m_l(7PfAD +zxdlpkLBI;sLR>bySTUCexZbbii@QH~>4a~w$~q=z$zgy~8TQ&C&s_vcYALwSGB>vJ +zGm-7C146Ak^+yl$HOstV`;o0o(T!xHrJoy9%rn2&az4;j&kPd*;Ib*HV3aTCI?dMD +zj8))8qtpLPA6!Or=@{7R?R(iqgJ_^;en&D8BGPwddg8&!O@vF2byR`W|zqG_@=XriK;+>|+NmDpyYS+?QQ$ed8=9)Tl# +zNx1yI4)lvp`83vHbE1FW6!a6x@^jog^OW)oZ?;ui;DsJUHbpk*U$+hlei1iTRo3m!c)8Tsa0Y`5LKA}fyRiZZPvHM?^xM^qM6l}Z6*q@2>CRu +zIU3D%v3UVKV%GsR=51qvrsmiP9Ui*5OC8SLK7euttviG;0am06DW8gB$=X(r{o(;> +zS+tTpN|wgZOA=WLLhqbUKjBn5mwdPqQC>H0Wn<)|>{TwS3^0cRKnbPVIKaZZ2=;Yh +zmOc_$(BwAs>e8hdF{q)eSSB6eNGq!lVcF&>AqcryYG=Plc@oN}h~yzA-a%9gyf=7( +zjEKlE6lehfy0Da_jLg8w0#E@@?D?=FW8TQa=%feGorA!htlW2_1> +z329AS(XS@!3gArQpyb;)5OO0`N%^$|uWb5gKEl_d6Oi{Pv;JM9UQA-vC~ywx~AKUPy( +zrVZ9}yxdk*aguxVLL$=JDgibH0QZ5!eg3}{eSP&+&FOBzk-d$M6JO`w`O&&r`P{R2 +zb3br)+3YG<5t$`?Cdqo^2CpZZG)$i}m}Ry%#AdQuCuL?mnN<4V2$$=Lj^F!?k5_-+ +z{V`^D)z`axdf%?O>YXk4+x5IG?CZB=!_Q~U-k*zl-|YH_=W-Zd)ny9@nFs&w#I5~5 +zsXHx0rFY7FZdsE_X>JykM%?q}T$uU!_LOX)A4k=Fb*^V0Zhf`j0Po@*D_IuXJ@EJ} +z^83Rwp);|o*mmvUXl`%eh|_#r|7q)q{cTBgZTn<$J3Y(<4MS#bli+3SlAfY;yg2P- +zUeoQ>H`RDP_RT*dByu8NaDwc#}}=HS?CLVN<4ip5amohGPut( aLRSpace ); +- } ++ // put back the new item ++ pTmpSet->Put( aLRSpace ); + + // assure that numbering rule is in + if (SfxItemState::SET != pTmpSet->GetItemState(RES_PARATR_NUMRULE, false) ) +-- +2.4.0 + diff --git a/SOURCES/0001-LinkUpdateMode-is-a-global-setting.patch b/SOURCES/0001-LinkUpdateMode-is-a-global-setting.patch deleted file mode 100644 index 13aaa10..0000000 --- a/SOURCES/0001-LinkUpdateMode-is-a-global-setting.patch +++ /dev/null @@ -1,261 +0,0 @@ -From 089026b255697b45c606a7a86d96995fbaa7c8f7 Mon Sep 17 00:00:00 2001 -From: Stephan Bergmann -Date: Tue, 23 Jun 2015 08:26:36 +0200 -Subject: [PATCH 1/4] LinkUpdateMode is a global setting - -(cherry picked from commit 77cc71476bae2b3655102e2c29d36af40a393201) -Conflicts: - sw/source/core/doc/DocumentLinksAdministrationManager.cxx - sw/source/filter/xml/xmlimp.cxx - -Reviewed-on: https://gerrit.libreoffice.org/16422 -Reviewed-by: Miklos Vajna -Tested-by: Miklos Vajna -(cherry picked from commit 8110d0c3cd79339d1d01b8ab2b11bee72551f083) - -Change-Id: Ida1257337c6e0916f2228fe053d9c9f085183af6 ---- - include/unotools/securityoptions.hxx | 2 + - sc/source/filter/xml/xmlimprt.cxx | 10 +++- - sc/source/ui/docshell/docsh4.cxx | 18 +++++-- - sw/source/core/doc/docnew.cxx | 10 ++++ - sw/source/filter/xml/xmlimp.cxx | 78 +++++++++++++++--------------- - unotools/source/config/securityoptions.cxx | 8 +++ - 6 files changed, 84 insertions(+), 42 deletions(-) - -diff --git a/include/unotools/securityoptions.hxx b/include/unotools/securityoptions.hxx -index 3bd8807..77e4720 100644 ---- a/include/unotools/securityoptions.hxx -+++ b/include/unotools/securityoptions.hxx -@@ -186,6 +186,8 @@ class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtSecurityOptions : public utl::detail - */ - bool isTrustedLocationUri(OUString const & uri) const; - -+ bool isTrustedLocationUriForUpdatingLinks(OUString const & uri) const; -+ - ::com::sun::star::uno::Sequence< Certificate > GetTrustedAuthors ( ) const; - void SetTrustedAuthors ( const ::com::sun::star::uno::Sequence< Certificate >& rAuthors ); - -diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx -index a3fb7d5..bf1beeb 100644 ---- a/sc/source/filter/xml/xmlimprt.cxx -+++ b/sc/source/filter/xml/xmlimprt.cxx -@@ -2630,6 +2630,9 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence aFilteredProps( -+ aConfigProps.getLength()); -+ sal_Int32 nFilteredPropsLen = 0; - for (sal_Int32 i = nCount - 1; i >= 0; --i) - { - if (aConfigProps[i].Name == sCTName) -@@ -2664,11 +2667,16 @@ void ScXMLImport::SetConfigurationSettings(const uno::SequencesetPropertyValue( aConfigProps[i].Name, aConfigProps[i].Value ); - } - } -+ if (aConfigProps[i].Name != "LinkUpdateMode") -+ { -+ aFilteredProps[nFilteredPropsLen++] = aConfigProps[i]; -+ } - } -+ aFilteredProps.realloc(nFilteredPropsLen); - uno::Reference xInterface = xMultiServiceFactory->createInstance("com.sun.star.comp.SpreadsheetSettings"); - uno::Reference xProperties(xInterface, uno::UNO_QUERY); - if (xProperties.is()) -- SvXMLUnitConverter::convertPropertySet(xProperties, aConfigProps); -+ SvXMLUnitConverter::convertPropertySet(xProperties, aFilteredProps); - } - } - } -diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx -index 13855e6..3961186 100644 ---- a/sc/source/ui/docshell/docsh4.cxx -+++ b/sc/source/ui/docshell/docsh4.cxx -@@ -48,6 +48,7 @@ using namespace ::com::sun::star; - #include - #include - #include -+#include - - #include - #include "docuno.hxx" -@@ -423,12 +424,23 @@ void ScDocShell::Execute( SfxRequest& rReq ) - - if (nCanUpdate == com::sun::star::document::UpdateDocMode::NO_UPDATE) - nSet = LM_NEVER; -- else if (nCanUpdate == com::sun::star::document::UpdateDocMode::QUIET_UPDATE && -- nSet == LM_ON_DEMAND) -- nSet = LM_NEVER; - else if (nCanUpdate == com::sun::star::document::UpdateDocMode::FULL_UPDATE) - nSet = LM_ALWAYS; - -+ if (nSet == LM_ALWAYS -+ && !(SvtSecurityOptions() -+ .isTrustedLocationUriForUpdatingLinks( -+ GetMedium() == 0 -+ ? OUString() : GetMedium()->GetName()))) -+ { -+ nSet = LM_ON_DEMAND; -+ } -+ if (nCanUpdate == css::document::UpdateDocMode::QUIET_UPDATE -+ && nSet == LM_ON_DEMAND) -+ { -+ nSet = LM_NEVER; -+ } -+ - if(nSet==LM_ON_DEMAND) - { - QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), -diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx -index d42dd9f..86447aa 100644 ---- a/sw/source/core/doc/docnew.cxx -+++ b/sw/source/core/doc/docnew.cxx -@@ -44,6 +44,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -889,6 +890,15 @@ void SwDoc::UpdateLinks( bool bUI ) - case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate = false; break; - case document::UpdateDocMode::FULL_UPDATE: bAskUpdate = true; break; - } -+ if (nLinkMode == AUTOMATIC && !bAskUpdate) -+ { -+ SfxMedium * medium = GetDocShell()->GetMedium(); -+ if (!SvtSecurityOptions().isTrustedLocationUriForUpdatingLinks( -+ medium == 0 ? OUString() : medium->GetName())) -+ { -+ bAskUpdate = true; -+ } -+ } - if( bUpdate && (bUI || !bAskUpdate) ) - { - SfxMedium* pMedium = GetDocShell()->GetMedium(); -diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx -index b04cfbd..2636c95 100644 ---- a/sw/source/filter/xml/xmlimp.cxx -+++ b/sw/source/filter/xml/xmlimp.cxx -@@ -1075,46 +1075,46 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC - if( !xInfo.is() ) - return; - -- boost::unordered_set< OUString, OUStringHash > aSet; -- aSet.insert("ForbiddenCharacters"); -- aSet.insert("IsKernAsianPunctuation"); -- aSet.insert("CharacterCompressionType"); -- aSet.insert("LinkUpdateMode"); -- aSet.insert("FieldAutoUpdate"); -- aSet.insert("ChartAutoUpdate"); -- aSet.insert("AddParaTableSpacing"); -- aSet.insert("AddParaTableSpacingAtStart"); -- aSet.insert("PrintAnnotationMode"); -- aSet.insert("PrintBlackFonts"); -- aSet.insert("PrintControls"); -- aSet.insert("PrintDrawings"); -- aSet.insert("PrintGraphics"); -- aSet.insert("PrintLeftPages"); -- aSet.insert("PrintPageBackground"); -- aSet.insert("PrintProspect"); -- aSet.insert("PrintReversed"); -- aSet.insert("PrintRightPages"); -- aSet.insert("PrintFaxName"); -- aSet.insert("PrintPaperFromSetup"); -- aSet.insert("PrintTables"); -- aSet.insert("PrintSingleJobs"); -- aSet.insert("UpdateFromTemplate"); -- aSet.insert("PrinterIndependentLayout"); -- aSet.insert("PrintEmptyPages"); -- aSet.insert("SmallCapsPercentage66"); -- aSet.insert("TabOverflow"); -- aSet.insert("UnbreakableNumberings"); -- aSet.insert("ClippedPictures"); -- aSet.insert("BackgroundParaOverDrawings"); -- aSet.insert("TabOverMargin"); -- aSet.insert("PropLineSpacingShrinksFirstLine"); -+ boost::unordered_set< OUString, OUStringHash > aExcludeAlways; -+ aExcludeAlways.insert("LinkUpdateMode"); -+ boost::unordered_set< OUString, OUStringHash > aExcludeWhenNotLoadingUserSettings; -+ aExcludeWhenNotLoadingUserSettings.insert("ForbiddenCharacters"); -+ aExcludeWhenNotLoadingUserSettings.insert("IsKernAsianPunctuation"); -+ aExcludeWhenNotLoadingUserSettings.insert("CharacterCompressionType"); -+ aExcludeWhenNotLoadingUserSettings.insert("FieldAutoUpdate"); -+ aExcludeWhenNotLoadingUserSettings.insert("ChartAutoUpdate"); -+ aExcludeWhenNotLoadingUserSettings.insert("AddParaTableSpacing"); -+ aExcludeWhenNotLoadingUserSettings.insert("AddParaTableSpacingAtStart"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintAnnotationMode"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintBlackFonts"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintControls"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintDrawings"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintGraphics"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintLeftPages"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintPageBackground"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintProspect"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintReversed"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintRightPages"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintFaxName"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintPaperFromSetup"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintTables"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintSingleJobs"); -+ aExcludeWhenNotLoadingUserSettings.insert("UpdateFromTemplate"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrinterIndependentLayout"); -+ aExcludeWhenNotLoadingUserSettings.insert("PrintEmptyPages"); -+ aExcludeWhenNotLoadingUserSettings.insert("SmallCapsPercentage66"); -+ aExcludeWhenNotLoadingUserSettings.insert("TabOverflow"); -+ aExcludeWhenNotLoadingUserSettings.insert("UnbreakableNumberings"); -+ aExcludeWhenNotLoadingUserSettings.insert("ClippedPictures"); -+ aExcludeWhenNotLoadingUserSettings.insert("BackgroundParaOverDrawings"); -+ aExcludeWhenNotLoadingUserSettings.insert("TabOverMargin"); -+ aExcludeWhenNotLoadingUserSettings.insert("PropLineSpacingShrinksFirstLine"); - - sal_Int32 nCount = aConfigProps.getLength(); - const PropertyValue* pValues = aConfigProps.getConstArray(); - - SvtSaveOptions aSaveOpt; -- bool bIsUserSetting = aSaveOpt.IsLoadUserSettings(), -- bSet = bIsUserSetting; -+ bool bIsUserSetting = aSaveOpt.IsLoadUserSettings(); - - // for some properties we don't want to use the application - // default if they're missing. So we watch for them in the loop -@@ -1150,10 +1150,12 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC - - while( nCount-- ) - { -- if( !bIsUserSetting ) -+ bool bSet = aExcludeAlways.find(pValues->Name) == aExcludeAlways.end(); -+ if( bSet && !bIsUserSetting -+ && (aExcludeWhenNotLoadingUserSettings.find(pValues->Name) -+ != aExcludeWhenNotLoadingUserSettings.end()) ) - { -- // test over the hash value if the entry is in the table. -- bSet = aSet.find(pValues->Name) == aSet.end(); -+ bSet = false; - } - - if( bSet ) -diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx -index 7906ed7..86055c5 100644 ---- a/unotools/source/config/securityoptions.cxx -+++ b/unotools/source/config/securityoptions.cxx -@@ -1051,6 +1051,14 @@ bool SvtSecurityOptions::isTrustedLocationUri(OUString const & uri) const { - return false; - } - -+bool SvtSecurityOptions::isTrustedLocationUriForUpdatingLinks( -+ OUString const & uri) const -+{ -+ return GetMacroSecurityLevel() == 0 || uri.isEmpty() -+ || uri.startsWithIgnoreAsciiCase("private:") -+ || isTrustedLocationUri(uri); -+} -+ - sal_Int32 SvtSecurityOptions::GetMacroSecurityLevel() const - { - MutexGuard aGuard( GetInitMutex() ); --- -2.5.0 - diff --git a/SOURCES/0001-No-fstack-protect-strong-for-gcc3_linux_aarch64-cpp2.patch b/SOURCES/0001-No-fstack-protect-strong-for-gcc3_linux_aarch64-cpp2.patch deleted file mode 100644 index 2452164..0000000 --- a/SOURCES/0001-No-fstack-protect-strong-for-gcc3_linux_aarch64-cpp2.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 8d12e4ec8b843d59661a12a7a92bfec7e4473e0f Mon Sep 17 00:00:00 2001 -From: Stephan Bergmann -Date: Thu, 4 Sep 2014 15:26:58 +0200 -Subject: [PATCH] No -fstack-protect-strong for gcc3_linux_aarch64/cpp2uno.cxx - vtableSlotCall - -Change-Id: I52efda594d87c37c2d38c61b54f1eebcc76cdfce ---- - bridges/Library_cpp_uno.mk | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk -index 33a5c00..c2e303d 100644 ---- a/bridges/Library_cpp_uno.mk -+++ b/bridges/Library_cpp_uno.mk -@@ -38,7 +38,14 @@ endif - else ifeq ($(OS)-$(CPUNAME),LINUX-AARCH64) - - bridges_SELECTED_BRIDGE := gcc3_linux_aarch64 --bridge_exception_objects := abi callvirtualfunction cpp2uno uno2cpp -+bridge_exception_objects := abi callvirtualfunction uno2cpp -+ -+$(eval $(call gb_Library_add_cxxobjects,$(gb_CPPU_ENV)_uno, \ -+ bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/cpp2uno, \ -+ $(subst -fstack-protector-strong,-fstack-protector, \ -+ $(gb_LinkTarget_EXCEPTIONFLAGS) \ -+ $(call gb_LinkTarget__get_cxxflags,$(gb_CPPU_ENV)_uno)) \ -+)) - - else ifeq ($(OS)-$(CPUNAME),LINUX-AXP) - --- -1.9.3 - diff --git a/SOURCES/0001-Pasting-from-a-pdf-from-a-fallback-font-doesn-t-give.patch b/SOURCES/0001-Pasting-from-a-pdf-from-a-fallback-font-doesn-t-give.patch new file mode 100644 index 0000000..e639609 --- /dev/null +++ b/SOURCES/0001-Pasting-from-a-pdf-from-a-fallback-font-doesn-t-give.patch @@ -0,0 +1,39 @@ +From 924126df792915092ee6201d1f068e43ffb80b67 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 24 Apr 2016 21:24:41 +0100 +Subject: [PATCH] Pasting -- from a pdf from a fallback font doesn't give -- as + output + +Type -- into a writer document, on a machine without Courier installed +set that text to Courier. Export to pdf, select inside e.g. evince and +paste to a terminal. You don't get -- + +0x2D is mapped from unicode 0x2D and unicode 0xAD in the adobe +encoding. So the latter trumps the earlier one and is pasted +instead of <2D2D>. + +Reverse the order that the encoding is mapped from unicode so lower +more "ascii" options are preferred over the higher more "unlikely" +unicode options + +Change-Id: I8f251253fca468d269493801e668617a935ee15d +--- + vcl/source/gdi/pdfwriter_impl.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx +index ee9b0df..4ee0366 100644 +--- a/vcl/source/gdi/pdfwriter_impl.cxx ++++ b/vcl/source/gdi/pdfwriter_impl.cxx +@@ -3096,7 +3096,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical + memset( nEncodedCodes, 0, sizeof(nEncodedCodes) ); + memset( pUnicodesPerGlyph, 0, sizeof(pUnicodesPerGlyph) ); + memset( pEncToUnicodeIndex, 0, sizeof(pEncToUnicodeIndex) ); +- for( Ucs2SIntMap::const_iterator it = pEncoding->begin(); it != pEncoding->end(); ++it ) ++ for( Ucs2SIntMap::const_reverse_iterator it = pEncoding->rbegin(); it != pEncoding->rend(); ++it ) + { + if(it->second == -1) + continue; +-- +2.7.3 + diff --git a/SOURCES/0001-Related-fdo-78151-only-make-outline-title-and-subtit.patch b/SOURCES/0001-Related-fdo-78151-only-make-outline-title-and-subtit.patch deleted file mode 100644 index efbf420..0000000 --- a/SOURCES/0001-Related-fdo-78151-only-make-outline-title-and-subtit.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f8533123802c5a709280dd06b4452d00a11c71b1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Wed, 3 Dec 2014 10:49:15 +0000 -Subject: [PATCH] Related: fdo#78151 only make outline, title and subtitle - read-only - -Change-Id: Ic62291a61f6f4c055255f644df5f5e02fe6d0801 ---- - sd/source/ui/view/sdview.cxx | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx -index 9b93c8c..1eb87b5 100644 ---- a/sd/source/ui/view/sdview.cxx -+++ b/sd/source/ui/view/sdview.cxx -@@ -738,8 +738,22 @@ bool View::SdrBeginTextEdit( - } - } - -- if (bMasterPage && bReturn) -- maMasterViewFilter.Start(pOutl); -+ if (bMasterPage && bReturn && pOutl) -+ { -+ const SdrTextObj* pTextObj = pOutl->GetTextObj(); -+ const SdPage* pSdPage = pTextObj ? static_cast(pTextObj->GetPage()) : NULL; -+ const PresObjKind eKind = pSdPage ? pSdPage->GetPresObjKind(const_cast(pTextObj)) : PRESOBJ_NONE; -+ switch (eKind) -+ { -+ case PRESOBJ_TITLE: -+ case PRESOBJ_OUTLINE: -+ case PRESOBJ_TEXT: -+ maMasterViewFilter.Start(pOutl); -+ break; -+ default: -+ break; -+ } -+ } - - return bReturn; - } --- -1.9.3 - diff --git a/SOURCES/0001-Related-fdo-87242-init-VirtualDevice-with-size-of-su.patch b/SOURCES/0001-Related-fdo-87242-init-VirtualDevice-with-size-of-su.patch deleted file mode 100644 index 5875b6c..0000000 --- a/SOURCES/0001-Related-fdo-87242-init-VirtualDevice-with-size-of-su.patch +++ /dev/null @@ -1,559 +0,0 @@ -From bc839c159d4ee94ef8ca08975cf65be37378ae04 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 11 Dec 2014 16:20:49 +0000 -Subject: [PATCH] Related: fdo#87242 init VirtualDevice with size of surface - -otherwise vcl's clipping doesn't work quite right when the render text -with vcl apis fallback is used. - -Manually forced in my case, but it should happen in practice with vertical -text, so if there is a bug about vertical text not appearing in slideshows then -this is part of the fix for that. - -Windows and Mac remain unchanged as initialized with 1, 1. If the same problem -affects those platforms then they'll need to be adjusted to remember their -height/widths from the ctor and those values plugged in here instead - -(cherry picked from commit f95b0743da4239e047db8638c61f90f8bbe54306) -(cherry picked from commit e2be2c23c1ad61b3bd640be6f16d66f5cd925d38) - -Conflicts: - desktop/source/lib/init.cxx - -Related: fdo#87242 merge duplicate clip setup code - -favoring the vclcanvas one for the places where -they diverge - -(cherry picked from commit f88b5ab8692ee7ecf58b570e703d0e7f10cc2f0d) -(cherry picked from commit e0e96579ce3a248ee5d3b07ecf90f38e2020c555) - -Conflicts: - canvas/source/cairo/cairo_canvashelper_text.cxx - canvas/source/vcl/canvashelper.cxx - -Resolves: fdo#87242 reuse vcl clip for cairo during animations - -(cherry picked from commit 94d935eecbba0161de2616c2234b4a5d9d3cad88) -(cherry picked from commit 3a108b0600ce61f7960d561cee9989ab3a48780f) - -stray debugging code - -(cherry picked from commit 067b560335195b24eeedc4514956029ea975fbbf) -(cherry picked from commit fafc85559097166eceb67c4db4528cc9977e4184) - -Change-Id: I2f82f0db0cf446d7db21f0a7ee4f8c15c7ebdb42 -18e3d4e7659ebd4cb90c86718c1b1035671b4be3 -0a26d4c4092226732620c3852b0402ee45d4fa1d -953389e236739c01226365c33ab777fc3972b69d ---- - canvas/source/cairo/cairo_canvashelper.hxx | 3 + - canvas/source/cairo/cairo_canvashelper_text.cxx | 117 ++++++++++-------------- - canvas/source/cairo/cairo_quartz_cairo.cxx | 2 +- - canvas/source/cairo/cairo_win32_cairo.cxx | 2 +- - canvas/source/cairo/cairo_xlib_cairo.cxx | 7 +- - canvas/source/tools/canvastools.cxx | 75 +++++++++++++++ - canvas/source/vcl/canvashelper.cxx | 79 +--------------- - include/canvas/canvastools.hxx | 6 ++ - include/vcl/virdev.hxx | 3 +- - vcl/source/gdi/virdev.cxx | 6 +- - 10 files changed, 147 insertions(+), 153 deletions(-) - -diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx -index 9258e7c..ccb03ac 100644 ---- a/canvas/source/cairo/cairo_canvashelper.hxx -+++ b/canvas/source/cairo/cairo_canvashelper.hxx -@@ -310,6 +310,9 @@ namespace cairocanvas - ::cairo::CairoSharedPtr mpCairo; - ::cairo::SurfaceSharedPtr mpSurface; - ::basegfx::B2ISize maSize; -+ -+ void clip_cairo_from_dev(::OutputDevice& rOutDev); -+ - }; - - /// also needed from SpriteHelper -diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx -index d65f2de..78a2ddf 100644 ---- a/canvas/source/cairo/cairo_canvashelper_text.cxx -+++ b/canvas/source/cairo/cairo_canvashelper_text.cxx -@@ -127,73 +127,7 @@ namespace cairocanvas - - // TODO(P2): Don't change clipping all the time, maintain current clip - // state and change only when update is necessary -- -- // accumulate non-empty clips into one region -- // ========================================== -- -- Region aClipRegion; -- -- if( viewState.Clip.is() ) -- { -- ::basegfx::B2DPolyPolygon aClipPoly( -- ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( -- viewState.Clip) ); -- -- if( aClipPoly.count() ) -- { -- // setup non-empty clipping -- ::basegfx::B2DHomMatrix aMatrix; -- aClipPoly.transform( -- ::basegfx::unotools::homMatrixFromAffineMatrix( aMatrix, -- viewState.AffineTransform ) ); -- -- aClipRegion = Region::GetRegionFromPolyPolygon( ::PolyPolygon( aClipPoly ) ); -- } -- } -- -- if( renderState.Clip.is() ) -- { -- ::basegfx::B2DPolyPolygon aClipPoly( -- ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( -- renderState.Clip) ); -- -- ::basegfx::B2DHomMatrix aMatrix; -- aClipPoly.transform( -- ::canvas::tools::mergeViewAndRenderTransform( aMatrix, -- viewState, -- renderState ) ); -- -- if( aClipPoly.count() ) -- { -- // setup non-empty clipping -- Region aRegion = Region::GetRegionFromPolyPolygon( ::PolyPolygon( aClipPoly ) ); -- -- if( aClipRegion.IsEmpty() ) -- aClipRegion = aRegion; -- else -- aClipRegion.Intersect( aRegion ); -- } -- else -- { -- // clip polygon is empty -- aClipRegion.SetEmpty(); -- } -- } -- -- // setup accumulated clip region. Note that setting an -- // empty clip region denotes "clip everything" on the -- // OutputDevice (which is why we translate that into -- // SetClipRegion() here). When both view and render clip -- // are empty, aClipRegion remains default-constructed, -- // i.e. empty, too. -- if( aClipRegion.IsEmpty() ) -- { -- rOutDev.SetClipRegion(); -- } -- else -- { -- rOutDev.SetClipRegion( aClipRegion ); -- } -+ ::canvas::tools::clipOutDev(viewState, renderState, rOutDev); - - if( eColorType != IGNORE_COLOR ) - { -@@ -238,6 +172,31 @@ namespace cairocanvas - return nTransparency; - } - -+ class DeviceSettingsGuard -+ { -+ private: -+ OutputDevice *mpVirtualDevice; -+ cairo_t *mpCairo; -+ bool mbMappingWasEnabled; -+ public: -+ DeviceSettingsGuard(OutputDevice *pVirtualDevice, cairo_t *pCairo) -+ : mpVirtualDevice(pVirtualDevice) -+ , mpCairo(pCairo) -+ , mbMappingWasEnabled(mpVirtualDevice->IsMapModeEnabled()) -+ { -+ cairo_save(mpCairo); -+ mpVirtualDevice->Push(); -+ mpVirtualDevice->EnableMapMode(false); -+ } -+ -+ ~DeviceSettingsGuard() -+ { -+ mpVirtualDevice->EnableMapMode(mbMappingWasEnabled); -+ mpVirtualDevice->Pop(); -+ cairo_restore(mpCairo); -+ } -+ }; -+ - bool setupTextOutput( OutputDevice& rOutDev, - const rendering::XCanvas* pOwner, - ::Point& o_rOutPos, -@@ -247,14 +206,12 @@ namespace cairocanvas - { - setupOutDevState( rOutDev, pOwner, viewState, renderState, TEXT_COLOR ); - -- ::Font aVCLFont; -- - CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() ); - - ENSURE_ARG_OR_THROW( pFont, - "CanvasHelper::setupTextOutput(): Font not compatible with this canvas" ); - -- aVCLFont = pFont->getVCLFont(); -+ ::Font aVCLFont = pFont->getVCLFont(); - - Color aColor( COL_BLACK ); - -@@ -273,10 +230,20 @@ namespace cairocanvas - - rOutDev.SetFont( aVCLFont ); - -- - return true; - } - -+ //set the clip of the rOutDev to the cairo surface -+ void CanvasHelper::clip_cairo_from_dev(::OutputDevice& rOutDev) -+ { -+ Region aRegion(rOutDev.GetClipRegion()); -+ if (!aRegion.IsEmpty() && !aRegion.IsNull()) -+ { -+ doPolyPolygonImplementation(aRegion.GetAsB2DPolyPolygon(), Clip, mpCairo.get(), -+ NULL, mpSurfaceProvider, rendering::FillRule_EVEN_ODD); -+ } -+ } -+ - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* pOwner, - const rendering::StringContext& text, - const uno::Reference< rendering::XCanvasFont >& xFont, -@@ -297,6 +264,8 @@ namespace cairocanvas - - if( mpVirtualDevice ) - { -+ DeviceSettingsGuard aGuard(mpVirtualDevice.get(), mpCairo.get()); -+ - #if defined CAIRO_HAS_WIN32_SURFACE - // FIXME: Some kind of work-araound... - cairo_rectangle (mpSurface->getCairo().get(), 0, 0, 0, 0); -@@ -330,6 +299,8 @@ namespace cairocanvas - // TODO(F2): alpha - mpVirtualDevice->SetLayoutMode( nLayoutMode ); - -+ clip_cairo_from_dev(*mpVirtualDevice); -+ - OSL_TRACE(":cairocanvas::CanvasHelper::drawText(O,t,f,v,r,d): %s", OUStringToOString( text.Text.copy( text.StartPosition, text.Length ), - RTL_TEXTENCODING_UTF8 ).getStr()); - -@@ -357,6 +328,8 @@ namespace cairocanvas - - if( mpVirtualDevice ) - { -+ DeviceSettingsGuard aGuard(mpVirtualDevice.get(), mpCairo.get()); -+ - #if defined CAIRO_HAS_WIN32_SURFACE - // FIXME: Some kind of work-araound... - cairo_rectangle( mpSurface->getCairo().get(), 0, 0, 0, 0); -@@ -371,6 +344,8 @@ namespace cairocanvas - if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xLayoutedText->getFont() ) ) - return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary - -+ clip_cairo_from_dev(*mpVirtualDevice); -+ - // TODO(F2): What about the offset scalings? - pTextLayout->draw( mpSurface, *mpVirtualDevice, aOutpos, viewState, renderState ); - } -diff --git a/canvas/source/cairo/cairo_quartz_cairo.cxx b/canvas/source/cairo/cairo_quartz_cairo.cxx -index 07951ee..6b8b9aa 100644 ---- a/canvas/source/cairo/cairo_quartz_cairo.cxx -+++ b/canvas/source/cairo/cairo_quartz_cairo.cxx -@@ -269,7 +269,7 @@ namespace cairo - aSystemGraphicsData.nSize = sizeof(SystemGraphicsData); - aSystemGraphicsData.rCGContext = getCGContext(); - return boost::shared_ptr( -- new VirtualDevice( &aSystemGraphicsData, getDepth() )); -+ new VirtualDevice( &aSystemGraphicsData, Size(1, 1), getDepth() )); - } - - /** -diff --git a/canvas/source/cairo/cairo_win32_cairo.cxx b/canvas/source/cairo/cairo_win32_cairo.cxx -index a70add9..8d53b4f 100644 ---- a/canvas/source/cairo/cairo_win32_cairo.cxx -+++ b/canvas/source/cairo/cairo_win32_cairo.cxx -@@ -197,7 +197,7 @@ namespace cairo - aSystemGraphicsData.hDC = cairo_win32_surface_get_dc( mpSurface.get() ); - - return boost::shared_ptr( -- new VirtualDevice( &aSystemGraphicsData, sal::static_int_cast(getDepth()) )); -+ new VirtualDevice( &aSystemGraphicsData, Size(1, 1), sal::static_int_cast(getDepth()) )); - } - - -diff --git a/canvas/source/cairo/cairo_xlib_cairo.cxx b/canvas/source/cairo/cairo_xlib_cairo.cxx -index 9b49c7e..79ab2a5 100644 ---- a/canvas/source/cairo/cairo_xlib_cairo.cxx -+++ b/canvas/source/cairo/cairo_xlib_cairo.cxx -@@ -277,8 +277,13 @@ namespace cairo - aSystemGraphicsData.hDrawable = getDrawable(); - aSystemGraphicsData.pXRenderFormat = getRenderFormat(); - -+ int width = cairo_xlib_surface_get_width(mpSurface.get()); -+ int height = cairo_xlib_surface_get_height(mpSurface.get()); -+ - return boost::shared_ptr( -- new VirtualDevice( &aSystemGraphicsData, std::max( getDepth(), 0 ) )); -+ new VirtualDevice(&aSystemGraphicsData, -+ Size(width, height), -+ std::max(getDepth(), 0))); - } - - /** -diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx -index ae79cc9..6698f58 100644 ---- a/canvas/source/tools/canvastools.cxx -+++ b/canvas/source/tools/canvastools.cxx -@@ -1290,6 +1290,81 @@ namespace canvas - nColorSteps ) ); - } - -+ void clipOutDev(const rendering::ViewState& viewState, -+ const rendering::RenderState& renderState, -+ OutputDevice& rOutDev, -+ OutputDevice* p2ndOutDev) -+ { -+ // accumulate non-empty clips into one region -+ Region aClipRegion(true); -+ -+ if( viewState.Clip.is() ) -+ { -+ ::basegfx::B2DPolyPolygon aClipPoly( -+ ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(viewState.Clip) ); -+ -+ if( aClipPoly.count() ) -+ { -+ // setup non-empty clipping -+ ::basegfx::B2DHomMatrix aMatrix; -+ aClipPoly.transform( -+ ::basegfx::unotools::homMatrixFromAffineMatrix( aMatrix, -+ viewState.AffineTransform ) ); -+ -+ aClipRegion = Region::GetRegionFromPolyPolygon( PolyPolygon( aClipPoly ) ); -+ } -+ else -+ { -+ // clip polygon is empty -+ aClipRegion.SetEmpty(); -+ } -+ } -+ -+ if( renderState.Clip.is() ) -+ { -+ ::basegfx::B2DPolyPolygon aClipPoly( -+ ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(renderState.Clip) ); -+ -+ ::basegfx::B2DHomMatrix aMatrix; -+ aClipPoly.transform( -+ ::canvas::tools::mergeViewAndRenderTransform( aMatrix, -+ viewState, -+ renderState ) ); -+ -+ if( aClipPoly.count() ) -+ { -+ // setup non-empty clipping -+ Region aRegion = Region::GetRegionFromPolyPolygon( PolyPolygon( aClipPoly ) ); -+ aClipRegion.Intersect( aRegion ); -+ } -+ else -+ { -+ // clip polygon is empty -+ aClipRegion.SetEmpty(); -+ } -+ } -+ -+ // setup accumulated clip region. Note that setting an -+ // empty clip region denotes "clip everything" on the -+ // OutputDevice (which is why we translate that into -+ // SetClipRegion() here). When both view and render clip -+ // are empty, aClipRegion remains default-constructed, -+ // i.e. empty, too. -+ if( aClipRegion.IsNull() ) -+ { -+ rOutDev.SetClipRegion(); -+ -+ if( p2ndOutDev ) -+ p2ndOutDev->SetClipRegion(); -+ } -+ else -+ { -+ rOutDev.SetClipRegion( aClipRegion ); -+ -+ if( p2ndOutDev ) -+ p2ndOutDev->SetClipRegion( aClipRegion ); -+ } -+ } - } // namespace tools - - } // namespace canvas -diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx -index 0bd3954..5424e9e 100644 ---- a/canvas/source/vcl/canvashelper.cxx -+++ b/canvas/source/vcl/canvashelper.cxx -@@ -1236,78 +1236,7 @@ namespace vclcanvas - - // TODO(P2): Don't change clipping all the time, maintain current clip - // state and change only when update is necessary -- -- // accumulate non-empty clips into one region -- // ========================================== -- -- Region aClipRegion(true); -- -- if( viewState.Clip.is() ) -- { -- ::basegfx::B2DPolyPolygon aClipPoly( -- ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(viewState.Clip) ); -- -- if( aClipPoly.count() ) -- { -- // setup non-empty clipping -- ::basegfx::B2DHomMatrix aMatrix; -- aClipPoly.transform( -- ::basegfx::unotools::homMatrixFromAffineMatrix( aMatrix, -- viewState.AffineTransform ) ); -- -- aClipRegion = Region::GetRegionFromPolyPolygon( ::PolyPolygon( aClipPoly ) ); -- } -- else -- { -- // clip polygon is empty -- aClipRegion.SetEmpty(); -- } -- } -- -- if( renderState.Clip.is() ) -- { -- ::basegfx::B2DPolyPolygon aClipPoly( -- ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(renderState.Clip) ); -- -- ::basegfx::B2DHomMatrix aMatrix; -- aClipPoly.transform( -- ::canvas::tools::mergeViewAndRenderTransform( aMatrix, -- viewState, -- renderState ) ); -- -- if( aClipPoly.count() ) -- { -- // setup non-empty clipping -- Region aRegion = Region::GetRegionFromPolyPolygon( ::PolyPolygon( aClipPoly ) ); -- aClipRegion.Intersect( aRegion ); -- } -- else -- { -- // clip polygon is empty -- aClipRegion.SetEmpty(); -- } -- } -- -- // setup accumulated clip region. Note that setting an -- // empty clip region denotes "clip everything" on the -- // OutputDevice (which is why we translate that into -- // SetClipRegion() here). When both view and render clip -- // are empty, aClipRegion remains default-constructed, -- // i.e. empty, too. -- if( aClipRegion.IsNull() ) -- { -- rOutDev.SetClipRegion(); -- -- if( p2ndOutDev ) -- p2ndOutDev->SetClipRegion(); -- } -- else -- { -- rOutDev.SetClipRegion( aClipRegion ); -- -- if( p2ndOutDev ) -- p2ndOutDev->SetClipRegion( aClipRegion ); -- } -+ ::canvas::tools::clipOutDev(viewState, renderState, rOutDev, p2ndOutDev); - - Color aColor( COL_WHITE ); - -@@ -1373,18 +1302,16 @@ namespace vclcanvas - ENSURE_OR_THROW( mpOutDev.get(), - "outdev null. Are we disposed?" ); - -- setupOutDevState( viewState, renderState, TEXT_COLOR ); -- - OutputDevice& rOutDev( mpOutDev->getOutDev() ); - -- ::Font aVCLFont; -+ setupOutDevState( viewState, renderState, TEXT_COLOR ); - - CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() ); - - ENSURE_ARG_OR_THROW( pFont, - "Font not compatible with this canvas" ); - -- aVCLFont = pFont->getVCLFont(); -+ ::Font aVCLFont = pFont->getVCLFont(); - - Color aColor( COL_BLACK ); - -diff --git a/include/canvas/canvastools.hxx b/include/canvas/canvastools.hxx -index de5a76c..3881537 100644 ---- a/include/canvas/canvastools.hxx -+++ b/include/canvas/canvastools.hxx -@@ -77,6 +77,7 @@ namespace com { namespace sun { namespace star { namespace awt - } } } } - - class Color; -+class OutputDevice; - - namespace canvas - { -@@ -579,6 +580,11 @@ namespace canvas - ::std::size_t mnEntries; - bool mbCaseSensitive; - }; -+ -+ CANVASTOOLS_DLLPUBLIC void clipOutDev(const css::rendering::ViewState& viewState, -+ const css::rendering::RenderState& renderState, -+ OutputDevice& rOutDev, -+ OutputDevice* p2ndOutDev=NULL); - } - } - -diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx -index 87205c7..1c0a412 100644 ---- a/include/vcl/virdev.hxx -+++ b/include/vcl/virdev.hxx -@@ -110,7 +110,8 @@ public: - Any rendering will happen directly on the context and not on any intermediate bitmap. - Note: This might not be supported on all platforms ! - */ -- explicit VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount ); -+ explicit VirtualDevice(const SystemGraphicsData *pData, const Size &rSize, -+ sal_uInt16 nBitCount); - - virtual ~VirtualDevice(); - -diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx -index 6378785..9dcc286 100644 ---- a/vcl/source/gdi/virdev.cxx -+++ b/vcl/source/gdi/virdev.cxx -@@ -236,13 +236,15 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount - mnAlphaDepth = sal::static_int_cast(nAlphaBitCount); - } - --VirtualDevice::VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount ) -+VirtualDevice::VirtualDevice(const SystemGraphicsData *pData, const Size &rSize, -+ sal_uInt16 nBitCount) - : mpVirDev( NULL ), - meRefDevMode( REFDEV_NONE ) - { - SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" ); - -- ImplInitVirDev( Application::GetDefaultDevice(), 1, 1, nBitCount, pData ); -+ ImplInitVirDev(Application::GetDefaultDevice(), rSize.Width(), rSize.Height(), -+ nBitCount, pData); - } - - VirtualDevice::~VirtualDevice() --- -1.9.3 - diff --git a/SOURCES/0001-Related-rhbz-1117853-nStartPara-of-EE_PARA_NOT_FOUND.patch b/SOURCES/0001-Related-rhbz-1117853-nStartPara-of-EE_PARA_NOT_FOUND.patch deleted file mode 100644 index 85b596d..0000000 --- a/SOURCES/0001-Related-rhbz-1117853-nStartPara-of-EE_PARA_NOT_FOUND.patch +++ /dev/null @@ -1,62 +0,0 @@ -From fdb1d62a09f7320ee5c2828aa4ce84248a6e3e4e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 17 Jul 2014 13:48:30 +0100 -Subject: [PATCH] Related: rhbz#1117853 nStartPara of EE_PARA_NOT_FOUND - -we know that nStartPara is EE_PARA_NOT_FOUND so rOutliner.GetAbsPos must have -returned that, but we don't know the circumstances that lead to that yet. - -Change-Id: I53a488317d154b4a3c050248b8737da0a611ca43 ---- - editeng/source/outliner/outliner.cxx | 3 +-- - sd/source/ui/view/outlnvsh.cxx | 5 ++--- - 2 files changed, 3 insertions(+), 5 deletions(-) - -diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx -index 4d7214b..aaa843d 100644 ---- a/editeng/source/outliner/outliner.cxx -+++ b/editeng/source/outliner/outliner.cxx -@@ -384,7 +384,6 @@ sal_Int32 Outliner::GetBulletsNumberingStatus() const - - OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32 nCount ) const - { -- - if ( static_cast(nStartPara) + nCount > - static_cast(pParaList->GetParagraphCount()) ) - nCount = pParaList->GetParagraphCount() - nStartPara; -@@ -394,7 +393,7 @@ OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32 - if ( ( nStartPara + nCount ) > pEditEngine->GetParagraphCount() ) - nCount = pEditEngine->GetParagraphCount() - nStartPara; - -- if( !nCount ) -+ if (nCount <= 0) - return NULL; - - EditTextObject* pText = pEditEngine->CreateTextObject( nStartPara, nCount ); -diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx -index 03e899d..e3b4aa7 100644 ---- a/sd/source/ui/view/outlnvsh.cxx -+++ b/sd/source/ui/view/outlnvsh.cxx -@@ -1658,7 +1658,6 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara ) - - ::Outliner* pOutliner = pOlView->GetOutliner(); - SdrTextObj* pTO = pOlView->GetTitleTextObject( pPage ); -- OutlinerParaObject* pOPO = NULL; - - OUString aTest = pOutliner->GetText(pPara); - bool bText = !aTest.isEmpty(); -@@ -1675,9 +1674,9 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara ) - } - - // if we have a title object and a text, set the text -- if( pTO ) -+ OutlinerParaObject* pOPO = pTO ? pOutliner->CreateParaObject(pOutliner->GetAbsPos(pPara), 1) : NULL; -+ if (pOPO) - { -- pOPO = pOutliner->CreateParaObject( pOutliner->GetAbsPos( pPara ), 1 ); - pOPO->SetOutlinerMode( OUTLINERMODE_TITLEOBJECT ); - pOPO->SetVertical( pTO->IsVerticalWriting() ); - if( pTO->GetOutlinerParaObject() && (pOPO->GetTextObject() == pTO->GetOutlinerParaObject()->GetTextObject()) ) --- -1.9.3 - diff --git a/SOURCES/0001-Related-rhbz-1130264-plausible-fix-for-reported-cras.patch b/SOURCES/0001-Related-rhbz-1130264-plausible-fix-for-reported-cras.patch deleted file mode 100644 index 9594cc9..0000000 --- a/SOURCES/0001-Related-rhbz-1130264-plausible-fix-for-reported-cras.patch +++ /dev/null @@ -1,76 +0,0 @@ -From eb21b6827e25b2c943025a662cde2049c0454a6b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 15 Aug 2014 15:59:58 +0100 -Subject: [PATCH] Related: rhbz#1130264 plausible fix for reported crash - -Change-Id: I4ccdf19bfc7986881f7022109f22f47a0f493591 ---- - avmedia/source/gstreamer/gstplayer.cxx | 20 ++++++++++++++++---- - avmedia/source/gstreamer/gstplayer.hxx | 3 +++ - 2 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx -index ceea8e2..836e89e 100644 ---- a/avmedia/source/gstreamer/gstplayer.cxx -+++ b/avmedia/source/gstreamer/gstplayer.cxx -@@ -74,7 +74,9 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : - mpXOverlay( NULL ), - mnDuration( 0 ), - mnWidth( 0 ), -- mnHeight( 0 ) -+ mnHeight( 0 ), -+ mnWatchID( 0 ), -+ mbWatchID( false ) - { - // Initialize GStreamer library - int argc = 1; -@@ -127,11 +129,15 @@ void SAL_CALL Player::disposing() - g_object_unref( G_OBJECT ( mpXOverlay ) ); - mpXOverlay = NULL; - } -+ -+ } -+ if (mbWatchID) -+ { -+ g_source_remove(mnWatchID); -+ mbWatchID = false; - } - } - -- -- - static gboolean pipeline_bus_callback( GstBus *, GstMessage *message, gpointer data ) - { - Player* pPlayer = static_cast(data); -@@ -357,7 +363,13 @@ void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) - g_object_set( G_OBJECT( mpPlaybin ), "uri", ascURL.getStr() , NULL ); - - pBus = gst_element_get_bus( mpPlaybin ); -- gst_bus_add_watch( pBus, pipeline_bus_callback, this ); -+ if (mbWatchID) -+ { -+ g_source_remove(mnWatchID); -+ mbWatchID = false; -+ } -+ mnWatchID = gst_bus_add_watch( pBus, pipeline_bus_callback, this ); -+ mbWatchID = true; - DBG( "%p set sync handler", this ); - #ifdef AVMEDIA_GST_0_10 - gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this ); -diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx -index 2426eed..33c9e4d 100644 ---- a/avmedia/source/gstreamer/gstplayer.hxx -+++ b/avmedia/source/gstreamer/gstplayer.hxx -@@ -97,6 +97,9 @@ protected: - int mnWidth; - int mnHeight; - -+ guint mnWatchID; -+ bool mbWatchID; -+ - osl::Condition maSizeCondition; - }; - --- -1.9.3 - diff --git a/SOURCES/0001-Related-rhbz-1281906-set-a-min-size-on-un-resizeable.patch b/SOURCES/0001-Related-rhbz-1281906-set-a-min-size-on-un-resizeable.patch new file mode 100644 index 0000000..d216231 --- /dev/null +++ b/SOURCES/0001-Related-rhbz-1281906-set-a-min-size-on-un-resizeable.patch @@ -0,0 +1,35 @@ +From afeddaf7e0d11ad9b1df0c80bcc3f50caa87e21a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 16 Dec 2015 10:46:10 +0000 +Subject: [PATCH] Related: rhbz#1281906 set a min size on un-resizeable + non-layout dialogs + +a min size equates to a size-request which is reliable under gtk3+wayland +as the dialog contents size. + +a default size equates to the size of the dialog, which includes decorations +under wayland + +Change-Id: I20baf00fb5952ab93628f4dd6891779ce682783c +--- + vcl/source/window/syswin.cxx | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx +index 8589db6..3f2cde1 100644 +--- a/vcl/source/window/syswin.cxx ++++ b/vcl/source/window/syswin.cxx +@@ -1135,6 +1135,10 @@ void SystemWindow::DoInitialLayout() + mbIsCalculatingInitialLayoutSize = false; + mbInitialLayoutDone = true; + } ++ else if (!(GetStyle() & WB_SIZEABLE)) ++ { ++ SetMinOutputSizePixel(GetSizePixel()); ++ } + } + + void SystemWindow::doDeferredInit(WinBits /*nBits*/) +-- +2.5.0 + diff --git a/SOURCES/0001-Related-rhbz-1281906-wayland-toolbar-drawn-over-menu.patch b/SOURCES/0001-Related-rhbz-1281906-wayland-toolbar-drawn-over-menu.patch new file mode 100644 index 0000000..28bae4b --- /dev/null +++ b/SOURCES/0001-Related-rhbz-1281906-wayland-toolbar-drawn-over-menu.patch @@ -0,0 +1,319 @@ +From 2e071f6dd64561ae173b903a76065e2fab48a266 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 24 Jul 2015 12:22:14 +0100 +Subject: [PATCH] Related: rhbz#1281906 wayland toolbar drawn over menus etc + +gtk3: draw/paint to the fixed container + +which fills the toplevel window, rather than directly to the toplevel window. + +It makes no difference for X, but for wayland the window decorations are part +of the toplevel window, dropping down a level means we don't draw out menu bar +under the window decoration space + +(cherry picked from commit 298c089df77d9afe2cf86bb7a6a8544a0151e8c5) + +Change-Id: Icec400efacd16b5d901107c13b6fa90c59cad0e6 + +gtk3: insert an event box between toplevel and contents + +Change-Id: Ic78aa62baaa4260645a80ffb6704103440339595 +(cherry picked from commit 2796d7f1723d5b45177fe6da7a6e66cb914ae6d2) + +gtk3: connect to the eventbox and not toplevel for mouse events + +this leaves whatever magic gtk3 under wayland is doing on the toplevel +alone so the window can be resized and the title bar responds to +clicks as expected + +Change-Id: I9952cb719f3148660e17951b4f66a2525e11a6df +(cherry picked from commit 10d2467c2532178efe3d672405839bc1d0aab1e5) + +attach gestures to event widget instead of toplevel + +Change-Id: Id0658cf561570a2ae15fb7fd603e6437da9cfaf2 +(cherry picked from commit 848f685ae8f614ad62d205ef628f259cafb738b3) +--- + vcl/inc/unx/gtk/gtkframe.hxx | 5 +- + vcl/unx/gtk/a11y/atkfactory.cxx | 21 +++++++-- + vcl/unx/gtk/window/gtksalframe.cxx | 93 +++++++++++++++++++++++++++----------- + 3 files changed, 88 insertions(+), 31 deletions(-) + +diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx +index 604f2a6..3531c41 100644 +--- a/vcl/inc/unx/gtk/gtkframe.hxx ++++ b/vcl/inc/unx/gtk/gtkframe.hxx +@@ -173,6 +173,8 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + + SalX11Screen m_nXScreen; + GtkWidget* m_pWindow; ++ GtkEventBox* m_pEventBox; ++ GtkFixed* m_pFixedContainer; + GdkWindow* m_pForeignParent; + GdkNativeWindow m_aForeignParentWindow; + GdkWindow* m_pForeignTopLevel; +@@ -180,7 +182,6 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + Pixmap m_hBackgroundPixmap; + sal_uLong m_nStyle; + SalExtStyle m_nExtStyle; +- GtkFixed* m_pFixedContainer; + GtkSalFrame* m_pParent; + std::list< GtkSalFrame* > m_aChildren; + GdkWindowState m_nState; +@@ -335,6 +336,7 @@ public: + guint m_nActionGroupExportId; + guint m_nAppActionGroupExportId; + guint m_nHudAwarenessId; ++ std::vector m_aMouseSignalIds; + + // dispatches an event, returns true if dispatched + // and false else; if true was returned the event should +@@ -347,6 +349,7 @@ public: + static GdkDisplay* getGdkDisplay(); + GtkWidget* getWindow() const { return m_pWindow; } + GtkFixed* getFixedContainer() const { return m_pFixedContainer; } ++ GtkWidget* getMouseEventWidget() const; + GdkWindow* getForeignParent() const { return m_pForeignParent; } + GdkNativeWindow getForeignParentWindow() const { return m_aForeignParentWindow; } + GdkWindow* getForeignTopLevel() const { return m_pForeignTopLevel; } +diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx +index 99ed750..9edc7ab 100644 +--- a/vcl/unx/gtk/a11y/atkfactory.cxx ++++ b/vcl/unx/gtk/a11y/atkfactory.cxx +@@ -101,14 +101,27 @@ wrapper_factory_get_accessible_type() + static AtkObject* + wrapper_factory_create_accessible( GObject *obj ) + { +- GtkWidget* parent_widget = gtk_widget_get_parent( GTK_WIDGET( obj ) ); ++#if GTK_CHECK_VERSION(3,0,0) ++ GtkWidget* pEventBox = gtk_widget_get_parent(GTK_WIDGET(obj)); + + // gail_container_real_remove_gtk tries to re-instanciate an accessible + // for a widget that is about to vanish .. +- if( ! parent_widget ) ++ if (!pEventBox) + return atk_noop_object_wrapper_new(); + +- GtkSalFrame* pFrame = GtkSalFrame::getFromWindow( GTK_WINDOW( parent_widget ) ); ++ GtkWidget* pTopLevel = gtk_widget_get_parent(pEventBox); ++ if (!pTopLevel) ++ return atk_noop_object_wrapper_new(); ++#else ++ GtkWidget* pTopLevel = gtk_widget_get_parent(GTK_WIDGET(obj)); ++ ++ // gail_container_real_remove_gtk tries to re-instanciate an accessible ++ // for a widget that is about to vanish .. ++ if (!pTopLevel) ++ return atk_noop_object_wrapper_new(); ++#endif ++ ++ GtkSalFrame* pFrame = GtkSalFrame::getFromWindow(GTK_WINDOW(pTopLevel)); + g_return_val_if_fail( pFrame != NULL, NULL ); + + vcl::Window* pFrameWindow = pFrame->GetWindow(); +@@ -130,7 +143,7 @@ wrapper_factory_create_accessible( GObject *obj ) + if( accessible ) + g_object_ref( G_OBJECT(accessible) ); + else +- accessible = atk_object_wrapper_new( xAccessible, gtk_widget_get_accessible(parent_widget) ); ++ accessible = atk_object_wrapper_new( xAccessible, gtk_widget_get_accessible(pTopLevel) ); + + return accessible; + } +diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx +index eef48cd..8acdf8a 100644 +--- a/vcl/unx/gtk/window/gtksalframe.cxx ++++ b/vcl/unx/gtk/window/gtksalframe.cxx +@@ -414,7 +414,7 @@ void GtkSalFrame::doKeyCallback( guint state, + if (keyval == GDK_0) + { + fprintf( stderr, "force widget_queue_draw\n"); +- gtk_widget_queue_draw (m_pWindow); ++ gtk_widget_queue_draw (m_pFixedContainer); + return; + } + else if (keyval == GDK_1) +@@ -894,8 +894,13 @@ GtkSalFrame::~GtkSalFrame() + if( m_pIMHandler ) + delete m_pIMHandler; + ++ GtkWidget *pEventWidget = getMouseEventWidget(); ++ for (auto handler_id : m_aMouseSignalIds) ++ g_signal_handler_disconnect(G_OBJECT(pEventWidget), handler_id); + if( m_pFixedContainer ) + gtk_widget_destroy( GTK_WIDGET( m_pFixedContainer ) ); ++ if( m_pEventBox ) ++ gtk_widget_destroy( GTK_WIDGET(m_pEventBox) ); + { + SolarMutexGuard aGuard; + #if defined ENABLE_GMENU_INTEGRATION +@@ -1036,38 +1041,75 @@ void GtkSalFrame::updateScreenNumber() + maGeometry.nDisplayScreenNumber = nScreen; + } + ++GtkWidget *GtkSalFrame::getMouseEventWidget() const ++{ ++#if GTK_CHECK_VERSION(3,0,0) ++ return GTK_WIDGET(m_pEventBox); ++#else ++ return m_pWindow; ++#endif ++} ++ + void GtkSalFrame::InitCommon() + { ++#if GTK_CHECK_VERSION(3,0,0) ++ m_pEventBox = GTK_EVENT_BOX(gtk_event_box_new()); ++ gtk_widget_add_events( GTK_WIDGET(m_pEventBox), ++ GDK_ALL_EVENTS_MASK ); ++ gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pEventBox) ); ++ ++ // add the fixed container child, ++ // fixed is needed since we have to position plugin windows ++ m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL )); ++ gtk_container_add( GTK_CONTAINER(m_pEventBox), GTK_WIDGET(m_pFixedContainer) ); ++#else ++ m_pEventBox = 0; ++ // add the fixed container child, ++ // fixed is needed since we have to position plugin windows ++ m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL )); ++ gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pFixedContainer) ); ++#endif ++ ++ GtkWidget *pEventWidget = getMouseEventWidget(); ++ ++ gtk_widget_set_app_paintable(GTK_WIDGET(m_pFixedContainer), true); ++ /*non-X11 displays won't show anything at all without double-buffering ++ enabled*/ ++ if (GDK_IS_X11_DISPLAY(getGdkDisplay())) ++ gtk_widget_set_double_buffered(GTK_WIDGET(m_pFixedContainer), false); ++ gtk_widget_set_redraw_on_allocate(GTK_WIDGET(m_pFixedContainer), false); ++ ++ + // connect signals + g_signal_connect( G_OBJECT(m_pWindow), "style-set", G_CALLBACK(signalStyleSet), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "button-press-event", G_CALLBACK(signalButton), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "button-release-event", G_CALLBACK(signalButton), this ); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-press-event", G_CALLBACK(signalButton), this )); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "motion-notify-event", G_CALLBACK(signalMotion), this )); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-release-event", G_CALLBACK(signalButton), this )); + #if GTK_CHECK_VERSION(3,0,0) +- g_signal_connect( G_OBJECT(m_pWindow), "draw", G_CALLBACK(signalDraw), this ); ++ g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this ); + g_signal_connect( G_OBJECT(m_pWindow), "size-allocate", G_CALLBACK(sizeAllocated), this ); + // g_signal_connect( G_OBJECT(m_pWindow), "state-flags-changed", G_CALLBACK(signalFlagsChanged), this ); + #if GTK_CHECK_VERSION(3,14,0) +- GtkGesture *pSwipe = gtk_gesture_swipe_new(m_pWindow); ++ GtkGesture *pSwipe = gtk_gesture_swipe_new(pEventWidget); + g_signal_connect(pSwipe, "swipe", G_CALLBACK(gestureSwipe), this); + gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER (pSwipe), GTK_PHASE_TARGET); +- g_object_weak_ref(G_OBJECT(m_pWindow), reinterpret_cast(g_object_unref), pSwipe); ++ g_object_weak_ref(G_OBJECT(pEventWidget), reinterpret_cast(g_object_unref), pSwipe); + +- GtkGesture *pLongPress = gtk_gesture_long_press_new(m_pWindow); ++ GtkGesture *pLongPress = gtk_gesture_long_press_new(pEventWidget); + g_signal_connect(pLongPress, "pressed", G_CALLBACK(gestureLongPress), this); + gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER (pLongPress), GTK_PHASE_TARGET); +- g_object_weak_ref(G_OBJECT(m_pWindow), reinterpret_cast(g_object_unref), pLongPress); ++ g_object_weak_ref(G_OBJECT(pEventWidget), reinterpret_cast(g_object_unref), pLongPress); + + #endif + + #else +- g_signal_connect( G_OBJECT(m_pWindow), "expose-event", G_CALLBACK(signalExpose), this ); ++ g_signal_connect( G_OBJECT(m_pFixedContainer), "expose-event", G_CALLBACK(signalExpose), this ); + #endif + g_signal_connect( G_OBJECT(m_pWindow), "focus-in-event", G_CALLBACK(signalFocus), this ); + g_signal_connect( G_OBJECT(m_pWindow), "focus-out-event", G_CALLBACK(signalFocus), this ); + g_signal_connect( G_OBJECT(m_pWindow), "map-event", G_CALLBACK(signalMap), this ); + g_signal_connect( G_OBJECT(m_pWindow), "unmap-event", G_CALLBACK(signalUnmap), this ); + g_signal_connect( G_OBJECT(m_pWindow), "configure-event", G_CALLBACK(signalConfigure), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "motion-notify-event", G_CALLBACK(signalMotion), this ); + g_signal_connect( G_OBJECT(m_pWindow), "key-press-event", G_CALLBACK(signalKey), this ); + g_signal_connect( G_OBJECT(m_pWindow), "key-release-event", G_CALLBACK(signalKey), this ); + g_signal_connect( G_OBJECT(m_pWindow), "delete-event", G_CALLBACK(signalDelete), this ); +@@ -1102,26 +1144,18 @@ void GtkSalFrame::InitCommon() + m_nAppActionGroupExportId = 0; + m_nHudAwarenessId = 0; + +- gtk_widget_set_app_paintable( m_pWindow, TRUE ); +- /*non-X11 displays won't show anything at all without double-buffering +- enabled*/ +- if (GDK_IS_X11_DISPLAY(getGdkDisplay())) +- gtk_widget_set_double_buffered( m_pWindow, FALSE ); +- gtk_widget_set_redraw_on_allocate( m_pWindow, FALSE ); +- + gtk_widget_add_events( m_pWindow, + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | + GDK_VISIBILITY_NOTIFY_MASK | GDK_SCROLL_MASK + ); + +- // add the fixed container child, +- // fixed is needed since we have to position plugin windows +- m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL )); +- gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pFixedContainer) ); +- + // show the widgets +- gtk_widget_show( GTK_WIDGET(m_pFixedContainer) ); ++#if GTK_CHECK_VERSION(3,0,0) ++ gtk_widget_show_all( GTK_WIDGET(m_pEventBox) ); ++#else ++ gtk_widget_show_all( GTK_WIDGET(m_pFixedContainer) ); ++#endif + + // realize the window, we need an XWindow id + gtk_widget_realize( m_pWindow ); +@@ -2780,7 +2814,7 @@ void GtkSalFrame::grabPointer( bool bGrab, bool bOwnerEvents ) + GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay()); + GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager); + if (bGrab) +- gdk_device_grab(pPointer, widget_get_window(m_pWindow), GDK_OWNERSHIP_NONE, bOwnerEvents, (GdkEventMask) nMask, m_pCurrentCursor, GDK_CURRENT_TIME); ++ gdk_device_grab(pPointer, widget_get_window(getMouseEventWidget()), GDK_OWNERSHIP_NONE, bOwnerEvents, (GdkEventMask) nMask, m_pCurrentCursor, GDK_CURRENT_TIME); + else + gdk_device_ungrab(pPointer, GDK_CURRENT_TIME); + #else +@@ -3189,8 +3223,14 @@ void GtkSalFrame::createNewWindow( ::Window aNewParent, bool bXEmbed, SalX11Scre + { + gdk_region_destroy( m_pRegion ); + } ++ ++ GtkWidget *pEventWidget = getMouseEventWidget(); ++ for (auto handler_id : m_aMouseSignalIds) ++ g_signal_handler_disconnect(G_OBJECT(pEventWidget), handler_id); + if( m_pFixedContainer ) + gtk_widget_destroy( GTK_WIDGET(m_pFixedContainer) ); ++ if( m_pEventBox ) ++ gtk_widget_destroy( GTK_WIDGET(m_pEventBox) ); + if( m_pWindow ) + gtk_widget_destroy( m_pWindow ); + if( m_pForeignParent ) +@@ -3651,7 +3691,7 @@ void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect) + cairo_destroy(cr); + } + +- gtk_widget_queue_draw_area(m_pWindow, ++ gtk_widget_queue_draw_area(GTK_WIDGET(m_pFixedContainer), + rDamageRect.getMinX(), + rDamageRect.getMinY(), + rDamageRect.getWidth(), +@@ -3874,7 +3914,7 @@ void GtkSalFrame::TriggerPaintEvent() + SAL_INFO("vcl.gtk3", "force painting" << 0 << "," << 0 << " " << maGeometry.nWidth << "x" << maGeometry.nHeight); + SalPaintEvent aPaintEvt(0, 0, maGeometry.nWidth, maGeometry.nHeight, true); + CallCallback(SALEVENT_PAINT, &aPaintEvt); +- gtk_widget_queue_draw(m_pWindow); ++ gtk_widget_queue_draw(GTK_WIDGET(m_pFixedContainer)); + #endif + } + +@@ -4212,6 +4252,7 @@ void GtkSalFrame::signalDestroy( GtkWidget* pObj, gpointer frame ) + if( pObj == pThis->m_pWindow ) + { + pThis->m_pFixedContainer = NULL; ++ pThis->m_pEventBox = NULL; + pThis->m_pWindow = NULL; + pThis->InvalidateGraphics(); + } +-- +2.5.0 + diff --git a/SOURCES/0001-Related-rhbz-1290014-gtk3-use-gtk_window_set_modal-o.patch b/SOURCES/0001-Related-rhbz-1290014-gtk3-use-gtk_window_set_modal-o.patch new file mode 100644 index 0000000..421bcbb --- /dev/null +++ b/SOURCES/0001-Related-rhbz-1290014-gtk3-use-gtk_window_set_modal-o.patch @@ -0,0 +1,107 @@ +From 8a30dab4e78b42cf3ce587965414b98a50830a78 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 14 Dec 2015 11:36:50 +0000 +Subject: [PATCH 1/2] Related: rhbz#1290014 gtk3: use gtk_window_set_modal on + modal dialogs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +which makes modal dialogs (which are most of them) place correctly +under wayland. Modeless ones are still uselessly shoved far to the +left, but this makes things near usable and gives the same "graying +into the bg" effect for the main window as other gtk apps + +Change-Id: If1486feb7631c5a0c2aa6efac3a6b9dd1b215daf +Reviewed-on: https://gerrit.libreoffice.org/20699 +Tested-by: Jenkins +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +(cherry picked from commit 8d5822983e9b6a1e04874ce4d2c807fd0cf1ee04) +Reviewed-on: https://gerrit.libreoffice.org/20700 +--- + vcl/inc/salframe.hxx | 4 ++++ + vcl/inc/unx/gtk/gtkframe.hxx | 4 ++++ + vcl/source/window/dialog.cxx | 3 ++- + vcl/unx/gtk3/gtk3gtkframe.cxx | 7 +++++++ + 4 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx +index 4e52fe4..484504c 100644 +--- a/vcl/inc/salframe.hxx ++++ b/vcl/inc/salframe.hxx +@@ -233,6 +233,10 @@ public: + // done setting up the clipregion + virtual void EndSetClipRegion() = 0; + ++ virtual void SetModal(bool /*bModal*/) ++ { ++ } ++ + // Callbacks (indepent part in vcl/source/window/winproc.cxx) + // for default message handling return 0 + void SetCallback( vcl::Window* pWindow, SALFRAMEPROC pProc ); +diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx +index 3bd5353..ee19e6c 100644 +--- a/vcl/inc/unx/gtk/gtkframe.hxx ++++ b/vcl/inc/unx/gtk/gtkframe.hxx +@@ -465,6 +465,10 @@ public: + // done setting up the clipregion + virtual void EndSetClipRegion() SAL_OVERRIDE; + ++#if GTK_CHECK_VERSION(3,0,0) ++ virtual void SetModal(bool bModal) override; ++#endif ++ + static GtkSalFrame *getFromWindow( GtkWindow *pWindow ); + + virtual Window GetX11Window() SAL_OVERRIDE; +diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx +index 4ce15de..cd1f0da 100644 +--- a/vcl/source/window/dialog.cxx ++++ b/vcl/source/window/dialog.cxx +@@ -46,6 +46,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1001,7 +1002,6 @@ void Dialog::SetModalInputMode( bool bModal ) + mpDialogParent = pParent->mpWindowImpl->mpFrameWindow; + mpDialogParent->ImplIncModalCount(); + } +- + } + else + { +@@ -1037,6 +1037,7 @@ void Dialog::SetModalInputMode( bool bModal ) + } + } + } ++ ImplGetFrame()->SetModal(bModal); + } + + void Dialog::SetModalInputMode( bool bModal, bool bSubModalDialogs ) +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index 1443054..ca9d371 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -2616,6 +2616,13 @@ void GtkSalFrame::EndSetClipRegion() + gdk_window_shape_combine_region( widget_get_window(m_pWindow), m_pRegion, 0, 0 ); + } + ++void GtkSalFrame::SetModal(bool bModal) ++{ ++ if (!m_pWindow) ++ return; ++ gtk_window_set_modal(GTK_WINDOW(m_pWindow), bModal); ++} ++ + gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer frame ) + { + GtkSalFrame* pThis = static_cast(frame); +-- +2.5.0 + diff --git a/SOURCES/0001-Related-tdf-72880-presumably-using-startcenter-as-ge.patch b/SOURCES/0001-Related-tdf-72880-presumably-using-startcenter-as-ge.patch new file mode 100644 index 0000000..17ab102 --- /dev/null +++ b/SOURCES/0001-Related-tdf-72880-presumably-using-startcenter-as-ge.patch @@ -0,0 +1,29 @@ +From ac33ef3a4abe73c65600e1f199d25e1a1f0080db Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 8 Oct 2015 12:38:06 +0100 +Subject: [PATCH] Related: tdf#72880 presumably using startcenter as generic LO + target will work + +for the gnome case + +Change-Id: Icb5ad2d50d672b35783720c100a408fa3e5cb63e +--- + sysui/desktop/menus/startcenter.desktop | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysui/desktop/menus/startcenter.desktop b/sysui/desktop/menus/startcenter.desktop +index ed333b6..f0d2b63 100644 +--- a/sysui/desktop/menus/startcenter.desktop ++++ b/sysui/desktop/menus/startcenter.desktop +@@ -23,7 +23,7 @@ Icon=startcenter + Type=Application + Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Other; + Exec=${UNIXBASISROOTNAME} %%FILE%% +-MimeType=application/vnd.openofficeorg.extension; ++MimeType=application/vnd.openofficeorg.extension;x-scheme-handler/vnd.libreoffice.cmis; + Name=%PRODUCTNAME + GenericName=Office + Comment=The office productivity suite compatible to the open and standardized ODF document format. Supported by The Document Foundation. +-- +2.4.3 + diff --git a/SOURCES/0001-Related-tdf-93676-msword-wraps-slightly-differently-.patch b/SOURCES/0001-Related-tdf-93676-msword-wraps-slightly-differently-.patch new file mode 100644 index 0000000..2771111 --- /dev/null +++ b/SOURCES/0001-Related-tdf-93676-msword-wraps-slightly-differently-.patch @@ -0,0 +1,49 @@ +From 1ff5ecda9ccfcf3e65e90c404db93fcbbefb889e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 7 Sep 2015 16:37:22 +0100 +Subject: [PATCH] Related: tdf#93676 msword wraps slightly differently than us + +Change-Id: I91ba41cb052c38aa3b047cf079090b01bbe93b39 +--- + sw/source/filter/ww8/wrtw8esh.cxx | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx +index 763fb44..fd6dfbc 100644 +--- a/sw/source/filter/ww8/wrtw8esh.cxx ++++ b/sw/source/filter/ww8/wrtw8esh.cxx +@@ -803,6 +803,19 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const + + SwTwips nLeft = aRect.Left() + nThick; + SwTwips nRight = aRect.Right() - nThick; ++ SwTwips nTop = aRect.Top() + nThick; ++ SwTwips nBottom = aRect.Bottom() - nThick; ++ ++ // tdf#93675, 0 below line/paragraph and/or top line/paragraph with ++ // wrap top+bottom or other wraps is affecting the line directly ++ // above the anchor line, which seems odd, but a tiny adjustment ++ // here to bring the top down convinces msoffice to wrap like us ++ if (nTop < 8 && !rFrameFormat.IsInline() && ++ rVOr.GetVertOrient() == text::VertOrientation::NONE && ++ rVOr.GetRelationOrient() == text::RelOrientation::FRAME) ++ { ++ nTop = 8; ++ } + + //Nasty swap for bidi if necessary + rWrt.MiserableRTLFrameFormatHack(nLeft, nRight, rFrameFormat); +@@ -811,9 +824,9 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const + //(most of) the border is outside the graphic is word, so + //change dimensions to fit + SwWW8Writer::WriteLong(*rWrt.pTableStrm, nLeft); +- SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + nThick); ++ SwWW8Writer::WriteLong(*rWrt.pTableStrm, nTop); + SwWW8Writer::WriteLong(*rWrt.pTableStrm, nRight); +- SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - nThick); ++ SwWW8Writer::WriteLong(*rWrt.pTableStrm, nBottom); + + //fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock + sal_uInt16 nFlags=0; +-- +2.1.0 + diff --git a/SOURCES/0001-Remove-smb-from-X-KDE-Protocols-lines.patch b/SOURCES/0001-Remove-smb-from-X-KDE-Protocols-lines.patch deleted file mode 100644 index 79ee877..0000000 --- a/SOURCES/0001-Remove-smb-from-X-KDE-Protocols-lines.patch +++ /dev/null @@ -1,156 +0,0 @@ -From f9f9aa9873c5851da86d33ca75e937ac022206a3 Mon Sep 17 00:00:00 2001 -From: Stephan Bergmann -Date: Wed, 8 Oct 2014 09:54:55 +0200 -Subject: [PATCH] Remove smb from X-KDE-Protocols lines - -smb was included in the set of supported protocols since those X-KDE-Protocol -lines got introduced with 673be8e76856c6bc39f448f3374db4ae84258952 "add -X-KDE-Protocols," but as discussed in the mail thread starting at - -"X-KDE-Protocols=...,smb,...," actual support for smb URLs in LO under KDE is -very fragile and typically requires further steps from the user (which vary -across the various LO configure options, --enable-gio vs. --enable-gnome-vfs, -and Linux distros) to work at all. - -So it is probably best to not unconditionally claim smb support in those -X-KDE_Protocols lines at least in the vanilla LO sources (esp. since the TDF -builds with --enable-gnome-vfs need a really weird OOO_FORCE_DESKTOP=gnome -workaround to make it work at all, cf. - -"Re: X-KDE-Protocols=...,smb,..."). Any Linux distros that are confident that -smb support in LO under KDE reliably works for them can patch those lines -locally. - -Change-Id: I1c247d85825c96f0d74efcce3003e327a1522fa3 ---- - sysui/desktop/menus/base.desktop | 2 +- - sysui/desktop/menus/calc.desktop | 2 +- - sysui/desktop/menus/draw.desktop | 2 +- - sysui/desktop/menus/impress.desktop | 2 +- - sysui/desktop/menus/math.desktop | 2 +- - sysui/desktop/menus/qstart.desktop | 2 +- - sysui/desktop/menus/startcenter.desktop | 2 +- - sysui/desktop/menus/writer.desktop | 2 +- - sysui/desktop/menus/xsltfilter.desktop | 2 +- - 9 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/sysui/desktop/menus/base.desktop b/sysui/desktop/menus/base.desktop -index 26f1c6a..76255fe 100644 ---- a/sysui/desktop/menus/base.desktop -+++ b/sysui/desktop/menus/base.desktop -@@ -31,8 +31,8 @@ X-GIO-NoFuse=true - Keywords=Data;SQL; - InitialPreference=5 - StartupWMClass=libreoffice-base --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav - X-TryExec=oobase - - Actions=NewDocument; - [Desktop Action NewDocument] -diff --git a/sysui/desktop/menus/calc.desktop b/sysui/desktop/menus/calc.desktop -index fca3fe3..5aa48d2 100644 ---- a/sysui/desktop/menus/calc.desktop -+++ b/sysui/desktop/menus/calc.desktop -@@ -31,8 +31,8 @@ X-GIO-NoFuse=true - Keywords=Accounting;Stats;OpenDocument Spreadsheet;Chart;Microsoft Excel;Microsoft Works;OpenOffice Calc;ods;xls;xlsx; - InitialPreference=5 - StartupWMClass=libreoffice-calc --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav - X-TryExec=oocalc - - Actions=NewDocument; - [Desktop Action NewDocument] -diff --git a/sysui/desktop/menus/draw.desktop b/sysui/desktop/menus/draw.desktop -index ae57504..3e20e8d 100644 ---- a/sysui/desktop/menus/draw.desktop -+++ b/sysui/desktop/menus/draw.desktop -@@ -31,8 +31,8 @@ X-GIO-NoFuse=true - Keywords=Vector;Schema;Diagram;Layout;OpenDocument Graphics;Microsoft Publisher;Corel Draw;cdr;odg;svg; - InitialPreference=5 - StartupWMClass=libreoffice-draw --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav - X-TryExec=oodraw - - Actions=NewDocument; - [Desktop Action NewDocument] -diff --git a/sysui/desktop/menus/impress.desktop b/sysui/desktop/menus/impress.desktop -index c1f6231..b419593 100644 ---- a/sysui/desktop/menus/impress.desktop -+++ b/sysui/desktop/menus/impress.desktop -@@ -31,8 +31,8 @@ X-GIO-NoFuse=true - Keywords=Slideshow;Slides;OpenDocument Presentation;Microsoft PowerPoint;Microsoft Works;OpenOffice Impress;odp;ppt;pptx; - InitialPreference=5 - StartupWMClass=libreoffice-impress --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav - X-TryExec=ooimpress - - Actions=NewDocument; - [Desktop Action NewDocument] -diff --git a/sysui/desktop/menus/math.desktop b/sysui/desktop/menus/math.desktop -index b6981f5..e437d26 100644 ---- a/sysui/desktop/menus/math.desktop -+++ b/sysui/desktop/menus/math.desktop -@@ -32,8 +32,8 @@ X-GIO-NoFuse=true - Keywords=Equation;OpenDocument Formula;Formula;odf;MathML; - InitialPreference=5 - StartupWMClass=libreoffice-math --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav - X-TryExec=oomath - - Actions=NewDocument; - [Desktop Action NewDocument] -diff --git a/sysui/desktop/menus/qstart.desktop b/sysui/desktop/menus/qstart.desktop -index 2669cc3..ec4e9c2 100644 ---- a/sysui/desktop/menus/qstart.desktop -+++ b/sysui/desktop/menus/qstart.desktop -@@ -25,4 +25,4 @@ NoDisplay=true - Name=%PRODUCTNAME Quickstarter - Comment=Hook for quickstarter startup - X-GIO-NoFuse=true --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav -diff --git a/sysui/desktop/menus/startcenter.desktop b/sysui/desktop/menus/startcenter.desktop -index 3858c89..08d4a11 100644 ---- a/sysui/desktop/menus/startcenter.desktop -+++ b/sysui/desktop/menus/startcenter.desktop -@@ -30,7 +30,7 @@ Comment=The office productivity suite compatible to the open and standardized OD - StartupNotify=true - X-GIO-NoFuse=true - StartupWMClass=libreoffice-startcenter --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav - - ##Define Actions - Actions=Writer;Calc;Impress;Draw;Base;Math; -diff --git a/sysui/desktop/menus/writer.desktop b/sysui/desktop/menus/writer.desktop -index e22a7b4..44a6421 100644 ---- a/sysui/desktop/menus/writer.desktop -+++ b/sysui/desktop/menus/writer.desktop -@@ -31,8 +31,8 @@ X-GIO-NoFuse=true - Keywords=Text;Letter;Fax;Document;OpenDocument Text;Microsoft Word;Microsoft Works;Lotus WordPro;OpenOffice Writer;CV;odt;doc;docx;rtf; - InitialPreference=5 - StartupWMClass=libreoffice-writer --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav - X-TryExec=oowriter - - Actions=NewDocument; - [Desktop Action NewDocument] -diff --git a/sysui/desktop/menus/xsltfilter.desktop b/sysui/desktop/menus/xsltfilter.desktop -index 3dcad81..adea82a 100644 ---- a/sysui/desktop/menus/xsltfilter.desktop -+++ b/sysui/desktop/menus/xsltfilter.desktop -@@ -9,4 +9,4 @@ GenericName=XSLT based filters - NoDisplay=true - StartupNotify=true - X-GIO-NoFuse=true --X-KDE-Protocols=file,http,smb,ftp,webdav -+X-KDE-Protocols=file,http,ftp,webdav --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-fdo-37559-revert-adding-extra-dummy-polygon.patch b/SOURCES/0001-Resolves-fdo-37559-revert-adding-extra-dummy-polygon.patch deleted file mode 100644 index e04e56a..0000000 --- a/SOURCES/0001-Resolves-fdo-37559-revert-adding-extra-dummy-polygon.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 62ccbdf2233e10e70909a080f09465982a504474 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Wed, 5 Nov 2014 13:49:07 +0000 -Subject: [PATCH] Resolves: fdo#37559 revert adding extra dummy polygons to get - better gradients - -Change-Id: I38b8e7cb79540a99696ac09e4061c9d87440b2b2 ---- - drawinglayer/source/primitive2d/polygonprimitive2d.cxx | 3 +-- - svx/source/customshapes/EnhancedCustomShape2d.cxx | 16 ---------------- - svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 2 +- - 3 files changed, 2 insertions(+), 19 deletions(-) - -diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx -index 4a2944b..85b118f 100644 ---- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx -+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx -@@ -526,11 +526,10 @@ namespace drawinglayer - { - // copy local polygon, it may be changed - basegfx::B2DPolygon aLocalPolygon(getB2DPolygon()); -- aLocalPolygon.removeDoublePoints(); - basegfx::B2DPolyPolygon aArrowA; - basegfx::B2DPolyPolygon aArrowB; - -- if(!aLocalPolygon.isClosed() && aLocalPolygon.count() > 1) -+ if(!aLocalPolygon.isClosed()) - { - // apply arrows - const double fPolyLength(basegfx::tools::getLength(aLocalPolygon)); -diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx -index 1e0e818..64e08d9 100644 ---- a/svx/source/customshapes/EnhancedCustomShape2d.cxx -+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx -@@ -1902,22 +1902,6 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm - - if(aNewB2DPolyPolygon.count()) - { -- if( !bLineGeometryNeededOnly ) -- { -- // hack aNewB2DPolyPolygon to fill logic rect - this is -- // needed to produce gradient fills that look like mso -- aNewB2DPolygon.clear(); -- aNewB2DPolygon.append(basegfx::B2DPoint(0,0)); -- aNewB2DPolygon.setClosed(true); -- aNewB2DPolyPolygon.append(aNewB2DPolygon); -- -- aNewB2DPolygon.clear(); -- aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(), -- aLogicRect.GetHeight())); -- aNewB2DPolygon.setClosed(true); -- aNewB2DPolyPolygon.append(aNewB2DPolygon); -- } -- - // #i37011# - bool bForceCreateTwoObjects(false); - -diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx -index 7332449..fba8740 100644 ---- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx -+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx -@@ -606,7 +606,7 @@ void InsertMissingOutlinePoints( const Polygon& /*rOutlinePoly*/, const std::vec - void GetPoint( const Polygon& rPoly, const std::vector< double >& rDistances, const double& fX, double& fx1, double& fy1 ) - { - fy1 = fx1 = 0.0; -- if ( rPoly.GetSize() > 1 ) -+ if ( rPoly.GetSize() ) - { - std::vector< double >::const_iterator aIter = std::lower_bound( rDistances.begin(), rDistances.end(), fX ); - sal_uInt16 nIdx = sal::static_int_cast( std::distance( rDistances.begin(), aIter ) ); --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-fdo-68967-looping-layout.patch b/SOURCES/0001-Resolves-fdo-68967-looping-layout.patch deleted file mode 100644 index 8c89e8f..0000000 --- a/SOURCES/0001-Resolves-fdo-68967-looping-layout.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 1fec67aab152e0c0ad6dd85082c50f1beff7d520 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 16 Sep 2014 13:22:44 +0100 -Subject: [PATCH] Resolves: fdo#68967 looping layout - -RemoveFollowFlowLine() marks the layout invalid, but the -next cycle through does everything exactly the same again. - -Try the same foul horror as nUnSplitted. But at least with -a test-case that nails down reproducing the bug if a better -fix is needed. - -Change-Id: Id6698bcb2364bd0253bedd4a7c313e25f705be8d ---- - sw/qa/extras/ww8import/data/fdo68967.doc | Bin 0 -> 99328 bytes - sw/qa/extras/ww8import/ww8import.cxx | 4 ++++ - sw/source/core/layout/tabfrm.cxx | 7 +++++++ - 3 files changed, 11 insertions(+) - create mode 100644 sw/qa/extras/ww8import/data/fdo68967.doc - -diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx -index 06f38c7..f7a39f5 100644 ---- a/sw/source/core/layout/tabfrm.cxx -+++ b/sw/source/core/layout/tabfrm.cxx -@@ -1831,6 +1831,7 @@ void SwTabFrm::MakeAll() - } - - int nUnSplitted = 5; // Just another loop control :-( -+ int nThrowAwayValidLayoutLimit = 5; // And another one :-( - SWRECTFN( this ) - while ( !mbValidPos || !mbValidSize || !mbValidPrtArea ) - { -@@ -2301,7 +2302,13 @@ void SwTabFrm::MakeAll() - // An existing follow flow line has to be removed. - if ( HasFollowFlowLine() ) - { -+ if (!nThrowAwayValidLayoutLimit) -+ continue; -+ bool bInitialLoopEndCondition = mbValidPos && mbValidSize && mbValidPrtArea; - RemoveFollowFlowLine(); -+ bool bFinalLoopEndCondition = mbValidPos && mbValidSize && mbValidPrtArea; -+ if (bInitialLoopEndCondition && !bFinalLoopEndCondition) -+ --nThrowAwayValidLayoutLimit; - } - - const bool bSplitError = !Split( nDeadLine, bTryToSplit, ( bTableRowKeep && !bAllowSplitOfRow ) ); --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-fdo-78151-change-style-on-toggling-bullets-.patch b/SOURCES/0001-Resolves-fdo-78151-change-style-on-toggling-bullets-.patch deleted file mode 100644 index 6ab8336..0000000 --- a/SOURCES/0001-Resolves-fdo-78151-change-style-on-toggling-bullets-.patch +++ /dev/null @@ -1,810 +0,0 @@ -From 34dcadf5f7bec6a02e3269d4cffb27e036303b2a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 6 Jun 2014 15:13:26 +0100 -Subject: [PATCH] Resolves: fdo#78151 change style on toggling bullets on - master page outliners - -"do what I mean" - -In master pages prior to this if we toggle bullets on and off the that changes -the *level* of the paragraph. And because the paragraph is effectively a -preview of the equivalent style level, changing the level disconnects it from -the style which is useless for us. - -So instead turn the numbering off at the given outline level. In order to -toggle the numbering back split the defaults-setting into a reusable piece that -sets the numbering indent which we can call to toggle numbering back on - -Also split out the broadcast style change *and explicit child* broadcast code -into a reusable method, the absence of which left me stumped for well over an -hour as to why my changes only worked on level 1 - -Related: fdo#78151 force outliners in master view to be read-only text - -because these contain place-holder text and it doesn't make sense -to be able to edit them (unless some-day we support custom place-holder -prompts) - -because they are now read-only add a pair of "show next level" and "hide -last level" features so on right clicking the last outline paragraph -you can make the next one visible, or make the last one invisible - -Change-Id: Iea24d810f298156cfe2f32aa53d0515da45e08eb -(cherry picked from commit 7e600aca08ebbd69b0c8ef924c84af4dcf80df56) - -Change-Id: I311c7f35f1ca7dff1d151c6141ff5faa7f15c5a2 -(cherry picked from commit 8a5b3971057237b178f7e65437deec766b56f9c4) ---- - .../openoffice/Office/UI/DrawImpressCommands.xcu | 10 +++ - sd/inc/app.hrc | 5 +- - sd/inc/sdcommands.h | 2 + - sd/inc/stlpool.hxx | 2 + - sd/inc/stlsheet.hxx | 8 +++ - sd/sdi/_drvwsh.sdi | 10 +++ - sd/sdi/sdraw.sdi | 48 ++++++++++++++ - sd/source/core/stlpool.cxx | 57 +++++++++++----- - sd/source/core/stlsheet.cxx | 30 ++++++++- - sd/source/ui/app/popup.src | 13 ++++ - sd/source/ui/func/futempl.cxx | 21 +----- - sd/source/ui/inc/DrawViewShell.hxx | 6 ++ - sd/source/ui/inc/View.hxx | 19 ++++++ - sd/source/ui/view/drtxtob1.cxx | 76 ++++++++++++++++++++-- - sd/source/ui/view/drviews2.cxx | 50 ++++++++++++++ - sd/source/ui/view/drviews7.cxx | 66 +++++++++++++++++++ - sd/source/ui/view/sdview.cxx | 30 ++++++++- - 17 files changed, 408 insertions(+), 45 deletions(-) - -diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu -index b4b6366..31aa4d7 100644 ---- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu -+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu -@@ -584,6 +584,16 @@ - H~yperlink... - - -+ -+ -+ ~Hide Last Level -+ -+ -+ -+ -+ ~Show Next Level -+ -+ - - - ~Page... -diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc -index ef8631f..fae13da 100644 ---- a/sd/inc/app.hrc -+++ b/sd/inc/app.hrc -@@ -447,9 +447,10 @@ - - #define SID_ADD_MOTION_PATH (SID_SD_START+442) - #define SID_TABLE_TOOLBOX (SID_SD_START+443) -- - // free --#define SID_PRESENTATION_MINIMIZER (SID_SD_START+450) -+#define SID_HIDE_LAST_LEVEL (SID_SD_START+448) -+#define SID_SHOW_NEXT_LEVEL (SID_SD_START+449) -+#define SID_PRESENTATION_MINIMIZER (SID_SD_START+450) - #endif - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/sd/inc/sdcommands.h b/sd/inc/sdcommands.h -index 2041d8f..276bf6d 100644 ---- a/sd/inc/sdcommands.h -+++ b/sd/inc/sdcommands.h -@@ -119,6 +119,8 @@ - #define CMD_SID_INSERTPAGE_LAYOUT_MENU ".uno:TaskPaneInsertPage" - #define CMD_SID_PHOTOALBUM ".uno:PhotoAlbumDialog" - #define CMD_SID_PRESENTATION_MINIMIZER ".uno:PresentationMinimizer" -+#define CMD_SID_HIDE_LAST_LEVEL ".uno:HideLastLevel" -+#define CMD_SID_SHOW_NEXT_LEVEL ".uno:ShowNextLevel" - - #endif - -diff --git a/sd/inc/stlpool.hxx b/sd/inc/stlpool.hxx -index 31cb814..7af9fe9 100644 ---- a/sd/inc/stlpool.hxx -+++ b/sd/inc/stlpool.hxx -@@ -42,6 +42,7 @@ class SdStyleSheet; - class SdDrawDocument; - class SdPage; - class SfxStyleSheetBase; -+class SvxNumberFormat; - - typedef std::map< const SdPage*, SdStyleFamilyRef > SdStyleFamilyMap; - -@@ -92,6 +93,7 @@ public: - - static SdStyleSheetVector CreateChildList( SdStyleSheet* pSheet ); - -+ static void setDefaultOutlineNumberFormatBulletAndIndent(sal_uInt16 i, SvxNumberFormat &rNumberFormat); - - public: - void throwIfDisposed() throw(::com::sun::star::uno::RuntimeException); -diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx -index a64366b..d8b1183 100644 ---- a/sd/inc/stlsheet.hxx -+++ b/sd/inc/stlsheet.hxx -@@ -39,6 +39,8 @@ - - #include - -+#include "prlayout.hxx" -+ - class ModifyListenerForewarder; - - typedef cppu::ImplInheritanceHelper5< SfxUnoStyleSheet, -@@ -75,6 +77,12 @@ public: - - static SdStyleSheet* CreateEmptyUserStyle( SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily ); - -+ //Broadcast that a SdStyleSheet has changed, taking into account outline sublevels -+ //which need to be explicitly broadcast as changing if their parent style was -+ //the one that changed -+ static void BroadcastSdStyleSheetChange(SfxStyleSheetBase* pStyleSheet, PresentationObjects ePO, -+ SfxStyleSheetBasePool* pSSPool); -+ - // XInterface - virtual void SAL_CALL release( ) throw () SAL_OVERRIDE; - -diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi -index d328cf4..f8119e9 100644 ---- a/sd/sdi/_drvwsh.sdi -+++ b/sd/sdi/_drvwsh.sdi -@@ -2309,6 +2309,16 @@ interface DrawView - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] -+ SID_HIDE_LAST_LEVEL // ole : no, status : ? -+ [ -+ ExecMethod = FuTemporary ; -+ StateMethod = GetMenuState ; -+ ] -+ SID_SHOW_NEXT_LEVEL // ole : no, status : ? -+ [ -+ ExecMethod = FuTemporary ; -+ StateMethod = GetMenuState ; -+ ] - SID_TRANSLITERATE_UPPER // ole : no, status : ? - [ - ExecMethod = FuSupport ; -diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi -index 9a03c4f..de7f1a2 100644 ---- a/sd/sdi/sdraw.sdi -+++ b/sd/sdi/sdraw.sdi -@@ -7025,3 +7025,51 @@ SfxVoidItem PresentationMinimizer SID_PRESENTATION_MINIMIZER - ToolBoxConfig = TRUE, - GroupId = GID_OPTIONS; - ] -+ -+SfxVoidItem HideLastLevel SID_HIDE_LAST_LEVEL -+() -+[ -+ /* flags: */ -+ AutoUpdate = FALSE, -+ Cachable = Cachable, -+ FastCall = FALSE, -+ HasCoreId = FALSE, -+ HasDialog = TRUE, -+ ReadOnlyDoc = FALSE, -+ Toggle = FALSE, -+ Container = FALSE, -+ RecordAbsolute = FALSE, -+ RecordPerSet; -+ Synchron; -+ -+ /* config: */ -+ AccelConfig = FALSE, -+ MenuConfig = FALSE, -+ StatusBarConfig = FALSE, -+ ToolBoxConfig = FALSE, -+ GroupId = GID_OPTIONS; -+] -+ -+SfxVoidItem ShowNextLevel SID_SHOW_NEXT_LEVEL -+() -+[ -+ /* flags: */ -+ AutoUpdate = FALSE, -+ Cachable = Cachable, -+ FastCall = FALSE, -+ HasCoreId = FALSE, -+ HasDialog = TRUE, -+ ReadOnlyDoc = FALSE, -+ Toggle = FALSE, -+ Container = FALSE, -+ RecordAbsolute = FALSE, -+ RecordPerSet; -+ Synchron; -+ -+ /* config: */ -+ AccelConfig = FALSE, -+ MenuConfig = FALSE, -+ StatusBarConfig = FALSE, -+ ToolBoxConfig = FALSE, -+ GroupId = GID_OPTIONS; -+] -diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx -index c98dff7..8fdec5e 100644 ---- a/sd/source/core/stlpool.cxx -+++ b/sd/source/core/stlpool.cxx -@@ -1052,9 +1052,49 @@ void SdStyleSheetPool::UpdateStdNames() - } - } - --// Set new SvxNumBulletItem for the respective style sheet -+void SdStyleSheetPool::setDefaultOutlineNumberFormatBulletAndIndent(sal_uInt16 i, SvxNumberFormat &rNumberFormat) -+{ -+ rNumberFormat.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34 -+ rNumberFormat.SetBulletRelSize(45); -+ const short nLSpace = (i + 1) * 1200; -+ rNumberFormat.SetLSpace(nLSpace); -+ rNumberFormat.SetAbsLSpace(nLSpace); -+ short nFirstLineOffset = -600; -+ -+ switch(i) -+ { -+ case 0: -+ { -+ nFirstLineOffset = -900; -+ } -+ break; - -+ case 1: -+ { -+ rNumberFormat.SetBulletChar( 0x2013 ); // StarBats: 0xF000 + 150 -+ rNumberFormat.SetBulletRelSize(75); -+ nFirstLineOffset = -900; -+ } -+ break; - -+ case 2: -+ { -+ nFirstLineOffset = -800; -+ } -+ break; -+ -+ case 3: -+ { -+ rNumberFormat.SetBulletChar( 0x2013 ); // StarBats: 0xF000 + 150 -+ rNumberFormat.SetBulletRelSize(75); -+ } -+ break; -+ } -+ -+ rNumberFormat.SetFirstLineOffset(nFirstLineOffset); -+} -+ -+// Set new SvxNumBulletItem for the respective style sheet - void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, - Font& rBulletFont ) - { -@@ -1134,12 +1174,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, - SVX_MAX_NUM, false ); - for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ ) - { -- aNumberFormat.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34 -- aNumberFormat.SetBulletRelSize(45); -- const short nLSpace = (i + 1) * 1200; -- aNumberFormat.SetLSpace(nLSpace); -- aNumberFormat.SetAbsLSpace(nLSpace); -- short nFirstLineOffset = -600; -+ setDefaultOutlineNumberFormatBulletAndIndent(i, aNumberFormat); - - sal_uLong nFontSize = 20; - switch(i) -@@ -1147,36 +1182,28 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, - case 0: - { - nFontSize = 32; -- nFirstLineOffset = -900; - } - break; - - case 1: - { -- aNumberFormat.SetBulletChar( 0x2013 ); // StarBats: 0xF000 + 150 -- aNumberFormat.SetBulletRelSize(75); - nFontSize = 32; -- nFirstLineOffset = -900; - } - break; - - case 2: - { - nFontSize = 28; -- nFirstLineOffset = -800; - } - break; - - case 3: - { -- aNumberFormat.SetBulletChar( 0x2013 ); // StarBats: 0xF000 + 150 -- aNumberFormat.SetBulletRelSize(75); - nFontSize = 24; - } - break; - } - -- aNumberFormat.SetFirstLineOffset(nFirstLineOffset); - nFontSize = (sal_uInt16)((nFontSize * 2540L) / 72); // Pt --> 1/100 mm - rBulletFont.SetSize(Size(0,846)); // 24 pt - aNumberFormat.SetBulletFont(&rBulletFont); -diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx -index 5df055f..c0f34e0 100644 ---- a/sd/source/core/stlsheet.cxx -+++ b/sd/source/core/stlsheet.cxx -@@ -1364,12 +1364,38 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName ) t - return aRet; - } - -- -- - /** this is used because our property map is not sorted yet */ - const SfxItemPropertySimpleEntry* SdStyleSheet::getPropertyMapEntry( const OUString& rPropertyName ) const throw() - { - return GetStylePropertySet().getPropertyMapEntry(rPropertyName); - } - -+//Broadcast that a SdStyleSheet has changed, taking into account outline sublevels -+//which need to be explicitly broadcast as changing if their parent style was -+//the one that changed -+void SdStyleSheet::BroadcastSdStyleSheetChange(SfxStyleSheetBase* pStyleSheet, -+ PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) -+{ -+ SdStyleSheet* pRealSheet =((SdStyleSheet*)pStyleSheet)->GetRealStyleSheet(); -+ pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); -+ -+ if( (ePO >= PO_OUTLINE_1) && (ePO <= PO_OUTLINE_8) ) -+ { -+ OUString sStyleName(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE) + " "); -+ -+ for( sal_uInt16 n = (sal_uInt16)(ePO - PO_OUTLINE_1 + 2); n < 10; n++ ) -+ { -+ OUString aName( sStyleName + OUString::number(n) ); -+ -+ SfxStyleSheetBase* pSheet = pSSPool->Find( aName, SD_STYLE_FAMILY_PSEUDO); -+ -+ if(pSheet) -+ { -+ SdStyleSheet* pRealStyleSheet = ((SdStyleSheet*)pSheet)->GetRealStyleSheet(); -+ pRealStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); -+ } -+ } -+ } -+} -+ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/sd/source/ui/app/popup.src b/sd/source/ui/app/popup.src -index 7f8692f..1fd5561 100644 ---- a/sd/source/ui/app/popup.src -+++ b/sd/source/ui/app/popup.src -@@ -33,6 +33,19 @@ Menu RID_DRAW_TEXTOBJ_INSIDE_POPUP - { - ItemList = - { -+ MenuItem -+ { -+ Identifier = SID_HIDE_LAST_LEVEL; -+ Command = CMD_SID_HIDE_LAST_LEVEL; -+ Text [ en-US ] = "~Hide Last Level"; -+ }; -+ MenuItem -+ { -+ Identifier = SID_SHOW_NEXT_LEVEL; -+ Command = CMD_SID_SHOW_NEXT_LEVEL; -+ Text [ en-US ] = "~Show Next Level"; -+ }; -+ SEPARATOR - MN_SET_DEFAULT - SEPARATOR - MN_TEXTATTR -diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx -index 1dd0c40..42b453c 100644 ---- a/sd/source/ui/func/futempl.cxx -+++ b/sd/source/ui/func/futempl.cxx -@@ -428,27 +428,8 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) - } - } - -- OUString sStyleName(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE) + " "); -- - pStyleSheet->GetItemSet().Put(aTempSet); -- SdStyleSheet* pRealSheet =((SdStyleSheet*)pStyleSheet)->GetRealStyleSheet(); -- pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); -- -- if( (ePO >= PO_OUTLINE_1) && (ePO <= PO_OUTLINE_8) ) -- { -- for( sal_uInt16 n = (sal_uInt16)(ePO - PO_OUTLINE_1 + 2); n < 10; n++ ) -- { -- OUString aName( sStyleName + OUString::number(n) ); -- -- SfxStyleSheetBase* pSheet = pSSPool->Find( aName, SD_STYLE_FAMILY_PSEUDO); -- -- if(pSheet) -- { -- SdStyleSheet* pRealStyleSheet = ((SdStyleSheet*)pSheet)->GetRealStyleSheet(); -- pRealStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); -- } -- } -- } -+ SdStyleSheet::BroadcastSdStyleSheetChange(pStyleSheet, ePO, pSSPool); - } - - SfxItemSet& rAttr = pStyleSheet->GetItemSet(); -diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx -index 7ec42ea..6e4b55a 100644 ---- a/sd/source/ui/inc/DrawViewShell.hxx -+++ b/sd/source/ui/inc/DrawViewShell.hxx -@@ -32,6 +32,7 @@ - #include - #include - -+class Outliner; - class SdPage; - class SdrExternalToolEdit; - class DrawDocShell; -@@ -43,6 +44,7 @@ class TransferableClipboardListener; - class AbstractSvxNameDialog; - class SdrLayer; - class SvxClipboardFmtItem; -+struct ESelection; - - namespace sd { - -@@ -163,6 +165,10 @@ public: - virtual OUString GetSelectionText( bool bCompleteWords = false ); - virtual bool HasSelection( bool bText = true ) const; - -+ //If we are editing an PRESOBJ_OUTLINE return the Outliner and fill rSel -+ //with the current selection -+ ::Outliner* GetOutlinerForMasterPageOutlineTextObj(ESelection &rSel); -+ - void ExecCtrl(SfxRequest& rReq); - void GetCtrlState(SfxItemSet& rSet); - void GetDrawAttrState(SfxItemSet& rSet); -diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx -index cd80568..2c59ade 100644 ---- a/sd/source/ui/inc/View.hxx -+++ b/sd/source/ui/inc/View.hxx -@@ -63,6 +63,24 @@ struct SdViewRedrawRec - Rectangle aRect; - }; - -+//For master view we want to force that master -+//textboxes have readonly text, because the -+//text is the auto-generated click-here-to-edit -+//and it doesn't help to change it -+class OutlinerMasterViewFilter -+{ -+private: -+ SdrOutliner *m_pOutl; -+ bool m_bReadOnly; -+public: -+ OutlinerMasterViewFilter() -+ : m_pOutl(0) -+ , m_bReadOnly(false) -+ { -+ } -+ void Start(SdrOutliner *pOutl); -+ void End(); -+}; - - class View : public FmFormView - { -@@ -275,6 +293,7 @@ protected: - - private: - ::std::auto_ptr mpClipboard; -+ OutlinerMasterViewFilter maMasterViewFilter; - }; - - -diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx -index 605983c..761ed63 100644 ---- a/sd/source/ui/view/drtxtob1.cxx -+++ b/sd/source/ui/view/drtxtob1.cxx -@@ -57,10 +57,14 @@ - #include - - #include "app.hrc" -- -+#include "glob.hrc" -+#include "sdresid.hxx" -+#include "prlayout.hxx" - #include "ViewShell.hxx" - #include "drawview.hxx" - #include "drawdoc.hxx" -+#include "stlpool.hxx" -+#include "stlsheet.hxx" - #include "OutlineView.hxx" - #include "Window.hxx" - #include "futempl.hxx" -@@ -316,10 +320,74 @@ void TextObjectBar::Execute( SfxRequest &rReq ) - break; - - case FN_NUM_BULLET_ON: -- if( pOLV ) -- pOLV->ToggleBullets(); -- break; -+ { -+ if (pOLV) -+ { -+ bool bMasterPage = false; -+ SdrPageView* pPageView = mpView->GetSdrPageView(); -+ if (pPageView) -+ { -+ SdPage* pPage = (SdPage*)pPageView->GetPage(); -+ bMasterPage = pPage && (pPage->GetPageKind() == PK_STANDARD) && pPage->IsMasterPage(); -+ } - -+ if (!bMasterPage) -+ pOLV->ToggleBullets(); -+ else -+ { -+ //Resolves: fdo#78151 in master pages if we toggle bullets on -+ //and off then just disable/enable the bulleting, but do not -+ //change the *level* of the paragraph, because the paragraph is -+ //effectively a preview of the equivalent style level, and -+ //changing the level disconnects it from the style -+ -+ ::Outliner* pOL = pOLV->GetOutliner(); -+ if (pOL) -+ { -+ const SvxNumBulletItem *pItem = NULL; -+ SfxStyleSheetBasePool* pSSPool = mpView->GetDocSh()->GetStyleSheetPool(); -+ OUString sStyleName(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE) + " 1"); -+ SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find(sStyleName, SD_STYLE_FAMILY_PSEUDO); -+ if( pFirstStyleSheet ) -+ pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, (const SfxPoolItem**)&pItem); -+ -+ if (pItem ) -+ { -+ SvxNumRule aNewRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); -+ ESelection aSel = pOLV->GetSelection(); -+ aSel.Adjust(); -+ sal_Int32 nStartPara = aSel.nStartPara; -+ sal_Int32 nEndPara = aSel.nEndPara; -+ for (sal_Int32 nPara = nStartPara; nPara <= nEndPara; ++nPara) -+ { -+ sal_uInt16 nLevel = pOL->GetDepth(nPara); -+ SvxNumberFormat aFmt(aNewRule.GetLevel(nLevel)); -+ -+ if (aFmt.GetNumberingType() == SVX_NUM_NUMBER_NONE) -+ { -+ aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); -+ SdStyleSheetPool::setDefaultOutlineNumberFormatBulletAndIndent(nLevel, aFmt); -+ } -+ else -+ { -+ aFmt.SetNumberingType(SVX_NUM_NUMBER_NONE); -+ aFmt.SetLSpace(0); -+ aFmt.SetAbsLSpace(0); -+ aFmt.SetFirstLineOffset(0); -+ } -+ -+ aNewRule.SetLevel(nLevel, aFmt); -+ } -+ -+ pFirstStyleSheet->GetItemSet().Put(SvxNumBulletItem(aNewRule, EE_PARA_NUMBULLET)); -+ -+ SdStyleSheet::BroadcastSdStyleSheetChange(pFirstStyleSheet, PO_OUTLINE_1, pSSPool); -+ } -+ } -+ } -+ } -+ break; -+ } - case SID_GROW_FONT_SIZE: - case SID_SHRINK_FONT_SIZE: - { -diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx -index 688432e..685adbd 100644 ---- a/sd/source/ui/view/drviews2.cxx -+++ b/sd/source/ui/view/drviews2.cxx -@@ -1799,6 +1799,56 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) - } - break; - -+ case SID_HIDE_LAST_LEVEL: -+ { -+ ESelection aSel; -+ // fdo#78151 editing a PRESOBJ_OUTLINE in a master page ? -+ ::Outliner* pOL = GetOutlinerForMasterPageOutlineTextObj(aSel); -+ if (pOL) -+ { -+ //we are on the last paragraph -+ aSel.Adjust(); -+ if (aSel.nEndPara == pOL->GetParagraphCount() - 1) -+ { -+ sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara); -+ //there exists a previous numbering level -+ if (nDepth != sal_uInt16(-1) && nDepth > 0) -+ { -+ Paragraph* pPara = pOL->GetParagraph(aSel.nEndPara); -+ pOL->Remove(pPara, 1); -+ } -+ } -+ } -+ Cancel(); -+ rReq.Done (); -+ } -+ break; -+ -+ case SID_SHOW_NEXT_LEVEL: -+ { -+ ESelection aSel; -+ // fdo#78151 editing a PRESOBJ_OUTLINE in a master page ? -+ ::Outliner* pOL = GetOutlinerForMasterPageOutlineTextObj(aSel); -+ if (pOL) -+ { -+ //we are on the last paragraph -+ aSel.Adjust(); -+ if (aSel.nEndPara == pOL->GetParagraphCount() - 1) -+ { -+ sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara); -+ //there exists a previous numbering level -+ if (nDepth != sal_uInt16(-1) && nDepth < 8) -+ { -+ sal_uInt16 nNewDepth = nDepth+1; -+ pOL->Insert(SD_RESSTR(STR_PRESOBJ_MPOUTLINE+nNewDepth), EE_PARA_APPEND, nNewDepth); -+ } -+ } -+ } -+ Cancel(); -+ rReq.Done (); -+ } -+ break; -+ - case SID_INSERT_FLD_DATE_FIX: - case SID_INSERT_FLD_DATE_VAR: - case SID_INSERT_FLD_TIME_FIX: -diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx -index 81e2e00..d57b4a6 100644 ---- a/sd/source/ui/view/drviews7.cxx -+++ b/sd/source/ui/view/drviews7.cxx -@@ -212,6 +212,37 @@ void DrawViewShell::GetDrawAttrState(SfxItemSet& rSet) - rSet.Put(aSet,false); - } - -+::Outliner* DrawViewShell::GetOutlinerForMasterPageOutlineTextObj(ESelection &rSel) -+{ -+ if( !mpDrawView ) -+ return NULL; -+ -+ //when there is one object selected -+ if (!mpDrawView->AreObjectsMarked() || (mpDrawView->GetMarkedObjectList().GetMarkCount() != 1)) -+ return NULL; -+ -+ //and we are editing the outline object -+ if (!mpDrawView->IsTextEdit()) -+ return NULL; -+ -+ SdrPageView* pPageView = mpDrawView->GetSdrPageView(); -+ if (!pPageView) -+ return NULL; -+ -+ SdPage* pPage = (SdPage*)pPageView->GetPage(); -+ //only show these in a normal master page -+ if (!pPage || (pPage->GetPageKind() != PK_STANDARD) || !pPage->IsMasterPage()) -+ return NULL; -+ -+ OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView(); -+ ::Outliner* pOL = pOLV ? pOLV->GetOutliner() : NULL; -+ if (!pOL) -+ return NULL; -+ rSel = pOLV->GetSelection(); -+ -+ return pOL; -+} -+ - void DrawViewShell::GetMenuState( SfxItemSet &rSet ) - { - if (mpDrawView == NULL) -@@ -1565,6 +1596,41 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) - if ( bDisableEditHyperlink ) - rSet.DisableItem( SID_OPEN_HYPERLINK ); - -+ //fdo#78151 enable show next level/hide last level if editing a master page -+ //PRESOBJ_OUTLINE object and the current selection allow that to happen -+ { -+ bool bDisableShowNextLevel = true; -+ bool bDisableHideLastLevel = true; -+ -+ ESelection aSel; -+ ::Outliner* pOL = GetOutlinerForMasterPageOutlineTextObj(aSel); -+ if (pOL) -+ { -+ //and are on the last paragraph -+ aSel.Adjust(); -+ if (aSel.nEndPara == pOL->GetParagraphCount() - 1) -+ { -+ sal_uInt16 nDepth = pOL->GetDepth(aSel.nEndPara); -+ if (nDepth != sal_uInt16(-1)) -+ { -+ //there exists another numbering level that -+ //is currently hidden -+ if (nDepth < 8) -+ bDisableShowNextLevel = false; -+ //there exists a previous numbering level -+ if (nDepth > 0) -+ bDisableHideLastLevel = false; -+ } -+ } -+ } -+ -+ if (bDisableShowNextLevel) -+ rSet.DisableItem(SID_SHOW_NEXT_LEVEL); -+ -+ if (bDisableHideLastLevel) -+ rSet.DisableItem(SID_HIDE_LAST_LEVEL); -+ } -+ - #if defined WNT || defined UNX - if( !mxScannerManager.is() ) - { -diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx -index 53e48a5..8755f8e 100644 ---- a/sd/source/ui/view/sdview.cxx -+++ b/sd/source/ui/view/sdview.cxx -@@ -653,12 +653,33 @@ static void SetSpellOptions( const SdDrawDocument& rDoc, sal_uLong& rCntrl ) - rCntrl &= ~EE_CNTRL_ONLINESPELLING; - } - -+void OutlinerMasterViewFilter::Start(SdrOutliner *pOutl) -+{ -+ m_pOutl = pOutl; -+ OutlinerView* pOutlView = m_pOutl->GetView(0); -+ m_bReadOnly = pOutlView->IsReadOnly(); -+ pOutlView->SetReadOnly(true); -+} -+ -+void OutlinerMasterViewFilter::End() -+{ -+ if (m_pOutl) -+ { -+ OutlinerView* pOutlView = m_pOutl->GetView(0); -+ pOutlView->SetReadOnly(m_bReadOnly); -+ m_pOutl = NULL; -+ } -+} -+ - bool View::SdrBeginTextEdit( - SdrObject* pObj, SdrPageView* pPV, ::Window* pWin, - bool bIsNewObj, - SdrOutliner* pOutl, OutlinerView* pGivenOutlinerView, - bool bDontDeleteOutliner, bool bOnlyOneView, bool bGrabFocus ) - { -+ SdrPage* pPage = pObj->GetPage(); -+ bool bMasterPage = pPage && pPage->IsMasterPage(); -+ - GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent( - sd::tools::EventMultiplexerEvent::EID_BEGIN_TEXT_EDIT, (void*)pObj ); - -@@ -731,12 +752,17 @@ bool View::SdrBeginTextEdit( - } - } - -- return(bReturn); -+ if (bMasterPage && bReturn) -+ maMasterViewFilter.Start(pOutl); -+ -+ return bReturn; - } - - /** ends current text editing */ --SdrEndTextEditKind View::SdrEndTextEdit(bool bDontDeleteReally ) -+SdrEndTextEditKind View::SdrEndTextEdit(bool bDontDeleteReally) - { -+ maMasterViewFilter.End(); -+ - SdrObjectWeakRef xObj( GetTextEditObject() ); - - bool bDefaultTextRestored = RestoreDefaultText( dynamic_cast< SdrTextObj* >( GetTextEditObject() ) ); --- -2.1.0 - diff --git a/SOURCES/0001-Resolves-fdo-80911-don-t-swap-notes-page-width-heigh.patch b/SOURCES/0001-Resolves-fdo-80911-don-t-swap-notes-page-width-heigh.patch deleted file mode 100644 index c7c70c1..0000000 --- a/SOURCES/0001-Resolves-fdo-80911-don-t-swap-notes-page-width-heigh.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 8e4c1db34025dff41f4576865e49f1e9f990aa9f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 18 Sep 2014 11:40:26 +0100 -Subject: [PATCH] Resolves: fdo#80911 don't swap notes page width/height - -IsDraw doesn't mean the app/page is Draw - -it means a slide in impress. - -commit 7b31e45ec7106d2cfbdbb7915d97667ba710f81c -Date: Mon Jun 23 20:55:21 2014 +0100 - Make Draw use paper size when printing - fdo#63905 - - Previously, Draw/Impress use the default size from the printer. - Now Draw uses the paper size (specified in page formatting). - Impress still uses the old method - not sure if this is correct - but printing handouts etc probably complicate print/paper size. - -suggests the intent is for this to not affect Impress and to only -affect Draw, so this does that - -(cherry picked from commit f1f89f0202232635e7fbbd7ca47de51755b2bce0) - -Conflicts: - sd/source/ui/view/DocumentRenderer.cxx - -Change-Id: I481a824ef244fd837992c893f6de0c051af0a26b - -(cherry picked from commit cca120ad92ecab741ca9683f3cf76d9e4fc81729) - -Conflicts: - sd/source/ui/view/DocumentRenderer.cxx - -Change-Id: I9826f69d03de85ea8d2b2c025121599877798852 ---- - sd/source/ui/view/DocumentRenderer.cxx | 31 +++++++++++++++++-------------- - 1 file changed, 17 insertions(+), 14 deletions(-) - -diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx -index 7080e9d..8e1739c 100644 ---- a/sd/source/ui/view/DocumentRenderer.cxx -+++ b/sd/source/ui/view/DocumentRenderer.cxx -@@ -1409,6 +1409,7 @@ private: - SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc(); - bool bIsDraw = pDocument->GetDocumentType() == DOCUMENT_TYPE_DRAW; - rInfo.meOrientation = ORIENTATION_PORTRAIT; -+ bool bDoDodgyHeightWidthFit = !bIsDraw && !mpOptions->IsNotes(); - - if( ! mpOptions->IsBooklet()) - { -@@ -1418,9 +1420,9 @@ private: - else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height()) - rInfo.meOrientation = ORIENTATION_LANDSCAPE; - -- // Draw should abide by specified paper size -+ // Draw and Notes should abide by their specified paper size - Size aPaperSize; -- if (bIsDraw) -+ if (!bDoDodgyHeightWidthFit) - { - aPaperSize.setWidth(rInfo.maPageSize.Width()); - aPaperSize.setHeight(rInfo.maPageSize.Height()); -@@ -1431,18 +1433,19 @@ private: - aPaperSize.setHeight(rInfo.mpPrinter->GetPaperSize().Height()); - } - -- if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE && -- (aPaperSize.Width() < aPaperSize.Height())) -- || -- (rInfo.meOrientation == ORIENTATION_PORTRAIT && -- (aPaperSize.Width() > aPaperSize.Height())) -- ) -- { -- maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width()); -- } -- else -+ maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height()); -+ -+ if (bDoDodgyHeightWidthFit) - { -- maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height()); -+ if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE && -+ (aPaperSize.Width() < aPaperSize.Height())) -+ || -+ (rInfo.meOrientation == ORIENTATION_PORTRAIT && -+ (aPaperSize.Width() > aPaperSize.Height())) -+ ) -+ { -+ maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width()); -+ } - } - - return true; --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-fdo-81487-pasting-into-outline-view-crashes.patch b/SOURCES/0001-Resolves-fdo-81487-pasting-into-outline-view-crashes.patch deleted file mode 100644 index 4cbecd5..0000000 --- a/SOURCES/0001-Resolves-fdo-81487-pasting-into-outline-view-crashes.patch +++ /dev/null @@ -1,48 +0,0 @@ -From a5793f5e0013b156600fd718d8f77870a9e73032 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 18 Jul 2014 09:06:44 +0100 -Subject: [PATCH] Resolves: fdo#81487 pasting into outline view crashes impress - -CreateTitleTextObject will call indirectly ImpPageChange which -triggers tools::EventMultiplexerEvent::EID_PAGE_ORDER and so -in outlview.cxx without ignore page changes level in action -the outliner is filled in from the slide contents in -FillOutliner clearing the outliner contents and filling it -fresh, but.. - -a) this hack tower is not prepared for all the outliner -iterators to become invalid -b) the contents of this title object is empty, because -it was just created, and we didn't get a chance to fill -in its text. - -This all works for typing vs pasting because the KeyInput -uses the OutlineViewPageChangesGuard guard which sets the -ignore pages changes bit. - -So, given that OutlineView::UpdateDocument expects -the iterators of the outliner to be valid during -the lifetime of the method lock the full method with -the OutlineViewPageChangesGuard guard - -Change-Id: Iecbf37d54f5f0c5a181be5f27832f769a3d2e389 ---- - sd/source/ui/view/outlview.cxx | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx -index 268a32b..a76bb0b 100644 ---- a/sd/source/ui/view/outlview.cxx -+++ b/sd/source/ui/view/outlview.cxx -@@ -1535,6 +1535,8 @@ void OutlineView::EndModelChange() - /** updates all changes in the outliner model to the draw model */ - void OutlineView::UpdateDocument() - { -+ OutlineViewPageChangesGuard aGuard(this); -+ - const sal_uInt32 nPageCount = mrDoc.GetSdPageCount(PK_STANDARD); - Paragraph* pPara = mrOutliner.GetParagraph( 0 ); - sal_uInt32 nPage; --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-rhbz-1161238-sync-PRESOBJ_OUTLINE-para-dept.patch b/SOURCES/0001-Resolves-rhbz-1161238-sync-PRESOBJ_OUTLINE-para-dept.patch deleted file mode 100644 index 9055061..0000000 --- a/SOURCES/0001-Resolves-rhbz-1161238-sync-PRESOBJ_OUTLINE-para-dept.patch +++ /dev/null @@ -1,95 +0,0 @@ -From a6ddf90a2c4070d9c2355b7349db9f02b2119dc4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 7 Nov 2014 14:16:58 +0000 -Subject: [PATCH] Resolves: rhbz#1161238 sync PRESOBJ_OUTLINE para depths to - outline numbering - -same problem as fdo#78151, except that pre-existing documents created -before the bullet/numbering toggling UI change have PRESOBJ_OUTLINEs with -paras in them with "numbering off" but the outline level they are a -preview of still have numbering enabled. - -Leave the actual numbering styles alone in this case and toggle the -PRESOBJ_OUTLINEs paras back to the level they "really" are - -Change-Id: I76508f88b5003afd1740feee3ec328326117f896 ---- - sd/source/filter/xml/sdxmlwrp.cxx | 48 +++++++++++++++++++++++++++++++++++++++ - 1 file changed, 48 insertions(+) - -diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx -index 411e7b1..65a52ac 100644 ---- a/sd/source/filter/xml/sdxmlwrp.cxx -+++ b/sd/source/filter/xml/sdxmlwrp.cxx -@@ -26,6 +26,7 @@ - #include - #include - #include "drawdoc.hxx" -+#include "Outliner.hxx" - #include - #include - -@@ -415,6 +416,51 @@ sal_Int32 ReadThroughComponent( - - - -+//PRESOBJ_OUTLINEs in master pages are the preview of the outline styles -+//numbering format. Since fdo#78151 toggling bullets on and off changes -+//the style they are a preview of, previously toggling bullets on and off -+//would only affect the preview paragraph itself without an effect on the -+//style. i.e. previews of numbering which don't match the real numbering -+//they are supposed to be a preview of. -+// -+//But there exist documents which were saved previous to that modification -+//so here we detect such cases and fix them up to ensure the previews -+//numbering level matches that of the outline level it previews -+void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc) -+{ -+ for (sal_uInt16 i = 0; i < pDoc->GetMasterSdPageCount(PK_STANDARD); ++i) -+ { -+ SdPage *pMasterPage = pDoc->GetMasterSdPage(i, PK_STANDARD); -+ SdrObject* pMasterOutline = pMasterPage->GetPresObj(PRESOBJ_OUTLINE); -+ if (!pMasterOutline) -+ continue; -+ OutlinerParaObject* pOutlParaObj = pMasterOutline->GetOutlinerParaObject(); -+ if (!pOutlParaObj) -+ continue; -+ ::sd::Outliner* pOutliner = pDoc->GetInternalOutliner(); -+ pOutliner->Clear(); -+ pOutliner->SetText(*pOutlParaObj); -+ bool bInconsistent = false; -+ const sal_Int32 nParaCount = pOutliner->GetParagraphCount(); -+ for (sal_Int32 j = 0; j < nParaCount; ++j) -+ { -+ const sal_Int16 nExpectedDepth = j; -+ if (nExpectedDepth != pOutliner->GetDepth(j)) -+ { -+ Paragraph* p = pOutliner->GetParagraph(j); -+ pOutliner->SetDepth(p, nExpectedDepth); -+ bInconsistent = true; -+ } -+ } -+ if (bInconsistent) -+ { -+ SAL_WARN("sd.filter", "Fixing inconsistent outline numbering placeholder preview depth"); -+ pMasterOutline->SetOutlinerParaObject(pOutliner->CreateParaObject(0, nParaCount)); -+ } -+ pOutliner->Clear(); -+ } -+} -+ - bool SdXMLFilter::Import( ErrCode& nError ) - { - sal_uInt32 nRet = 0; -@@ -779,6 +825,8 @@ bool SdXMLFilter::Import( ErrCode& nError ) - } - } - -+ fixupOutlinePlaceholderNumberingDepths(pDoc); -+ - pDoc->EnableUndo(true); - mrDocShell.ClearUndoBuffer(); - return nRet == 0; --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch b/SOURCES/0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch deleted file mode 100644 index 2751bf4..0000000 --- a/SOURCES/0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch +++ /dev/null @@ -1,132 +0,0 @@ -From dffb7a52ddba02b725d0f1d2438931e20655475f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Wed, 18 Feb 2015 15:04:45 +0000 -Subject: [PATCH] Resolves: rhbz#1193971 clear hard-coded char props in table - cells... -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -like we do already for shapes. So now when attempting to set replacement char -properties on the entire cell, clear any hard-coded sub ranges within the -existing paragraphs. - -This extends the effort of -commit a217f3cb2dce71a4322f78ceb45edb6f171b2b65 -Author: Matúš Kukan -Date: Tue Aug 26 10:16:34 2014 +0200 - - bnc#770711: Make changing table text color in impress always work - -to encompass all character properties, not just color - -(cherry picked from commit b14259b946686c753c0df42c519fc2537e871601) - -Conflicts: - svx/source/table/cell.cxx - -Change-Id: If8b426c3531b4678868d8351426db32c3c558650 ---- - svx/source/svdraw/svdedtv1.cxx | 38 ++++++++++++++++++++++---------------- - svx/source/table/cell.cxx | 15 +++++++++++++-- - 2 files changed, 35 insertions(+), 18 deletions(-) - -diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx -index 7945d2c..928f9e2 100644 ---- a/svx/source/svdraw/svdedtv1.cxx -+++ b/svx/source/svdraw/svdedtv1.cxx -@@ -953,6 +953,26 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con - } - } - -+std::vector GetAllCharPropIds(const SfxItemSet& rSet) -+{ -+ std::vector aCharWhichIds; -+ { -+ SfxItemIter aIter(rSet); -+ const SfxPoolItem* pItem=aIter.FirstItem(); -+ while (pItem!=NULL) -+ { -+ if (!IsInvalidItem(pItem)) -+ { -+ sal_uInt16 nWhich = pItem->Which(); -+ if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END) -+ aCharWhichIds.push_back( nWhich ); -+ } -+ pItem=aIter.NextItem(); -+ } -+ } -+ return aCharWhichIds; -+} -+ - void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) - { - if (AreObjectsMarked()) -@@ -977,25 +997,11 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) - } - #endif - -- // #103836# if the user thets character attributes to the complete shape, -+ // #103836# if the user sets character attributes to the complete shape, - // we want to remove all hard set character attributes with same - // which ids from the text. We do that later but here we remember - // all character attribute which id's that are set. -- std::vector aCharWhichIds; -- { -- SfxItemIter aIter(rAttr); -- const SfxPoolItem* pItem=aIter.FirstItem(); -- while( pItem!=NULL ) -- { -- if (!IsInvalidItem(pItem)) -- { -- sal_uInt16 nWhich = pItem->Which(); -- if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END) -- aCharWhichIds.push_back( nWhich ); -- } -- pItem=aIter.NextItem(); -- } -- } -+ std::vector aCharWhichIds(GetAllCharPropIds(rAttr)); - - // To make Undo reconstruct text attributes correctly after Format.Standard - bool bHasEEItems=SearchOutlinerItems(rAttr,bReplaceAll); -diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx -index 8d64dbc..7c2e5eb 100644 ---- a/svx/source/table/cell.cxx -+++ b/svx/source/table/cell.cxx -@@ -139,6 +139,8 @@ SdrText* CellTextProvider::getText(sal_Int32 nIndex) const - - } - -+extern std::vector GetAllCharPropIds(const SfxItemSet& rSet); -+ - namespace sdr - { - namespace properties -@@ -261,12 +263,21 @@ namespace sdr - - sal_Int32 nParaCount(pOutliner->GetParagraphCount()); - -+ // if the user sets character attributes to the complete -+ // cell we want to remove all hard set character attributes -+ // with same which ids from the text -+ std::vector aCharWhichIds(GetAllCharPropIds(rSet)); -+ - for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++) - { - SfxItemSet aSet(pOutliner->GetParaAttribs(nPara)); - aSet.Put(rSet); -- if (aSet.GetItemState(EE_CHAR_COLOR, false) == SFX_ITEM_ON) -- pOutliner->QuickRemoveCharAttribs( nPara, EE_CHAR_COLOR ); -+ -+ for (std::vector::const_iterator aI = aCharWhichIds.begin(); aI != aCharWhichIds.end(); ++aI) -+ { -+ pOutliner->QuickRemoveCharAttribs(nPara, *aI); -+ } -+ - pOutliner->SetParaAttribs(nPara, aSet); - } - --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-rhbz-1204244-group-sdb-windows-together-as-.patch b/SOURCES/0001-Resolves-rhbz-1204244-group-sdb-windows-together-as-.patch deleted file mode 100644 index ea2244a..0000000 --- a/SOURCES/0001-Resolves-rhbz-1204244-group-sdb-windows-together-as-.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 71c00b3e96fb639e0ff0815608827936219adac5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 23 Mar 2015 10:41:21 +0000 -Subject: [PATCH] Resolves: rhbz#1204244 group sdb windows together as 'base' - -Change-Id: Ie0d17e562b24a8108d79d13592fff3bf2b9a6713 ---- - framework/source/helper/titlebarupdate.cxx | 20 ++++++-------------- - 1 file changed, 6 insertions(+), 14 deletions(-) - -diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx -index 7626309..b79b5b2 100644 ---- a/framework/source/helper/titlebarupdate.cxx -+++ b/framework/source/helper/titlebarupdate.cxx -@@ -139,25 +139,17 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr - - OUString sDesktopName; - OUString aModuleId = xModuleManager->identify(xFrame); -- if ( aModuleId == "com.sun.star.text.TextDocument" || -- aModuleId == "com.sun.star.text.GlobalDocument" || -- aModuleId == "com.sun.star.text.WebDocument" || -- aModuleId == "com.sun.star.xforms.XMLFormDocument" ) -+ if ( aModuleId.startsWith("com.sun.star.text.") || aModuleId.startsWith("com.sun.star.xforms.") ) - sDesktopName = "Writer"; -- else if ( aModuleId == "com.sun.star.sheet.SpreadsheetDocument" ) -+ else if ( aModuleId.startsWith("com.sun.star.sheet.") ) - sDesktopName = "Calc"; -- else if ( aModuleId == "com.sun.star.presentation.PresentationDocument" ) -+ else if ( aModuleId.startsWith("com.sun.star.presentation.") ) - sDesktopName = "Impress"; -- else if ( aModuleId == "com.sun.star.drawing.DrawingDocument" ) -+ else if ( aModuleId.startsWith("com.sun.star.drawing." ) ) - sDesktopName = "Draw"; -- else if ( aModuleId == "com.sun.star.formula.FormulaProperties" ) -+ else if ( aModuleId.startsWith("com.sun.star.formula." ) ) - sDesktopName = "Math"; -- else if ( aModuleId == "com.sun.star.sdb.DatabaseDocument" || -- aModuleId == "com.sun.star.sdb.OfficeDatabaseDocument" || -- aModuleId == "com.sun.star.sdb.RelationDesign" || -- aModuleId == "com.sun.star.sdb.QueryDesign" || -- aModuleId == "com.sun.star.sdb.TableDesign" || -- aModuleId == "com.sun.star.sdb.DataSourceBrowser" ) -+ else if ( aModuleId.startsWith("com.sun.star.sdb.") ) - sDesktopName = "Base"; - else - sDesktopName = "Startcenter"; --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-rhbz-1215060-get-LibreOffice-to-load-specif.patch b/SOURCES/0001-Resolves-rhbz-1215060-get-LibreOffice-to-load-specif.patch deleted file mode 100644 index c3b78cd..0000000 --- a/SOURCES/0001-Resolves-rhbz-1215060-get-LibreOffice-to-load-specif.patch +++ /dev/null @@ -1,619 +0,0 @@ -From fa8128adf0bdd7698a2806fd277da2ff61bb8dfa Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 28 Oct 2014 11:35:18 +0000 -Subject: [PATCH] Resolves: rhbz#1215060 get LibreOffice to load specific - Polarion .docx - -coverity#1000600 Division or modulo by zero - -Change-Id: I38fb8a7072eb7905f5dccc8697b3176d8b34c6c2 -(cherry picked from commit 04343704ae9e5b2be4a47f7ba8ef35174db7076d) - -coverity#1202781 Division or modulo by zero - -(cherry picked from commit 54ba9587c0f1d3b5206742339af4907047fb4748) - -Conflicts: - filter/source/graphicfilter/epict/epict.cxx - svtools/source/misc/imap.cxx - -Change-Id: I2908c57badd079c8f19c679f40ed815ce2cba374 - -coverity#1000600 Division or modulo by float zero - -Change-Id: If39679b54ef1bb0a7af794c2f7a6186ebd69c2e0 -(cherry picked from commit 2149e924cbc32c370128c5f87a4f55c50c99e6bd) - -be a little more consistent stylewise - -(cherry picked from commit 2d5130ebab13fb94b07950a03b7051825b3d5b15) - -Conflicts: - vcl/source/outdev/map.cxx - -Change-Id: If1d822e0e6c87e792ff4a769a525e161505325c9 - -Related: rhbz#1215060 pass std::exceptions through - -(cherry picked from commit cb4276278962c2cbd47d0685881fb2460bf31c70) - -Conflicts: - writerfilter/source/ooxml/OOXMLFastContextHandler.hxx - -Change-Id: Ifb3431a50f92b95dfc1e851f9584533271e69324 ---- - filter/source/graphicfilter/epict/epict.cxx | 2 +- - include/o3tl/numeric.hxx | 28 +++++++++++++ - svtools/source/misc/imap.cxx | 2 +- - sw/source/core/docnode/ndtbl.cxx | 22 ++++++---- - .../source/dmapper/DomainMapperTableManager.cxx | 47 ++++++++++++++------- - .../source/ooxml/OOXMLFastContextHandler.cxx | 48 ++++++++++----------- - .../source/ooxml/OOXMLFastContextHandler.hxx | 49 +++++++++++----------- - 7 files changed, 124 insertions(+), 74 deletions(-) - create mode 100644 include/o3tl/numeric.hxx - -diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx -index 1675cdc..2e037dd 100644 ---- a/filter/source/graphicfilter/epict/epict.cxx -+++ b/filter/source/graphicfilter/epict/epict.cxx -@@ -34,7 +34,7 @@ - #include - #include - #include -- -+#include - #include - #include - #include -diff --git a/include/o3tl/numeric.hxx b/include/o3tl/numeric.hxx -new file mode 100644 -index 0000000..09f67f5 ---- /dev/null -+++ b/include/o3tl/numeric.hxx -@@ -0,0 +1,28 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ */ -+ -+#ifndef INCLUDED_O3TL_NUMERIC_HXX -+#define INCLUDED_O3TL_NUMERIC_HXX -+ -+#include -+ -+namespace o3tl -+{ -+ struct divide_by_zero : public std::runtime_error -+ { -+ explicit divide_by_zero() -+ : std::runtime_error("divide by zero") -+ { -+ } -+ }; -+} -+ -+#endif -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx -index df2fddc..887d0ce 100644 ---- a/svtools/source/misc/imap.cxx -+++ b/svtools/source/misc/imap.cxx -@@ -22,7 +22,7 @@ - #include - #include - #include -- -+#include - #include - #include - #include -diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx -index c10acd5..c6a9a07 100644 ---- a/sw/source/core/docnode/ndtbl.cxx -+++ b/sw/source/core/docnode/ndtbl.cxx -@@ -85,6 +85,7 @@ - #include - #include - #include -+#include - #include - - #ifdef DBG_UTIL -@@ -2950,7 +2951,7 @@ const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox ) - - bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth ) - { -- sal_uInt16 n; -+ size_t n; - - if( !aPosArr.empty() ) - { -@@ -2969,13 +2970,20 @@ bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth ) - aPosArr.erase( aPosArr.begin(), aPosArr.begin() + n ); - m_Boxes.erase(m_Boxes.begin(), m_Boxes.begin() + n); - -- // Adapt the positions to the new Size -- for( n = 0; n < aPosArr.size(); ++n ) -+ size_t nSize = aPosArr.size(); -+ if (nSize) - { -- sal_uLong nSize = nWidth; -- nSize *= ( aPosArr[ n ] - nOffset ); -- nSize /= nOldWidth; -- aPosArr[ n ] = sal_uInt16( nSize ); -+ if (nOldWidth == 0) -+ throw o3tl::divide_by_zero(); -+ -+ // Adapt the positions to the new Size -+ for( n = 0; n < nSize; ++n ) -+ { -+ sal_uLong nSize = nWidth; -+ nSize *= ( aPosArr[ n ] - nOffset ); -+ nSize /= nOldWidth; -+ aPosArr[ n ] = sal_uInt16( nSize ); -+ } - } - } - return !aPosArr.empty(); -diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx -index 22c7a62..c4ba571 100644 ---- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx -+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -697,20 +698,27 @@ void DomainMapperTableManager::endOfRowAction() - sal_Int16 nLastRelPos = 0; - sal_uInt32 nBorderGridIndex = m_nGridBefore; - -- ::std::vector< sal_Int32 >::const_iterator aSpansIter = pCurrentSpans->begin( ); -- for( sal_uInt32 nBorder = 0; nBorder < m_nCell.back( ) - 1; ++nBorder ) -+ size_t nWidthsBound = m_nCell.back( ) - 1; -+ if (nWidthsBound) - { -- double fGridWidth = 0.; -- for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount ) -- fGridWidth += (*pTableGrid.get())[nBorderGridIndex++]; -+ if (nFullWidthRelative == 0) -+ throw o3tl::divide_by_zero(); - -- sal_Int16 nRelPos = -- sal::static_int_cast< sal_Int16 >((fGridWidth * 10000) / nFullWidthRelative); -+ ::std::vector< sal_Int32 >::const_iterator aSpansIter = pCurrentSpans->begin( ); -+ for( sal_uInt32 nBorder = 0; nBorder < nWidthsBound; ++nBorder ) -+ { -+ double fGridWidth = 0.; -+ for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount ) -+ fGridWidth += (*pTableGrid.get())[nBorderGridIndex++]; -+ -+ sal_Int16 nRelPos = -+ sal::static_int_cast< sal_Int16 >((fGridWidth * 10000) / nFullWidthRelative); - -- pSeparators[nBorder].Position = nRelPos + nLastRelPos; -- pSeparators[nBorder].IsVisible = sal_True; -- nLastRelPos = nLastRelPos + nRelPos; -- ++aSpansIter; -+ pSeparators[nBorder].Position = nRelPos + nLastRelPos; -+ pSeparators[nBorder].IsVisible = sal_True; -+ nLastRelPos = nLastRelPos + nRelPos; -+ ++aSpansIter; -+ } - } - TablePropertyMapPtr pPropMap( new TablePropertyMap ); - pPropMap->Insert( PROP_TABLE_COLUMN_SEPARATORS, uno::makeAny( aSeparators ) ); -@@ -744,12 +752,19 @@ void DomainMapperTableManager::endOfRowAction() - for (sal_uInt32 i = 0; i < pCellWidths->size(); ++i) - nFullWidthRelative += (*pCellWidths.get())[i]; - -- for (sal_uInt32 i = 0; i < pCellWidths->size() - 1; ++i) -+ size_t nWidthsBound = pCellWidths->size() - 1; -+ if (nWidthsBound) - { -- nSum += (*pCellWidths.get())[i]; -- pSeparators[nPos].Position = (nSum * 10000) / nFullWidthRelative; // Relative position -- pSeparators[nPos].IsVisible = sal_True; -- nPos++; -+ if (nFullWidthRelative == 0) -+ throw o3tl::divide_by_zero(); -+ -+ for (sal_uInt32 i = 0; i < nWidthsBound; ++i) -+ { -+ nSum += (*pCellWidths.get())[i]; -+ pSeparators[nPos].Position = (nSum * 10000) / nFullWidthRelative; // Relative position -+ pSeparators[nPos].IsVisible = sal_True; -+ nPos++; -+ } - } - - TablePropertyMapPtr pPropMap( new TablePropertyMap ); -diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx -index 5104574..4fd6a63 100644 ---- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx -+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx -@@ -289,7 +289,7 @@ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - void OOXMLFastContextHandler::lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - OOXMLFactory::getInstance()->startAction(this, Element); - if( Element == (NS_wordprocessingDrawing|OOXML_positionV) ) -@@ -301,7 +301,7 @@ void OOXMLFastContextHandler::lcl_startFastElement - - void OOXMLFastContextHandler::lcl_endFastElement - (Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - OOXMLFactory::getInstance()->endAction(this, Element); - } -@@ -346,7 +346,7 @@ uno::Reference< xml::sax::XFastContextHandler > - OOXMLFastContextHandler::lcl_createFastChildContext - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - return OOXMLFactory::getInstance()->createFastChildContext(this, Element); - } -@@ -381,7 +381,7 @@ void SAL_CALL OOXMLFastContextHandler::characters - - void OOXMLFastContextHandler::lcl_characters - (const OUString & rString) --throw (uno::RuntimeException, xml::sax::SAXException) -+throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - if (!m_bDiscardChildren) - OOXMLFactory::getInstance()->characters(this, rString); -@@ -1401,7 +1401,7 @@ OOXMLFastContextHandlerProperties::~OOXMLFastContextHandlerProperties() - - void OOXMLFastContextHandlerProperties::lcl_endFastElement - (Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - endAction(Element); - -@@ -1599,7 +1599,7 @@ OOXMLFastContextHandlerPropertyTable::~OOXMLFastContextHandlerPropertyTable() - - void OOXMLFastContextHandlerPropertyTable::lcl_endFastElement - (Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - OOXMLPropertySet::Pointer_t pPropSet(mpPropertySet->clone()); - OOXMLTableImpl::ValuePointer_t pTmpVal -@@ -1655,7 +1655,7 @@ OOXMLValue::Pointer_t OOXMLFastContextHandlerValue::getValue() const - - void OOXMLFastContextHandlerValue::lcl_endFastElement - (Token_t Element) --throw (uno::RuntimeException, xml::sax::SAXException) -+throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - sendPropertyToParent(); - -@@ -1743,7 +1743,7 @@ OOXMLFastContextHandlerTable::createFastChildContext - - void OOXMLFastContextHandlerTable::lcl_endFastElement - (Token_t /*Element*/) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - addCurrentChild(); - -@@ -1802,7 +1802,7 @@ OOXMLFastContextHandlerXNote::~OOXMLFastContextHandlerXNote() - void OOXMLFastContextHandlerXNote::lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - mbForwardEventsSaved = isForwardEvents(); - -@@ -1817,7 +1817,7 @@ void OOXMLFastContextHandlerXNote::lcl_startFastElement - - void OOXMLFastContextHandlerXNote::lcl_endFastElement - (Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - endAction(Element); - -@@ -2066,7 +2066,7 @@ OOXMLFastContextHandlerTextTable::~OOXMLFastContextHandlerTextTable() - void OOXMLFastContextHandlerTextTable::lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - mpParserState->startTable(); - mnTableDepth++; -@@ -2086,7 +2086,7 @@ void OOXMLFastContextHandlerTextTable::lcl_startFastElement - - void OOXMLFastContextHandlerTextTable::lcl_endFastElement - (Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - endAction(Element); - -@@ -2142,7 +2142,7 @@ OOXMLFastContextHandlerShape::~OOXMLFastContextHandlerShape() - void OOXMLFastContextHandlerShape::lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - startAction(Element); - -@@ -2198,7 +2198,7 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t Element ) - - void OOXMLFastContextHandlerShape::lcl_endFastElement - (Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - if (mrShapeContext.is()) - { -@@ -2227,7 +2227,7 @@ uno::Reference< xml::sax::XFastContextHandler > - OOXMLFastContextHandlerShape::lcl_createFastChildContext - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - uno::Reference< xml::sax::XFastContextHandler > xContextHandler; - -@@ -2300,7 +2300,7 @@ OOXMLFastContextHandlerShape::createUnknownChildContext - - void OOXMLFastContextHandlerShape::lcl_characters - (const OUString & aChars) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - if (mrShapeContext.is()) - mrShapeContext->characters(aChars); -@@ -2392,7 +2392,7 @@ void OOXMLFastContextHandlerWrapper::addToken( Token_t Token ) - void OOXMLFastContextHandlerWrapper::lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - if (mxContext.is()) - mxContext->startFastElement(Element, Attribs); -@@ -2400,7 +2400,7 @@ void OOXMLFastContextHandlerWrapper::lcl_startFastElement - - void OOXMLFastContextHandlerWrapper::lcl_endFastElement - (Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - if (mxContext.is()) - mxContext->endFastElement(Element); -@@ -2410,7 +2410,7 @@ uno::Reference< xml::sax::XFastContextHandler > - OOXMLFastContextHandlerWrapper::lcl_createFastChildContext - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - uno::Reference< xml::sax::XFastContextHandler > xResult; - -@@ -2464,7 +2464,7 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext - - void OOXMLFastContextHandlerWrapper::lcl_characters - (const OUString & aChars) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - if (mxContext.is()) - mxContext->characters(aChars); -@@ -2599,14 +2599,14 @@ OOXMLFastContextHandlerLinear::OOXMLFastContextHandlerLinear(OOXMLFastContextHan - - void OOXMLFastContextHandlerLinear::lcl_startFastElement(Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList >& Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - buffer.appendOpeningTag( Element, Attribs ); - ++depthCount; - } - - void OOXMLFastContextHandlerLinear::lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - buffer.appendClosingTag( Element ); - if( --depthCount == 0 ) -@@ -2616,7 +2616,7 @@ void OOXMLFastContextHandlerLinear::lcl_endFastElement(Token_t Element) - uno::Reference< xml::sax::XFastContextHandler > - OOXMLFastContextHandlerLinear::lcl_createFastChildContext(Token_t, - const uno::Reference< xml::sax::XFastAttributeList >&) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - uno::Reference< xml::sax::XFastContextHandler > xContextHandler; - xContextHandler.set( this ); -@@ -2624,7 +2624,7 @@ OOXMLFastContextHandlerLinear::lcl_createFastChildContext(Token_t, - } - - void OOXMLFastContextHandlerLinear::lcl_characters(const OUString& aChars) -- throw (uno::RuntimeException, xml::sax::SAXException) -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) - { - buffer.appendCharacters( aChars ); - } -diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx -index f56f5e9..6a40c25 100644 ---- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx -+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx -@@ -263,20 +263,19 @@ protected: - virtual void lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException); -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception); - - virtual void lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException); -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception); - - virtual uno::Reference< xml::sax::XFastContextHandler > - lcl_createFastChildContext - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException); -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception); - - virtual void lcl_characters(const OUString & aChars) -- throw (uno::RuntimeException, xml::sax::SAXException); -- -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception); - void startAction(Token_t Element); - virtual void lcl_startAction(Token_t Element); - void endAction(Token_t Element); -@@ -361,7 +360,7 @@ protected: - OOXMLPropertySet::Pointer_t mpPropertySet; - - virtual void lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - virtual void setParent(OOXMLFastContextHandler * pParent) SAL_OVERRIDE; - - private: -@@ -380,7 +379,7 @@ protected: - OOXMLTableImpl mTable; - - virtual void lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - }; - - class OOXMLFastContextHandlerValue : -@@ -395,7 +394,7 @@ public: - virtual OOXMLValue::Pointer_t getValue() const SAL_OVERRIDE; - - virtual void lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual string getType() const SAL_OVERRIDE { return "Value"; } - -@@ -427,7 +426,7 @@ protected: - RefAndPointer_t mCurrentChild; - - virtual void lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual ResourceEnum_t getResource() const SAL_OVERRIDE { return TABLE; } - -@@ -456,10 +455,10 @@ private: - virtual void lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual void lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual ResourceEnum_t getResource() const SAL_OVERRIDE { return STREAM; } - }; -@@ -507,10 +506,10 @@ protected: - virtual void lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual void lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - }; - - class OOXMLFastContextHandlerShape: public OOXMLFastContextHandlerProperties -@@ -559,19 +558,19 @@ protected: - virtual void lcl_startFastElement - (Token_t Element, - const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs) -- throw (css::uno::RuntimeException, css::xml::sax::SAXException) SAL_OVERRIDE; -+ throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual void lcl_endFastElement(Token_t Element) -- throw (css::uno::RuntimeException, css::xml::sax::SAXException) SAL_OVERRIDE; -+ throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual uno::Reference< xml::sax::XFastContextHandler > - lcl_createFastChildContext - (Token_t Element, - const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs) -- throw (css::uno::RuntimeException, css::xml::sax::SAXException) SAL_OVERRIDE; -+ throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual void lcl_characters(const OUString & aChars) -- throw (css::uno::RuntimeException, css::xml::sax::SAXException) SAL_OVERRIDE; -+ throw (css::uno::RuntimeException, css::xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - }; - -@@ -628,19 +627,19 @@ protected: - virtual void lcl_startFastElement - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual void lcl_endFastElement(Token_t Element) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual uno::Reference< xml::sax::XFastContextHandler > - lcl_createFastChildContext - (Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual void lcl_characters(const OUString & aChars) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual void setId(Id nId) SAL_OVERRIDE; - virtual Id getId() const SAL_OVERRIDE; -@@ -690,15 +689,15 @@ protected: - virtual void process() = 0; - - virtual void lcl_startFastElement(Token_t Element, const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - -- virtual void lcl_endFastElement(Token_t Element) throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ virtual void lcl_endFastElement(Token_t Element) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - virtual uno::Reference< xml::sax::XFastContextHandler > lcl_createFastChildContext(Token_t Element, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -- throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - -- virtual void lcl_characters(const OUString & aChars) throw (uno::RuntimeException, xml::sax::SAXException) SAL_OVERRIDE; -+ virtual void lcl_characters(const OUString & aChars) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) SAL_OVERRIDE; - - // should be private, but not much point in making deep copies of it - oox::formulaimport::XmlStreamBuilder buffer; --- -2.1.0 - diff --git a/SOURCES/0001-Resolves-rhbz-1256843-no-obvious-means-to-close-temp.patch b/SOURCES/0001-Resolves-rhbz-1256843-no-obvious-means-to-close-temp.patch new file mode 100644 index 0000000..2f2e11c --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1256843-no-obvious-means-to-close-temp.patch @@ -0,0 +1,786 @@ +From c33062fc07ac20b1ac28bd000fd3c57016d72e34 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Sep 2015 11:59:32 +0100 +Subject: [PATCH] Resolves: rhbz#1256843 no obvious means to close template + dialog + +under gnome-shell which doesn't put an "X" to close things in +the wm decorations if the GDK DIALOG hint it set + +prior to tdf#72587 this was a modeless dialog and in that case +it doesn't have a parent, in which case the hint is NORMAL +and it used to get close decorations. + +easist thing to do is to remain modal so the crashes and +confusion of tdf#72587 remain fixed but add a close to it to +behave like all the other dialogs do + +Change-Id: I64450be0ad1bc7b06196e1342679e15b60fc60d9 +--- + sfx2/uiconfig/ui/templatedlg.ui | 653 +++++++++++++++++++++------------------- + 1 file changed, 346 insertions(+), 307 deletions(-) + +diff --git a/sfx2/uiconfig/ui/templatedlg.ui b/sfx2/uiconfig/ui/templatedlg.ui +index de8270c..6ed0172 100644 +--- a/sfx2/uiconfig/ui/templatedlg.ui ++++ b/sfx2/uiconfig/ui/templatedlg.ui +@@ -1,111 +1,327 @@ + + + +- ++ + +- ++ + 800 +- 560 ++ 600 + False +- True + 6 + Template Manager +- +- +- True ++ True ++ normal ++ ++ + False +- 6 + vertical ++ 2 ++ ++ ++ False ++ end ++ ++ ++ gtk-close ++ True ++ True ++ True ++ True ++ True ++ True ++ ++ ++ True ++ True ++ 0 ++ ++ ++ ++ ++ False ++ False ++ 1 ++ ++ + +- ++ + True +- True +- True +- True ++ False ++ vertical + +- ++ + True +- False ++ True + True + True +- vertical +- 6 + +- ++ + True + False + True ++ True ++ vertical + 6 + +- ++ + True + False + True ++ 6 + +- ++ + True + False +- repository +- Repository +- True +- sfx2/imglst/actionview026.png +- +- +- False +- True +- +- +- +- +- False +- import +- Import +- True +- sfx2/imglst/actionview010.png +- +- +- False +- True +- +- +- +- +- False +- delete +- Delete +- True +- sfx2/imglst/actionview025.png ++ True ++ ++ ++ True ++ False ++ repository ++ Repository ++ True ++ sfx2/imglst/actionview026.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ False ++ import ++ Import ++ True ++ sfx2/imglst/actionview010.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ False ++ delete ++ Delete ++ True ++ sfx2/imglst/actionview025.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ False ++ save ++ Save ++ True ++ sfx2/imglst/actionview028.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ new_folder ++ New Folder ++ True ++ sfx2/imglst/actionview029.png ++ ++ ++ False ++ True ++ ++ + + + False +- True ++ True ++ 0 + + + +- ++ + False +- save +- Save +- True +- sfx2/imglst/actionview028.png ++ True ++ ++ ++ False ++ template_save ++ Save ++ True ++ sfx2/imglst/actionview028.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ open ++ Open ++ True ++ sfx2/imglst/actionview030.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ edit ++ Edit ++ True ++ sfx2/imglst/actiontemplates019.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ properties ++ Properties ++ True ++ sfx2/imglst/actiontemplates016.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ default ++ Set as Default ++ True ++ sfx2/imglst/actiontemplates015.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ move ++ Move to Folder ++ True ++ sfx2/imglst/actiontemplates017.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ export ++ Export ++ True ++ sfx2/imglst/actiontemplates020.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ template_delete ++ Delete ++ True ++ sfx2/imglst/actiontemplates018.png ++ ++ ++ False ++ True ++ ++ + + + False +- True ++ True ++ 1 + + + +- ++ + True + False +- new_folder +- New Folder +- True +- sfx2/imglst/actionview029.png ++ end ++ True ++ ++ ++ True ++ False ++ search ++ Search ++ True ++ sfx2/imglst/actionaction012.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ action_menu ++ Action Menu ++ True ++ sfx2/imglst/actionaction013.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ template_link ++ Get more templates for %PRODUCTNAME ++ True ++ sfx2/imglst/actionview010.png ++ ++ ++ False ++ True ++ ++ + + + False +- True ++ True ++ 2 + + + +@@ -116,120 +332,10 @@ + + + +- +- False ++ ++ True + True +- +- +- False +- template_save +- Save +- True +- sfx2/imglst/actionview028.png +- +- +- False +- True +- +- +- +- +- True +- False +- open +- Open +- True +- sfx2/imglst/actionview030.png +- +- +- False +- True +- +- +- +- +- True +- False +- edit +- Edit +- True +- sfx2/imglst/actiontemplates019.png +- +- +- False +- True +- +- +- +- +- True +- False +- properties +- Properties +- True +- sfx2/imglst/actiontemplates016.png +- +- +- False +- True +- +- +- +- +- True +- False +- default +- Set as Default +- True +- sfx2/imglst/actiontemplates015.png +- +- +- False +- True +- +- +- +- +- True +- False +- move +- Move to Folder +- True +- sfx2/imglst/actiontemplates017.png +- +- +- False +- True +- +- +- +- +- True +- False +- export +- Export +- True +- sfx2/imglst/actiontemplates020.png +- +- +- False +- True +- +- +- +- +- True +- False +- template_delete +- Delete +- True +- sfx2/imglst/actiontemplates018.png +- +- +- False +- True +- +- ++ + + + False +@@ -238,53 +344,11 @@ + + + +- ++ + True + False +- end + True +- +- +- True +- False +- search +- Search +- True +- sfx2/imglst/actionaction012.png +- +- +- False +- True +- +- +- +- +- True +- False +- action_menu +- Action Menu +- True +- sfx2/imglst/actionaction013.png +- +- +- False +- True +- +- +- +- +- True +- False +- template_link +- Get more templates for %PRODUCTNAME +- True +- sfx2/imglst/actionview010.png +- +- +- False +- True +- +- ++ True + + + False +@@ -292,123 +356,98 @@ + 2 + + ++ ++ ++ True ++ True ++ 0 ++ True ++ True ++ ++ ++ False ++ True ++ 3 ++ ++ ++ ++ ++ True ++ True ++ 0 ++ True ++ True ++ ++ ++ False ++ True ++ 4 ++ ++ ++ ++ ++ ++ ++ True ++ False ++ Documents + + +- False +- True +- 0 ++ False + + + +- +- True +- True +- ++ ++ ++ ++ ++ True ++ False ++ Spreadsheets + + +- False +- True + 1 ++ False + + + +- ++ ++ ++ ++ + True +- True +- True +- True ++ False ++ Presentations + + +- False +- True + 2 ++ False + + + +- +- True +- True +- 0 +- True +- True +- +- +- False +- True +- 3 +- ++ + +- +- +- True +- True +- 0 +- True +- True ++ ++ ++ True ++ False ++ Drawings + + +- False +- True +- 4 ++ 3 ++ False + + + +- +- +- +- True +- False +- Documents +- + +- False +- +- +- +- +- +- +- +- True +- False +- Spreadsheets +- +- +- 1 +- False +- +- +- +- +- +- +- +- True +- False +- Presentations +- +- +- 2 +- False +- +- +- +- +- +- +- +- True +- False +- Drawings +- +- +- 3 +- False ++ False ++ True ++ 0 + + + + +- False ++ True + True + 0 + +-- +2.4.0 + diff --git a/SOURCES/0001-Resolves-rhbz-1285380-get-menus-working-under-waylan.patch b/SOURCES/0001-Resolves-rhbz-1285380-get-menus-working-under-waylan.patch new file mode 100644 index 0000000..83a0e95 --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1285380-get-menus-working-under-waylan.patch @@ -0,0 +1,60 @@ +From c46d05caf360cfb43215e15d466016728d021c15 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 30 Nov 2015 14:03:34 +0000 +Subject: [PATCH] Resolves: rhbz#1285380 get menus working under wayland + +use GDK_WINDOW_TYPE_HINT_POPUP_MENU hint for menus + +and set hints after widget is realized + +and set gtk_window_set_transient_for menus too + +then you get menus and tooltips apparently in the right place + +Change-Id: Ib1046fb0872b9d8a5f80cc5f48828ef7f086b1a1 +--- + vcl/unx/gtk/window/gtksalframe.cxx | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx +index 8acdf8a..0053e5b 100644 +--- a/vcl/unx/gtk/window/gtksalframe.cxx ++++ b/vcl/unx/gtk/window/gtksalframe.cxx +@@ -1401,6 +1401,15 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + if( m_pParent && m_pParent->m_pWindow && ! isChild() ) + gtk_window_set_screen( GTK_WINDOW(m_pWindow), gtk_window_get_screen( GTK_WINDOW(m_pParent->m_pWindow) ) ); + ++ if (m_pParent) ++ { ++ if (!(m_pParent->m_nStyle & SAL_FRAME_STYLE_PLUG)) ++ gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) ); ++ m_pParent->m_aChildren.push_back( this ); ++ } ++ ++ InitCommon(); ++ + // set window type + bool bDecoHandling = + ! isChild() && +@@ -1441,17 +1450,11 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + #endif + gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType ); + gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC ); +- if( m_pParent && ! (m_pParent->m_nStyle & SAL_FRAME_STYLE_PLUG) ) +- gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) ); + } + else if( (nStyle & SAL_FRAME_STYLE_FLOAT) ) + { +- gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_UTILITY ); ++ gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_POPUP_MENU ); + } +- if( m_pParent ) +- m_pParent->m_aChildren.push_back( this ); +- +- InitCommon(); + + #if !GTK_CHECK_VERSION(3,0,0) + if( eWinType == GTK_WINDOW_TOPLEVEL ) +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-rhbz-1287581-explicitly-state-we-don-t-want.patch b/SOURCES/0001-Resolves-rhbz-1287581-explicitly-state-we-don-t-want.patch new file mode 100644 index 0000000..074ff16 --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1287581-explicitly-state-we-don-t-want.patch @@ -0,0 +1,26 @@ +From 991b9c32e98a924d659dc94923d9e85c8955d17a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 15 Dec 2015 13:47:39 +0000 +Subject: [PATCH] Resolves: rhbz#1287581 explicitly state we don't want + decorated toolbars + +Change-Id: Ibbf45b44eba9f5f65db0e7ae26cf6946b32f879d +--- + vcl/unx/gtk3/gtk3gtkframe.cxx | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index 592c872..7c24d2b 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -1180,6 +1180,7 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + { + eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; + gtk_window_set_accept_focus(GTK_WINDOW(m_pWindow), false); ++ gtk_window_set_decorated(GTK_WINDOW(m_pWindow), false); + } + else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) + { +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-rhbz-1289394-gtk3-implement-tooltips-native.patch b/SOURCES/0001-Resolves-rhbz-1289394-gtk3-implement-tooltips-native.patch new file mode 100644 index 0000000..f787102 --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1289394-gtk3-implement-tooltips-native.patch @@ -0,0 +1,469 @@ +From ee49f01f73348c9e7c822212a7ed69ab2e916946 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 14 Dec 2015 14:05:53 +0000 +Subject: [PATCH] Resolves: rhbz#1289394 gtk3: implement tooltips natively + +side step the whole pile of misery by using native gtk tooltips + +also gets transparency and native themeing too by default + +Related: rhbz#1289394 always provide the screen area the tip applies to + +this will make it easier to implement native help tips + +Change-Id: I984dfadaf02e9b7bf542ba82cf070911c89cb699 +(cherry picked from commit 01ef12d173fb2c54a49186c8eb4fa40288b82945) + +Change-Id: I59552661cd9dc18a563341885bc40fcdadc5264f +(cherry picked from commit c96eeb5bf2ef428e7d147258d69825ff97acb226) +--- + cui/source/customize/acccfg.cxx | 2 +- + cui/source/customize/selector.cxx | 10 +++-- + include/vcl/help.hxx | 3 -- + sfx2/source/dialog/dinfdlg.cxx | 2 +- + sw/source/core/draw/dpage.cxx | 6 +-- + sw/source/uibase/docvw/edtwin2.cxx | 17 +++++---- + vcl/inc/helpwin.hxx | 4 +- + vcl/inc/salframe.hxx | 7 ++++ + vcl/inc/unx/gtk/gtkframe.hxx | 6 +++ + vcl/source/app/help.cxx | 75 +++++++++++++++++--------------------- + vcl/source/window/menuwindow.cxx | 2 +- + vcl/source/window/window.cxx | 9 ++++- + vcl/unx/gtk3/gtk3gtkframe.cxx | 28 ++++++++++++++ + 13 files changed, 106 insertions(+), 65 deletions(-) + +diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx +index b3511e9..2125990 100644 +--- a/cui/source/customize/acccfg.cxx ++++ b/cui/source/customize/acccfg.cxx +@@ -1117,7 +1117,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, RemoveHdl) + IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox ) + { + // disable help +- Help::ShowBalloon( this, Point(), OUString() ); ++ Help::ShowBalloon( this, Point(), Rectangle(), OUString() ); + if (pListBox == m_pEntriesBox) + { + sal_uLong nPos = SvTreeList::GetRelPos( m_pEntriesBox->FirstSelected() ); +diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx +index 781ddbf..2da0b77 100644 +--- a/cui/source/customize/selector.cxx ++++ b/cui/source/customize/selector.cxx +@@ -130,7 +130,8 @@ void SvxConfigFunctionListBox::MouseMove( const MouseEvent& rMEvt ) + aTimer.Start(); + else + { +- Help::ShowBalloon( this, aMousePos, OUString() ); ++ Rectangle aRect(GetPosPixel(), GetSizePixel()); ++ Help::ShowBalloon( this, aMousePos, aRect, OUString() ); + aTimer.Stop(); + } + } +@@ -142,7 +143,10 @@ IMPL_LINK_NOARG_TYPED(SvxConfigFunctionListBox, TimerHdl, Timer *, void) + Point aMousePos = GetPointerPosPixel(); + SvTreeListEntry *pEntry = GetCurEntry(); + if ( pEntry && GetEntry( aMousePos ) == pEntry && pCurEntry == pEntry ) +- Help::ShowBalloon( this, OutputToScreenPixel( aMousePos ), GetHelpText( pEntry ) ); ++ { ++ Rectangle aRect(GetPosPixel(), GetSizePixel()); ++ Help::ShowBalloon( this, OutputToScreenPixel(aMousePos), aRect, GetHelpText( pEntry ) ); ++ } + } + + void SvxConfigFunctionListBox::ClearAll() +@@ -177,7 +181,7 @@ OUString SvxConfigFunctionListBox::GetHelpText( SvTreeListEntry *pEntry ) + + void SvxConfigFunctionListBox::FunctionSelected() + { +- Help::ShowBalloon( this, Point(), OUString() ); ++ Help::ShowBalloon( this, Point(), Rectangle(), OUString() ); + } + + // drag and drop support +diff --git a/include/vcl/help.hxx b/include/vcl/help.hxx +index 40dfcf2..4d226a8 100644 +--- a/include/vcl/help.hxx ++++ b/include/vcl/help.hxx +@@ -86,9 +86,6 @@ public: + static bool IsBalloonHelpEnabled(); + static bool ShowBalloon( vcl::Window* pParent, + const Point& rScreenPos, +- const OUString& rHelpText ); +- static bool ShowBalloon( vcl::Window* pParent, +- const Point& rScreenPos, + const Rectangle&, + const OUString& rHelpText ); + +diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx +index 0e47101..56d4d98 100644 +--- a/sfx2/source/dialog/dinfdlg.cxx ++++ b/sfx2/source/dialog/dinfdlg.cxx +@@ -1336,7 +1336,7 @@ void CustomPropertiesDurationField::RequestHelp( const HelpEvent& rHEvt ) + Size aSize( GetSizePixel() ); + Rectangle aItemRect( rHEvt.GetMousePosPixel(), aSize ); + if (Help::IsBalloonHelpEnabled()) +- Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), GetText() ); ++ Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aItemRect, GetText() ); + else + Help::ShowQuickHelp( this, aItemRect, GetText(), + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); +diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx +index db5707c..e401512 100644 +--- a/sw/source/core/draw/dpage.cxx ++++ b/sw/source/core/draw/dpage.cxx +@@ -237,14 +237,14 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView* pView, + sText = SwViewShell::GetShellRes()->aLinkClick + ": " + sText; + } + ++ // then display the help: ++ Rectangle aRect( rEvt.GetMousePosPixel(), Size(1,1) ); + if( rEvt.GetMode() & HelpEventMode::BALLOON ) + { +- Help::ShowBalloon( pWindow, rEvt.GetMousePosPixel(), sText ); ++ Help::ShowBalloon( pWindow, rEvt.GetMousePosPixel(), aRect, sText ); + } + else + { +- // then display the help: +- Rectangle aRect( rEvt.GetMousePosPixel(), Size(1,1) ); + Help::ShowQuickHelp( pWindow, aRect, sText ); + } + bContinue = false; +diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx +index dd78039..a7d55b3 100644 +--- a/sw/source/uibase/docvw/edtwin2.cxx ++++ b/sw/source/uibase/docvw/edtwin2.cxx +@@ -365,18 +365,19 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) + } + if (!sText.isEmpty()) + { ++ Rectangle aRect( aFieldRect.SVRect() ); ++ Point aPt( OutputToScreenPixel( LogicToPixel( aRect.TopLeft() ))); ++ aRect.Left() = aPt.X(); ++ aRect.Top() = aPt.Y(); ++ aPt = OutputToScreenPixel( LogicToPixel( aRect.BottomRight() )); ++ aRect.Right() = aPt.X(); ++ aRect.Bottom() = aPt.Y(); ++ + if( bBalloon ) +- Help::ShowBalloon( this, rEvt.GetMousePosPixel(), sText ); ++ Help::ShowBalloon( this, rEvt.GetMousePosPixel(), aRect, sText ); + else + { + // the show the help +- Rectangle aRect( aFieldRect.SVRect() ); +- Point aPt( OutputToScreenPixel( LogicToPixel( aRect.TopLeft() ))); +- aRect.Left() = aPt.X(); +- aRect.Top() = aPt.Y(); +- aPt = OutputToScreenPixel( LogicToPixel( aRect.BottomRight() )); +- aRect.Right() = aPt.X(); +- aRect.Bottom() = aPt.Y(); + OUString sDisplayText(ClipLongToolTip(sText)); + Help::ShowQuickHelp(this, aRect, sDisplayText, nStyle); + } +diff --git a/vcl/inc/helpwin.hxx b/vcl/inc/helpwin.hxx +index 5889a4f..7ff4072 100644 +--- a/vcl/inc/helpwin.hxx ++++ b/vcl/inc/helpwin.hxx +@@ -78,10 +78,10 @@ public: + + void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, + const OUString& rHelpText, const OUString& rStatusText, +- const Point& rScreenPos, const Rectangle* pHelpArea = NULL ); ++ const Point& rScreenPos, const Rectangle& rHelpArea ); + void ImplDestroyHelpWindow( bool bUpdateHideTime ); + void ImplSetHelpWindowPos( vcl::Window* pHelpWindow, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, +- const Point& rPos, const Rectangle* pHelpArea ); ++ const Point& rPos, const Rectangle& rHelpArea ); + + #endif // INCLUDED_VCL_INC_HELPWIN_HXX + +diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx +index 484504c..cfd401d 100644 +--- a/vcl/inc/salframe.hxx ++++ b/vcl/inc/salframe.hxx +@@ -237,6 +237,13 @@ public: + { + } + ++ // return true to indicate tooltips are shown natively, false otherwise ++ virtual bool ShowTooltip(const OUString& /*rHelpText*/, const Rectangle& /*rHelpArea*/ ) ++ { ++ return false; ++ } ++ ++ + // Callbacks (indepent part in vcl/source/window/winproc.cxx) + // for default message handling return 0 + void SetCallback( vcl::Window* pWindow, SALFRAMEPROC pProc ); +diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx +index ee19e6c..b779d39 100644 +--- a/vcl/inc/unx/gtk/gtkframe.hxx ++++ b/vcl/inc/unx/gtk/gtkframe.hxx +@@ -211,6 +211,8 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + Rectangle m_aRestorePosSize; + + #if GTK_CHECK_VERSION(3,0,0) ++ OUString m_aTooltip; ++ Rectangle m_aHelpArea; + guint32 m_nLastScrollEventTime; + long m_nWidthRequest; + long m_nHeightRequest; +@@ -243,6 +245,9 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + #if GTK_CHECK_VERSION(3,0,0) + static gboolean signalDraw( GtkWidget*, cairo_t *cr, gpointer ); + static void sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame); ++ static gboolean signalTooltipQuery(GtkWidget*, gint x, gint y, ++ gboolean keyboard_mode, GtkTooltip *tooltip, ++ gpointer frame); + #if GTK_CHECK_VERSION(3,14,0) + static void gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame); + static void gestureLongPress(GtkGestureLongPress* gesture, gpointer frame); +@@ -467,6 +472,7 @@ public: + + #if GTK_CHECK_VERSION(3,0,0) + virtual void SetModal(bool bModal) override; ++ virtual bool ShowTooltip(const OUString& rHelpText, const Rectangle& rHelpArea) override; + #endif + + static GtkSalFrame *getFromWindow( GtkWindow *pWindow ); +diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx +index 7014a79..9a6e845 100644 +--- a/vcl/source/app/help.cxx ++++ b/vcl/source/app/help.cxx +@@ -31,6 +31,7 @@ + #include "vcl/settings.hxx" + + #include "helpwin.hxx" ++#include "salframe.hxx" + #include "svdata.hxx" + + #define HELPWINSTYLE_QUICK 0 +@@ -147,21 +148,11 @@ bool Help::IsBalloonHelpEnabled() + } + + bool Help::ShowBalloon( vcl::Window* pParent, +- const Point& rScreenPos, +- const OUString& rHelpText ) +-{ +- ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, QuickHelpFlags::NONE, +- rHelpText, OUString(), rScreenPos ); +- +- return true; +-} +- +-bool Help::ShowBalloon( vcl::Window* pParent, + const Point& rScreenPos, const Rectangle& rRect, + const OUString& rHelpText ) + { + ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, QuickHelpFlags::NONE, +- rHelpText, OUString(), rScreenPos, &rRect ); ++ rHelpText, OUString(), rScreenPos, rRect ); + + return true; + } +@@ -189,7 +180,7 @@ bool Help::ShowQuickHelp( vcl::Window* pParent, + { + ImplShowHelpWindow( pParent, HELPWINSTYLE_QUICK, nStyle, + rHelpText, rLongHelpText, +- pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect ); ++ pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect ); + return true; + } + +@@ -221,7 +212,7 @@ void Help::UpdateTip( sal_uIntPtr nId, vcl::Window* pParent, const Rectangle& rS + Size aSz = pHelpWin->CalcOutSize(); + pHelpWin->SetOutputSizePixel( aSz ); + ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(), +- pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect ); ++ pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect ); + + pHelpWin->SetHelpText( rText ); + pHelpWin->Invalidate(); +@@ -475,8 +466,14 @@ OUString HelpTextWindow::GetText() const + + void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, + const OUString& rHelpText, const OUString& rStatusText, +- const Point& rScreenPos, const Rectangle* pHelpArea ) ++ const Point& rScreenPos, const Rectangle& rHelpArea ) + { ++ if (pParent->ImplGetFrame()->ShowTooltip(rHelpText, rHelpArea)) ++ { ++ //tooltips are handled natively, return early ++ return; ++ } ++ + ImplSVData* pSVData = ImplGetSVData(); + + if (rHelpText.isEmpty() && !pSVData->maHelpData.mbRequestingHelp) +@@ -490,9 +487,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe + + if ( ( ( pHelpWin->GetHelpText() != rHelpText ) + || ( pHelpWin->GetWinStyle() != nHelpWinStyle ) +- || ( pHelpArea +- && ( pHelpWin->GetHelpArea() != *pHelpArea ) +- ) ++ || ( pHelpWin->GetHelpArea() != rHelpArea ) + ) + && pSVData->maHelpData.mbRequestingHelp + ) +@@ -517,7 +512,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe + + pHelpWin->SetHelpText( rHelpText ); + // approach mouse position +- ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, pHelpArea ); ++ ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea ); + if( pHelpWin->IsVisible() ) + pHelpWin->Invalidate(); + } +@@ -536,13 +531,12 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe + pHelpWin = VclPtr::Create( pParent, rHelpText, nHelpWinStyle, nStyle ); + pSVData->maHelpData.mpHelpWin = pHelpWin; + pHelpWin->SetStatusText( rStatusText ); +- if ( pHelpArea ) +- pHelpWin->SetHelpArea( *pHelpArea ); ++ pHelpWin->SetHelpArea( rHelpArea ); + + // positioning + Size aSz = pHelpWin->CalcOutSize(); + pHelpWin->SetOutputSizePixel( aSz ); +- ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, pHelpArea ); ++ ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea ); + // if not called from Window::RequestHelp, then without delay... + if ( !pSVData->maHelpData.mbRequestingHelp ) + nDelayMode = HELPDELAY_NONE; +@@ -571,7 +565,7 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime ) + } + + void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, +- const Point& rPos, const Rectangle* pHelpArea ) ++ const Point& rPos, const Rectangle& rHelpArea ) + { + Point aPos = rPos; + Size aSz = pHelpWin->GetSizePixel(); +@@ -606,26 +600,23 @@ void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, Quic + + if ( nStyle & QuickHelpFlags::NoAutoPos ) + { +- if ( pHelpArea ) +- { +- // convert help area to screen coords +- Rectangle devHelpArea( +- pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( pHelpArea->TopLeft() ), +- pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( pHelpArea->BottomRight() ) ); +- +- // Welche Position vom Rechteck? +- aPos = devHelpArea.Center(); +- +- if ( nStyle & QuickHelpFlags::Left ) +- aPos.X() = devHelpArea.Left(); +- else if ( nStyle & QuickHelpFlags::Right ) +- aPos.X() = devHelpArea.Right(); +- +- if ( nStyle & QuickHelpFlags::Top ) +- aPos.Y() = devHelpArea.Top(); +- else if ( nStyle & QuickHelpFlags::Bottom ) +- aPos.Y() = devHelpArea.Bottom(); +- } ++ // convert help area to screen coords ++ Rectangle devHelpArea( ++ pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( rHelpArea.TopLeft() ), ++ pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( rHelpArea.BottomRight() ) ); ++ ++ // Welche Position vom Rechteck? ++ aPos = devHelpArea.Center(); ++ ++ if ( nStyle & QuickHelpFlags::Left ) ++ aPos.X() = devHelpArea.Left(); ++ else if ( nStyle & QuickHelpFlags::Right ) ++ aPos.X() = devHelpArea.Right(); ++ ++ if ( nStyle & QuickHelpFlags::Top ) ++ aPos.Y() = devHelpArea.Top(); ++ else if ( nStyle & QuickHelpFlags::Bottom ) ++ aPos.Y() = devHelpArea.Bottom(); + + // which direction? + if ( nStyle & QuickHelpFlags::Left ) +diff --git a/vcl/source/window/menuwindow.cxx b/vcl/source/window/menuwindow.cxx +index e915c33..4e89f44 100644 +--- a/vcl/source/window/menuwindow.cxx ++++ b/vcl/source/window/menuwindow.cxx +@@ -63,7 +63,7 @@ bool MenuWindow::ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu* pMenu, sal_ + + Rectangle aRect( aPos, Size() ); + if (!pMenu->GetHelpText(nId).isEmpty()) +- Help::ShowBalloon( pMenuWindow, aPos, pMenu->GetHelpText( nId ) ); ++ Help::ShowBalloon( pMenuWindow, aPos, aRect, pMenu->GetHelpText( nId ) ); + else + { + // give user a chance to read the full filename +diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx +index e8d2b96..20377ac 100644 +--- a/vcl/source/window/window.cxx ++++ b/vcl/source/window/window.cxx +@@ -1976,7 +1976,14 @@ void Window::RequestHelp( const HelpEvent& rHEvt ) + if ( rStr.isEmpty() && ImplGetParent() && !ImplIsOverlapWindow() ) + ImplGetParent()->RequestHelp( rHEvt ); + else +- Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), rStr ); ++ { ++ Point aPos = GetPosPixel(); ++ if ( ImplGetParent() && !ImplIsOverlapWindow() ) ++ aPos = ImplGetParent()->OutputToScreenPixel( aPos ); ++ Rectangle aRect( aPos, GetSizePixel() ); ++ ++ Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aRect, rStr ); ++ } + } + else if ( rHEvt.GetMode() & HelpEventMode::QUICK ) + { +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index ca9d371..592c872 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -978,6 +978,8 @@ void GtkSalFrame::InitCommon() + + // connect signals + g_signal_connect( G_OBJECT(m_pWindow), "style-set", G_CALLBACK(signalStyleSet), this ); ++ gtk_widget_set_has_tooltip(pEventWidget, true); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "query-tooltip", G_CALLBACK(signalTooltipQuery), this )); + m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-press-event", G_CALLBACK(signalButton), this )); + m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "motion-notify-event", G_CALLBACK(signalMotion), this )); + m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-release-event", G_CALLBACK(signalButton), this )); +@@ -2623,6 +2625,32 @@ void GtkSalFrame::SetModal(bool bModal) + gtk_window_set_modal(GTK_WINDOW(m_pWindow), bModal); + } + ++gboolean GtkSalFrame::signalTooltipQuery(GtkWidget*, gint /*x*/, gint /*y*/, ++ gboolean /*keyboard_mode*/, GtkTooltip *tooltip, ++ gpointer frame) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ if (pThis->m_aTooltip.isEmpty()) ++ return false; ++ gtk_tooltip_set_text(tooltip, ++ OUStringToOString(pThis->m_aTooltip, RTL_TEXTENCODING_UTF8).getStr()); ++ GdkRectangle aHelpArea; ++ aHelpArea.x = pThis->m_aHelpArea.Left(); ++ aHelpArea.y = pThis->m_aHelpArea.Top(); ++ aHelpArea.width = pThis->m_aHelpArea.GetWidth(); ++ aHelpArea.height = pThis->m_aHelpArea.GetHeight(); ++ gtk_tooltip_set_tip_area(tooltip, &aHelpArea); ++ return true; ++} ++ ++bool GtkSalFrame::ShowTooltip(const OUString& rHelpText, const Rectangle& rHelpArea) ++{ ++ m_aTooltip = rHelpText; ++ m_aHelpArea = rHelpArea; ++ gtk_widget_trigger_tooltip_query(getMouseEventWidget()); ++ return true; ++} ++ + gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer frame ) + { + GtkSalFrame* pThis = static_cast(frame); +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-rhbz-1289398-unable-to-use-scroll-wheel-und.patch b/SOURCES/0001-Resolves-rhbz-1289398-unable-to-use-scroll-wheel-und.patch new file mode 100644 index 0000000..a834ec3 --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1289398-unable-to-use-scroll-wheel-und.patch @@ -0,0 +1,125 @@ +From ab20ea1d78697aa88dd84b8be4ac385cf295ea20 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 8 Dec 2015 15:52:47 +0000 +Subject: [PATCH] Resolves: rhbz#1289398 unable to use scroll wheel under + wayland + +because we only get smooth scroll events, so implement that as +best we can. + +(cherry picked from commit c5c1f8f710760d40ca1004c5fdd69f8fa2c87496) + +Change-Id: I7701949cf7c9ffdc9d062f75b23db7c6add3c6a9 +--- + vcl/inc/unx/gtk/gtkframe.hxx | 1 + + vcl/unx/gtk/window/gtksalframe.cxx | 70 +++++++++++++++++++++++++++----------- + 2 files changed, 52 insertions(+), 19 deletions(-) + +diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx +index 3531c41..4594249 100644 +--- a/vcl/inc/unx/gtk/gtkframe.hxx ++++ b/vcl/inc/unx/gtk/gtkframe.hxx +@@ -211,6 +211,7 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + Rectangle m_aRestorePosSize; + + #if GTK_CHECK_VERSION(3,0,0) ++ guint32 m_nLastScrollEventTime; + cairo_region_t* m_pRegion; + #else + GdkRegion* m_pRegion; +diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx +index 614974a..616f73f 100644 +--- a/vcl/unx/gtk/window/gtksalframe.cxx ++++ b/vcl/unx/gtk/window/gtksalframe.cxx +@@ -1129,6 +1129,9 @@ void GtkSalFrame::InitCommon() + m_bSpanMonitorsWhenFullscreen = false; + m_nState = GDK_WINDOW_STATE_WITHDRAWN; + m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED; ++#if GTK_CHECK_VERSION(3,0,0) ++ m_nLastScrollEventTime = GDK_CURRENT_TIME; ++#endif + m_bSendModChangeOnRelease = false; + m_pIMHandler = NULL; + m_hBackgroundPixmap = None; +@@ -3542,30 +3545,59 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame + GdkEventScroll* pSEvent = reinterpret_cast(pEvent); + + #if GTK_CHECK_VERSION(3,0,0) +- //TODO: do something less feeble here +- if (pSEvent->direction == GDK_SCROLL_SMOOTH) ++ // gnome#726878 check for duplicate legacy scroll event ++ if (pSEvent->direction != GDK_SCROLL_SMOOTH && ++ pThis->m_nLastScrollEventTime == pSEvent->time) ++ { + return true; ++ } + #endif + +- static sal_uLong nLines = 0; +- if( ! nLines ) ++ SalWheelMouseEvent aEvent; ++ ++ aEvent.mnTime = pSEvent->time; ++ aEvent.mnX = (sal_uLong)pSEvent->x; ++ aEvent.mnY = (sal_uLong)pSEvent->y; ++ aEvent.mnCode = GetMouseModCode( pSEvent->state ); ++ aEvent.mnScrollLines = 3; ++ ++ switch (pSEvent->direction) + { +- char* pEnv = getenv( "SAL_WHEELLINES" ); +- nLines = pEnv ? atoi( pEnv ) : 3; +- if( nLines > 10 ) +- nLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL; +- } ++#if GTK_CHECK_VERSION(3,0,0) ++ case GDK_SCROLL_SMOOTH: ++ { ++ double delta_x, delta_y; ++ gdk_event_get_scroll_deltas(pEvent, &delta_x, &delta_y); ++ //pick the bigger one I guess ++ aEvent.mbHorz = fabs(delta_x) > fabs(delta_y); ++ if (aEvent.mbHorz) ++ aEvent.mnDelta = -delta_x; ++ else ++ aEvent.mnDelta = -delta_y; ++ aEvent.mnScrollLines = 1; ++ pThis->m_nLastScrollEventTime = pSEvent->time; ++ break; ++ } ++#endif ++ case GDK_SCROLL_UP: ++ aEvent.mnDelta = 120; ++ aEvent.mbHorz = false; ++ break; ++ case GDK_SCROLL_DOWN: ++ aEvent.mnDelta = -120; ++ aEvent.mbHorz = false; ++ break; ++ case GDK_SCROLL_LEFT: ++ aEvent.mbHorz = true; ++ aEvent.mnDelta = 120; ++ break; ++ case GDK_SCROLL_RIGHT: ++ aEvent.mnDelta = -120; ++ aEvent.mbHorz = true; ++ break; ++ }; + +- bool bNeg = (pSEvent->direction == GDK_SCROLL_DOWN || pSEvent->direction == GDK_SCROLL_RIGHT ); +- SalWheelMouseEvent aEvent; +- aEvent.mnTime = pSEvent->time; +- aEvent.mnX = (sal_uLong)pSEvent->x; +- aEvent.mnY = (sal_uLong)pSEvent->y; +- aEvent.mnDelta = bNeg ? -120 : 120; +- aEvent.mnNotchDelta = bNeg ? -1 : 1; +- aEvent.mnScrollLines = nLines; +- aEvent.mnCode = GetMouseModCode( pSEvent->state ); +- aEvent.mbHorz = (pSEvent->direction == GDK_SCROLL_LEFT || pSEvent->direction == GDK_SCROLL_RIGHT); ++ aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : 1; + + // --- RTL --- (mirror mouse pos) + if( AllSettings::GetLayoutRTL() ) +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-rhbz-1291925-implement-SAL_INVERT_TRACKFRAM.patch b/SOURCES/0001-Resolves-rhbz-1291925-implement-SAL_INVERT_TRACKFRAM.patch new file mode 100644 index 0000000..690f197 --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1291925-implement-SAL_INVERT_TRACKFRAM.patch @@ -0,0 +1,186 @@ +From add0b75abd601d5d80e5ad6f20ab63ac1489f028 Mon Sep 17 00:00:00 2001 +From: rpmbuild +Date: Wed, 16 Dec 2015 10:18:52 +0000 +Subject: [PATCH] Resolves: rhbz#1291925 implement SAL_INVERT_TRACKFRAME + +Change-Id: Iec7df66f9bfddcb916047aff569cf2070dd2fa4f +--- + vcl/headless/svpgdi.cxx | 85 +++++++++++++++++++++++++++---------------------- + 1 file changed, 47 insertions(+), 38 deletions(-) + +diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx +index a79142c..ed2c8cf 100644 +--- a/vcl/headless/svpgdi.cxx ++++ b/vcl/headless/svpgdi.cxx +@@ -109,13 +109,9 @@ namespace + if (rBuffer->getScanlineFormat() != basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX) + return false; + +-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) + basegfx::B2IVector size = rBuffer->getSize(); + sal_Int32 nStride = rBuffer->getScanlineStride(); + return (cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, size.getX()) == nStride); +-#else +- return false; +-#endif + } + } + +@@ -135,7 +131,7 @@ void SvpSalGraphics::clipRegion(cairo_t* cr) + cairo_clip(cr); + } + } +-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) ++ + namespace + { + cairo_rectangle_int_t getFillDamage(cairo_t* cr) +@@ -163,22 +159,20 @@ namespace + double x1, y1, x2, y2; + + cairo_clip_extents(cr, &x1, &y1, &x2, &y2); +- extents.x = x1, extents.y = x2, extents.width = x2-x1, extents.height = y2-y1; +-#if CAIRO_VERSION_MAJOR > 1 || (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR >= 10) ++ extents.x = x1, extents.y = y1, extents.width = x2-x1, extents.height = y2-y1; ++ + cairo_region_t *region = cairo_region_create_rectangle(&extents); + + cairo_stroke_extents(cr, &x1, &y1, &x2, &y2); +- extents.x = x1, extents.y = x2, extents.width = x2-x1, extents.height = y2-y1; ++ extents.x = x1, extents.y = y1, extents.width = x2-x1, extents.height = y2-y1; + cairo_region_intersect_rectangle(region, &extents); + + cairo_region_get_extents(region, &extents); + cairo_region_destroy(region); +-#endif + + return extents; + } + } +-#endif + + #endif + +@@ -213,7 +207,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, + fTransparency); + cairo_rectangle(cr, nX, nY, nWidth, nHeight); + +- cairo_rectangle_int_t extents; ++ cairo_rectangle_int_t extents = {0, 0, 0, 0}; + basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aOrigDevice->getDamageTracker()); + if (xDamageTracker) + extents = getFillDamage(cr); +@@ -798,7 +792,7 @@ bool SvpSalGraphics::drawPolyLine( + + AddPolygonToPath(cr, rPolyLine, rPolyLine.isClosed()); + +- cairo_rectangle_int_t extents; ++ cairo_rectangle_int_t extents = {0, 0, 0, 0}; + basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); + + cairo_set_source_rgba(cr, m_aLineColor.getRed()/255.0, +@@ -884,7 +878,7 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d + for (const basegfx::B2DPolygon* pPoly = rPolyPoly.begin(); pPoly != rPolyPoly.end(); ++pPoly) + AddPolygonToPath(cr, *pPoly, true); + +- cairo_rectangle_int_t extents; ++ cairo_rectangle_int_t extents = {0, 0, 0, 0}; + basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aOrigDevice->getDamageTracker()); + if (xDamageTracker) + extents = getFillDamage(cr); +@@ -1067,15 +1061,10 @@ namespace + void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ) + { + #if ENABLE_CAIRO_CANVAS +-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) +- // FIXME: handle SAL_INVERT_TRACKFRAME +- if ( nFlags & SAL_INVERT_TRACKFRAME ) +- { +- SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, unhandled SAL_INVERT_TRACKFRAME"); +- } +- else if ( nFlags & SAL_INVERT_50 ) ++ if (m_aDrawMode != basebmp::DrawMode_XOR) + { +- if (cairo_t* cr = createCairoContext(m_aOrigDevice)) ++ cairo_t* cr = createCairoContext(m_aOrigDevice); ++ if (cr && cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0)) + { + if (!m_aOrigDevice->isTopDown()) + { +@@ -1085,36 +1074,56 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv + + clipRegion(cr); + +- cairo_pattern_t *pattern = create_stipple(); +- +- cairo_rectangle_int_t extents; ++ cairo_rectangle_int_t extents = {0, 0, 0, 0}; + basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aOrigDevice->getDamageTracker()); + + cairo_rectangle(cr, nX, nY, nWidth, nHeight); + +- if (xDamageTracker) +- extents = getFillDamage(cr); +- +- cairo_clip(cr); +- + cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); + cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); +- cairo_mask(cr, pattern); +- cairo_pattern_destroy(pattern); ++ ++ if (nFlags & SAL_INVERT_TRACKFRAME) ++ { ++ cairo_set_line_width(cr, 2.0); ++ const double dashLengths[2] = { 4.0, 4.0 }; ++ cairo_set_dash(cr, dashLengths, 2, 0); ++ ++ if (xDamageTracker) ++ extents = getStrokeDamage(cr); ++ ++ cairo_stroke(cr); ++ } ++ else ++ { ++ if (xDamageTracker) ++ extents = getFillDamage(cr); ++ ++ cairo_clip(cr); ++ ++ if (nFlags & SAL_INVERT_50) ++ { ++ cairo_pattern_t *pattern = create_stipple(); ++ cairo_mask(cr, pattern); ++ cairo_pattern_destroy(pattern); ++ } ++ else ++ { ++ cairo_paint(cr); ++ } ++ } + + cairo_surface_flush(cairo_get_target(cr)); + cairo_destroy(cr); // unref + ++ if (xDamageTracker) ++ { ++ xDamageTracker->damaged(basegfx::B2IBox(extents.x, extents.y, extents.x + extents.width, ++ extents.y + extents.height)); ++ } ++ + return; + } +- else +- SAL_WARN("vcl.gdi", "SvpSalGraphics::invert unhandled XOR (?)"); + } +- else +- { +- SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, unhandled SAL_INVERT_TRACKFRAME"); +- } +-#endif + #endif + + basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ); +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-rhbz-1294208-trackpad-two-finger-scroll-doe.patch b/SOURCES/0001-Resolves-rhbz-1294208-trackpad-two-finger-scroll-doe.patch new file mode 100644 index 0000000..87a249e --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1294208-trackpad-two-finger-scroll-doe.patch @@ -0,0 +1,37 @@ +From 14e7252cc4ceaf1a732034696a17dd3ad1439902 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 27 Jan 2016 16:20:35 +0000 +Subject: [PATCH] Resolves: rhbz#1294208 trackpad two finger scroll does into + reverse + +Change-Id: Ic576f14cae82781a93e52972513a28c4a141d1a2 +(cherry picked from commit e734c7f53cfffa6141e6b46c06825ee273e2136b) +--- + vcl/unx/gtk3/gtk3gtkframe.cxx | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index af284ca..3914de5 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -2557,14 +2557,12 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame + { + case GDK_SCROLL_SMOOTH: + { +- double delta_x, delta_y; +- gdk_event_get_scroll_deltas(pEvent, &delta_x, &delta_y); + //pick the bigger one I guess +- aEvent.mbHorz = fabs(delta_x) > fabs(delta_y); ++ aEvent.mbHorz = fabs(pSEvent->delta_x) > fabs(pSEvent->delta_y); + if (aEvent.mbHorz) +- aEvent.mnDelta = -delta_x; ++ aEvent.mnDelta = -pSEvent->delta_x * 40; + else +- aEvent.mnDelta = -delta_y; ++ aEvent.mnDelta = -pSEvent->delta_y * 40; + aEvent.mnScrollLines = 1; + pThis->m_nLastScrollEventTime = pSEvent->time; + break; +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-rhbz-1315385-use-preferred-size-if-widget-s.patch b/SOURCES/0001-Resolves-rhbz-1315385-use-preferred-size-if-widget-s.patch new file mode 100644 index 0000000..747ef70 --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1315385-use-preferred-size-if-widget-s.patch @@ -0,0 +1,30 @@ +From 86692366b7edbd6dd1ce329a172fb78d402ac328 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 9 Mar 2016 11:01:43 +0000 +Subject: [PATCH] Resolves: rhbz#1315385 use preferred size if widget supports + it + +when deciding if a popup needs to be placed up or down to stay +visible on screen + +Change-Id: I718e0ee4a79152e919ac95841e15d4b53764ac78 +--- + vcl/source/window/floatwin.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx +index 00c3b34..6553f94 100644 +--- a/vcl/source/window/floatwin.cxx ++++ b/vcl/source/window/floatwin.cxx +@@ -244,7 +244,7 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, + { + // get window position + Point aPos; +- Size aSize = pWindow->GetSizePixel(); ++ Size aSize = ::isLayoutEnabled(pWindow) ? pWindow->get_preferred_size() : pWindow->GetSizePixel(); + Rectangle aScreenRect = pWindow->ImplGetFrameWindow()->GetDesktopRectPixel(); + FloatingWindow *pFloatingWindow = dynamic_cast( pWindow ); + +-- +2.7.1 + diff --git a/SOURCES/0001-Resolves-rhbz-1364335-tooltips-are-truncated.patch b/SOURCES/0001-Resolves-rhbz-1364335-tooltips-are-truncated.patch new file mode 100644 index 0000000..16f3a2a --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1364335-tooltips-are-truncated.patch @@ -0,0 +1,47 @@ +From 2d7b2c6357d478b83fce8f457305e7c2932c4656 Mon Sep 17 00:00:00 2001 +From: rpmbuild +Date: Mon, 15 Aug 2016 15:17:11 +0100 +Subject: [PATCH] Resolves: rhbz#1364335 tooltips are truncated + +--- + vcl/inc/helpwin.hxx | 1 + + vcl/source/app/help.cxx | 11 +++++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/vcl/inc/helpwin.hxx b/vcl/inc/helpwin.hxx +index 5889a4f..def965d 100644 +--- a/vcl/inc/helpwin.hxx ++++ b/vcl/inc/helpwin.hxx +@@ -49,6 +49,7 @@ protected: + virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SAL_OVERRIDE; + virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; + virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE; ++ virtual void StateChanged(StateChangedType nType) SAL_OVERRIDE; + + virtual OUString GetText() const SAL_OVERRIDE; + void ImplShow(); +diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx +index 7014a79..13b0c24 100644 +--- a/vcl/source/app/help.cxx ++++ b/vcl/source/app/help.cxx +@@ -269,6 +269,17 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal + maHideTimer.SetTimeout( rHelpSettings.GetTipTimeout() ); + } + ++void HelpTextWindow::StateChanged(StateChangedType nType) ++{ ++ FloatingWindow::StateChanged(nType); ++ if (nType == StateChangedType::InitShow) ++ { ++ ApplySettings(*this); ++ SetHelpText(maHelpText); ++ Invalidate(); ++ } ++} ++ + void HelpTextWindow::ApplySettings(vcl::RenderContext& rRenderContext) + { + const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); +-- +1.8.3.1 + diff --git a/SOURCES/0001-Resolves-tdf-49407-enable-CaseMap-property-in-impres.patch b/SOURCES/0001-Resolves-tdf-49407-enable-CaseMap-property-in-impres.patch new file mode 100644 index 0000000..8327d31 --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-49407-enable-CaseMap-property-in-impres.patch @@ -0,0 +1,222 @@ +From fb65ac2e3028c4fc160a47448bc44d73d282c9f2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 8 Jun 2015 12:21:01 +0100 +Subject: [PATCH] Resolves: tdf#49407 enable CaseMap property in impress/draw + +I don't see why this was explicitly disabled, works fine +out of the box for me, import/export already hooked up +in odf + +Change-Id: I5e6bdbc6a4f3cbcd97330c7d9fb33589489afee2 +--- + cui/source/inc/chardlg.hxx | 10 ---------- + sd/sdi/drtxtob.sdi | 6 ++++++ + sd/source/core/typemap.cxx | 1 + + sd/source/ui/dlg/dlgchar.cxx | 1 - + sd/source/ui/dlg/prltempl.cxx | 1 - + sd/source/ui/dlg/tabtempl.cxx | 1 - + sd/source/ui/func/fuchar.cxx | 1 + + sd/source/ui/func/futext.cxx | 7 ++++--- + sd/source/ui/view/drtxtob.cxx | 3 ++- + sd/source/ui/view/drviews2.cxx | 11 +++++++++++ + sd/source/ui/view/drviewsf.cxx | 1 + + sw/source/ui/chrdlg/chardlg.cxx | 8 +------- + 12 files changed, 27 insertions(+), 24 deletions(-) + +diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx +index 4eb009a..a023a45 100644 +--- a/cui/source/inc/chardlg.hxx ++++ b/cui/source/inc/chardlg.hxx +@@ -32,16 +32,6 @@ + class SvxFontListItem; + class FontList; + +- +- +-#define DISABLE_CASEMAP ((sal_uInt16)0x0001) +-#define DISABLE_WORDLINE ((sal_uInt16)0x0002) +-#define DISABLE_BLINK ((sal_uInt16)0x0004) +-#define DISABLE_UNDERLINE_COLOR ((sal_uInt16)0x0008) +- +-#define DISABLE_LANGUAGE ((sal_uInt16)0x0010) +-#define DISABLE_HIDE_LANGUAGE ((sal_uInt16)0x0020) +- + // class SvxCharBasePage ------------------------------------------------- + + class SvxCharBasePage : public SfxTabPage +diff --git a/sd/sdi/drtxtob.sdi b/sd/sdi/drtxtob.sdi +index 3e975d4..ed564e4 100644 +--- a/sd/sdi/drtxtob.sdi ++++ b/sd/sdi/drtxtob.sdi +@@ -92,6 +92,12 @@ shell TextObjectBar + StateMethod = GetAttrState; + ] + ++ SID_ATTR_CHAR_CASEMAP // ole : ?, status : ? ++ [ ++ ExecMethod = Execute; ++ StateMethod = GetAttrState; ++ ] ++ + SID_ATTR_PARA_ADJUST_LEFT // ole : ?, status : ? + [ + ExecMethod = Execute; +diff --git a/sd/source/core/typemap.cxx b/sd/source/core/typemap.cxx +index a5548a3..65f7cf0 100644 +--- a/sd/source/core/typemap.cxx ++++ b/sd/source/core/typemap.cxx +@@ -21,6 +21,7 @@ + + #include + #include ++#include + #include + #include + #include +diff --git a/sd/source/ui/dlg/dlgchar.cxx b/sd/source/ui/dlg/dlgchar.cxx +index a23cd80..5e44899 100644 +--- a/sd/source/ui/dlg/dlgchar.cxx ++++ b/sd/source/ui/dlg/dlgchar.cxx +@@ -60,7 +60,6 @@ void SdCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) + } + else if (nId == mnCharEffects) + { +- aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); + rPage.PageCreated(aSet); + } + } +diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx +index 74c010e..c503c93 100644 +--- a/sd/source/ui/dlg/prltempl.cxx ++++ b/sd/source/ui/dlg/prltempl.cxx +@@ -281,7 +281,6 @@ void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) + + else if (nId == mnEffects) + { +- aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); + rPage.PageCreated(aSet); + } + } +diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx +index 61514ee..1189922 100644 +--- a/sd/source/ui/dlg/tabtempl.cxx ++++ b/sd/source/ui/dlg/tabtempl.cxx +@@ -152,7 +152,6 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) + } + else if (nId == m_nFontEffectId) + { +- aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); + rPage.PageCreated(aSet); + } + else if (nId == m_nTextId) +diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx +index 174391a..b8166c2 100644 +--- a/sd/source/ui/func/fuchar.cxx ++++ b/sd/source/ui/func/fuchar.cxx +@@ -106,6 +106,7 @@ void FuChar::DoExecute( SfxRequest& rReq ) + SID_ATTR_CHAR_FONTHEIGHT, + SID_ATTR_CHAR_COLOR, + SID_ATTR_CHAR_KERNING, ++ SID_ATTR_CHAR_CASEMAP, + SID_SET_SUPER_SCRIPT, + SID_SET_SUB_SCRIPT, + 0 }; +diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx +index ac6fb71..33e5339 100644 +--- a/sd/source/ui/func/futext.cxx ++++ b/sd/source/ui/func/futext.cxx +@@ -85,12 +85,13 @@ static sal_uInt16 SidArray[] = { + SID_ATTR_CHAR_FONT, // 10007 + SID_ATTR_CHAR_POSTURE, // 10008 + SID_ATTR_CHAR_WEIGHT, // 10009 +- SID_ATTR_CHAR_SHADOWED, //10010 +- SID_ATTR_CHAR_STRIKEOUT, //10013 ++ SID_ATTR_CHAR_SHADOWED, // 10010 ++ SID_ATTR_CHAR_STRIKEOUT, // 10013 + SID_ATTR_CHAR_UNDERLINE, // 10014 + SID_ATTR_CHAR_FONTHEIGHT, // 10015 + SID_ATTR_CHAR_COLOR, // 10017 +- SID_ATTR_CHAR_KERNING, //10018 ++ SID_ATTR_CHAR_KERNING, // 10018 ++ SID_ATTR_CHAR_CASEMAP, // 10019 + SID_ATTR_PARA_ADJUST_LEFT, // 10028 + SID_ATTR_PARA_ADJUST_RIGHT, // 10029 + SID_ATTR_PARA_ADJUST_CENTER, // 10030 +diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx +index 25913dd..45c868f 100644 +--- a/sd/source/ui/view/drtxtob.cxx ++++ b/sd/source/ui/view/drtxtob.cxx +@@ -171,8 +171,9 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) + case SID_ATTR_CHAR_FONTHEIGHT: + case SID_ATTR_CHAR_WEIGHT: + case SID_ATTR_CHAR_POSTURE: +- case SID_ATTR_CHAR_SHADOWED: ++ case SID_ATTR_CHAR_SHADOWED: + case SID_ATTR_CHAR_STRIKEOUT: ++ case SID_ATTR_CHAR_CASEMAP: + { + sal_uInt16 stretchX = 100; + sal_uInt16 stretchY = 100; +diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx +index d4ed8fa..ffbb503 100644 +--- a/sd/source/ui/view/drviews2.cxx ++++ b/sd/source/ui/view/drviews2.cxx +@@ -87,6 +87,7 @@ + #include + #include + ++#include + #include + #include + #include +@@ -3032,6 +3033,16 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) + } + } + break; ++ case SID_ATTR_CHAR_CASEMAP: ++ if( rReq.GetArgs() ) ++ { ++ SFX_REQUEST_ARG( rReq, pItem, SvxCaseMapItem, SID_ATTR_CHAR_CASEMAP , false ); ++ if (pItem) ++ { ++ aNewAttr.Put(*pItem); ++ } ++ } ++ break; + case SID_SET_SUB_SCRIPT: + { + SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); +diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx +index 56d7a88..a5183c1 100644 +--- a/sd/source/ui/view/drviewsf.cxx ++++ b/sd/source/ui/view/drviewsf.cxx +@@ -409,6 +409,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) + case SID_ATTR_CHAR_WEIGHT: + case SID_ATTR_CHAR_COLOR: + case SID_ATTR_CHAR_KERNING: ++ case SID_ATTR_CHAR_CASEMAP: + case SID_SET_SUB_SCRIPT: + case SID_SET_SUPER_SCRIPT: + { +diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx +index b20dfdc2..2483fda 100644 +--- a/sw/source/ui/chrdlg/chardlg.cxx ++++ b/sw/source/ui/chrdlg/chardlg.cxx +@@ -112,13 +112,7 @@ void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) + } + else if (nId == m_nCharExtId) + { +- if(m_nDialogMode == DLG_CHAR_DRAW || m_nDialogMode == DLG_CHAR_ANN) +- aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); +- +- else +- { +- aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER|SVX_ENABLE_FLASH)); +- } ++ aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER|SVX_ENABLE_FLASH)); + rPage.PageCreated(aSet); + } + else if (nId == m_nCharPosId) +-- +2.4.0 + diff --git a/SOURCES/0001-Resolves-tdf-73211-gtk-checkboxes-need-erase-afer-to.patch b/SOURCES/0001-Resolves-tdf-73211-gtk-checkboxes-need-erase-afer-to.patch deleted file mode 100644 index 504098a..0000000 --- a/SOURCES/0001-Resolves-tdf-73211-gtk-checkboxes-need-erase-afer-to.patch +++ /dev/null @@ -1,53 +0,0 @@ -From cefd9a4a0ad5d8c1cd352e5911f8eebccd344e6b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 24 Apr 2015 11:01:50 +0100 -Subject: [PATCH] Resolves: tdf#73211 gtk checkboxes need erase afer toggling - -because an unchecked checkbox can have a smaller paint area -than a checked checkbox. This has always bugged me - -(cherry picked from commit d194074aa34e3724dd9b93fbc81bf2ba793cd37a) - -Conflicts: - vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx - -Change-Id: Iac0f075089611b47c381863a9655445d732bfddc ---- - vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 2 ++ - vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 7 ++++++- - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx -index b1e7e23..226ea69 100644 ---- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx -+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx -@@ -441,6 +441,8 @@ void GtkData::initNWF( void ) - pSVData->maNWFData.mnMenuFormatBorderX = xthickness + horizontal_padding; - pSVData->maNWFData.mnMenuFormatBorderY = ythickness + vertical_padding; - -+ pSVData->maNWFData.mbCheckBoxNeedsErase = true; -+ - if( SalGetDesktopEnvironment() == "KDE" ) - { - // #i97196# ensure a widget exists and the style engine was loaded -diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx -index 2a1f4e7..ed4c2d0 100644 ---- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx -+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx -@@ -1470,7 +1470,12 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP - return false; - } - --void GtkData::initNWF() {} -+void GtkData::initNWF() -+{ -+ ImplSVData* pSVData = ImplGetSVData(); -+ pSVData->maNWFData.mbCheckBoxNeedsErase = true; -+} -+ - void GtkData::deInitNWF() {} - - void GtkSalGraphics::getStyleContext(GtkStyleContext** style, GtkWidget* widget) --- -2.1.0 - diff --git a/SOURCES/0001-Resolves-tdf-89905-don-t-copy-palettes-from-shared-t.patch b/SOURCES/0001-Resolves-tdf-89905-don-t-copy-palettes-from-shared-t.patch new file mode 100644 index 0000000..4dc0a71 --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-89905-don-t-copy-palettes-from-shared-t.patch @@ -0,0 +1,599 @@ +From f47aa0dbb17a998bdeb01036b9fd9ba0b74b8704 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sat, 6 Jun 2015 14:24:46 +0100 +Subject: [PATCH] Resolves: tdf#89905 don't copy palettes from shared to user + +make this a multi-path element with a shared read-only location +and a user read/write location and don't copy the presets, instead +just keep them in the shared location + +Now an admin can copy extra palettes into the shared location +and they magically appear in the user deployments + +Change-Id: I7585789c0c59941094f6128368df94b834d3c2a2 +(cherry picked from commit 29202a16d9f1934684c7d0978112849f2a21fe2f) + +Related: tdf#89905 these PalettePath uses appear to really be UserConfigPath + +which is the same path at the moment + +Change-Id: Ifdefa478003a2b5cc5c065b1942194dda1275f5e +(cherry picked from commit 2c3bf6bfc244517a0134e320acaa1f720703d8f2) +--- + cui/source/tabpages/tabarea.cxx | 9 ++- + cui/source/tabpages/tabline.cxx | 10 +++- + cui/source/tabpages/tpbitmap.cxx | 22 ++++++- + cui/source/tabpages/tpcolor.cxx | 22 ++++++- + cui/source/tabpages/tpgradnt.cxx | 22 ++++++- + cui/source/tabpages/tphatch.cxx | 22 ++++++- + cui/source/tabpages/tplnedef.cxx | 22 ++++++- + cui/source/tabpages/tplneend.cxx | 23 +++++++- + extras/Package_palettes.mk | 2 +- + offapi/com/sun/star/util/XPathSettings.idl | 3 +- + .../registry/data/org/openoffice/Office/Paths.xcu | 3 + + .../schema/org/openoffice/Office/Common.xcs | 7 ++- + sd/source/ui/dlg/PhotoAlbumDialog.cxx | 2 +- + svx/source/sidebar/nbdtmg.cxx | 4 +- + svx/source/tbxctrls/PaletteManager.cxx | 67 +++++++++++++++------- + svx/source/xoutdev/xtable.cxx | 54 ++++++++++++----- + 16 files changed, 237 insertions(+), 57 deletions(-) + +diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx +index 7ecc836..1bdaa17 100644 +--- a/cui/source/tabpages/tabarea.cxx ++++ b/cui/source/tabpages/tabarea.cxx +@@ -142,7 +142,14 @@ void SvxAreaTabDialog::SavePalettes() + + // save the tables when they have been changed + +- const OUString aPath( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aPath; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aPath = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); + + if( mnHatchingListState & ChangeType::MODIFIED ) + { +diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx +index aa99b2c..6049c8c 100644 +--- a/cui/source/tabpages/tabline.cxx ++++ b/cui/source/tabpages/tabline.cxx +@@ -130,8 +130,14 @@ void SvxLineTabDialog::SavePalettes() + } + + // Save the tables when they have been changed +- +- const OUString aPath( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aPath; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aPath = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); + + if( nDashListState & ChangeType::MODIFIED ) + { +diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx +index 0d11116..71c23e6 100644 +--- a/cui/source/tabpages/tpbitmap.cxx ++++ b/cui/source/tabpages/tpbitmap.cxx +@@ -795,7 +795,16 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickLoadHdl_Impl) + ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); + OUString aStrFilterType( "*.sob" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); + + if ( aDlg.Execute() == ERRCODE_NONE ) +@@ -875,7 +884,16 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickSaveHdl_Impl) + OUString aStrFilterType( "*.sob" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); + +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); + + if( !pBitmapList->GetName().isEmpty() ) +diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx +index 94231c5..50b74de 100644 +--- a/cui/source/tabpages/tpcolor.cxx ++++ b/cui/source/tabpages/tpcolor.cxx +@@ -142,7 +142,16 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickLoadHdl_Impl) + OUString aStrFilterType( XPropertyList::GetDefaultExtFilter( meType ) ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); + +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); + + if ( aDlg.Execute() == ERRCODE_NONE ) +@@ -202,7 +211,16 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickSaveHdl_Impl) + OUString aStrFilterType( XPropertyList::GetDefaultExtFilter( meType ) ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); + +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); + + XPropertyListRef pList = GetList(); +diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx +index e737410..380f36a 100644 +--- a/cui/source/tabpages/tpgradnt.cxx ++++ b/cui/source/tabpages/tpgradnt.cxx +@@ -655,7 +655,16 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl) + ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); + OUString aStrFilterType( "*.sog" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); + + if( aDlg.Execute() == ERRCODE_NONE ) +@@ -739,7 +748,16 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickSaveHdl_Impl) + OUString aStrFilterType( "*.sog" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); + +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); + + if( !pGradientList->GetName().isEmpty() ) +diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx +index bad1e71..0060b36 100644 +--- a/cui/source/tabpages/tphatch.cxx ++++ b/cui/source/tabpages/tphatch.cxx +@@ -692,7 +692,16 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickLoadHdl_Impl) + ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); + OUString aStrFilterType( "*.soh" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); + + if( aDlg.Execute() == ERRCODE_NONE ) +@@ -765,7 +774,16 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickSaveHdl_Impl) + OUString aStrFilterType( "*.soh" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); + +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); + + if( !pHatchingList->GetName().isEmpty() ) +diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx +index 6694a54..38a7c7f 100644 +--- a/cui/source/tabpages/tplnedef.cxx ++++ b/cui/source/tabpages/tplnedef.cxx +@@ -761,7 +761,16 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl) + ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); + OUString aStrFilterType( "*.sod" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); + + if( aDlg.Execute() == ERRCODE_NONE ) +@@ -821,7 +830,16 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickSaveHdl_Impl) + OUString aStrFilterType( "*.sod" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); + +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); + + if( !pDashList->GetName().isEmpty() ) +diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx +index aff55b9..478ab46 100644 +--- a/cui/source/tabpages/tplneend.cxx ++++ b/cui/source/tabpages/tplneend.cxx +@@ -573,7 +573,17 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl) + ::sfx2::FileDialogHelper aDlg(com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); + OUString aStrFilterType( "*.soe" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); + + if( aDlg.Execute() == ERRCODE_NONE ) +@@ -633,7 +643,16 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl) + OUString aStrFilterType( "*.soe" ); + aDlg.AddFilter( aStrFilterType, aStrFilterType ); + +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ OUString aPalettePath(SvtPathOptions().GetPalettePath()); ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = aPalettePath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aFile(aLastDir); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); + + if( !pLineEndList->GetName().isEmpty() ) +diff --git a/extras/Package_palettes.mk b/extras/Package_palettes.mk +index bc317e2..5cf4c61 100644 +--- a/extras/Package_palettes.mk ++++ b/extras/Package_palettes.mk +@@ -9,7 +9,7 @@ + + $(eval $(call gb_Package_Package,extras_palettes,$(SRCDIR)/extras/source/palettes)) + +-$(eval $(call gb_Package_add_files,extras_palettes,$(LIBO_SHARE_PRESETS_FOLDER)/config,\ ++$(eval $(call gb_Package_add_files,extras_palettes,$(LIBO_SHARE_FOLDER)/palette,\ + arrowhd.soe \ + classic.sog \ + cmyk.soc \ +diff --git a/offapi/com/sun/star/util/XPathSettings.idl b/offapi/com/sun/star/util/XPathSettings.idl +index 5f202a3..d54c122 100644 +--- a/offapi/com/sun/star/util/XPathSettings.idl ++++ b/offapi/com/sun/star/util/XPathSettings.idl +@@ -89,7 +89,8 @@ published interface XPathSettings + [attribute] string Module; + + /** This is the path to the palette files *.SOB to *.SOF containing +- user-defined colors and patterns. */ ++ user-defined colors and patterns. The value can be more than ++ one path separated by a semicolon.*/ + [attribute] string Palette; + + /** Plugins are saved in these directories. The value can be more than +diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu +index 6d739e6..965a629 100644 +--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu ++++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu +@@ -124,6 +124,9 @@ + + + ++ ++ ++ + + $(userurl)/config + +diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs +index 0bc0dc8..8922889 100644 +--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs ++++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs +@@ -1642,12 +1642,15 @@ + + $(progpath) + +- ++ + + Specifies the path to the palette files *.SOB to *.SOF + containing user-defined colors and patterns. + +- $(userurl)/config ++ ++ $(insturl)/@LIBO_SHARE_FOLDER@/palette ++ $(userurl)/config ++ + + + +diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx +index d5dcd09..b29ea21 100644 +--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx ++++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx +@@ -480,7 +480,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, FileHdl) + // Read configuration + OUString sUrl(officecfg::Office::Impress::Pictures::Path::get()); + +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ INetURLObject aFile( SvtPathOptions().GetUserConfigPath() ); + if (!sUrl.isEmpty()) + aDlg.SetDisplayDirectory(sUrl); + else +diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx +index 7c7e2c4..9570c2b 100644 +--- a/svx/source/sidebar/nbdtmg.cxx ++++ b/svx/source/sidebar/nbdtmg.cxx +@@ -157,7 +157,7 @@ void NBOTypeMgrBase::ImplLoad(const OUString& filename) + bIsLoading = true; + SfxMapUnit eOldCoreUnit=eCoreUnit; + eCoreUnit = SFX_MAPUNIT_100TH_MM; +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ INetURLObject aFile( SvtPathOptions().GetUserConfigPath() ); + aFile.Append( filename); + std::unique_ptr xIStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); + if( xIStm ) { +@@ -196,7 +196,7 @@ void NBOTypeMgrBase::ImplStore(const OUString& filename) + if (bIsLoading) return; + SfxMapUnit eOldCoreUnit=eCoreUnit; + eCoreUnit = SFX_MAPUNIT_100TH_MM; +- INetURLObject aFile( SvtPathOptions().GetPalettePath() ); ++ INetURLObject aFile( SvtPathOptions().GetUserConfigPath() ); + aFile.Append( filename); + std::unique_ptr xOStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE )); + if( xOStm ) { +diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx +index 109f934..3334afc 100644 +--- a/svx/source/tbxctrls/PaletteManager.cxx ++++ b/svx/source/tbxctrls/PaletteManager.cxx +@@ -27,6 +27,8 @@ + #include + #include + #include ++#include ++#include + + PaletteManager::PaletteManager() : + mnMaxRecentColors(Application::GetSettings().GetStyleSettings().GetColorValueSetColumnCount()), +@@ -47,31 +49,52 @@ PaletteManager::~PaletteManager() + void PaletteManager::LoadPalettes() + { + maPalettes.clear(); +- OUString aPalPath = SvtPathOptions().GetPalettePath(); +- +- osl::Directory aDir(aPalPath); +- osl::DirectoryItem aDirItem; +- osl::FileStatus aFileStat( osl_FileStatus_Mask_FileName | +- osl_FileStatus_Mask_FileURL | +- osl_FileStatus_Mask_Type ); +- if( aDir.open() == osl::FileBase::E_None ) ++ OUString aPalPaths = SvtPathOptions().GetPalettePath(); ++ ++ std::stack aDirs; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aDirs.push(aPalPaths.getToken(0, ';', nIndex)); ++ } ++ while (nIndex >= 0); ++ ++ std::set aNames; ++ //try all entries palette path list user first, then ++ //system, ignoring duplicate file names ++ while (!aDirs.empty()) + { +- while( aDir.getNextItem(aDirItem) == osl::FileBase::E_None ) ++ OUString aPalPath = aDirs.top(); ++ aDirs.pop(); ++ ++ osl::Directory aDir(aPalPath); ++ osl::DirectoryItem aDirItem; ++ osl::FileStatus aFileStat( osl_FileStatus_Mask_FileName | ++ osl_FileStatus_Mask_FileURL | ++ osl_FileStatus_Mask_Type ); ++ if( aDir.open() == osl::FileBase::E_None ) + { +- aDirItem.getFileStatus(aFileStat); +- if(aFileStat.isRegular() || aFileStat.isLink()) ++ while( aDir.getNextItem(aDirItem) == osl::FileBase::E_None ) + { +- OUString aFName = aFileStat.getFileName(); +- Palette* pPalette = 0; +- if( aFName.endsWithIgnoreAsciiCase(".gpl") ) +- pPalette = new PaletteGPL( aFileStat.getFileURL(), aFName ); +- else if( aFName.endsWithIgnoreAsciiCase(".soc") ) +- pPalette = new PaletteSOC( aFileStat.getFileURL(), aFName ); +- else if ( aFName.endsWithIgnoreAsciiCase(".ase") ) +- pPalette = new PaletteASE( aFileStat.getFileURL(), aFName ); +- +- if( pPalette && pPalette->IsValid() ) +- maPalettes.push_back( pPalette ); ++ aDirItem.getFileStatus(aFileStat); ++ if(aFileStat.isRegular() || aFileStat.isLink()) ++ { ++ OUString aFName = aFileStat.getFileName(); ++ if (aNames.find(aFName) == aNames.end()) ++ { ++ Palette* pPalette = 0; ++ if( aFName.endsWithIgnoreAsciiCase(".gpl") ) ++ pPalette = new PaletteGPL( aFileStat.getFileURL(), aFName ); ++ else if( aFName.endsWithIgnoreAsciiCase(".soc") ) ++ pPalette = new PaletteSOC( aFileStat.getFileURL(), aFName ); ++ else if ( aFName.endsWithIgnoreAsciiCase(".ase") ) ++ pPalette = new PaletteASE( aFileStat.getFileURL(), aFName ); ++ ++ if( pPalette && pPalette->IsValid() ) ++ maPalettes.push_back( pPalette ); ++ aNames.insert(aFName); ++ } ++ } + } + } + } +diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx +index 5e35be9..b3f1416d 100644 +--- a/svx/source/xoutdev/xtable.cxx ++++ b/svx/source/xoutdev/xtable.cxx +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + using namespace com::sun::star; + +@@ -224,23 +225,41 @@ bool XPropertyList::Load() + if( mbListDirty ) + { + mbListDirty = false; ++ std::stack aDirs; + +- INetURLObject aURL( maPath ); +- +- if( INetProtocol::NotValid == aURL.GetProtocol() ) ++ sal_Int32 nIndex = 0; ++ do + { +- DBG_ASSERT( maPath.isEmpty(), "invalid URL" ); +- return false; ++ aDirs.push(maPath.getToken(0, ';', nIndex)); + } ++ while (nIndex >= 0); ++ ++ //try all entries palette path list working back to front until one ++ //succeeds ++ while (!aDirs.empty()) ++ { ++ OUString aPath(aDirs.top()); ++ aDirs.pop(); ++ ++ INetURLObject aURL(aPath); ++ ++ if( INetProtocol::NotValid == aURL.GetProtocol() ) ++ { ++ DBG_ASSERT( aPath.isEmpty(), "invalid URL" ); ++ return false; ++ } + +- aURL.Append( maName ); ++ aURL.Append( maName ); + +- if( aURL.getExtension().isEmpty() ) +- aURL.setExtension( GetDefaultExt() ); ++ if( aURL.getExtension().isEmpty() ) ++ aURL.setExtension( GetDefaultExt() ); + +- return SvxXMLXTableImport::load( aURL.GetMainURL( INetURLObject::NO_DECODE ), maReferer, +- uno::Reference < embed::XStorage >(), +- createInstance(), NULL ); ++ bool bRet = SvxXMLXTableImport::load(aURL.GetMainURL(INetURLObject::NO_DECODE), ++ maReferer, uno::Reference < embed::XStorage >(), ++ createInstance(), NULL ); ++ if (bRet) ++ return bRet; ++ } + } + return false; + } +@@ -256,11 +275,20 @@ bool XPropertyList::LoadFrom( const uno::Reference < embed::XStorage > &xStorage + + bool XPropertyList::Save() + { +- INetURLObject aURL( maPath ); ++ //save to the last path in the palette path list ++ OUString aLastDir; ++ sal_Int32 nIndex = 0; ++ do ++ { ++ aLastDir = maPath.getToken(0, ';', nIndex); ++ } ++ while (nIndex >= 0); ++ ++ INetURLObject aURL(aLastDir); + + if( INetProtocol::NotValid == aURL.GetProtocol() ) + { +- DBG_ASSERT( maPath.isEmpty(), "invalid URL" ); ++ DBG_ASSERT( aLastDir.isEmpty(), "invalid URL" ); + return false; + } + +-- +2.4.0 + diff --git a/SOURCES/0001-Resolves-tdf-90256-repair-invalid-docking-positions.patch b/SOURCES/0001-Resolves-tdf-90256-repair-invalid-docking-positions.patch deleted file mode 100644 index 4856428..0000000 --- a/SOURCES/0001-Resolves-tdf-90256-repair-invalid-docking-positions.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 3c22024f41029dd4c1dca6b265d1fd0f14fc2f95 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 26 Mar 2015 13:37:10 +0000 -Subject: [PATCH] Resolves: tdf#90256 repair invalid docking positions - -Change-Id: If144a867dc4be6975c08cd1eea9ebb540975aafc ---- - framework/source/layoutmanager/layoutmanager.cxx | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx -index d4e4eee..94e99ff 100644 ---- a/framework/source/layoutmanager/layoutmanager.cxx -+++ b/framework/source/layoutmanager/layoutmanager.cxx -@@ -531,8 +531,15 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem - else if ( aWindowState[n].Name == WINDOWSTATE_PROPERTY_DOCKPOS ) - { - awt::Point aPoint; -- if ( aWindowState[n].Value >>= aPoint ) -+ if (aWindowState[n].Value >>= aPoint) -+ { -+ //tdf#90256 repair these broken Docking positions -+ if (aPoint.X < 0) -+ aPoint.X = SAL_MAX_INT32; -+ if (aPoint.Y < 0) -+ aPoint.Y = SAL_MAX_INT32; - rElementData.m_aDockedData.m_aPos = aPoint; -+ } - } - else if ( aWindowState[n].Name == WINDOWSTATE_PROPERTY_POS ) - { --- -1.9.3 - diff --git a/SOURCES/0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch b/SOURCES/0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch deleted file mode 100644 index 8460b0e..0000000 --- a/SOURCES/0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 92ce22450d4a140b368bf95ae6975887f3a30032 Mon Sep 17 00:00:00 2001 -Message-Id: <92ce22450d4a140b368bf95ae6975887f3a30032.1430767502.git.erack@redhat.com> -From: Eike Rathke -Date: Mon, 4 May 2015 20:45:45 +0200 -Subject: [PATCH] Resolves tdf#90757 ensure start row / end row order makes - sense -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="------------erAck-patch-parts" - -This is a multi-part message in MIME format. ---------------erAck-patch-parts -Content-Type: text/plain; charset=UTF-8; format=fixed -Content-Transfer-Encoding: 8bit - - -... in case the header is the only row. - -(cherry picked from commit 46fa99f61aff88f1697959a9d3c41a5c3c3c05e9) - -Conflicts: - sc/source/ui/docshell/dbdocfun.cxx - -Change-Id: I5e6046007a8d668f9834e108aaf8af0072629fc8 ---- - sc/source/core/data/table3.cxx | 9 ++++----- - sc/source/ui/docshell/dbdocfun.cxx | 13 ++++++++----- - 2 files changed, 12 insertions(+), 10 deletions(-) - - ---------------erAck-patch-parts -Content-Type: text/x-patch; name="0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch" -Content-Transfer-Encoding: 8bit -Content-Disposition: attachment; filename="0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch" - -diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx -index daf370c..c9e9377 100644 ---- a/sc/source/core/data/table3.cxx -+++ b/sc/source/core/data/table3.cxx -@@ -1429,11 +1429,10 @@ void ScTable::Sort( - SCROW nLastRow = 0; - for (SCCOL nCol = rSortParam.nCol1; nCol <= rSortParam.nCol2; nCol++) - nLastRow = std::max(nLastRow, aCol[nCol].GetLastDataPos()); -- rSortParam.nRow2 = nLastRow = std::min(nLastRow, rSortParam.nRow2); -- SCROW nRow1 = (rSortParam.bHasHeader ? -- rSortParam.nRow1 + 1 : rSortParam.nRow1); -+ rSortParam.nRow2 = nLastRow = std::max( std::min(nLastRow, rSortParam.nRow2), rSortParam.nRow1); -+ SCROW nRow1 = (rSortParam.bHasHeader ? rSortParam.nRow1 + 1 : rSortParam.nRow1); - aSortParam = rSortParam; // must be assigned before calling IsSorted() -- if (!IsSorted(nRow1, nLastRow)) -+ if (nRow1 < nLastRow && !IsSorted(nRow1, nLastRow)) - { - if(pProgress) - pProgress->SetState( 0, nLastRow-nRow1 ); -@@ -1459,7 +1458,7 @@ void ScTable::Sort( - SCCOL nCol1 = (rSortParam.bHasHeader ? - rSortParam.nCol1 + 1 : rSortParam.nCol1); - aSortParam = rSortParam; // must be assigned before calling IsSorted() -- if (!IsSorted(nCol1, nLastCol)) -+ if (nCol1 < nLastCol && !IsSorted(nCol1, nLastCol)) - { - if(pProgress) - pProgress->SetState( 0, nLastCol-nCol1 ); -diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx -index c4e81bc..cb132b6 100644 ---- a/sc/source/ui/docshell/dbdocfun.cxx -+++ b/sc/source/ui/docshell/dbdocfun.cxx -@@ -531,10 +531,13 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, - - pDBData->SetSortParam(rSortParam); - -- ScRange aDirtyRange( -- aLocalParam.nCol1, nStartRow, nTab, -- aLocalParam.nCol2, aLocalParam.nRow2, nTab); -- pDoc->SetDirty( aDirtyRange, true ); -+ if (nStartRow <= aLocalParam.nRow2) -+ { -+ ScRange aDirtyRange( -+ aLocalParam.nCol1, nStartRow, nTab, -+ aLocalParam.nCol2, aLocalParam.nRow2, nTab); -+ pDoc->SetDirty( aDirtyRange, true ); -+ } - - if (bPaint) - { -@@ -552,7 +555,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, - rDocShell.PostPaint(ScRange(nStartX, nStartY, nTab, nEndX, nEndY, nTab), nPaint); - } - -- if (!bUniformRowHeight) -+ if (!bUniformRowHeight && nStartRow <= aLocalParam.nRow2) - rDocShell.AdjustRowHeight(nStartRow, aLocalParam.nRow2, nTab); - - aModificator.SetDocumentModified(); - ---------------erAck-patch-parts-- - - diff --git a/SOURCES/0001-Resolves-tdf-91078-check-also-DBData-modified-not-on.patch b/SOURCES/0001-Resolves-tdf-91078-check-also-DBData-modified-not-on.patch deleted file mode 100644 index d672de6..0000000 --- a/SOURCES/0001-Resolves-tdf-91078-check-also-DBData-modified-not-on.patch +++ /dev/null @@ -1,259 +0,0 @@ -From 43c6130f152066ce751033f5b0fd205b4912e332 Mon Sep 17 00:00:00 2001 -Message-Id: <43c6130f152066ce751033f5b0fd205b4912e332.1430929664.git.erack@redhat.com> -From: Eike Rathke -Date: Wed, 6 May 2015 17:15:12 +0200 -Subject: [PATCH] Resolves: tdf#91078 check also DBData modified, not only - named expressions -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="------------erAck-patch-parts" - -This is a multi-part message in MIME format. ---------------erAck-patch-parts -Content-Type: text/plain; charset=UTF-8; format=fixed -Content-Transfer-Encoding: 8bit - - -This adds ScDocument& to all RefUpdate...Context; another approach could -had been to add an UpdatedDBData similar to UpdatedRangeNames and gather -those in the ScDBData::Update...() methods, but as long as -ScDBData::IsModified() works that isn't necessary. - -(cherry picked from commit 848dc76e76c1c4a9040be4a0088c4d4527af6f40) - -Backported. - -Change-Id: Iae3ec6c8b8356cbd8acb2445489e91e7d6922fb3 ---- - sc/inc/refupdatecontext.hxx | 9 ++++++--- - sc/source/core/data/documen2.cxx | 4 ++-- - sc/source/core/data/document.cxx | 8 ++++---- - sc/source/core/data/refupdatecontext.cxx | 12 ++++++------ - sc/source/core/tool/token.cxx | 29 +++++++++++++++++++++-------- - 5 files changed, 39 insertions(+), 23 deletions(-) - - ---------------erAck-patch-parts -Content-Type: text/x-patch; name="0001-Resolves-tdf-91078-check-also-DBData-modified-not-on.patch" -Content-Transfer-Encoding: 8bit -Content-Disposition: attachment; filename="0001-Resolves-tdf-91078-check-also-DBData-modified-not-on.patch" - -diff --git a/sc/inc/refupdatecontext.hxx b/sc/inc/refupdatecontext.hxx -index 393a855..3b4db92 100644 ---- a/sc/inc/refupdatecontext.hxx -+++ b/sc/inc/refupdatecontext.hxx -@@ -103,29 +103,32 @@ struct RefUpdateResult - - struct RefUpdateInsertTabContext - { -+ ScDocument& mrDoc; - SCTAB mnInsertPos; - SCTAB mnSheets; - UpdatedRangeNames maUpdatedNames; - -- RefUpdateInsertTabContext(SCTAB nInsertPos, SCTAB nSheets); -+ RefUpdateInsertTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets); - }; - - struct RefUpdateDeleteTabContext - { -+ ScDocument& mrDoc; - SCTAB mnDeletePos; - SCTAB mnSheets; - UpdatedRangeNames maUpdatedNames; - -- RefUpdateDeleteTabContext(SCTAB nInsertPos, SCTAB nSheets); -+ RefUpdateDeleteTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets); - }; - - struct RefUpdateMoveTabContext - { -+ ScDocument& mrDoc; - SCTAB mnOldPos; - SCTAB mnNewPos; - UpdatedRangeNames maUpdatedNames; - -- RefUpdateMoveTabContext(SCTAB nOldPos, SCTAB nNewPos); -+ RefUpdateMoveTabContext(ScDocument& rDoc, SCTAB nOldPos, SCTAB nNewPos); - - SCTAB getNewTab(SCTAB nOldTab) const; - }; -diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx -index 79e6f63..5e73cb9 100644 ---- a/sc/source/core/data/documen2.cxx -+++ b/sc/source/core/data/documen2.cxx -@@ -744,7 +744,7 @@ bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos, ScProgress* pProgress ) - // Referenz-Updaterei - //! mit UpdateReference zusammenfassen! - -- sc::RefUpdateMoveTabContext aCxt(nOldPos, nNewPos); -+ sc::RefUpdateMoveTabContext aCxt( *this, nOldPos, nNewPos); - - SCsTAB nDz = ((SCsTAB)nNewPos) - (SCsTAB)nOldPos; - ScRange aSourceRange( 0,0,nOldPos, MAXCOL,MAXROW,nOldPos ); -@@ -820,7 +820,7 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM - bValid = !GetTable( aName, nDummy ); - - sc::AutoCalcSwitch aACSwitch(*this, false); -- sc::RefUpdateInsertTabContext aCxt(nNewPos, 1); -+ sc::RefUpdateInsertTabContext aCxt( *this, nNewPos, 1); - - if (bValid) - { -diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx -index 524f97f..cfa6c7c 100644 ---- a/sc/source/core/data/document.cxx -+++ b/sc/source/core/data/document.cxx -@@ -494,7 +494,7 @@ bool ScDocument::InsertTab( - { - if (ValidTab(nPos) && (nPos < nTabCount)) - { -- sc::RefUpdateInsertTabContext aCxt(nPos, 1); -+ sc::RefUpdateInsertTabContext aCxt( *this, nPos, 1); - - ScRange aRange( 0,0,nPos, MAXCOL,MAXROW,MAXTAB ); - xColNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,1 ); -@@ -588,7 +588,7 @@ bool ScDocument::InsertTabs( SCTAB nPos, const std::vector& rNames, - { - if (ValidTab(nPos) && (nPos < nTabCount)) - { -- sc::RefUpdateInsertTabContext aCxt(nPos, nNewSheets); -+ sc::RefUpdateInsertTabContext aCxt( *this, nPos, nNewSheets); - ScRange aRange( 0,0,nPos, MAXCOL,MAXROW,MAXTAB ); - xColNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,nNewSheets ); - xRowNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,nNewSheets ); -@@ -666,7 +666,7 @@ bool ScDocument::DeleteTab( SCTAB nTab ) - if (nTabCount > 1) - { - sc::AutoCalcSwitch aACSwitch(*this, false); -- sc::RefUpdateDeleteTabContext aCxt(nTab, 1); -+ sc::RefUpdateDeleteTabContext aCxt( *this, nTab, 1); - - ScRange aRange( 0, 0, nTab, MAXCOL, MAXROW, nTab ); - DelBroadcastAreasInRange( aRange ); -@@ -752,7 +752,7 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets ) - if (nTabCount > nSheets) - { - sc::AutoCalcSwitch aACSwitch(*this, false); -- sc::RefUpdateDeleteTabContext aCxt(nTab, nSheets); -+ sc::RefUpdateDeleteTabContext aCxt( *this, nTab, nSheets); - - for (SCTAB aTab = 0; aTab < nSheets; ++aTab) - { -diff --git a/sc/source/core/data/refupdatecontext.cxx b/sc/source/core/data/refupdatecontext.cxx -index 8bf52985..6727765 100644 ---- a/sc/source/core/data/refupdatecontext.cxx -+++ b/sc/source/core/data/refupdatecontext.cxx -@@ -61,14 +61,14 @@ RefUpdateResult::RefUpdateResult(const RefUpdateResult& r) : - mbReferenceModified(r.mbReferenceModified), - mbNameModified(r.mbNameModified) {} - --RefUpdateInsertTabContext::RefUpdateInsertTabContext(SCTAB nInsertPos, SCTAB nSheets) : -- mnInsertPos(nInsertPos), mnSheets(nSheets) {} -+RefUpdateInsertTabContext::RefUpdateInsertTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets) : -+ mrDoc(rDoc), mnInsertPos(nInsertPos), mnSheets(nSheets) {} - --RefUpdateDeleteTabContext::RefUpdateDeleteTabContext(SCTAB nDeletePos, SCTAB nSheets) : -- mnDeletePos(nDeletePos), mnSheets(nSheets) {} -+RefUpdateDeleteTabContext::RefUpdateDeleteTabContext(ScDocument& rDoc, SCTAB nDeletePos, SCTAB nSheets) : -+ mrDoc(rDoc), mnDeletePos(nDeletePos), mnSheets(nSheets) {} - --RefUpdateMoveTabContext::RefUpdateMoveTabContext(SCTAB nOldPos, SCTAB nNewPos) : -- mnOldPos(nOldPos), mnNewPos(nNewPos) {} -+RefUpdateMoveTabContext::RefUpdateMoveTabContext(ScDocument& rDoc, SCTAB nOldPos, SCTAB nNewPos) : -+ mrDoc(rDoc), mnOldPos(nOldPos), mnNewPos(nNewPos) {} - - SCTAB RefUpdateMoveTabContext::getNewTab(SCTAB nOldTab) const - { -diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx -index 9961b58..a83ba8e 100644 ---- a/sc/source/core/tool/token.cxx -+++ b/sc/source/core/tool/token.cxx -@@ -42,6 +42,7 @@ - #include "types.hxx" - #include "globstr.hrc" - #include "addincol.hxx" -+#include "dbdata.hxx" - #include - - using ::std::vector; -@@ -2748,9 +2749,6 @@ bool expandRangeByEdge( const sc::RefUpdateContext& rCxt, ScRange& rRefRange, co - - bool isNameModified( const sc::UpdatedRangeNames& rUpdatedNames, SCTAB nOldTab, const formula::FormulaToken& rToken ) - { -- if (rToken.GetOpCode() != ocName) -- return false; -- - SCTAB nTab = -1; - if (!rToken.IsGlobal()) - nTab = nOldTab; -@@ -2759,6 +2757,16 @@ bool isNameModified( const sc::UpdatedRangeNames& rUpdatedNames, SCTAB nOldTab, - return rUpdatedNames.isNameUpdated(nTab, rToken.GetIndex()); - } - -+bool isDBDataModified( const ScDocument& rDoc, const formula::FormulaToken& rToken ) -+{ -+ // Check if this DBData has been modified. -+ const ScDBData* pDBData = rDoc.GetDBCollection()->getNamedDBs().findByIndex( rToken.GetIndex()); -+ if (!pDBData) -+ return false; -+ -+ return pDBData->IsModified(); -+} -+ - } - - sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( const sc::RefUpdateContext& rCxt, const ScAddress& rOldPos ) -@@ -2897,7 +2905,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( const sc::RefUpdateCon - break; - case svIndex: - { -- if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) -+ if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) || -+ ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p))) - aRes.mbNameModified = true; - } - break; -@@ -2965,7 +2974,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove( - break; - case svIndex: - { -- if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) -+ if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) || -+ ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p))) - aRes.mbNameModified = true; - } - break; -@@ -3489,7 +3499,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnDeletedTab( sc::RefUpdateDele - break; - case svIndex: - { -- if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) -+ if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) || -+ ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p))) - aRes.mbNameModified = true; - } - break; -@@ -3533,7 +3544,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnInsertedTab( sc::RefUpdateIns - break; - case svIndex: - { -- if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) -+ if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) || -+ ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p))) - aRes.mbNameModified = true; - } - break; -@@ -3598,7 +3610,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMovedTab( sc::RefUpdateMoveTa - break; - case svIndex: - { -- if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) -+ if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) || -+ ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p))) - aRes.mbNameModified = true; - } - break; - ---------------erAck-patch-parts-- - - diff --git a/SOURCES/0001-Resolves-tdf-91778-drawing-the-background-over-an-ac.patch b/SOURCES/0001-Resolves-tdf-91778-drawing-the-background-over-an-ac.patch new file mode 100644 index 0000000..522ea58 --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-91778-drawing-the-background-over-an-ac.patch @@ -0,0 +1,52 @@ +From f34863825fca2002b420d10679d0cdbb9d767a81 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 20 Apr 2016 11:55:01 +0100 +Subject: [PATCH] Resolves: tdf#91778 drawing the background over an active + cursor + +will overwrite it, which means that when it toggles "off" afterwards, it uses +invert on the freshly drawn background which will visually make it appear "on" +and not off + +Just explictly turn it off and restore it and avoid the whole potential +problem. + +Change-Id: Ie21d77e9d704124011e43b42c98b26eaf208eef2 +(cherry picked from commit 29a9f433c268414747d8ec7343fc2b5987971738) +--- + sc/source/ui/view/gridwin4.cxx | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx +index ceaf3d8..5ec4bf0 100644 +--- a/sc/source/ui/view/gridwin4.cxx ++++ b/sc/source/ui/view/gridwin4.cxx +@@ -902,6 +902,14 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI + aEnd.X() -= 2 * nLayoutSign; + aEnd.Y() -= 2; + ++ // toggle the cursor off if its on to ensure the cursor invert ++ // background logic remains valid after the background is cleared on ++ // the next cursor flash ++ vcl::Cursor* pCrsr = pEditView->GetCursor(); ++ const bool bVisCursor = pCrsr && pCrsr->IsVisible(); ++ if (bVisCursor) ++ pCrsr->Hide(); ++ + // set the correct mapmode + Rectangle aBackground(aStart, aEnd); + if (bIsTiledRendering) +@@ -918,6 +926,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI + // paint the editeng text + pEditView->Paint(rDevice.PixelToLogic(Rectangle(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH()))), &rDevice); + rDevice.SetMapMode(MAP_PIXEL); ++ ++ // restore the cursor it it was originally visible ++ if (bVisCursor) ++ pCrsr->Show(); + } + + if (pViewData->HasEditView(eWhich)) +-- +2.7.3 + diff --git a/SOURCES/0001-Resolves-tdf-94146-a11y-crash-obtain-formula-using-t.patch b/SOURCES/0001-Resolves-tdf-94146-a11y-crash-obtain-formula-using-t.patch new file mode 100644 index 0000000..69801eb --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-94146-a11y-crash-obtain-formula-using-t.patch @@ -0,0 +1,55 @@ +From 7581b5de05259dfcf65fc0d3b6fa565f74acaf8a Mon Sep 17 00:00:00 2001 +Message-Id: <7581b5de05259dfcf65fc0d3b6fa565f74acaf8a.1462364344.git.erack@redhat.com> +From: Eike Rathke +Date: Wed, 4 May 2016 13:41:59 +0200 +Subject: [PATCH] Resolves: tdf#94146 a11y crash, obtain formula using the + correct pointer +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------erAck-patch-parts" + +This is a multi-part message in MIME format. +--------------erAck-patch-parts +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + + +Fallout from IAccessible2 integration. Of the union, wrong string +pointer instead of formula cell pointer was used. + +Change-Id: I1afaf0ffff14a770ab52e8cbf880708bd66b3ef2 +(cherry picked from commit 3a767d91bfa70af4303b905cefa038181d56cc9a) +--- + sc/source/ui/view/tabvwsh.cxx | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + + +--------------erAck-patch-parts +Content-Type: text/x-patch; name="0001-Resolves-tdf-94146-a11y-crash-obtain-formula-using-t.patch" +Content-Transfer-Encoding: 8bit +Content-Disposition: attachment; filename="0001-Resolves-tdf-94146-a11y-crash-obtain-formula-using-t.patch" + +diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx +index 632757d..0675e69 100644 +--- a/sc/source/ui/view/tabvwsh.cxx ++++ b/sc/source/ui/view/tabvwsh.cxx +@@ -39,6 +39,7 @@ + #include "dwfunctr.hxx" + #include "sc.hrc" + #include "spelldialog.hxx" ++#include "formulacell.hxx" + #include + + #include +@@ -116,7 +117,7 @@ OUString ScTabViewShell::GetFormula(ScAddress& rAddress) + aCell.assign(*pDoc, rAddress); + if (!aCell.isEmpty() && aCell.meType == CELLTYPE_FORMULA) + { +- sFormula = aCell.mpString->getString(); ++ aCell.mpFormula->GetFormula( sFormula); + } + return sFormula; + } + +--------------erAck-patch-parts-- + + diff --git a/SOURCES/0001-Resolves-tdf-95682-spell-dialog-add-a-button-to-open.patch b/SOURCES/0001-Resolves-tdf-95682-spell-dialog-add-a-button-to-open.patch new file mode 100644 index 0000000..0fe5d9c --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-95682-spell-dialog-add-a-button-to-open.patch @@ -0,0 +1,480 @@ +From f46860e84df8548daa12f180f27deef7a1d708d3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 13 Nov 2015 09:56:01 +0000 +Subject: [PATCH] Resolves: tdf#95682 spell dialog: add a button to open + special character + +(cherry picked from commit b08b76774fbd253cba587207d471f9bf0c0b0a82) + +Change-Id: I0d070dee9e940b93b294c6b2de180005a5c2248e + +Related: tdf#95682 set edit to modified after insert symbol/paste + +Change-Id: If5892931649bde3d1fc00c0e5817149d0623cb1e +(cherry picked from commit de0a391137080a18e73f315b6dc5342b5b078574) + +clear VclPtr warning + +Change-Id: I13f08989034a656bc6f0ae6b556272802f4b8fc2 +(cherry picked from commit 9c7d3345b02bcf69f28bdbc956a7cedaabe894a0) +--- + cui/source/dialogs/SpellDialog.cxx | 54 ++++++++++++-- + cui/source/inc/SpellDialog.hxx | 8 +++ + cui/uiconfig/ui/spellingdialog.ui | 143 ++++++++++++++++++++----------------- + 3 files changed, 135 insertions(+), 70 deletions(-) + +diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx +index f8952df..7f09b7f 100644 +--- a/cui/source/dialogs/SpellDialog.cxx ++++ b/cui/source/dialogs/SpellDialog.cxx +@@ -222,6 +222,8 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, + get(m_pOptionsPB, "options"); + get(m_pUndoPB, "undo"); + get(m_pClosePB, "close"); ++ get(m_pToolbar, "toolbar"); ++ m_pSentenceED->Init(m_pToolbar); + xSpell = LinguMgr::GetSpellChecker(); + pImpl = new SpellDialog_Impl; + +@@ -243,8 +245,6 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, + LINK( this, SpellDialog, InitHdl ), NULL, true ); + } + +- +- + SpellDialog::~SpellDialog() + { + disposeOnce(); +@@ -282,6 +282,7 @@ void SpellDialog::dispose() + m_pOptionsPB.clear(); + m_pUndoPB.clear(); + m_pClosePB.clear(); ++ m_pToolbar.clear(); + SfxModelessDialog::dispose(); + } + +@@ -318,8 +319,6 @@ void SpellDialog::Init_Impl() + SvxGetChangeAllList()->clear(); + } + +- +- + void SpellDialog::UpdateBoxes_Impl() + { + sal_Int32 i; +@@ -443,6 +442,7 @@ void SpellDialog::SpellContinue_Impl(bool bUseSavedSentence, bool bIgnoreCurrent + */ + IMPL_LINK( SpellDialog, InitHdl, SpellDialog *, ) + { ++ m_pToolbar->Disable(); + SetUpdateMode( false ); + //show or hide AutoCorrect depending on the modules abilities + m_pAutoCorrPB->Show(rParent.HasAutoCorrection()); +@@ -1219,6 +1219,11 @@ SentenceEditWindow_Impl::SentenceEditWindow_Impl(vcl::Window * pParent, WinBits + DisableSelectionOnFocus(); + } + ++SentenceEditWindow_Impl::~SentenceEditWindow_Impl() ++{ ++ disposeOnce(); ++} ++ + VCL_BUILDER_DECL_FACTORY(SentenceEditWindow) + { + (void)rMap; +@@ -1559,9 +1564,50 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt ) + else + bChange = false; + } ++ else if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS && m_xToolbar) ++ { ++ m_xToolbar->Enable(); ++ } ++ else if(rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS && m_xToolbar) ++ { ++ m_xToolbar->Disable(); ++ } + return bChange || VclMultiLineEdit::PreNotify(rNEvt); + } + ++void SentenceEditWindow_Impl::Init(VclPtr &rToolbar) ++{ ++ m_xToolbar = rToolbar; ++ m_xToolbar->SetSelectHdl(LINK(this,SentenceEditWindow_Impl,ToolbarHdl)); ++} ++ ++IMPL_LINK_NOARG_TYPED(SentenceEditWindow_Impl, ToolbarHdl, ToolBox *, void) ++{ ++ const sal_uInt16 nCurItemId = m_xToolbar->GetCurItemId(); ++ if (nCurItemId == m_xToolbar->GetItemId("paste")) ++ { ++ Paste(); ++ CallModifyLink(); ++ } ++ else if (nCurItemId == m_xToolbar->GetItemId("insert")) ++ { ++ if (Edit::GetGetSpecialCharsFunction()) ++ { ++ OUString aChars = Edit::GetGetSpecialCharsFunction()( this, GetFont() ); ++ if (!aChars.isEmpty()) ++ { ++ ReplaceSelected(aChars); ++ CallModifyLink(); ++ } ++ } ++ } ++} ++ ++void SentenceEditWindow_Impl::dispose() ++{ ++ m_xToolbar.clear(); ++ VclMultiLineEdit::dispose(); ++} + + bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, com::sun::star::uno::Reference xSpell ) + { +diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx +index 38a08cf..543581c 100644 +--- a/cui/source/inc/SpellDialog.hxx ++++ b/cui/source/inc/SpellDialog.hxx +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + + +@@ -62,6 +63,7 @@ class SentenceEditWindow_Impl : public VclMultiLineEdit + + private: + std::set< sal_uInt16 > m_aIgnoreErrorsAt; ++ VclPtr m_xToolbar; + sal_uInt16 m_nErrorStart; + sal_uInt16 m_nErrorEnd; + bool m_bIsUndoEditMode; +@@ -71,13 +73,17 @@ private: + void CallModifyLink() {m_aModifyLink.Call(this);} + + inline SpellDialog* GetSpellDialog() const; ++ ++ DECL_LINK_TYPED(ToolbarHdl, ToolBox*, void); + protected: + virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; + + public: + SentenceEditWindow_Impl(vcl::Window* pParent, WinBits nBits); ++ ~SentenceEditWindow_Impl(); + + void SetModifyHdl(const Link<>& rLink) SAL_OVERRIDE { m_aModifyLink = rLink;} ++ void Init(VclPtr &rToolbar); + + void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd ); + void SetText( const OUString& rStr ) SAL_OVERRIDE; +@@ -96,6 +102,7 @@ public: + + void ResetModified() { GetTextEngine()->SetModified(false); m_bIsUndoEditMode = false;} + virtual bool IsModified() const SAL_OVERRIDE { return GetTextEngine()->IsModified(); } ++ virtual void dispose() SAL_OVERRIDE; + + bool IsUndoEditMode() const { return m_bIsUndoEditMode;} + void SetUndoEditMode(bool bSet); +@@ -151,6 +158,7 @@ private: + VclPtr m_pOptionsPB; + VclPtr m_pUndoPB; + VclPtr m_pClosePB; ++ VclPtr m_pToolbar; + + OUString m_sResumeST; + OUString m_sIgnoreOnceST; +diff --git a/cui/uiconfig/ui/spellingdialog.ui b/cui/uiconfig/ui/spellingdialog.ui +index 5d89284..94b5307 100644 +--- a/cui/uiconfig/ui/spellingdialog.ui ++++ b/cui/uiconfig/ui/spellingdialog.ui +@@ -1,8 +1,8 @@ + +- ++ + + +- ++ + + False + 6 +@@ -103,24 +103,6 @@ + + 1 + 0 +- 1 +- 1 +- +- +- +- +- True +- False +- 0 +- _Not in dictionary +- True +- sentence +- +- +- 0 +- 2 +- 3 +- 1 + + + +@@ -135,8 +117,6 @@ + + 2 + 3 +- 1 +- 1 + + + +@@ -154,22 +134,6 @@ + + + +- +- True +- False +- 0 +- _Suggestions +- True +- suggestionslb +- +- +- 0 +- 8 +- 3 +- 1 +- +- +- + + Co_rrect + True +@@ -181,8 +145,6 @@ + + 2 + 9 +- 1 +- 1 + + + +@@ -197,8 +159,6 @@ + + 2 + 10 +- 1 +- 1 + + + +@@ -213,8 +173,6 @@ + + 2 + 11 +- 1 +- 1 + + + +@@ -231,7 +189,6 @@ + 0 + 12 + 3 +- 1 + + + +@@ -246,8 +203,6 @@ + + 2 + 4 +- 1 +- 1 + + + +@@ -262,39 +217,34 @@ + + 2 + 5 +- 1 +- 1 + + + + + True + False +- 0 + Text languag_e: + True + languagelb ++ 0 + + + 0 + 0 +- 1 +- 1 + + + + + False + True +- 0 + True + True ++ 0 + + + 0 + 1 + 2 +- 1 + + + +@@ -309,8 +259,6 @@ + + 2 + 1 +- 1 +- 1 + + + +@@ -323,8 +271,6 @@ + + 0 + 13 +- 1 +- 1 + + + +@@ -337,8 +283,6 @@ + + 1 + 13 +- 1 +- 1 + + + +@@ -351,8 +295,6 @@ + + 2 + 13 +- 1 +- 1 + + + +@@ -384,8 +326,6 @@ + + 2 + 6 +- 1 +- 1 + + + +@@ -400,11 +340,82 @@ + + 2 + 7 +- 1 +- 1 + + + ++ ++ True ++ False ++ _Suggestions ++ True ++ suggestionslb ++ 0 ++ ++ ++ 0 ++ 8 ++ 3 ++ ++ ++ ++ ++ True ++ False ++ True ++ _Not in dictionary ++ True ++ sentence ++ 0 ++ ++ ++ 0 ++ 2 ++ ++ ++ ++ ++ True ++ False ++ end ++ icons ++ ++ ++ True ++ False ++ paste ++ Paste ++ True ++ cmd/sc_paste.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ True ++ False ++ insert ++ Special Character ++ True ++ cmd/sc_insertsymbol.png ++ ++ ++ False ++ True ++ ++ ++ ++ ++ 1 ++ 2 ++ ++ ++ ++ ++ ++ + + + +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-tdf-95962-incorrect-scanline-stride.patch b/SOURCES/0001-Resolves-tdf-95962-incorrect-scanline-stride.patch new file mode 100644 index 0000000..f6ffa32 --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-95962-incorrect-scanline-stride.patch @@ -0,0 +1,794 @@ +From beaba7e2e7a3248cbe87870c84b2c0df0a25503d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 25 Nov 2015 10:32:33 +0000 +Subject: [PATCH] Resolves: tdf#95962 incorrect scanline stride +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +gtk3: it's the *Original* device we care about, not the temp clip hack devices + +Change-Id: I2ac61cd2a99da25122165af692154fdbc2ac6d2e +(cherry picked from commit 872c1b7654510daa4a6974150490623745d931bf) + +we were reusing the stride of the surface we were cloning, +but the new surface has a different underlying size. + +remove the custom stride argument and just change our stride +calculation to use the same scheme that cairo and GDI uses, which +remove another platform/drawing-system variable + +Reviewed-on: https://gerrit.libreoffice.org/20149 +Tested-by: Jenkins +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +(cherry picked from commit 9b52b8999be86e5c6e5f5901b2640b16f08a2323) + +Change-Id: I257dac9757b121642e9ccfde7db0911edc9f3fb1 +--- + basebmp/source/bitmapdevice.cxx | 25 +++++++------------------ + basebmp/test/basictest.cxx | 30 +++++++++++++----------------- + basebmp/test/bmpmasktest.cxx | 24 +++++++----------------- + basebmp/test/bmptest.cxx | 12 ++++-------- + basebmp/test/cliptest.cxx | 12 ++++-------- + basebmp/test/filltest.cxx | 6 ++---- + basebmp/test/linetest.cxx | 12 ++++-------- + basebmp/test/masktest.cxx | 9 +++------ + basebmp/test/polytest.cxx | 6 ++---- + include/basebmp/bitmapdevice.hxx | 9 +++------ + sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 2 +- + vcl/headless/svpbmp.cxx | 6 ++---- + vcl/headless/svpframe.cxx | 3 +-- + vcl/headless/svpgdi.cxx | 31 ++++++++++++++++--------------- + vcl/headless/svptextrender.cxx | 2 +- + vcl/headless/svpvd.cxx | 7 +++---- + vcl/qa/cppunit/BitmapTest.cxx | 15 +++++---------- + vcl/unx/gtk/window/gtksalframe.cxx | 3 +-- + 18 files changed, 79 insertions(+), 135 deletions(-) + +diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx +index 04d4892..1517f05 100644 +--- a/basebmp/source/bitmapdevice.cxx ++++ b/basebmp/source/bitmapdevice.cxx +@@ -1956,7 +1956,6 @@ namespace + BitmapDeviceSharedPtr createBitmapDeviceImplInner( const basegfx::B2IVector& rSize, + bool bTopDown, + Format nScanlineFormat, +- sal_Int32 nScanlineStride, + boost::shared_array< sal_uInt8 > pMem, + PaletteMemorySharedVector pPal, + const basegfx::B2IBox* pSubset, +@@ -1977,6 +1976,8 @@ BitmapDeviceSharedPtr createBitmapDeviceImplInner( const basegfx::B2IVector& + return BitmapDeviceSharedPtr(); + } + ++ sal_Int32 nScanlineStride = getBitmapDeviceStrideForWidth(nScanlineFormat, rSize.getX()); ++ + // factor in bottom-up scanline order case + nScanlineStride *= bTopDown ? 1 : -1; + +@@ -2139,14 +2140,13 @@ BitmapDeviceSharedPtr createBitmapDeviceImplInner( const basegfx::B2IVector& + BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& rSize, + bool bTopDown, + Format nScanlineFormat, +- sal_Int32 nScanlineStride, + boost::shared_array< sal_uInt8 > pMem, + PaletteMemorySharedVector pPal, + const basegfx::B2IBox* pSubset, + const IBitmapDeviceDamageTrackerSharedPtr& rDamage, + bool bBlack = true) + { +- BitmapDeviceSharedPtr result( createBitmapDeviceImplInner( rSize, bTopDown, nScanlineFormat, nScanlineStride, pMem, pPal, pSubset, rDamage, bBlack ) ); ++ BitmapDeviceSharedPtr result( createBitmapDeviceImplInner( rSize, bTopDown, nScanlineFormat, pMem, pPal, pSubset, rDamage, bBlack ) ); + + #ifdef SAL_LOG_INFO + std::ostringstream subset; +@@ -2172,24 +2172,20 @@ sal_Int32 getBitmapDeviceStrideForWidth(Format nScanlineFormat, sal_Int32 nWidth + // round up to full 8 bit, divide by 8 + sal_Int32 nScanlineStride = (nWidth*nBitsPerPixel + 7) >> 3; + +- // rounded up to next full power-of-two number of bytes +- const sal_uInt32 bytesPerPixel = nextPow2( +- (bitsPerPixel[nScanlineFormat] + 7) >> 3); ++ // pixman (cairo) and GDI (windows) pad to multiples of 32bits ++ // so do the same to be easily compatible ++ nScanlineStride = (nScanlineStride + 3) & ~0x3; + +- // now make nScanlineStride a multiple of bytesPerPixel +- nScanlineStride = (nScanlineStride + bytesPerPixel - 1) / bytesPerPixel * bytesPerPixel; + return nScanlineStride; + } + + BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize, + bool bTopDown, +- Format nScanlineFormat, +- sal_Int32 nScanlineStride ) ++ Format nScanlineFormat ) + { + return createBitmapDeviceImpl( rSize, + bTopDown, + nScanlineFormat, +- nScanlineStride, + boost::shared_array< sal_uInt8 >(), + PaletteMemorySharedVector(), + NULL, +@@ -2199,13 +2195,11 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize, + BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize, + bool bTopDown, + Format nScanlineFormat, +- sal_Int32 nScanlineStride, + const PaletteMemorySharedVector& rPalette ) + { + return createBitmapDeviceImpl( rSize, + bTopDown, + nScanlineFormat, +- nScanlineStride, + boost::shared_array< sal_uInt8 >(), + rPalette, + NULL, +@@ -2215,14 +2209,12 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize + BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize, + bool bTopDown, + Format nScanlineFormat, +- sal_Int32 nScanlineStride, + const RawMemorySharedArray& rMem, + const PaletteMemorySharedVector& rPalette ) + { + return createBitmapDeviceImpl( rSize, + bTopDown, + nScanlineFormat, +- nScanlineStride, + rMem, + rPalette, + NULL, +@@ -2235,7 +2227,6 @@ BitmapDeviceSharedPtr createClipDevice( const basegfx::B2IVector& rSize ) + createBitmapDeviceImpl( rSize, + false, /* bTopDown */ + basebmp::FORMAT_ONE_BIT_MSB_GREY, +- getBitmapDeviceStrideForWidth(basebmp::FORMAT_ONE_BIT_MSB_GREY, rSize.getX()), + boost::shared_array< sal_uInt8 >(), + PaletteMemorySharedVector(), + NULL, +@@ -2251,7 +2242,6 @@ BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto, + return createBitmapDeviceImpl( rProto->getSize(), + rProto->isTopDown(), + rProto->getScanlineFormat(), +- rProto->getScanlineStride(), + rProto->getBuffer(), + rProto->getPalette(), + &rSubset, +@@ -2264,7 +2254,6 @@ BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector& rSize, + return createBitmapDeviceImpl( rSize, + rProto->isTopDown(), + rProto->getScanlineFormat(), +- rProto->getScanlineStride(), + boost::shared_array< sal_uInt8 >(), + rProto->getPalette(), + NULL, +diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx +index 293fbe5..671320d 100644 +--- a/basebmp/test/basictest.cxx ++++ b/basebmp/test/basictest.cxx +@@ -83,16 +83,19 @@ public: + basegfx::B2ISize aSize2(aSize); + BitmapDeviceSharedPtr pDevice( createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()))); ++ FORMAT_ONE_BIT_MSB_PAL ++ ) ); + CPPUNIT_ASSERT_MESSAGE("right size", + pDevice->getSize() == aSize2 ); + CPPUNIT_ASSERT_MESSAGE("Top down format", + pDevice->isTopDown() ); + CPPUNIT_ASSERT_MESSAGE("Scanline format", + pDevice->getScanlineFormat() == FORMAT_ONE_BIT_MSB_PAL ); ++ sal_Int32 nExpectedStride = (aSize2.getY() + 7)/8; ++ sal_Int32 nAlign = sizeof(sal_uInt32); ++ nExpectedStride = ((nExpectedStride + nAlign-1) / nAlign) * nAlign; + CPPUNIT_ASSERT_MESSAGE("Scanline len", +- pDevice->getScanlineStride() == (aSize2.getY() + 7)/8 ); ++ pDevice->getScanlineStride() == nExpectedStride ); + CPPUNIT_ASSERT_MESSAGE("Palette existence", + pDevice->getPalette() ); + CPPUNIT_ASSERT_MESSAGE("Palette entry 0 is black", +@@ -107,8 +110,7 @@ public: + basegfx::B2ISize aSize2(3,3); + BitmapDeviceSharedPtr pDevice( createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()))); ++ FORMAT_ONE_BIT_MSB_PAL) ); + + BitmapDeviceSharedPtr pClone( cloneBitmapDevice( + aSize2, +@@ -123,8 +125,7 @@ public: + const basegfx::B2ISize aSize(64,64); + BitmapDeviceSharedPtr pDevice( createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()))); ++ FORMAT_ONE_BIT_MSB_PAL) ); + + const basegfx::B2IPoint aPt(3,3); + CPPUNIT_ASSERT_MESSAGE("getPixelData for virgin device", +@@ -171,8 +172,7 @@ public: + { + pDevice = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_LSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_LSB_PAL, aSize.getX())); ++ FORMAT_ONE_BIT_LSB_PAL); + + pDevice->setPixel( aPt2, aCol, DrawMode_PAINT ); + CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #4", +@@ -197,8 +197,7 @@ public: + { + pDevice = createBitmapDevice( aSize, + true, +- FORMAT_EIGHT_BIT_GREY, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_EIGHT_BIT_GREY, aSize.getX())); ++ FORMAT_EIGHT_BIT_GREY); + + const Color aCol4(0x010101); + pDevice->setPixel( aPt, aCol4, DrawMode_PAINT ); +@@ -220,8 +219,7 @@ public: + { + pDevice = createBitmapDevice( aSize, + true, +- FORMAT_SIXTEEN_BIT_LSB_TC_MASK, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_SIXTEEN_BIT_LSB_TC_MASK, aSize.getX())); ++ FORMAT_SIXTEEN_BIT_LSB_TC_MASK); + const Color aCol7(0); + pDevice->clear( aCol7 ); + +@@ -245,8 +243,7 @@ public: + { + pDevice = createBitmapDevice( aSize, + true, +- FORMAT_TWENTYFOUR_BIT_TC_MASK, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_TWENTYFOUR_BIT_TC_MASK, aSize.getX())); ++ FORMAT_TWENTYFOUR_BIT_TC_MASK); + + const Color aCol4(0x01010101); + pDevice->setPixel( aPt, aCol4, DrawMode_PAINT ); +@@ -273,8 +270,7 @@ public: + { + pDevice = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX())); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA); + + const Color aCol4(0x01010101); + pDevice->setPixel( aPt, aCol4, DrawMode_PAINT ); +diff --git a/basebmp/test/bmpmasktest.cxx b/basebmp/test/bmpmasktest.cxx +index 611e189..ded87f8 100644 +--- a/basebmp/test/bmpmasktest.cxx ++++ b/basebmp/test/bmpmasktest.cxx +@@ -91,26 +91,21 @@ public: + const basegfx::B2ISize aSize(10,10); + mpDevice1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX())); ++ FORMAT_ONE_BIT_MSB_PAL); + mpDevice32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX())); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA); + + mpMaskBmp1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_GREY, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_GREY, aSize.getX())); ++ FORMAT_ONE_BIT_MSB_GREY); + + mpBmp1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX())); ++ FORMAT_ONE_BIT_MSB_PAL); + mpBmp32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX())); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA); + + OUString aSvg( "m 0 0h5v10h5v-5h-10z" ); + +@@ -169,7 +164,6 @@ public: + // nFormat = Format::OneBitMsbGrey; // FIXME - un-comment me to crash hard. + xMask = createBitmapDevice( aSize, false /* bTopDown */, + nFormat, +- basebmp::getBitmapDeviceStrideForWidth( nFormat, aSize.getX()), + PaletteMemorySharedVector( + new std::vector< basebmp::Color >(aDevPal) ) ); + // wipe to copy everything. +@@ -183,17 +177,13 @@ public: + DrawMode::DrawMode_PAINT ); + + xBitmap = createBitmapDevice( aSize, false, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX, +- basebmp::getBitmapDeviceStrideForWidth( +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX, aSize.getX() ) ); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX ); + xBitmap->clear(Color(0x80808080)); + } + { // mpOutput & mpBitmap + const basegfx::B2ISize aSize(9, 9); + xOutput = createBitmapDevice( aSize, false, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX, +- basebmp::getBitmapDeviceStrideForWidth( +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX, aSize.getX()) ); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX); + xOutput->clear(Color(0xffffffff)); + } + +diff --git a/basebmp/test/bmptest.cxx b/basebmp/test/bmptest.cxx +index 30644fb..f6ea0b6 100644 +--- a/basebmp/test/bmptest.cxx ++++ b/basebmp/test/bmptest.cxx +@@ -148,23 +148,19 @@ public: + void setUp() SAL_OVERRIDE + { + const basegfx::B2ISize aSize(10,10); +- sal_Int32 nStride = basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()); + mpDevice1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, nStride ); +- nStride = basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX()); ++ FORMAT_ONE_BIT_MSB_PAL ); + mpDevice32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, nStride ); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA); + +- nStride = basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()); + mpBmp1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, nStride ); +- nStride = basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX()); ++ FORMAT_ONE_BIT_MSB_PAL); + mpBmp32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, nStride ); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA ); + + OUString aSvg( "m 0 0h5v10h5v-5h-10z" ); + +diff --git a/basebmp/test/cliptest.cxx b/basebmp/test/cliptest.cxx +index 13ad48c..8526964 100644 +--- a/basebmp/test/cliptest.cxx ++++ b/basebmp/test/cliptest.cxx +@@ -154,10 +154,9 @@ private: + + void implTestMaskColorClip(const BitmapDeviceSharedPtr& rDevice) + { +- sal_Int32 nStride = basebmp::getBitmapDeviceStrideForWidth(FORMAT_EIGHT_BIT_GREY, rDevice->getSize().getX()); + BitmapDeviceSharedPtr pBmp( createBitmapDevice( rDevice->getSize(), + true, +- FORMAT_EIGHT_BIT_GREY, nStride )); ++ FORMAT_EIGHT_BIT_GREY )); + + OUString aSvg( "m 0 0h5v10h5v-5h-10z" ); + +@@ -189,18 +188,15 @@ public: + void setUp() SAL_OVERRIDE + { + const basegfx::B2ISize aSize(11,11); +- sal_Int32 nStride = basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_GREY, aSize.getX()); + mpClipMask = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_GREY, nStride ); +- nStride = basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()); ++ FORMAT_ONE_BIT_MSB_GREY ); + mpDevice1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, nStride ); +- nStride = basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX()); ++ FORMAT_ONE_BIT_MSB_PAL ); + mpDevice32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, nStride ); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA ); + + OUString aSvg( "m 0 0 h5 l5 5 v5 h-5 l-5-5 z" ); + basegfx::B2DPolyPolygon aPoly; +diff --git a/basebmp/test/filltest.cxx b/basebmp/test/filltest.cxx +index 875a27d..067ec24 100644 +--- a/basebmp/test/filltest.cxx ++++ b/basebmp/test/filltest.cxx +@@ -211,12 +211,10 @@ public: + const basegfx::B2ISize aSize(11,11); + mpDevice1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX())); ++ FORMAT_ONE_BIT_MSB_PAL ); + mpDevice32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX())); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA ); + } + + void testRectFill() +diff --git a/basebmp/test/linetest.cxx b/basebmp/test/linetest.cxx +index 731158e..f6a3909 100644 +--- a/basebmp/test/linetest.cxx ++++ b/basebmp/test/linetest.cxx +@@ -151,12 +151,10 @@ public: + const basegfx::B2ISize aSize(11,11); + mpDevice1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()) ); ++ FORMAT_ONE_BIT_MSB_PAL ); + mpDevice32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX()) ); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA ); + } + + void testCornerCases() +@@ -165,8 +163,7 @@ public: + BitmapDeviceSharedPtr pDevice = createBitmapDevice( + aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()) ); ++ FORMAT_ONE_BIT_MSB_PAL ); + + const basegfx::B2IPoint aPt1(0,0); + const basegfx::B2IPoint aPt2(10,10); +@@ -182,8 +179,7 @@ public: + pDevice = createBitmapDevice( + aSize2, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX())); ++ FORMAT_ONE_BIT_MSB_PAL ); + + CPPUNIT_ASSERT_MESSAGE("only pixel cleared", + pDevice->getPixelData(aPt1) == 0); +diff --git a/basebmp/test/masktest.cxx b/basebmp/test/masktest.cxx +index 7b4559c..d53ba72 100644 +--- a/basebmp/test/masktest.cxx ++++ b/basebmp/test/masktest.cxx +@@ -104,17 +104,14 @@ public: + const basegfx::B2ISize aSize(10,10); + mpDevice1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX()) ); ++ FORMAT_ONE_BIT_MSB_PAL ); + mpDevice32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX()) ); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA ); + + mpMask = createBitmapDevice( aSize, + true, +- FORMAT_EIGHT_BIT_GREY, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_EIGHT_BIT_GREY, aSize.getX()) ); ++ FORMAT_EIGHT_BIT_GREY ); + + OUString aSvg( "m 0 0h5v10h5v-5h-10z" ); + +diff --git a/basebmp/test/polytest.cxx b/basebmp/test/polytest.cxx +index 60746d7..a0371eb 100644 +--- a/basebmp/test/polytest.cxx ++++ b/basebmp/test/polytest.cxx +@@ -296,12 +296,10 @@ public: + const basegfx::B2ISize aSize(10,10); + mpDevice1bpp = createBitmapDevice( aSize, + true, +- FORMAT_ONE_BIT_MSB_PAL, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_ONE_BIT_MSB_PAL, aSize.getX())); ++ FORMAT_ONE_BIT_MSB_PAL ); + mpDevice32bpp = createBitmapDevice( aSize, + true, +- FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, +- basebmp::getBitmapDeviceStrideForWidth(FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, aSize.getX())); ++ FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA ); + } + + void testEmpty() +diff --git a/include/basebmp/bitmapdevice.hxx b/include/basebmp/bitmapdevice.hxx +index 5953741..6071c79 100644 +--- a/include/basebmp/bitmapdevice.hxx ++++ b/include/basebmp/bitmapdevice.hxx +@@ -668,8 +668,7 @@ sal_Int32 BASEBMP_DLLPUBLIC getBitmapDeviceStrideForWidth(Format nScanlineFormat + */ + BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize, + bool bTopDown, +- Format nScanlineFormat, +- sal_Int32 nScanlineStride ); ++ Format nScanlineFormat ); + + /** Function to create a BitmapDevice for given scanline format + with the given palette +@@ -681,7 +680,6 @@ BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVe + BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize, + bool bTopDown, + Format nScanlineFormat, +- sal_Int32 nScanlineStride, + const PaletteMemorySharedVector& rPalette ); + + /** Function to create a BitmapDevice for given scanline format +@@ -693,7 +691,6 @@ BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVe + BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize, + bool bTopDown, + Format nScanlineFormat, +- sal_Int32 nScanlineStride, + const RawMemorySharedArray& rMem, + const PaletteMemorySharedVector& rPalette ); + +@@ -725,8 +722,8 @@ BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC subsetBitmapDevice( const BitmapDeviceSh + copied, only the size can be varied. Note that the prototype's + bitmap content is not copied, only a palette (if any). + */ +-BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC cloneBitmapDevice( const basegfx::B2IVector& rSize, +- const BitmapDeviceSharedPtr& rProto ); ++BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC cloneBitmapDevice(const basegfx::B2IVector& rSize, ++ const BitmapDeviceSharedPtr& rProto); + + } + +diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +index 87435f5..b535187 100644 +--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx ++++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +@@ -771,7 +771,7 @@ DECLARE_OOXMLIMPORT_TEST(testN777345, "n777345.docx") + Graphic aGraphic(xGraphic); + // If this changes later, feel free to update it, but make sure it's not + // the checksum of a white/transparent placeholder rectangle. +- CPPUNIT_ASSERT_EQUAL(BitmapChecksum(3652741777587093783), aGraphic.GetChecksum()); ++ CPPUNIT_ASSERT_EQUAL(BitmapChecksum(SAL_CONST_UINT64(12149824012634930130)), aGraphic.GetChecksum()); + #endif + } + +diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx +index 901526e..92c2835 100644 +--- a/vcl/headless/svpbmp.cxx ++++ b/vcl/headless/svpbmp.cxx +@@ -52,9 +52,8 @@ bool SvpSalBitmap::Create( const Size& rSize, + aSize.setX( 1 ); + if( aSize.getY() == 0 ) + aSize.setY( 1 ); +- sal_Int32 nStride = getBitmapDeviceStrideForWidth(nFormat, aSize.getX()); + if( nBitCount > 8 ) +- m_aBitmap = createBitmapDevice( aSize, false, nFormat, nStride ); ++ m_aBitmap = createBitmapDevice( aSize, false, nFormat ); + else + { + // prepare palette +@@ -67,7 +66,7 @@ bool SvpSalBitmap::Create( const Size& rSize, + const BitmapColor& rCol = rPalette[i]; + (*pPalette)[i] = basebmp::Color( rCol.GetRed(), rCol.GetGreen(), rCol.GetBlue() ); + } +- m_aBitmap = createBitmapDevice( aSize, false, nFormat, nStride, ++ m_aBitmap = createBitmapDevice( aSize, false, nFormat, + basebmp::RawMemorySharedArray(), + basebmp::PaletteMemorySharedVector( pPalette ) + ); +@@ -336,7 +335,6 @@ void SvpSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode + m_aBitmap = basebmp::createBitmapDevice( m_aBitmap->getSize(), + m_aBitmap->isTopDown(), + m_aBitmap->getScanlineFormat(), +- m_aBitmap->getScanlineStride(), + m_aBitmap->getBuffer(), + pPal ); + } +diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx +index e1218d7..22ffaef 100644 +--- a/vcl/headless/svpframe.cxx ++++ b/vcl/headless/svpframe.cxx +@@ -292,8 +292,7 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u + aFrameSize.setX( 1 ); + if( aFrameSize.getY() == 0 ) + aFrameSize.setY( 1 ); +- sal_Int32 nStride = basebmp::getBitmapDeviceStrideForWidth(m_nScanlineFormat, aFrameSize.getX()); +- m_aFrame = createBitmapDevice( aFrameSize, m_bTopDown, m_nScanlineFormat, nStride ); ++ m_aFrame = createBitmapDevice( aFrameSize, m_bTopDown, m_nScanlineFormat ); + if (m_bDamageTracking) + m_aFrame->setDamageTracker( + basebmp::IBitmapDeviceDamageTrackerSharedPtr( new DamageTracker ) ); +diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx +index 0afce7e..cbe3dc1 100644 +--- a/vcl/headless/svpgdi.cxx ++++ b/vcl/headless/svpgdi.cxx +@@ -173,14 +173,14 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, + return false; + } + +- cairo_t* cr = createCairoContext(m_aDevice); ++ cairo_t* cr = createCairoContext(m_aOrigDevice); + if (!cr) + return bRet; + +- if (!m_aDevice->isTopDown()) ++ if (!m_aOrigDevice->isTopDown()) + { + cairo_scale(cr, 1, -1.0); +- cairo_translate(cr, 0.0, -m_aDevice->getSize().getY()); ++ cairo_translate(cr, 0.0, -m_aOrigDevice->getSize().getY()); + } + + clipRegion(cr); +@@ -193,7 +193,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, + cairo_rectangle(cr, nX, nY, nWidth, nHeight); + + cairo_rectangle_int_t extents; +- basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); ++ basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aOrigDevice->getDamageTracker()); + if (xDamageTracker) + extents = getFillDamage(cr); + +@@ -731,14 +731,14 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d + return false; + } + +- cairo_t* cr = createCairoContext(m_aDevice); ++ cairo_t* cr = createCairoContext(m_aOrigDevice); + if (!cr) + return false; + +- if (!m_aDevice->isTopDown()) ++ if (!m_aOrigDevice->isTopDown()) + { + cairo_scale(cr, 1, -1.0); +- cairo_translate(cr, 0.0, -m_aDevice->getSize().getY()); ++ cairo_translate(cr, 0.0, -m_aOrigDevice->getSize().getY()); + } + + clipRegion(cr); +@@ -752,7 +752,7 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d + AddPolygonToPath(cr, *pPoly, true); + + cairo_rectangle_int_t extents; +- basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); ++ basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aOrigDevice->getDamageTracker()); + if (xDamageTracker) + extents = getFillDamage(cr); + +@@ -891,11 +891,12 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh + { + SvpSalBitmap* pBitmap = new SvpSalBitmap(); + +- if (m_aDevice) ++ if (m_aOrigDevice) + { + basebmp::BitmapDeviceSharedPtr aCopy; + aCopy = cloneBitmapDevice(basegfx::B2IVector(nWidth, nHeight), +- m_aDevice); ++ m_aOrigDevice); ++ basegfx::B2IVector size = aCopy->getSize(); + basegfx::B2IBox aSrcRect( nX, nY, nX+nWidth, nY+nHeight ); + basegfx::B2IBox aDestRect( 0, 0, nWidth, nHeight ); + +@@ -941,12 +942,12 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv + } + else if ( nFlags & SAL_INVERT_50 ) + { +- if (cairo_t* cr = createCairoContext(m_aDevice)) ++ if (cairo_t* cr = createCairoContext(m_aOrigDevice)) + { +- if (!m_aDevice->isTopDown()) ++ if (!m_aOrigDevice->isTopDown()) + { + cairo_scale(cr, 1, -1.0); +- cairo_translate(cr, 0.0, -m_aDevice->getSize().getY()); ++ cairo_translate(cr, 0.0, -m_aOrigDevice->getSize().getY()); + } + + clipRegion(cr); +@@ -954,7 +955,7 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv + cairo_pattern_t *pattern = create_stipple(); + + cairo_rectangle_int_t extents; +- basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); ++ basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aOrigDevice->getDamageTracker()); + + cairo_rectangle(cr, nX, nY, nWidth, nHeight); + +@@ -1075,7 +1076,7 @@ bool SvpSalGraphics::supportsOperation(OutDevSupportType eType) const + #if ENABLE_CAIRO_CANVAS + if (m_aDrawMode == basebmp::DrawMode_XOR) + return false; +- if (!isCairoCompatible(m_aDevice)) ++ if (!isCairoCompatible(m_aOrigDevice)) + return false; + switch (eType) + { +diff --git a/vcl/headless/svptextrender.cxx b/vcl/headless/svptextrender.cxx +index f143da1..2cd51ef 100644 +--- a/vcl/headless/svptextrender.cxx ++++ b/vcl/headless/svptextrender.cxx +@@ -152,7 +152,7 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, + pGcpHelper->maRawBitmap.mnScanlineSize, + pGcpHelper->maRawBitmap.mnHeight ); + static PaletteMemorySharedVector aDummyPAL; +- pGcpHelper->maBitmapDev = createBitmapDevice( aSize, true, nBmpFormat, aSize.getX(), pGcpHelper->maRawBitmap.mpBits, aDummyPAL ); ++ pGcpHelper->maBitmapDev = createBitmapDevice( aSize, true, nBmpFormat, pGcpHelper->maRawBitmap.mpBits, aDummyPAL ); + } + + rGlyphData.ExtDataRef().meInfo = nBmpFormat; +diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx +index 1e4050a..1c4237b 100644 +--- a/vcl/headless/svpvd.cxx ++++ b/vcl/headless/svpvd.cxx +@@ -71,21 +71,20 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, + SvpSalInstance* pInst = SvpSalInstance::s_pDefaultInstance; + assert( pInst ); + basebmp::Format nFormat = pInst->getFormatForBitCount( m_nBitCount ); +- sal_Int32 nStride = basebmp::getBitmapDeviceStrideForWidth(nFormat, aDevSize.getX()); + + if ( m_nBitCount == 1 ) + { + std::vector< basebmp::Color > aDevPal(2); + aDevPal[0] = basebmp::Color( 0, 0, 0 ); + aDevPal[1] = basebmp::Color( 0xff, 0xff, 0xff ); +- m_aDevice = createBitmapDevice( aDevSize, bTopDown, nFormat, nStride, ++ m_aDevice = createBitmapDevice( aDevSize, bTopDown, nFormat, + PaletteMemorySharedVector( new std::vector< basebmp::Color >(aDevPal) ) ); + } + else + { + m_aDevice = pBuffer ? +- createBitmapDevice( aDevSize, bTopDown, nFormat, nStride, pBuffer, PaletteMemorySharedVector() ) +- : createBitmapDevice( aDevSize, bTopDown, nFormat, nStride ); ++ createBitmapDevice( aDevSize, bTopDown, nFormat, pBuffer, PaletteMemorySharedVector() ) ++ : createBitmapDevice( aDevSize, bTopDown, nFormat ); + } + + // update device in existing graphics +diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx +index a5437c1..384afc7 100644 +--- a/vcl/qa/cppunit/BitmapTest.cxx ++++ b/vcl/qa/cppunit/BitmapTest.cxx +@@ -51,17 +51,12 @@ void BitmapTest::testConvert() + { + Bitmap::ScopedReadAccess pReadAccess(aBitmap); + CPPUNIT_ASSERT_EQUAL(static_cast(8), pReadAccess->GetBitCount()); +-#if defined WNT +- if (!OpenGLHelper::isVCLOpenGLEnabled()) +- { +- // GDI Scanlines padded to DWORD multiples, it seems +- CPPUNIT_ASSERT_EQUAL(static_cast(12), pReadAccess->GetScanlineSize()); +- } +- else ++#if defined MACOSX || defined IOS ++ //it would be nice to find and change the stride for quartz to be the same as everyone else ++ CPPUNIT_ASSERT_EQUAL(static_cast(10), pReadAccess->GetScanlineSize()); ++#else ++ CPPUNIT_ASSERT_EQUAL(static_cast(12), pReadAccess->GetScanlineSize()); + #endif +- { +- CPPUNIT_ASSERT_EQUAL(static_cast(10), pReadAccess->GetScanlineSize()); +- } + CPPUNIT_ASSERT(pReadAccess->HasPalette()); + const BitmapColor& rColor = pReadAccess->GetPaletteColor(pReadAccess->GetPixelIndex(1, 1)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(204), sal_Int32(rColor.GetRed())); +diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx +index a28c144..eef48cd 100644 +--- a/vcl/unx/gtk/window/gtksalframe.cxx ++++ b/vcl/unx/gtk/window/gtksalframe.cxx +@@ -2063,9 +2063,8 @@ void GtkSalFrame::AllocateFrame() + aFrameSize.setX( 1 ); + if( aFrameSize.getY() == 0 ) + aFrameSize.setY( 1 ); +- int cairo_stride = cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, aFrameSize.getX()); + m_aFrame = basebmp::createBitmapDevice(aFrameSize, true, +- basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX, cairo_stride); ++ basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX); + m_aFrame->setDamageTracker( + basebmp::IBitmapDeviceDamageTrackerSharedPtr(new DamageTracker(*this)) ); + SAL_INFO("vcl.gtk3", "allocated m_aFrame size of " << maGeometry.nWidth << " x " << maGeometry.nHeight); +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-tdf-96285-restore-bodge-for-unresizable-win.patch b/SOURCES/0001-Resolves-tdf-96285-restore-bodge-for-unresizable-win.patch new file mode 100644 index 0000000..34af44b --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-96285-restore-bodge-for-unresizable-win.patch @@ -0,0 +1,83 @@ +From b7c0576a8e8f39171b94d08fddea868da0459597 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 8 Dec 2015 13:09:34 +0000 +Subject: [PATCH] Resolves: tdf#96285 restore bodge for unresizable windows + with no min size set + +(cherry picked from commit e1df21cfe0318bf287ae8ce29261d4759c49bd5a) + +Change-Id: Ia1af11514f6096ac55d561f729bbcba9ee5b0b14 +--- + vcl/inc/unx/gtk/gtkframe.hxx | 2 ++ + vcl/unx/gtk3/gtk3gtkframe.cxx | 21 ++++++++++++++++++++- + 2 files changed, 22 insertions(+), 1 deletion(-) + +diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx +index 0fb5da7..3bd5353 100644 +--- a/vcl/inc/unx/gtk/gtkframe.hxx ++++ b/vcl/inc/unx/gtk/gtkframe.hxx +@@ -212,6 +212,8 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + + #if GTK_CHECK_VERSION(3,0,0) + guint32 m_nLastScrollEventTime; ++ long m_nWidthRequest; ++ long m_nHeightRequest; + cairo_region_t* m_pRegion; + #else + GdkRegion* m_pRegion; +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index dcfebbf..1443054 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -885,6 +885,8 @@ void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) + + void GtkSalFrame::window_resize(long nWidth, long nHeight) + { ++ m_nWidthRequest = nWidth; ++ m_nHeightRequest = nHeight; + gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight); + } + +@@ -1055,6 +1057,9 @@ void GtkSalFrame::InitCommon() + m_aSystemData.pAppContext = NULL; + m_aSystemData.pShellWidget = m_aSystemData.pWidget; + ++ m_nWidthRequest = 0; ++ m_nHeightRequest = 0; ++ + // fake an initial geometry, gets updated via configure event or SetPosSize + if( m_bDefaultPos || m_bDefaultSize ) + { +@@ -1592,6 +1597,20 @@ void GtkSalFrame::setMinMaxSize() + aHints |= GDK_HINT_MAX_SIZE; + } + } ++ else ++ { ++ if (!m_bFullscreen && m_nWidthRequest && m_nHeightRequest) ++ { ++ aGeo.min_width = m_nWidthRequest; ++ aGeo.min_height = m_nHeightRequest; ++ aHints |= GDK_HINT_MIN_SIZE; ++ ++ aGeo.max_width = m_nWidthRequest; ++ aGeo.max_height = m_nHeightRequest; ++ aHints |= GDK_HINT_MAX_SIZE; ++ } ++ } ++ + if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() ) + { + aGeo.max_width = m_aMaxSize.Width(); +@@ -1623,7 +1642,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight ) + m_aMinSize = Size( nWidth, nHeight ); + if( m_pWindow ) + { +- widget_set_size_request(nWidth, nHeight ); ++ widget_set_size_request(nWidth, nHeight); + setMinMaxSize(); + } + } +-- +2.5.0 + diff --git a/SOURCES/0001-Resolves-tdf-96989-videos-playback-at-maximum-possib.patch b/SOURCES/0001-Resolves-tdf-96989-videos-playback-at-maximum-possib.patch new file mode 100644 index 0000000..90ddbb4 --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-96989-videos-playback-at-maximum-possib.patch @@ -0,0 +1,192 @@ +From b09dbbfb58d67d1640709f71a7053a7ccea70cec Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 17 Mar 2016 12:21:16 +0000 +Subject: [PATCH] Resolves: tdf#96989 videos playback at maximum possible + volume + +On systems with flat-volumes then setting the volume directly on the playbin to +100% results in resetting the global volume to the maximum possible volume. + +We expect to set as % of the current system volume. Putting an intermediate +volume object into the pipeline does the more expected thing. + +(cherry picked from commit d4b48e0de7f817c0d4607382724778acf191f9f8) + +Change-Id: I911d6fffba0983e4fd7b455e820959a96115de34 +--- + avmedia/source/gstreamer/gstplayer.cxx | 90 ++++++++++++++++++++-------------- + avmedia/source/gstreamer/gstplayer.hxx | 1 + + 2 files changed, 54 insertions(+), 37 deletions(-) + +diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx +index b820ae1..50f54ea 100644 +--- a/avmedia/source/gstreamer/gstplayer.cxx ++++ b/avmedia/source/gstreamer/gstplayer.cxx +@@ -131,7 +131,7 @@ void MissingPluginInstaller::report( + { + // assert(gst_is_missing_plugin_message(message)); + gchar * det = gst_missing_plugin_message_get_installer_detail(message); +- if (det == nullptr) { ++ if (det == NULL) { + SAL_WARN( + "avmedia.gstreamer", + "gst_missing_plugin_message_get_installer_detail failed"); +@@ -268,8 +268,8 @@ void MissingPluginInstallerThread::execute() { + for (auto const & i: details) { + args.push_back(const_cast(i.getStr())); + } +- args.push_back(nullptr); +- gst_install_plugins_sync(args.data(), nullptr); ++ args.push_back(NULL); ++ gst_install_plugins_sync(args.data(), NULL); + { + osl::MutexGuard g(inst.mutex_); + if (inst.queued_.empty() || inst.launchNewThread_) { +@@ -290,6 +290,7 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : + GstPlayer_BASE( m_aMutex ), + mxMgr( rxMgr ), + mpPlaybin( NULL ), ++ mpVolumeControl( NULL ), + mbFakeVideo (false ), + mnUnmutedVolume( 0 ), + mbPlayPending ( false ), +@@ -351,6 +352,7 @@ void SAL_CALL Player::disposing() + g_object_unref( G_OBJECT( mpPlaybin ) ); + + mpPlaybin = NULL; ++ mpVolumeControl = NULL; + } + + if( mpXOverlay ) { +@@ -576,41 +578,55 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) + + void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) + { +- GstBus *pBus; ++ GstBus *pBus; + +- if( mpPlaybin != NULL ) { +- gst_element_set_state( mpPlaybin, GST_STATE_NULL ); +- mbPlayPending = false; +- g_object_unref( mpPlaybin ); +- } ++ if( mpPlaybin != NULL ) { ++ gst_element_set_state( mpPlaybin, GST_STATE_NULL ); ++ mbPlayPending = false; ++ g_object_unref( mpPlaybin ); ++ } + +- mpPlaybin = gst_element_factory_make( "playbin", NULL ); +- if( pSink != NULL ) // used for getting preferred size etc. +- { +- g_object_set( G_OBJECT( mpPlaybin ), "video-sink", pSink, NULL ); +- mbFakeVideo = true; +- } +- else +- mbFakeVideo = false; ++ mpPlaybin = gst_element_factory_make( "playbin", NULL ); ++ ++ //tdf#96989 on systems with flat-volumes setting the volume directly on the ++ //playbin to 100% results in setting the global volums to 100% of the ++ //maximum. We expect to set as % of the current volume. ++ mpVolumeControl = gst_element_factory_make( "volume", NULL ); ++ GstElement *pAudioSink = gst_element_factory_make( "autoaudiosink", NULL ); ++ GstElement* pAudioOutput = gst_bin_new("audio-output-bin"); ++ gst_bin_add_many(GST_BIN(pAudioOutput), mpVolumeControl, pAudioSink, NULL); ++ gst_element_link(mpVolumeControl, pAudioSink); ++ GstPad *pPad = gst_element_get_static_pad(mpVolumeControl, "sink"); ++ gst_element_add_pad(GST_ELEMENT(pAudioOutput), gst_ghost_pad_new("sink", pPad)); ++ gst_object_unref(GST_OBJECT(pPad)); ++ g_object_set(G_OBJECT(mpPlaybin), "audio-sink", pAudioOutput, NULL); ++ ++ if( pSink != NULL ) // used for getting preferred size etc. ++ { ++ g_object_set( G_OBJECT( mpPlaybin ), "video-sink", pSink, NULL ); ++ mbFakeVideo = true; ++ } ++ else ++ mbFakeVideo = false; + +- OString ascURL = OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ); +- g_object_set( G_OBJECT( mpPlaybin ), "uri", ascURL.getStr() , NULL ); ++ OString ascURL = OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ); ++ g_object_set( G_OBJECT( mpPlaybin ), "uri", ascURL.getStr() , NULL ); + +- pBus = gst_element_get_bus( mpPlaybin ); +- if (mbWatchID) +- { +- g_source_remove(mnWatchID); +- mbWatchID = false; +- } +- mnWatchID = gst_bus_add_watch( pBus, pipeline_bus_callback, this ); +- mbWatchID = true; +- DBG( "%p set sync handler", this ); ++ pBus = gst_element_get_bus( mpPlaybin ); ++ if (mbWatchID) ++ { ++ g_source_remove(mnWatchID); ++ mbWatchID = false; ++ } ++ mnWatchID = gst_bus_add_watch( pBus, pipeline_bus_callback, this ); ++ mbWatchID = true; ++ DBG( "%p set sync handler", this ); + #ifdef AVMEDIA_GST_0_10 +- gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this ); ++ gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this ); + #else +- gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this, NULL ); ++ gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this, NULL ); + #endif +- g_object_unref( pBus ); ++ g_object_unref( pBus ); + } + + bool Player::create( const OUString& rURL ) +@@ -784,7 +800,7 @@ void SAL_CALL Player::setMute( sal_Bool bSet ) + nVolume = 0.0; + } + +- g_object_set( G_OBJECT( mpPlaybin ), "volume", nVolume, NULL ); ++ g_object_set( G_OBJECT( mpVolumeControl ), "volume", nVolume, NULL); + + mbMuted = bSet; + } +@@ -812,10 +828,10 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) + DBG( "set volume: %d gst volume: %lf", nVolumeDB, mnUnmutedVolume ); + + // change volume +- if( !mbMuted && mpPlaybin ) +- { +- g_object_set( G_OBJECT( mpPlaybin ), "volume", (gdouble) mnUnmutedVolume, NULL ); +- } ++ if( !mbMuted && mpPlaybin ) ++ { ++ g_object_set( G_OBJECT( mpVolumeControl ), "volume", mnUnmutedVolume, NULL ); ++ } + } + + +@@ -830,7 +846,7 @@ sal_Int16 SAL_CALL Player::getVolumeDB() + if( mpPlaybin ) { + double nGstVolume = 0.0; + +- g_object_get( G_OBJECT( mpPlaybin ), "volume", &nGstVolume, NULL ); ++ g_object_get( G_OBJECT( mpVolumeControl ), "volume", &nGstVolume, NULL ); + + nVolumeDB = (sal_Int16) ( 20.0*log10 ( nGstVolume ) ); + } +diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx +index c5fc4f6..ed60e79 100644 +--- a/avmedia/source/gstreamer/gstplayer.hxx ++++ b/avmedia/source/gstreamer/gstplayer.hxx +@@ -83,6 +83,7 @@ protected: + + // Add elements and pipeline here + GstElement* mpPlaybin; // the playbin is also a pipeline ++ GstElement* mpVolumeControl; // the playbin is also a pipeline + bool mbFakeVideo; + + gdouble mnUnmutedVolume; +-- +2.7.1 + diff --git a/SOURCES/0001-Resolves-tdf-99417-explicitly-track-formula-cells-fo.patch b/SOURCES/0001-Resolves-tdf-99417-explicitly-track-formula-cells-fo.patch new file mode 100644 index 0000000..731f055 --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-99417-explicitly-track-formula-cells-fo.patch @@ -0,0 +1,56 @@ +From 388129064d30cd28ce9011ca459b19c238b9d005 Mon Sep 17 00:00:00 2001 +Message-Id: <388129064d30cd28ce9011ca459b19c238b9d005.1462273102.git.erack@redhat.com> +From: Eike Rathke +Date: Mon, 2 May 2016 16:25:01 +0200 +Subject: [PATCH] Resolves: tdf#99417 explicitly track formula cells for + BROADCAST_BROADCASTERS +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------erAck-patch-parts" + +This is a multi-part message in MIME format. +--------------erAck-patch-parts +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + + +Change-Id: I717fc6d1d7c2bc01ed2a256f6fc08a055be24e4b +(cherry picked from commit a0b9fa819c9193dee1405cee13690adf00e2d9b9) +Reviewed-on: https://gerrit.libreoffice.org/24592 +Reviewed-by: Markus Mohrhard +Tested-by: Jenkins +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sc/source/core/data/column.cxx | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + + +--------------erAck-patch-parts +Content-Type: text/x-patch; name="0001-Resolves-tdf-99417-explicitly-track-formula-cells-fo.patch" +Content-Transfer-Encoding: 8bit +Content-Disposition: attachment; filename="0001-Resolves-tdf-99417-explicitly-track-formula-cells-fo.patch" + +diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx +index 3a7daf1..48fb280 100644 +--- a/sc/source/core/data/column.cxx ++++ b/sc/source/core/data/column.cxx +@@ -3165,7 +3165,14 @@ void ScColumn::SetDirty( SCROW nRow1, SCROW nRow2, BroadcastMode eMode ) + sc::ProcessFormula(maCells.begin(), maCells, nRow1, nRow2, aHdl); + // Broadcast all broadcasters in range. + ScHint aHint( SC_HINT_DATACHANGED, ScAddress( nCol, nRow1, nTab)); +- BroadcastBroadcasters( nRow1, nRow2, aHint); ++ if (BroadcastBroadcasters( nRow1, nRow2, aHint)) ++ { ++ // SetDirtyOnRangeHandler implicitly tracks notified ++ // formulas via ScDocument::Broadcast(), which ++ // BroadcastBroadcastersHandler doesn't, so explicitly ++ // track them here. ++ pDocument->TrackFormulas(); ++ } + } + break; + } + +--------------erAck-patch-parts-- + + diff --git a/SOURCES/0001-Resolves-tdf-99498-don-t-overwrite-trwWidth-value-if.patch b/SOURCES/0001-Resolves-tdf-99498-don-t-overwrite-trwWidth-value-if.patch new file mode 100644 index 0000000..20f426f --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-99498-don-t-overwrite-trwWidth-value-if.patch @@ -0,0 +1,72 @@ +From b5d3739516032e8863ee60e0c614dd1ec9e262a8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 27 Apr 2016 14:50:05 +0100 +Subject: [PATCH] Resolves: tdf#99498 don't overwrite trwWidth value if set on + a table + +Change-Id: Ia39da999a2de1ca2b8bec5fc7f35d2f9ffe2dd19 +--- + sw/qa/extras/rtfimport/rtfimport.cxx | 10 ++++++++++ + writerfilter/source/rtftok/rtfdocumentimpl.cxx | 18 ++++++++++++++---- + 2 files changed, 24 insertions(+), 4 deletions(-) + +diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx +index 4236a48..07dd0da 100644 +--- a/sw/qa/extras/rtfimport/rtfimport.cxx ++++ b/sw/qa/extras/rtfimport/rtfimport.cxx +@@ -2388,6 +2388,16 @@ DECLARE_RTFIMPORT_TEST(testTdf96308Tabpos, "tdf96308-tabpos.rtf") + CPPUNIT_ASSERT(!aTabStops.hasElements()); + } + ++DECLARE_RTFIMPORT_TEST(testTdf99498, "tdf99498.rtf") ++{ ++ uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); ++ uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); ++ ++ // Table width should be 7056 ++ CPPUNIT_ASSERT_EQUAL(sal_Int32(7056), getProperty(xTables->getByIndex(0), "Width")); ++} ++ ++ + DECLARE_RTFIMPORT_TEST(testTdf87034, "tdf87034.rtf") + { + // This was A1BC34D, i.e. the first "super" text portion was mis-imported, +diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +index 799186d..f292e9d 100644 +--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx ++++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +@@ -1368,10 +1368,14 @@ void RTFDocumentImpl::prepareProperties( + } + + // Table width. +- auto pUnitValue = std::make_shared(3); +- lcl_putNestedAttribute(rState.aTableRowSprms, NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_type, pUnitValue); +- auto pWValue = std::make_shared(nCurrentCellX); +- lcl_putNestedAttribute(rState.aTableRowSprms, NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pWValue); ++ RTFValue::Pointer_t const pTableWidthProps = rState.aTableRowSprms.find(NS_ooxml::LN_CT_TblPrBase_tblW); ++ if (!pTableWidthProps.get()) ++ { ++ auto pUnitValue = std::make_shared(3); ++ lcl_putNestedAttribute(rState.aTableRowSprms, NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_type, pUnitValue); ++ auto pWValue = std::make_shared(nCurrentCellX); ++ lcl_putNestedAttribute(rState.aTableRowSprms, NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pWValue); ++ } + + auto pRowValue = std::make_shared(1); + if (nCells > 0) +@@ -4783,6 +4787,12 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) + lcl_putNestedSprm(m_aStates.top().aTableRowSprms, NS_ooxml::LN_CT_TblPrBase_tblCellMar, NS_ooxml::LN_CT_TblCellMar_right, std::make_shared(aAttributes)); + } + break; ++ case RTF_TRFTSWIDTH: ++ lcl_putNestedAttribute(m_aStates.top().aTableRowSprms, NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_type, pIntValue); ++ break; ++ case RTF_TRWWIDTH: ++ lcl_putNestedAttribute(m_aStates.top().aTableRowSprms, NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pIntValue); ++ break; + default: + { + SAL_INFO("writerfilter", "TODO handle value '" << lcl_RtfToString(nKeyword) << "'"); +-- +2.7.3 + diff --git a/SOURCES/0001-Resolves-tdf-99604-ungrab-modal-dialogs.patch b/SOURCES/0001-Resolves-tdf-99604-ungrab-modal-dialogs.patch new file mode 100644 index 0000000..0433c6a --- /dev/null +++ b/SOURCES/0001-Resolves-tdf-99604-ungrab-modal-dialogs.patch @@ -0,0 +1,31 @@ +From c0d8f3643a634c062f094e97ea1a4d60e5e64916 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 19 Jan 2016 13:22:10 +0000 +Subject: [PATCH] Resolves: tdf#99604 ungrab modal dialogs + +Change-Id: I6735913c371968745da3ad6bf61e6ae3287c19a6 +--- + vcl/unx/gtk3/gtk3gtkframe.cxx | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index 6012f58..803542d 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -2367,6 +2367,13 @@ void GtkSalFrame::SetModal(bool bModal) + if (!m_pWindow) + return; + gtk_window_set_modal(GTK_WINDOW(m_pWindow), bModal); ++ if (bModal) ++ { ++ //gtk_window_set_modal bTrue adds a grab, so ungrab here. Quite ++ //possibly we should alternatively call grab_add grab_ungrab on ++ //show/hide of menus ? ++ gtk_grab_remove(m_pWindow); ++ } + } + + gboolean GtkSalFrame::signalTooltipQuery(GtkWidget*, gint /*x*/, gint /*y*/, +-- +2.5.0 + diff --git a/SOURCES/0001-Revert-upload-libwps-0.4.0.patch b/SOURCES/0001-Revert-upload-libwps-0.4.0.patch new file mode 100644 index 0000000..1303c6d --- /dev/null +++ b/SOURCES/0001-Revert-upload-libwps-0.4.0.patch @@ -0,0 +1,1064 @@ +From 97a27e85e1e4ec766dd5b528b6c7fba3b2910248 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Tue, 1 Mar 2016 07:23:54 +0100 +Subject: [PATCH] Revert "upload libwps 0.4.0" + +This reverts commit f9568335a653f72732f9c8ebf007cf8850021ff9. + +Change-Id: Iffbbc6fd409b807848a34c2e5cc4ac4c4e930a49 +--- + RepositoryExternal.mk | 2 +- + configure.ac | 2 +- + download.lst | 5 +- + ...parser-correct-a-mistake-when-reading-neg.patch | 26 --- + ...01-error-C2065-M_PI-undeclared-identifier.patch | 35 ---- + external/libwps/ExternalPackage_libwps.mk | 6 +- + external/libwps/ExternalProject_libwps.mk | 2 +- + external/libwps/Library_wps.mk | 8 - + external/libwps/UnpackedTarball_libwps.mk | 2 - + filter/Configuration_filter.mk | 4 - + .../config/fragments/filters/WPS_Lotus_Calc.xcu | 30 ---- + .../config/fragments/filters/WPS_QPro_Calc.xcu | 30 ---- + .../fragments/types/calc_WPS_Lotus_Document.xcu | 29 ---- + .../fragments/types/calc_WPS_QPro_Document.xcu | 29 ---- + scp2/source/ooo/file_ooo.scp | 1 - + scp2/source/ooo/module_ooo.scp | 1 - + writerperfect/Library_wpftcalc.mk | 2 - + writerperfect/Library_wpftdraw.mk | 2 - + writerperfect/Library_wpftimpress.mk | 2 - + writerperfect/Library_wpftwriter.mk | 2 - + writerperfect/Library_writerperfect.mk | 3 - + writerperfect/Module_writerperfect.mk | 4 - + writerperfect/UIConfig_writerperfect.mk | 26 --- + writerperfect/inc/WPFTEncodingDialog.hxx | 58 ------- + .../source/calc/MSWorksCalcImportFilter.cxx | 72 +-------- + writerperfect/source/common/WPFTEncodingDialog.cxx | 180 --------------------- + .../source/writer/MSWorksImportFilter.cxx | 34 +--- + writerperfect/uiconfig/ui/wpftencodingdialog.ui | 90 ----------- + 28 files changed, 15 insertions(+), 672 deletions(-) + delete mode 100644 external/libwps/0001-QuattroPro-parser-correct-a-mistake-when-reading-neg.patch + delete mode 100644 external/libwps/0001-error-C2065-M_PI-undeclared-identifier.patch + delete mode 100644 filter/source/config/fragments/filters/WPS_Lotus_Calc.xcu + delete mode 100644 filter/source/config/fragments/filters/WPS_QPro_Calc.xcu + delete mode 100644 filter/source/config/fragments/types/calc_WPS_Lotus_Document.xcu + delete mode 100644 filter/source/config/fragments/types/calc_WPS_QPro_Document.xcu + delete mode 100644 writerperfect/UIConfig_writerperfect.mk + delete mode 100644 writerperfect/inc/WPFTEncodingDialog.hxx + delete mode 100644 writerperfect/source/common/WPFTEncodingDialog.cxx + delete mode 100644 writerperfect/uiconfig/ui/wpftencodingdialog.ui + +diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk +index 20de676..3df6d6a 100644 +--- a/RepositoryExternal.mk ++++ b/RepositoryExternal.mk +@@ -2192,7 +2192,7 @@ $(call gb_LinkTarget_set_include,$(1),\ + $$(INCLUDE) \ + ) + $(call gb_LinkTarget_add_libs,$(1),\ +- -L$(call gb_UnpackedTarball_get_dir,libwps)/src/lib/.libs -lwps-0.4 \ ++ -L$(call gb_UnpackedTarball_get_dir,libwps)/src/lib/.libs -lwps-0.3 \ + ) + + endef +diff --git a/configure.ac b/configure.ac +index cc77ee9..6a99034 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -7713,7 +7713,7 @@ libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1]) + dnl =================================================================== + dnl Check for system libwps + dnl =================================================================== +-libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4]) ++libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.3]) + + dnl =================================================================== + dnl Check for system libwpg +diff --git a/download.lst b/download.lst +index 9e16272..dc9aaea 100644 +--- a/download.lst ++++ b/download.lst +@@ -146,9 +146,8 @@ export WPD_MD5SUM := 0773d79a1f240ef9f4f20242b13c5bb7 + export WPD_TARBALL := libwpd-0.10.0.tar.bz2 + export WPG_MD5SUM := 17da9770cb8b317b7633f9807b32b71a + export WPG_TARBALL := libwpg-0.3.0.tar.bz2 +-export WPS_MD5SUM := e9162d2566421d9d71b3ad2377a68fd5 +-export WPS_VERSION_MICRO := 0 +-export WPS_TARBALL := libwps-0.4.$(WPS_VERSION_MICRO).tar.bz2 ++export WPS_MD5SUM := a111d9ef5a0dab564e9aec0f2cf8d218 ++export WPS_TARBALL := libwps-0.3.1.tar.bz2 + export XSLTML_TARBALL := a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip + export ZLIB_MD5SUM := 44d667c142d7cda120332623eab69f40 + export ZLIB_TARBALL := zlib-1.2.8.tar.gz +diff --git a/external/libwps/0001-QuattroPro-parser-correct-a-mistake-when-reading-neg.patch b/external/libwps/0001-QuattroPro-parser-correct-a-mistake-when-reading-neg.patch +deleted file mode 100644 +index d5a6f54..0000000 +--- a/external/libwps/0001-QuattroPro-parser-correct-a-mistake-when-reading-neg.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From 45a3dd5393e07340d5a63d8a8735789d73a61b17 Mon Sep 17 00:00:00 2001 +-From: osnola +-Date: Mon, 18 May 2015 08:27:59 +0200 +-Subject: [PATCH] QuattroPro parser: correct a mistake when reading negative +- cell's position +- +---- +- src/lib/QuattroSpreadsheet.cpp | 2 +- +- 1 file changed, 1 insertion(+), 1 deletion(-) +- +-diff --git a/src/lib/QuattroSpreadsheet.cpp b/src/lib/QuattroSpreadsheet.cpp +-index cb0f4f5..ce5e20a 100644 +---- a/src/lib/QuattroSpreadsheet.cpp +-+++ b/src/lib/QuattroSpreadsheet.cpp +-@@ -1668,7 +1668,7 @@ bool QuattroSpreadsheet::readCell +- else +- { +- val &= 0x3FFF; +-- if (val & 0x2000) val = val - 0x4000; +-+ if (val>0x1000) val = val - 0x2000; +- } +- if (dim==2) +- val += sheetId; +--- +-2.3.2 (Apple Git-55) +- +diff --git a/external/libwps/0001-error-C2065-M_PI-undeclared-identifier.patch b/external/libwps/0001-error-C2065-M_PI-undeclared-identifier.patch +deleted file mode 100644 +index 01109dc..0000000 +--- a/external/libwps/0001-error-C2065-M_PI-undeclared-identifier.patch ++++ /dev/null +@@ -1,35 +0,0 @@ +-From 94af34d42129bad72fd7ce50dc6901287509703e Mon Sep 17 00:00:00 2001 +-From: David Tardon +-Date: Mon, 18 May 2015 18:50:25 +0200 +-Subject: [PATCH] error C2065: M_PI : undeclared identifier +- +---- +- src/lib/libwps_internal.h | 5 +++++ +- 1 file changed, 5 insertions(+) +- +-diff --git a/src/lib/libwps_internal.h b/src/lib/libwps_internal.h +-index fb9016d..02a87bc 100644 +---- a/src/lib/libwps_internal.h +-+++ b/src/lib/libwps_internal.h +-@@ -28,6 +28,7 @@ +- #include +- #endif +- +-+#include +- #include +- #include +- #include +-@@ -36,6 +37,10 @@ +- #include +- #include +- +-+#ifndef M_PI +-+#define M_PI 3.14159265358979323846 +-+#endif +-+ +- #if defined(_MSC_VER) || defined(__DJGPP__) +- typedef signed char int8_t; +- typedef unsigned char uint8_t; +--- +-2.4.0 +- +diff --git a/external/libwps/ExternalPackage_libwps.mk b/external/libwps/ExternalPackage_libwps.mk +index 24b00c6..3e0f79b 100644 +--- a/external/libwps/ExternalPackage_libwps.mk ++++ b/external/libwps/ExternalPackage_libwps.mk +@@ -12,11 +12,11 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,libwps,libwps)) + $(eval $(call gb_ExternalPackage_use_external_project,libwps,libwps)) + + ifeq ($(OS),MACOSX) +-$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.4.4.dylib,src/lib/.libs/libwps-0.4.4.dylib)) ++$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.3.3.dylib,src/lib/.libs/libwps-0.3.3.dylib)) + else ifeq ($(OS),WNT) +-$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.4.dll,src/lib/.libs/libwps-0.4.dll)) ++$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.3.dll,src/lib/.libs/libwps-0.3.dll)) + else ifeq ($(filter IOS ANDROID,$(OS)),) +-$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.4-lo.so.4,src/lib/.libs/libwps-0.4-lo.so.4.0.$(WPS_VERSION_MICRO))) ++$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.3.so.3,src/lib/.libs/libwps-0.3.so.3.0.1)) + endif + + # vim: set noet sw=4 ts=4: +diff --git a/external/libwps/ExternalProject_libwps.mk b/external/libwps/ExternalProject_libwps.mk +index 10b39b3..8cd2138 100644 +--- a/external/libwps/ExternalProject_libwps.mk ++++ b/external/libwps/ExternalProject_libwps.mk +@@ -44,7 +44,7 @@ $(call gb_ExternalProject_get_state_target,libwps,build) : + && $(MAKE) \ + $(if $(filter MACOSX,$(OS)),\ + && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \ +- $(EXTERNAL_WORKDIR)/src/lib/.libs/libwps-0.4.4.dylib \ ++ $(EXTERNAL_WORKDIR)/src/lib/.libs/libwps-0.3.3.dylib \ + ) \ + ) + +diff --git a/external/libwps/Library_wps.mk b/external/libwps/Library_wps.mk +index ef323ce..be9f3c6 100644 +--- a/external/libwps/Library_wps.mk ++++ b/external/libwps/Library_wps.mk +@@ -33,12 +33,6 @@ $(eval $(call gb_Library_add_defs,wps,\ + $(eval $(call gb_Library_set_generated_cxx_suffix,wps,cpp)) + + $(eval $(call gb_Library_add_generated_exception_objects,wps,\ +- UnpackedTarball/libwps/src/lib/Lotus \ +- UnpackedTarball/libwps/src/lib/LotusGraph \ +- UnpackedTarball/libwps/src/lib/LotusSpreadsheet \ +- UnpackedTarball/libwps/src/lib/LotusStyleManager \ +- UnpackedTarball/libwps/src/lib/Quattro \ +- UnpackedTarball/libwps/src/lib/QuattroSpreadsheet \ + UnpackedTarball/libwps/src/lib/WKS4 \ + UnpackedTarball/libwps/src/lib/WKS4Spreadsheet \ + UnpackedTarball/libwps/src/lib/WKSContentListener \ +@@ -58,8 +52,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,wps,\ + UnpackedTarball/libwps/src/lib/WPSDebug \ + UnpackedTarball/libwps/src/lib/WPSDocument \ + UnpackedTarball/libwps/src/lib/WPSFont \ +- UnpackedTarball/libwps/src/lib/WPSGraphicShape \ +- UnpackedTarball/libwps/src/lib/WPSGraphicStyle \ + UnpackedTarball/libwps/src/lib/WPSHeader \ + UnpackedTarball/libwps/src/lib/WPSList \ + UnpackedTarball/libwps/src/lib/WPSOLEParser \ +diff --git a/external/libwps/UnpackedTarball_libwps.mk b/external/libwps/UnpackedTarball_libwps.mk +index 52d9ab3..fd5953e 100644 +--- a/external/libwps/UnpackedTarball_libwps.mk ++++ b/external/libwps/UnpackedTarball_libwps.mk +@@ -14,8 +14,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libwps,$(WPS_TARBALL))) + $(eval $(call gb_UnpackedTarball_set_patchlevel,libwps,1)) + + $(eval $(call gb_UnpackedTarball_add_patches,libwps,\ +- external/libwps/0001-QuattroPro-parser-correct-a-mistake-when-reading-neg.patch \ +- external/libwps/0001-error-C2065-M_PI-undeclared-identifier.patch \ + $(if $(SYSTEM_REVENGE),,external/libwps/rpath.patch.0) \ + )) + +diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk +index 213e981..576536e 100644 +--- a/filter/Configuration_filter.mk ++++ b/filter/Configuration_filter.mk +@@ -496,8 +496,6 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,f + calc_OOXML \ + calc_OOXML_Template \ + calc_MS_Works_Document \ +- calc_WPS_Lotus_Document \ +- calc_WPS_QPro_Document \ + calc_Beagle_Works \ + calc_ClarisWorks \ + calc_Claris_Resolve \ +@@ -537,8 +535,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calc_filters.x + calc_OOXML \ + calc_OOXML_Template \ + MS_Works_Calc \ +- WPS_Lotus_Calc \ +- WPS_QPro_Calc \ + Beagle_Works_Calc \ + ClarisWorks_Calc \ + Claris_Resolve_Calc \ +diff --git a/filter/source/config/fragments/filters/WPS_Lotus_Calc.xcu b/filter/source/config/fragments/filters/WPS_Lotus_Calc.xcu +deleted file mode 100644 +index 721e68f..0000000 +--- a/filter/source/config/fragments/filters/WPS_Lotus_Calc.xcu ++++ /dev/null +@@ -1,30 +0,0 @@ +- +- +- IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER +- +- com.sun.star.comp.Calc.MSWorksCalcImportFilter +- +- +- Lotus Document +- +- 0 +- calc_WPS_Lotus_Document +- +- com.sun.star.sheet.SpreadsheetDocument +- +diff --git a/filter/source/config/fragments/filters/WPS_QPro_Calc.xcu b/filter/source/config/fragments/filters/WPS_QPro_Calc.xcu +deleted file mode 100644 +index 77c7b45..0000000 +--- a/filter/source/config/fragments/filters/WPS_QPro_Calc.xcu ++++ /dev/null +@@ -1,30 +0,0 @@ +- +- +- IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER +- +- com.sun.star.comp.Calc.MSWorksCalcImportFilter +- +- +- QuattroPro Document +- +- 0 +- calc_WPS_QPro_Document +- +- com.sun.star.sheet.SpreadsheetDocument +- +diff --git a/filter/source/config/fragments/types/calc_WPS_Lotus_Document.xcu b/filter/source/config/fragments/types/calc_WPS_Lotus_Document.xcu +deleted file mode 100644 +index 0ecc711..0000000 +--- a/filter/source/config/fragments/types/calc_WPS_Lotus_Document.xcu ++++ /dev/null +@@ -1,29 +0,0 @@ +- +- +- com.sun.star.comp.Calc.MSWorksCalcImportFilter +- +- wk1 wk3 +- +- true +- WPS_Lotus_Calc +- +- Lotus Wk1-Wk3 +- +- +- +diff --git a/filter/source/config/fragments/types/calc_WPS_QPro_Document.xcu b/filter/source/config/fragments/types/calc_WPS_QPro_Document.xcu +deleted file mode 100644 +index a335004..0000000 +--- a/filter/source/config/fragments/types/calc_WPS_QPro_Document.xcu ++++ /dev/null +@@ -1,29 +0,0 @@ +- +- +- com.sun.star.comp.Calc.MSWorksCalcImportFilter +- +- wq1 wq2 +- +- true +- WPS_QPro_Calc +- +- QuattroPro Document +- +- +- +diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp +index b0f3382..2405fb3 100644 +--- a/scp2/source/ooo/file_ooo.scp ++++ b/scp2/source/ooo/file_ooo.scp +@@ -290,7 +290,6 @@ UI_FILELIST(tubes, "UIConfig/tubes.filelist") + #endif + UI_FILELIST(uui, "UIConfig/uui.filelist") + UI_FILELIST(vcl, "UIConfig/vcl.filelist") +-UI_FILELIST(writerperfect, "UIConfig/writerperfect.filelist") + UI_FILELIST(xmlsec, "UIConfig/xmlsec.filelist") + + UI_FILELIST_ALL_LANG(basicide, modules/BasicIDE) +diff --git a/scp2/source/ooo/module_ooo.scp b/scp2/source/ooo/module_ooo.scp +index 9acfbe8..7cd2514 100644 +--- a/scp2/source/ooo/module_ooo.scp ++++ b/scp2/source/ooo/module_ooo.scp +@@ -126,7 +126,6 @@ Module gid_Module_Root + #endif + gid_File_Share_Config_Sofficecfg_uiconfig_uui, + gid_File_Share_Config_Sofficecfg_uiconfig_vcl, +- gid_File_Share_Config_Sofficecfg_uiconfig_writerperfect, + gid_File_Share_Config_Sofficecfg_uiconfig_xmlsec, + gid_File_Share_Registry_Main_Xcd, + gid_File_Share_Registry_Forcedefault_Xcd, +diff --git a/writerperfect/Library_wpftcalc.mk b/writerperfect/Library_wpftcalc.mk +index 18cc378..86c0fea 100644 +--- a/writerperfect/Library_wpftcalc.mk ++++ b/writerperfect/Library_wpftcalc.mk +@@ -34,10 +34,8 @@ $(eval $(call gb_Library_use_libraries,wpftcalc,\ + cppuhelper \ + sal \ + sot \ +- svx \ + tl \ + utl \ +- vcl \ + writerperfect \ + xo \ + $(gb_UWINAPI) \ +diff --git a/writerperfect/Library_wpftdraw.mk b/writerperfect/Library_wpftdraw.mk +index 1e57fcd..29409c1 100644 +--- a/writerperfect/Library_wpftdraw.mk ++++ b/writerperfect/Library_wpftdraw.mk +@@ -34,10 +34,8 @@ $(eval $(call gb_Library_use_libraries,wpftdraw,\ + cppuhelper \ + sal \ + sot \ +- svx \ + tl \ + utl \ +- vcl \ + writerperfect \ + xo \ + $(gb_UWINAPI) \ +diff --git a/writerperfect/Library_wpftimpress.mk b/writerperfect/Library_wpftimpress.mk +index 3d35aa7..eac71cb 100644 +--- a/writerperfect/Library_wpftimpress.mk ++++ b/writerperfect/Library_wpftimpress.mk +@@ -34,11 +34,9 @@ $(eval $(call gb_Library_use_libraries,wpftimpress,\ + cppuhelper \ + sal \ + sot \ +- svx \ + tl \ + ucbhelper \ + utl \ +- vcl \ + writerperfect \ + xo \ + $(gb_UWINAPI) \ +diff --git a/writerperfect/Library_wpftwriter.mk b/writerperfect/Library_wpftwriter.mk +index 288c929..60ff3b6 100644 +--- a/writerperfect/Library_wpftwriter.mk ++++ b/writerperfect/Library_wpftwriter.mk +@@ -36,11 +36,9 @@ $(eval $(call gb_Library_use_libraries,wpftwriter,\ + sal \ + sfx \ + sot \ +- svx \ + tl \ + ucbhelper \ + utl \ +- vcl \ + writerperfect \ + xo \ + $(gb_UWINAPI) \ +diff --git a/writerperfect/Library_writerperfect.mk b/writerperfect/Library_writerperfect.mk +index 165a7a0..1b8494b 100644 +--- a/writerperfect/Library_writerperfect.mk ++++ b/writerperfect/Library_writerperfect.mk +@@ -42,11 +42,9 @@ $(eval $(call gb_Library_use_libraries,writerperfect,\ + cppuhelper \ + sal \ + sot \ +- svx \ + tl \ + ucbhelper \ + utl \ +- vcl \ + xo \ + $(gb_UWINAPI) \ + )) +@@ -54,7 +52,6 @@ $(eval $(call gb_Library_use_libraries,writerperfect,\ + $(eval $(call gb_Library_add_exception_objects,writerperfect,\ + writerperfect/source/common/DirectoryStream \ + writerperfect/source/common/DocumentHandler \ +- writerperfect/source/common/WPFTEncodingDialog \ + writerperfect/source/common/WPXSvInputStream \ + )) + +diff --git a/writerperfect/Module_writerperfect.mk b/writerperfect/Module_writerperfect.mk +index e787043..9c30697 100644 +--- a/writerperfect/Module_writerperfect.mk ++++ b/writerperfect/Module_writerperfect.mk +@@ -27,10 +27,6 @@ $(eval $(call gb_Module_add_targets,writerperfect,\ + Library_writerperfect \ + )) + +-$(eval $(call gb_Module_add_l10n_targets,writerperfect,\ +- UIConfig_writerperfect \ +-)) +- + $(eval $(call gb_Module_add_check_targets,writerperfect,\ + CppunitTest_writerperfect_stream \ + )) +diff --git a/writerperfect/UIConfig_writerperfect.mk b/writerperfect/UIConfig_writerperfect.mk +deleted file mode 100644 +index d0d8ef5..0000000 +--- a/writerperfect/UIConfig_writerperfect.mk ++++ /dev/null +@@ -1,26 +0,0 @@ +-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +-# +-# This file is part of the LibreOffice project. +-# +-# This Source Code Form is subject to the terms of the Mozilla Public +-# License, v. 2.0. If a copy of the MPL was not distributed with this +-# file, You can obtain one at http://mozilla.org/MPL/2.0/. +-# +-# This file incorporates work covered by the following license notice: +-# +-# Licensed to the Apache Software Foundation (ASF) under one or more +-# contributor license agreements. See the NOTICE file distributed +-# with this work for additional information regarding copyright +-# ownership. The ASF licenses this file to you under the Apache +-# License, Version 2.0 (the "License"); you may not use this file +-# except in compliance with the License. You may obtain a copy of +-# the License at http://www.apache.org/licenses/LICENSE-2.0 . +-# +- +-$(eval $(call gb_UIConfig_UIConfig,writerperfect)) +- +-$(eval $(call gb_UIConfig_add_uifiles,writerperfect,\ +- writerperfect/uiconfig/ui/wpftencodingdialog \ +-)) +- +-# vim: set noet sw=4 ts=4: +diff --git a/writerperfect/inc/WPFTEncodingDialog.hxx b/writerperfect/inc/WPFTEncodingDialog.hxx +deleted file mode 100644 +index 2d3a63a..0000000 +--- a/writerperfect/inc/WPFTEncodingDialog.hxx ++++ /dev/null +@@ -1,58 +0,0 @@ +-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +-/* MSWorksImportFilter: Sets up the filter, and calls DocumentCollector +- * to do the actual filtering +- * +- * This file is part of the LibreOffice project. +- * +- * This Source Code Form is subject to the terms of the Mozilla Public +- * License, v. 2.0. If a copy of the MPL was not distributed with this +- * file, You can obtain one at http://mozilla.org/MPL/2.0/. +- */ +- +-#ifndef INCLUDED_WRITERPERFECT_WPFTENCODINGDIALOG_HXX +-#define INCLUDED_WRITERPERFECT_WPFTENCODINGDIALOG_HXX +- +-#include +- +-#include +-#include +-#include +- +-#include +- +-namespace writerperfect +-{ +- +-class WRITERPERFECT_DLLPUBLIC WPFTEncodingDialog : public ModalDialog +-{ +-public: +- WPFTEncodingDialog(const OUString &title, const OUString &defEncoding); +- +- virtual ~WPFTEncodingDialog(); +- +- OUString GetEncoding() const; +- bool hasUserCalledCancel() const +- { +- return m_userHasCancelled; +- } +-private: +- VclPtr m_pLbCharset; +- VclPtr m_pBtnOk; +- VclPtr m_pBtnCancel; +- +- bool m_userHasCancelled; +-private: +- DECL_LINK(DoubleClickHdl, ListBox *); +- DECL_LINK(CancelHdl, void *); +- +- void dispose() SAL_OVERRIDE; +- +- WPFTEncodingDialog(WPFTEncodingDialog const &) SAL_DELETED_FUNCTION; +- WPFTEncodingDialog &operator=(WPFTEncodingDialog const &) SAL_DELETED_FUNCTION; +-}; +- +-} +- +-#endif +- +-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx +index 3ccf2db..d897638 100644 +--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx ++++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx +@@ -14,7 +14,6 @@ + + #include + +-#include "WPFTEncodingDialog.hxx" + #include "MSWorksCalcImportFilter.hxx" + + using com::sun::star::uno::Sequence; +@@ -27,79 +26,18 @@ using com::sun::star::uno::XComponentContext; + + bool MSWorksCalcImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdsGenerator &rGenerator, utl::MediaDescriptor &) + { +- libwps::WPSKind kind = libwps::WPS_TEXT; +- libwps::WPSCreator creator; +- bool needEncoding; +- const libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(&rInput, kind, creator, needEncoding); +- +- std::string fileEncoding(""); +- if ((kind == libwps::WPS_SPREADSHEET || kind == libwps::WPS_DATABASE) && (confidence == libwps::WPS_CONFIDENCE_EXCELLENT) && needEncoding) +- { +- OUString title, encoding; +- if (creator == libwps::WPS_MSWORKS) +- { +- title="Import MsWorks files(libwps)"; +- encoding="CP850"; +- } +- else if (creator == libwps::WPS_LOTUS) +- { +- title="Import Lotus files(libwps)"; +- encoding="CP437"; +- } +- else if (creator == libwps::WPS_SYMPHONY) +- { +- title="Import Symphony files(libwps)"; +- encoding="CP437"; +- } +- else +- { +- title="Import Quattro Pro files(libwps)"; +- encoding="CP437"; +- } +- try +- { +- const ScopedVclPtrInstance pDlg(title, encoding); +- if (pDlg->Execute() == RET_OK) +- { +- if (!pDlg->GetEncoding().isEmpty()) +- fileEncoding=pDlg->GetEncoding().toUtf8().getStr(); +- } +- // we can fail because we are in headless mode, the user has cancelled conversion, ... +- else if (pDlg->hasUserCalledCancel()) +- return false; +- } +- catch (css::uno::Exception &e) +- { +- SAL_WARN("writerperfect", "ignoring Exception " << e.Message); +- } +- } +- return libwps::WPS_OK == libwps::WPSDocument::parse(&rInput, &rGenerator, "", fileEncoding.c_str()); ++ return libwps::WPS_OK == libwps::WPSDocument::parse(&rInput, &rGenerator); + } + + bool MSWorksCalcImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) + { + libwps::WPSKind kind = libwps::WPS_TEXT; +- libwps::WPSCreator creator; +- bool needEncoding; +- const libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(&rInput, kind, creator, needEncoding); ++ const libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(&rInput, kind); + +- if ((kind == libwps::WPS_SPREADSHEET || kind == libwps::WPS_DATABASE) && confidence == libwps::WPS_CONFIDENCE_EXCELLENT) ++ if ((kind == libwps::WPS_SPREADSHEET || kind == libwps::WPS_DATABASE) && (confidence == libwps::WPS_CONFIDENCE_EXCELLENT)) + { +- if (creator == libwps::WPS_MSWORKS) +- { +- rTypeName = "calc_MS_Works_Document"; +- return true; +- } +- if (creator == libwps::WPS_LOTUS || creator == libwps::WPS_SYMPHONY) +- { +- rTypeName = "calc_WPS_Lotus_Document"; +- return true; +- } +- if (creator == libwps::WPS_QUATTRO_PRO) +- { +- rTypeName = "calc_WPS_QPro_Document"; +- return true; +- } ++ rTypeName = "calc_MS_Works_Document"; ++ return true; + } + + return false; +diff --git a/writerperfect/source/common/WPFTEncodingDialog.cxx b/writerperfect/source/common/WPFTEncodingDialog.cxx +deleted file mode 100644 +index dec775b..0000000 +--- a/writerperfect/source/common/WPFTEncodingDialog.cxx ++++ /dev/null +@@ -1,180 +0,0 @@ +-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +-/* +- * This file is part of the LibreOffice project. +- * +- * This Source Code Form is subject to the terms of the Mozilla Public +- * License, v. 2.0. If a copy of the MPL was not distributed with this +- * file, You can obtain one at http://mozilla.org/MPL/2.0/. +- * +- * This file incorporates work covered by the following license notice: +- * +- * Licensed to the Apache Software Foundation (ASF) under one or more +- * contributor license agreements. See the NOTICE file distributed +- * with this work for additional information regarding copyright +- * ownership. The ASF licenses this file to you under the Apache +- * License, Version 2.0 (the "License"); you may not use this file +- * except in compliance with the License. You may obtain a copy of +- * the License at http://www.apache.org/licenses/LICENSE-2.0 . +- */ +- +-#include +- +-namespace writerperfect +-{ +- +-namespace +-{ +- +-struct EncodingImplementation +-{ +- +- static OUString const(s_encodings[]); +- +- static int numEncodings(); +- static void insertEncodings(ListBox *box); +- static void selectEncoding(ListBox *box, const OUString &encoding); +- static OUString getEncoding(ListBox *box); +-}; +- +-OUString const(EncodingImplementation::s_encodings[])= +-{ +- OUString("MacArabic"), OUString("Arabic (Apple Macintosh)"), +- OUString("CP864"), OUString("Arabic (DOS/OS2-864)"), +- OUString("CP1006"), OUString("Arabic (IBM-1006)"), +- OUString("CP1256"), OUString("Arabic (Windows-1256)"), +- OUString("CP775"), OUString("Baltic (DOS/OS2-775)"), +- OUString("CP1257"), OUString("Baltic (Windows-1257)"), +- OUString("MacCeltic"), OUString("Celtic (Apple Macintosh)"), +- OUString("MacCyrillic"), OUString("Cyrillic (Apple Macintosh)"), +- OUString("CP855"), OUString("Cyrillic (DOS/OS2-855)"), +- OUString("CP866"), OUString("Cyrillic (DOS/OS2-866/Russian)"), +- OUString("CP1251"), OUString("Cyrillic (Windows-1251)"), +- OUString("MacCEurope"), OUString("Eastern Europe (Apple Macintosh)"), +- OUString("MacCroatian"), OUString("Eastern Europe (Apple Macintosh/Croatian)"), +- OUString("MacRomanian"), OUString("Eastern Europe (Apple Macintosh/Romanian)"), +- OUString("CP852"), OUString("Eastern Europe (DOS/OS2-852)"), +- OUString("CP1250"), OUString("Eastern Europe (Windows-1250/WinLatin 2)"), +- OUString("MacGreek"), OUString("Greek (Apple Macintosh)"), +- OUString("CP737"), OUString("Greek (DOS/OS2-737)"), +- OUString("CP869"), OUString("Greek (DOS/OS2-869/Greek-2)"), +- OUString("CP875"), OUString("Greek (DOS/OS2-875)"), +- OUString("CP1253"), OUString("Greek (Windows-1253)"), +- OUString("MacHebrew"), OUString("Hebrew (Apple Macintosh)"), +- OUString("CP424"), OUString("Hebrew (DOS/OS2-424)"), +- OUString("CP856"), OUString("Hebrew (DOS/OS2-856)"), +- OUString("CP862"), OUString("Hebrew (DOS/OS2-862)"), +- OUString("CP1255"), OUString("Hebrew (Windows-1255)"), +- OUString("CP500"), OUString("International (DOS/OS2-500)"), +- OUString("MacThai"), OUString("Thai (Apple Macintosh)"), +- OUString("CP874"), OUString("Thai (DOS/OS2-874)"), +- OUString("MacTurkish"), OUString("Turkish (Apple Macintosh)"), +- OUString("CP857"), OUString("Turkish (DOS/OS2-857)"), +- OUString("CP1026"), OUString("Turkish (DOS/OS2-1026)"), +- OUString("CP1254"), OUString("Turkish (Windows-1254)"), +- OUString("CP1258"), OUString("Vietnamese (Windows-1258)"), +- OUString("MacRoman"), OUString("Western Europe (Apple Macintosh)"), +- OUString("MacIceland"), OUString("Western Europe (Apple Macintosh/Icelandic)"), +- OUString("CP037"), OUString("Western Europe (DOS/OS2-037/US-Canada)"), +- OUString("CP437"), OUString("Western Europe (DOS/OS2-437/US)"), +- OUString("CP850"), OUString("Western Europe (DOS/OS2-850)"), +- OUString("CP860"), OUString("Western Europe (DOS/OS2-860/Portuguese)"), +- OUString("CP861"), OUString("Western Europe (DOS/OS2-861/Icelandic)"), +- OUString("CP863"), OUString("Western Europe (DOS/OS2-863/French)"), +- OUString("CP865"), OUString("Western Europe (DOS/OS2-865/Nordic)"), +- OUString("CP1252"), OUString("Western Europe (Windows-1252/WinLatin 1)") +-}; +- +-int EncodingImplementation::numEncodings() +-{ +- return int(sizeof(s_encodings)/(2*sizeof(const OUString *))); +-} +- +-void EncodingImplementation::insertEncodings(ListBox *box) +-{ +- sal_IntPtr num=sal_IntPtr(numEncodings()); +- for (sal_IntPtr i=0; iInsertEntry(s_encodings[2*i+1]); +- box->SetEntryData(nAt, reinterpret_cast(i)); +- } +-} +- +-void EncodingImplementation::selectEncoding(ListBox *box, const OUString &encoding) +-{ +- sal_IntPtr num=sal_IntPtr(numEncodings()); +- for (sal_IntPtr i=0; iSelectEntryPos(i); +- return; +- } +-} +- +-OUString EncodingImplementation::getEncoding(ListBox *box) +-{ +- sal_IntPtr pos = reinterpret_cast(box->GetSelectEntryData()); +- if (pos<0||pos>=numEncodings()) +- return OUString(); +- return s_encodings[2*pos]; +-} +- +-} +- +-WPFTEncodingDialog::WPFTEncodingDialog( +- const OUString &title, const OUString &encoding) +- : ModalDialog(nullptr, "WPFTEncodingDialog", "writerperfect/ui/wpftencodingdialog.ui"), +- m_pLbCharset(), m_pBtnOk(), m_pBtnCancel(), m_userHasCancelled(false) +-{ +- get(m_pLbCharset, "comboboxtext"); +- get(m_pBtnOk, "ok"); +- get(m_pBtnCancel, "cancel"); +- +- m_pBtnCancel->SetClickHdl(LINK(this, WPFTEncodingDialog, CancelHdl)); +- +- EncodingImplementation::insertEncodings(m_pLbCharset); +- m_pLbCharset->SetStyle(m_pLbCharset->GetStyle() | WB_SORT); +- // m_pLbCharset->set_height_request(6 * m_pLbCharset->GetTextHeight()); +- m_pLbCharset->SetDoubleClickHdl(LINK(this, WPFTEncodingDialog, DoubleClickHdl)); +- EncodingImplementation::selectEncoding(m_pLbCharset, encoding); +- m_pLbCharset->Show(); +- +- SetText(title); +-} +- +-WPFTEncodingDialog::~WPFTEncodingDialog() +-{ +- disposeOnce(); +-} +- +-OUString WPFTEncodingDialog::GetEncoding() const +-{ +- return EncodingImplementation::getEncoding(m_pLbCharset); +-} +- +-IMPL_LINK_NOARG(WPFTEncodingDialog, CancelHdl) +-{ +- m_userHasCancelled=true; +- Close(); +- return 0; +-} +- +-IMPL_LINK(WPFTEncodingDialog, DoubleClickHdl, ListBox *, pLb) +-{ +- if (pLb == m_pLbCharset) +- { +- m_pBtnOk->Click(); +- } +- return 0; +-} +- +-void WPFTEncodingDialog::dispose() +-{ +- m_pLbCharset.disposeAndClear(); +- m_pBtnOk.disposeAndClear(); +- m_pBtnCancel.disposeAndClear(); +- ModalDialog::dispose(); +-} +- +-} +- +-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx b/writerperfect/source/writer/MSWorksImportFilter.cxx +index 018f790..61c54f5 100644 +--- a/writerperfect/source/writer/MSWorksImportFilter.cxx ++++ b/writerperfect/source/writer/MSWorksImportFilter.cxx +@@ -9,13 +9,11 @@ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +-#include + #include + #include + + #include + +-#include "WPFTEncodingDialog.hxx" + #include "MSWorksImportFilter.hxx" + + using com::sun::star::uno::Sequence; +@@ -35,41 +33,13 @@ static bool handleEmbeddedWKSObject(const librevenge::RVNGBinaryData &data, OdfD + + bool MSWorksImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdtGenerator &rGenerator, utl::MediaDescriptor &) + { +- libwps::WPSKind kind = libwps::WPS_TEXT; +- libwps::WPSCreator creator; +- bool needEncoding; +- const libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(&rInput, kind, creator, needEncoding); +- +- std::string fileEncoding(""); +- try +- { +- if ((kind == libwps::WPS_TEXT) && (confidence == libwps::WPS_CONFIDENCE_EXCELLENT) && needEncoding) +- { +- const ScopedVclPtrInstance pDlg( +- "Import MsWorks files(libwps)", "CP850"); +- if (pDlg->Execute() == RET_OK) +- { +- if (!pDlg->GetEncoding().isEmpty()) +- fileEncoding=pDlg->GetEncoding().toUtf8().getStr(); +- } +- // we can fail because we are in headless mode, the user has cancelled conversion, ... +- else if (pDlg->hasUserCalledCancel()) +- return false; +- } +- } +- catch (css::uno::Exception &e) +- { +- SAL_WARN("writerperfect", "ignoring Exception " << e.Message); +- } +- return libwps::WPS_OK == libwps::WPSDocument::parse(&rInput, &rGenerator, "", fileEncoding.c_str()); ++ return libwps::WPS_OK == libwps::WPSDocument::parse(&rInput, &rGenerator); + } + + bool MSWorksImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) + { + libwps::WPSKind kind = libwps::WPS_TEXT; +- libwps::WPSCreator creator; +- bool needEncoding; +- const libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(&rInput, kind, creator, needEncoding); ++ const libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(&rInput, kind); + + if ((kind == libwps::WPS_TEXT) && (confidence == libwps::WPS_CONFIDENCE_EXCELLENT)) + { +diff --git a/writerperfect/uiconfig/ui/wpftencodingdialog.ui b/writerperfect/uiconfig/ui/wpftencodingdialog.ui +deleted file mode 100644 +index 40d2652..0000000 +--- a/writerperfect/uiconfig/ui/wpftencodingdialog.ui ++++ /dev/null +@@ -1,90 +0,0 @@ +- +- +- +- +- +- False +- 6 +- False +- True +- -1 +- dialog +- +- +- False +- vertical +- 6 +- +- +- False +- end +- +- +- gtk-ok +- True +- True +- True +- True +- True +- 0.62000000476837158 +- +- +- True +- True +- 0 +- +- +- +- +- gtk-cancel +- True +- True +- True +- True +- +- +- True +- True +- 1 +- +- +- +- +- False +- False +- 2 +- +- +- +- +- True +- False +- start +- _Character set: +- True +- comboboxtext +- +- +- False +- True +- 0 +- +- +- +- +- False +- +- +- False +- True +- 1 +- +- +- +- +- +- ok +- cancel +- +- +- +-- +2.5.0 + diff --git a/SOURCES/0001-Use-the-same-advanced-Ellipse-and-Rectangle-shapes-i.patch b/SOURCES/0001-Use-the-same-advanced-Ellipse-and-Rectangle-shapes-i.patch deleted file mode 100644 index bdef5f7..0000000 --- a/SOURCES/0001-Use-the-same-advanced-Ellipse-and-Rectangle-shapes-i.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 5bf5fb4567096680d417af37744c743f00e26eeb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Wed, 14 Jan 2015 16:55:02 +0000 -Subject: [PATCH] Use the same advanced Ellipse and Rectangle shapes in writer - as draw - -i.e. reconcile writer with draw/impress wrt. - -commit 0e9faf7a0f8c76b50d9a9354d5fab5d1ad4af821 -Author: Petr Mladek -Date: Fri Apr 22 16:51:58 2011 +0200 - - sd-toolbar-advanced-shapes.diff: used advanced Ellipse and Rectangle shapes - - they allow to wrap text according to the shape which is a very nice - feature (bnc#171052) - -Change-Id: I0bddfe65030f3515bcb5a30f2886d3ad17a72b0d ---- - sw/uiconfig/sglobal/toolbar/drawbar.xml | 6 +++--- - sw/uiconfig/swform/toolbar/drawbar.xml | 6 +++--- - sw/uiconfig/swreport/toolbar/drawbar.xml | 6 +++--- - sw/uiconfig/swriter/toolbar/drawbar.xml | 6 +++--- - sw/uiconfig/swxform/toolbar/drawbar.xml | 6 +++--- - 5 files changed, 15 insertions(+), 15 deletions(-) - -diff --git a/sw/uiconfig/sglobal/toolbar/drawbar.xml b/sw/uiconfig/sglobal/toolbar/drawbar.xml -index 8731a05..b31c198 100644 ---- a/sw/uiconfig/sglobal/toolbar/drawbar.xml -+++ b/sw/uiconfig/sglobal/toolbar/drawbar.xml -@@ -21,8 +21,8 @@ - - - -- -- -+ -+ - - - -@@ -48,4 +48,4 @@ - - - -- -\ No newline at end of file -+ -diff --git a/sw/uiconfig/swform/toolbar/drawbar.xml b/sw/uiconfig/swform/toolbar/drawbar.xml -index 8731a05..b31c198 100644 ---- a/sw/uiconfig/swform/toolbar/drawbar.xml -+++ b/sw/uiconfig/swform/toolbar/drawbar.xml -@@ -21,8 +21,8 @@ - - - -- -- -+ -+ - - - -@@ -48,4 +48,4 @@ - - - -- -\ No newline at end of file -+ -diff --git a/sw/uiconfig/swreport/toolbar/drawbar.xml b/sw/uiconfig/swreport/toolbar/drawbar.xml -index 8731a05..b31c198 100644 ---- a/sw/uiconfig/swreport/toolbar/drawbar.xml -+++ b/sw/uiconfig/swreport/toolbar/drawbar.xml -@@ -21,8 +21,8 @@ - - - -- -- -+ -+ - - - -@@ -48,4 +48,4 @@ - - - -- -\ No newline at end of file -+ -diff --git a/sw/uiconfig/swriter/toolbar/drawbar.xml b/sw/uiconfig/swriter/toolbar/drawbar.xml -index 8731a05..b31c198 100644 ---- a/sw/uiconfig/swriter/toolbar/drawbar.xml -+++ b/sw/uiconfig/swriter/toolbar/drawbar.xml -@@ -21,8 +21,8 @@ - - - -- -- -+ -+ - - - -@@ -48,4 +48,4 @@ - - - -- -\ No newline at end of file -+ -diff --git a/sw/uiconfig/swxform/toolbar/drawbar.xml b/sw/uiconfig/swxform/toolbar/drawbar.xml -index 8731a05..b31c198 100644 ---- a/sw/uiconfig/swxform/toolbar/drawbar.xml -+++ b/sw/uiconfig/swxform/toolbar/drawbar.xml -@@ -21,8 +21,8 @@ - - - -- -- -+ -+ - - - -@@ -48,4 +48,4 @@ - - - -- -\ No newline at end of file -+ --- -1.9.3 - diff --git a/SOURCES/0001-add-X-TryExec-entries-to-desktop-files.patch b/SOURCES/0001-add-X-TryExec-entries-to-desktop-files.patch index 0b4707c..43e8ceb 100644 --- a/SOURCES/0001-add-X-TryExec-entries-to-desktop-files.patch +++ b/SOURCES/0001-add-X-TryExec-entries-to-desktop-files.patch @@ -20,7 +20,7 @@ index 26f1c6a..2861dfe 100644 @@ -32,6 +32,7 @@ Keywords=Data;SQL; InitialPreference=5 StartupWMClass=libreoffice-base - X-KDE-Protocols=file,http,smb,ftp,webdav + X-KDE-Protocols=file,http,ftp,webdav +X-TryExec=oobase Actions=NewDocument; @@ -32,7 +32,7 @@ index fc5e241..c50f380 100644 @@ -32,6 +32,7 @@ Keywords=Accounting;Stats;OpenDocument Spreadsheet;Chart;Microsoft Excel;Microso InitialPreference=5 StartupWMClass=libreoffice-calc - X-KDE-Protocols=file,http,smb,ftp,webdav + X-KDE-Protocols=file,http,ftp,webdav +X-TryExec=oocalc Actions=NewDocument; @@ -44,7 +44,7 @@ index b5d58ce..274275f 100644 @@ -32,6 +32,7 @@ Keywords=Vector;Schema;Diagram;Layout;OpenDocument Graphics;Microsoft Publisher; InitialPreference=5 StartupWMClass=libreoffice-draw - X-KDE-Protocols=file,http,smb,ftp,webdav + X-KDE-Protocols=file,http,ftp,webdav +X-TryExec=oodraw Actions=NewDocument; @@ -56,7 +56,7 @@ index c1f6231..7e70bfb 100644 @@ -32,6 +32,7 @@ Keywords=Slideshow;Slides;OpenDocument Presentation;Microsoft PowerPoint;Microso InitialPreference=5 StartupWMClass=libreoffice-impress - X-KDE-Protocols=file,http,smb,ftp,webdav + X-KDE-Protocols=file,http,ftp,webdav +X-TryExec=ooimpress Actions=NewDocument; @@ -68,7 +68,7 @@ index b6981f5..4d7bd3c 100644 @@ -33,6 +33,7 @@ Keywords=Equation;OpenDocument Formula;Formula;odf;MathML; InitialPreference=5 StartupWMClass=libreoffice-math - X-KDE-Protocols=file,http,smb,ftp,webdav + X-KDE-Protocols=file,http,ftp,webdav +X-TryExec=oomath Actions=NewDocument; @@ -80,7 +80,7 @@ index c4cea12..6d943a9 100644 @@ -32,6 +32,7 @@ Keywords=Text;Letter;Fax;Document;OpenDocument Text;Microsoft Word;Microsoft Wor InitialPreference=5 StartupWMClass=libreoffice-writer - X-KDE-Protocols=file,http,smb,ftp,webdav + X-KDE-Protocols=file,http,ftp,webdav +X-TryExec=oowriter Actions=NewDocument; diff --git a/SOURCES/0001-add-accel.-to-switch-monitors-to-pres.-console.patch b/SOURCES/0001-add-accel.-to-switch-monitors-to-pres.-console.patch deleted file mode 100644 index 9d75b02..0000000 --- a/SOURCES/0001-add-accel.-to-switch-monitors-to-pres.-console.patch +++ /dev/null @@ -1,56 +0,0 @@ -From c11b6b64f63b3c7f8f8bb0f1857a9c7d8748ba9c Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Thu, 12 Mar 2015 15:42:23 +0100 -Subject: [PATCH] add accel. to switch monitors to pres. console - -Change-Id: I86c458f2c0a1c6a6baa6461a44b68c5f48ea55b0 ---- - officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu | 8 ++++++++ - sdext/source/presenter/PresenterController.cxx | 5 ++++- - 2 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu -index 3eb6434..26d9483 100644 ---- a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu -+++ b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu -@@ -969,6 +969,14 @@ - Shows the Slides Overview - - -+ -+ -+ Ctrl-'4' -+ -+ -+ Switches monitors -+ -+ - - - -diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx -index 6c64bd7..e416a73 100644 ---- a/sdext/source/presenter/PresenterController.cxx -+++ b/sdext/source/presenter/PresenterController.cxx -@@ -1005,7 +1005,7 @@ void PresenterController::HandleNumericKeyPress ( - - case awt::KeyModifier::MOD1: - // Ctrl-1, Ctrl-2, and Ctrl-3 are used to switch between views -- // (slide view, notes view, normal) -+ // (slide view, notes view, normal). Ctrl-4 switches monitors - mnPendingSlideNumber = -1; - if (mpWindowManager.get() == NULL) - return; -@@ -1020,6 +1020,9 @@ void PresenterController::HandleNumericKeyPress ( - case 3: - mpWindowManager->SetViewMode(PresenterWindowManager::VM_SlideOverview); - break; -+ case 4: -+ SwitchMonitors(); -+ break; - default: - // Ignore unsupported key. - break; --- -2.3.1 - diff --git a/SOURCES/0001-allow-comparing-documents-which-only-differ-by-frame.patch b/SOURCES/0001-allow-comparing-documents-which-only-differ-by-frame.patch deleted file mode 100644 index e1ce8ce..0000000 --- a/SOURCES/0001-allow-comparing-documents-which-only-differ-by-frame.patch +++ /dev/null @@ -1,436 +0,0 @@ -From b2b455b4258993a9982efb829b333df9905fe95c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 13 Jan 2015 13:55:58 +0000 -Subject: [PATCH] allow comparing documents which only differ by frame contents - -if two documents have the same number of frames then have an additional stab at -comparing the contents of those frames - -(cherry picked from commit 16916a14a2ce382aa4ff2a25f8e477108aba5a67) - -Change-Id: Ib8ad2ba938da48a46c012961b00d81b2c386a368 ---- - sw/source/core/doc/doccomp.cxx | 238 +++++++++++++++++++++++++---------------- - 1 file changed, 146 insertions(+), 92 deletions(-) - -diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx -index 3a6e4f3..210224f 100644 ---- a/sw/source/core/doc/doccomp.cxx -+++ b/sw/source/core/doc/doccomp.cxx -@@ -35,6 +35,8 @@ - #include - #include - #include -+#include -+#include - - #include - #include -@@ -62,18 +63,32 @@ public: - - class CompareData - { -+protected: -+ SwDoc& rDoc; -+private: - size_t* pIndex; - bool* pChangedFlag; - --protected: -+ SwPaM *pInsRing, *pDelRing; -+ -+ sal_uLong PrevIdx( const SwNode* pNd ); -+ sal_uLong NextIdx( const SwNode* pNd ); -+ - vector< CompareLine* > aLines; - sal_uLong nSttLineNum; -+ bool m_bRecordDiff; - - // Truncate beginning and end and add all others to the LinesArray -- virtual void CheckRanges( CompareData& ) = 0; -+ void CheckRanges( CompareData& ); -+ -+ virtual const SwNode& GetEndOfContent() = 0; - - public: -- CompareData(); -+ CompareData(SwDoc& rD, bool bRecordDiff) -+ : rDoc( rD ), pIndex( 0 ), pChangedFlag( 0 ), pInsRing(0), pDelRing(0) -+ , nSttLineNum( 0 ), m_bRecordDiff(bRecordDiff) -+ { -+ } - virtual ~CompareData(); - - // Are there differences? -@@ -86,10 +101,10 @@ public: - // Displaying the actually content is to be handled by the subclass! - sal_uLong ShowDiffs( const CompareData& rData ); - -- virtual void ShowInsert( sal_uLong nStt, sal_uLong nEnd ); -- virtual void ShowDelete( const CompareData& rData, sal_uLong nStt, -+ void ShowInsert( sal_uLong nStt, sal_uLong nEnd ); -+ void ShowDelete( const CompareData& rData, sal_uLong nStt, - sal_uLong nEnd, sal_uLong nInsPos ); -- virtual void CheckForChangesInLine( const CompareData& rData, -+ void CheckForChangesInLine( const CompareData& rData, - sal_uLong& nStt, sal_uLong& nEnd, - sal_uLong& nThisStt, sal_uLong& nThisEnd ); - -@@ -111,6 +126,38 @@ public: - { return aLines[ nLine ]; } - void InsertLine( CompareLine* pLine ) - { aLines.push_back( pLine ); } -+ -+ void SetRedlinesToDoc( bool bUseDocInfo ); -+}; -+ -+class CompareMainText : public CompareData -+{ -+public: -+ CompareMainText(SwDoc &rD, bool bRecordDiff=true) -+ : CompareData(rD, bRecordDiff) -+ { -+ } -+ -+ virtual const SwNode& GetEndOfContent() SAL_OVERRIDE -+ { -+ return rDoc.GetNodes().GetEndOfContent(); -+ } -+}; -+ -+class CompareFrmFmtText : public CompareData -+{ -+ const SwNodeIndex &m_rIndex; -+public: -+ CompareFrmFmtText(SwDoc &rD, const SwNodeIndex &rIndex, bool bRecordDiff=true) -+ : CompareData(rD, bRecordDiff) -+ , m_rIndex(rIndex) -+ { -+ } -+ -+ virtual const SwNode& GetEndOfContent() SAL_OVERRIDE -+ { -+ return *m_rIndex.GetNode().EndOfSectionNode(); -+ } - }; - - class Hash -@@ -325,13 +372,21 @@ public: - - CompareLine::~CompareLine() {} - --CompareData::CompareData() -- : pIndex( 0 ), pChangedFlag( 0 ), nSttLineNum( 0 ) --{ --} -- - CompareData::~CompareData() - { -+ if( pDelRing ) -+ { -+ while( pDelRing->GetNext() != pDelRing ) -+ delete pDelRing->GetNext(); -+ delete pDelRing; -+ } -+ if( pInsRing ) -+ { -+ while( pInsRing->GetNext() != pInsRing ) -+ delete pInsRing->GetNext(); -+ delete pInsRing; -+ } -+ - delete[] pIndex; - delete[] pChangedFlag; - } -@@ -390,9 +445,12 @@ sal_uLong CompareData::ShowDiffs( const CompareData& rData ) - while( nStt1 < nLen1 && rData.GetChanged( nStt1 )) ++nStt1; - while( nStt2 < nLen2 && GetChanged( nStt2 )) ++nStt2; - -- // Check if there are changed lines (only slightly different) and -- // compare them in detail. -- CheckForChangesInLine( rData, nSav1, nStt1, nSav2, nStt2 ); -+ if (m_bRecordDiff) -+ { -+ // Check if there are changed lines (only slightly different) and -+ // compare them in detail. -+ CheckForChangesInLine( rData, nSav1, nStt1, nSav2, nStt2 ); -+ } - - ++nCnt; - } -@@ -419,19 +477,6 @@ bool CompareData::HasDiffs( const CompareData& rData ) const - return bRet; - } - --void CompareData::ShowInsert( sal_uLong, sal_uLong ) --{ --} -- --void CompareData::ShowDelete( const CompareData&, sal_uLong, sal_uLong, sal_uLong ) --{ --} -- --void CompareData::CheckForChangesInLine( const CompareData& , -- sal_uLong&, sal_uLong&, sal_uLong&, sal_uLong& ) --{ --} -- - Hash::Hash( sal_uLong nSize ) - : nCount(1) - { -@@ -969,30 +1014,6 @@ public: - OUString GetText() const; - }; - --class SwCompareData : public CompareData --{ -- SwDoc& rDoc; -- SwPaM *pInsRing, *pDelRing; -- -- sal_uLong PrevIdx( const SwNode* pNd ); -- sal_uLong NextIdx( const SwNode* pNd ); -- -- virtual void CheckRanges( CompareData& ) SAL_OVERRIDE; -- virtual void ShowInsert( sal_uLong nStt, sal_uLong nEnd ) SAL_OVERRIDE; -- virtual void ShowDelete( const CompareData& rData, sal_uLong nStt, -- sal_uLong nEnd, sal_uLong nInsPos ) SAL_OVERRIDE; -- -- virtual void CheckForChangesInLine( const CompareData& rData, -- sal_uLong& nStt, sal_uLong& nEnd, -- sal_uLong& nThisStt, sal_uLong& nThisEnd ) SAL_OVERRIDE; -- --public: -- SwCompareData( SwDoc& rD ) : rDoc( rD ), pInsRing(0), pDelRing(0) {} -- virtual ~SwCompareData(); -- -- void SetRedlinesToDoc( bool bUseDocInfo ); --}; -- - SwCompareLine::SwCompareLine( const SwNode& rNd ) - : rNode( rNd ) - { -@@ -1397,23 +1418,7 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine, - return bRet; - } - --SwCompareData::~SwCompareData() --{ -- if( pDelRing ) -- { -- while( pDelRing->GetNext() != pDelRing ) -- delete pDelRing->GetNext(); -- delete pDelRing; -- } -- if( pInsRing ) -- { -- while( pInsRing->GetNext() != pInsRing ) -- delete pInsRing->GetNext(); -- delete pInsRing; -- } --} -- --sal_uLong SwCompareData::NextIdx( const SwNode* pNd ) -+sal_uLong CompareData::NextIdx( const SwNode* pNd ) - { - if( pNd->IsStartNode() ) - { -@@ -1427,7 +1432,7 @@ sal_uLong SwCompareData::NextIdx( const SwNode* pNd ) - return pNd->GetIndex() + 1; - } - --sal_uLong SwCompareData::PrevIdx( const SwNode* pNd ) -+sal_uLong CompareData::PrevIdx( const SwNode* pNd ) - { - if( pNd->IsEndNode() ) - { -@@ -1441,13 +1446,13 @@ sal_uLong SwCompareData::PrevIdx( const SwNode* pNd ) - return pNd->GetIndex() - 1; - } - --void SwCompareData::CheckRanges( CompareData& rData ) -+void CompareData::CheckRanges( CompareData& rData ) - { -- const SwNodes& rSrcNds = ((SwCompareData&)rData).rDoc.GetNodes(); -+ const SwNodes& rSrcNds = rData.rDoc.GetNodes(); - const SwNodes& rDstNds = rDoc.GetNodes(); - -- const SwNode& rSrcEndNd = rSrcNds.GetEndOfContent(); -- const SwNode& rDstEndNd = rDstNds.GetEndOfContent(); -+ const SwNode& rSrcEndNd = rData.GetEndOfContent(); -+ const SwNode& rDstEndNd = GetEndOfContent(); - - sal_uLong nSrcSttIdx = NextIdx( rSrcEndNd.StartOfSectionNode() ); - sal_uLong nSrcEndIdx = rSrcEndNd.GetIndex(); -@@ -1494,7 +1499,7 @@ void SwCompareData::CheckRanges( CompareData& rData ) - } - } - --void SwCompareData::ShowInsert( sal_uLong nStt, sal_uLong nEnd ) -+void CompareData::ShowInsert( sal_uLong nStt, sal_uLong nEnd ) - { - SwPaM* pTmp = new SwPaM( ((SwCompareLine*)GetLine( nStt ))->GetNode(), 0, - ((SwCompareLine*)GetLine( nEnd-1 ))->GetEndNode(), 0, -@@ -1505,7 +1510,7 @@ void SwCompareData::ShowInsert( sal_uLong nStt, sal_uLong nEnd ) - // #i65201#: These SwPaMs are calculated smaller than needed, see comment below - } - --void SwCompareData::ShowDelete( -+void CompareData::ShowDelete( - const CompareData& rData, - sal_uLong nStt, - sal_uLong nEnd, -@@ -1538,14 +1543,14 @@ void SwCompareData::ShowDelete( - } - else - { -- pLineNd = &rDoc.GetNodes().GetEndOfContent(); -+ pLineNd = &GetEndOfContent(); - nOffset = 0; - } - - SwNodeIndex aInsPos( *pLineNd, nOffset ); - SwNodeIndex aSavePos( aInsPos, -1 ); - -- ((SwCompareData&)rData).rDoc.CopyWithFlyInFly( aRg, 0, aInsPos ); -+ rData.rDoc.CopyWithFlyInFly( aRg, 0, aInsPos ); - rDoc.SetModified(); - ++aSavePos; - -@@ -1569,7 +1574,7 @@ void SwCompareData::ShowDelete( - } - } - --void SwCompareData::CheckForChangesInLine( const CompareData& rData, -+void CompareData::CheckForChangesInLine( const CompareData& rData, - sal_uLong& rStt, sal_uLong& rEnd, - sal_uLong& rThisStt, sal_uLong& rThisEnd ) - { -@@ -1622,7 +1627,7 @@ void SwCompareData::CheckForChangesInLine( const CompareData& rData, - } - } - --void SwCompareData::SetRedlinesToDoc( bool bUseDocInfo ) -+void CompareData::SetRedlinesToDoc( bool bUseDocInfo ) - { - SwPaM* pTmp = pDelRing; - -@@ -1670,7 +1675,7 @@ void SwCompareData::SetRedlinesToDoc( bool bUseDocInfo ) - } - // #i101009# - // prevent redlines that end on structural end node -- if (& rDoc.GetNodes().GetEndOfContent() == -+ if (& GetEndOfContent() == - & pTmp->GetPoint()->nNode.GetNode()) - { - pTmp->GetPoint()->nNode--; -@@ -1702,7 +1707,7 @@ void SwCompareData::SetRedlinesToDoc( bool bUseDocInfo ) - } - // #i101009# - // prevent redlines that end on structural end node -- if (& rDoc.GetNodes().GetEndOfContent() == -+ if (& GetEndOfContent() == - & pTmp->GetPoint()->nNode.GetNode()) - { - pTmp->GetPoint()->nNode--; -@@ -1766,6 +1771,48 @@ static bool lcl_MergePortions(SwNode *const& pNode, void *) - return true; - } - -+typedef boost::shared_ptr CompareDataPtr; -+typedef std::pair CompareDataPtrPair; -+typedef std::vector Comparators; -+ -+namespace -+{ -+ Comparators buildComparators(SwDoc &rSrcDoc, SwDoc &rDestDoc) -+ { -+ Comparators aComparisons; -+ //compare main text -+ aComparisons.push_back(CompareDataPtrPair(CompareDataPtr(new CompareMainText(rSrcDoc)), -+ CompareDataPtr(new CompareMainText(rDestDoc)))); -+ -+ //if we have the same number of frames then try to compare within them -+ const SwFrmFmts *pSrcFrmFmts = rSrcDoc.GetSpzFrmFmts(); -+ const SwFrmFmts *pDestFrmFmts = rDestDoc.GetSpzFrmFmts(); -+ if (pSrcFrmFmts->size() == pDestFrmFmts->size()) -+ { -+ for (size_t i = 0; i < pSrcFrmFmts->size(); ++i) -+ { -+ const SwFrmFmt& rSrcFmt = *(*pSrcFrmFmts)[i]; -+ const SwFrmFmt& rDestFmt = *(*pDestFrmFmts)[i]; -+ const SwNodeIndex* pSrcIdx = rSrcFmt.GetCntnt().GetCntntIdx(); -+ const SwNodeIndex* pDestIdx = rDestFmt.GetCntnt().GetCntntIdx(); -+ if (!pSrcIdx && !pDestIdx) -+ continue; -+ if (!pSrcIdx || !pDestIdx) -+ break; -+ const SwNode* pSrcNode = pSrcIdx->GetNode().EndOfSectionNode(); -+ const SwNode* pDestNode = pDestIdx->GetNode().EndOfSectionNode(); -+ if (!pSrcNode && !pDestNode) -+ continue; -+ if (!pSrcNode || !pDestNode) -+ break; -+ aComparisons.push_back(CompareDataPtrPair(CompareDataPtr(new CompareFrmFmtText(rSrcDoc, *pSrcIdx)), -+ CompareDataPtr(new CompareFrmFmtText(rDestDoc, *pDestIdx)))); -+ } -+ } -+ return aComparisons; -+ } -+} -+ - // Returns (the difference count?) if something is different - long SwDoc::CompareDoc( const SwDoc& rDoc ) - { -@@ -1808,19 +1855,28 @@ long SwDoc::CompareDoc( const SwDoc& rDoc ) - rSrcDoc.SetRedlineMode( nsRedlineMode_t::REDLINE_SHOW_INSERT ); - SetRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT)); - -- SwCompareData aD0( rSrcDoc ); -- SwCompareData aD1( *this ); -- -- aD1.CompareLines( aD0 ); -+ Comparators aComparisons(buildComparators(rSrcDoc, *this)); - -- nRet = aD1.ShowDiffs( aD0 ); -+ for (Comparators::iterator aIter = aComparisons.begin(); aIter != aComparisons.end(); ++aIter) -+ { -+ CompareDataPtrPair& a = *aIter; -+ CompareData& rD0 = *a.first.get(); -+ CompareData& rD1 = *a.second.get(); -+ rD1.CompareLines( rD0 ); -+ nRet |= rD1.ShowDiffs( rD0 ); -+ } - - if( nRet ) - { -- SetRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | -+ SetRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | - nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE)); - -- aD1.SetRedlinesToDoc( !bDocWasModified ); -+ for (Comparators::iterator aIter = aComparisons.begin(); aIter != aComparisons.end(); ++aIter) -+ { -+ CompareDataPtrPair& a = *aIter; -+ CompareData& rD1 = *a.second.get(); -+ rD1.SetRedlinesToDoc( !bDocWasModified ); -+ } - SetModified(); - } - -@@ -2026,11 +2082,9 @@ long SwDoc::MergeDoc( const SwDoc& rDoc ) - rSrcDoc.SetRedlineMode( nsRedlineMode_t::REDLINE_SHOW_DELETE ); - SetRedlineMode( nsRedlineMode_t::REDLINE_SHOW_DELETE ); - -- SwCompareData aD0( rSrcDoc ); -- SwCompareData aD1( *this ); -- -+ CompareMainText aD0(rSrcDoc, false); -+ CompareMainText aD1(*this, false); - aD1.CompareLines( aD0 ); -- - if( !aD1.HasDiffs( aD0 ) ) - { - // we want to get all redlines from the SourceDoc --- -1.9.3 - diff --git a/SOURCES/0001-allow-slide-design-to-affect-multiple-standard-pages.patch b/SOURCES/0001-allow-slide-design-to-affect-multiple-standard-pages.patch new file mode 100644 index 0000000..bbb8019 --- /dev/null +++ b/SOURCES/0001-allow-slide-design-to-affect-multiple-standard-pages.patch @@ -0,0 +1,178 @@ +From f7ed8b99b628625851fb28ec1a3dead710c8871c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 23 Jun 2015 16:54:52 +0100 +Subject: [PATCH] allow slide design to affect multiple standard pages + +modify this minimally and select all standard pages +selected in the slidesorted, unselect them afterwards +and loop over the selected ones. + +This looks like it could do with a rework to disentangle +the master/standard pages stuff, but leave it as is in +this commit + +Change-Id: Ifd01fe21c91e5e6b07b2d8bba0d85facadc25998 +--- + sd/source/ui/func/fuprlout.cxx | 94 +++++++++++++++++++++++++++++------------- + 1 file changed, 66 insertions(+), 28 deletions(-) + +diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx +index 6ce661f..f087ad9 100644 +--- a/sd/source/ui/func/fuprlout.cxx ++++ b/sd/source/ui/func/fuprlout.cxx +@@ -42,6 +42,7 @@ + #include "strmname.h" + #include "app.hrc" + #include "DrawDocShell.hxx" ++#include "SlideSorterViewShell.hxx" + #include "unprlout.hxx" + #include "unchss.hxx" + #include "unmovss.hxx" +@@ -89,24 +90,6 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) + + bool bError = false; + +- // determine the active page +- sal_uInt16 nSelectedPage = SDRPAGE_NOTFOUND; +- for (sal_uInt16 nPage = 0; nPage < mpDoc->GetSdPageCount(PK_STANDARD); nPage++) +- { +- if (mpDoc->GetSdPage(nPage, PK_STANDARD)->IsSelected()) +- { +- nSelectedPage = nPage; +- break; +- } +- } +- +- DBG_ASSERT(nSelectedPage != SDRPAGE_NOTFOUND, "no selected page"); +- SdPage* pSelectedPage = mpDoc->GetSdPage(nSelectedPage, PK_STANDARD); +- OUString aOldLayoutName(pSelectedPage->GetLayoutName()); +- sal_Int32 nPos = aOldLayoutName.indexOf(SD_LT_SEPARATOR); +- if (nPos != -1) +- aOldLayoutName = aOldLayoutName.copy(0, nPos); +- + /* if we are on a master page, the changes apply for all pages and notes- + pages who are using the relevant layout */ + bool bOnMaster = false; +@@ -117,6 +100,51 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) + if (eEditMode == EM_MASTERPAGE) + bOnMaster = true; + } ++ ++ std::vector aUnselect; ++ if (!bOnMaster) ++ { ++ //We later rely on IsSelected, so transfer the selection here ++ //into the document ++ slidesorter::SlideSorterViewShell* pSlideSorterViewShell ++ = slidesorter::SlideSorterViewShell::GetSlideSorter(mpViewShell->GetViewShellBase()); ++ if (pSlideSorterViewShell) ++ { ++ boost::shared_ptr xSelection( ++ pSlideSorterViewShell->GetPageSelection()); ++ if (xSelection) ++ { ++ for (auto it = xSelection->begin(); it != xSelection->end(); ++it) ++ { ++ SdPage *pPage = *it; ++ if (pPage->IsSelected() || pPage->GetPageKind() != PK_STANDARD) ++ continue; ++ mpDoc->SetSelected(pPage, true); ++ aUnselect.push_back(pPage); ++ } ++ } ++ } ++ } ++ ++ std::vector aSelectedPages; ++ std::vector aSelectedPageNums; ++ // determine the active pages ++ for (sal_uInt16 nPage = 0; nPage < mpDoc->GetSdPageCount(PK_STANDARD); nPage++) ++ { ++ SdPage* pPage = mpDoc->GetSdPage(nPage, PK_STANDARD); ++ if (pPage->IsSelected()) ++ { ++ aSelectedPages.push_back(pPage); ++ aSelectedPageNums.push_back(nPage); ++ } ++ } ++ ++ assert(!aSelectedPages.empty() && "no selected page"); ++ OUString aOldLayoutName(aSelectedPages.back()->GetLayoutName()); ++ sal_Int32 nPos = aOldLayoutName.indexOf(SD_LT_SEPARATOR); ++ if (nPos != -1) ++ aOldLayoutName = aOldLayoutName.copy(0, nPos); ++ + bool bMasterPage = bOnMaster; + bool bCheckMasters = false; + +@@ -196,14 +224,15 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) + OUString aLayoutName; + if( pTempDoc ) + aLayoutName = aFile.getToken(1, DOCUMENT_TOKEN); +- +- mpDoc->SetMasterPage(nSelectedPage, aLayoutName, pTempDoc, bMasterPage, bCheckMasters); ++ for (auto nSelectedPage : aSelectedPageNums) ++ mpDoc->SetMasterPage(nSelectedPage, aLayoutName, pTempDoc, bMasterPage, bCheckMasters); + mpDoc->CloseBookmarkDoc(); + } + else + { + // use master page with the layout name aFile from current Doc +- mpDoc->SetMasterPage(nSelectedPage, aFile, mpDoc, bMasterPage, bCheckMasters); ++ for (auto nSelectedPage : aSelectedPageNums) ++ mpDoc->SetMasterPage(nSelectedPage, aFile, mpDoc, bMasterPage, bCheckMasters); + } + + // remove blocking +@@ -211,7 +240,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) + static_cast(mpView)->BlockPageOrderChangedHint(false); + + // if the master page was visible, show it again +- if (!bError && nSelectedPage != SDRPAGE_NOTFOUND) ++ if (!bError) + { + if (bOnMaster) + { +@@ -219,13 +248,16 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) + { + ::sd::View* pView = + static_cast(mpViewShell)->GetView(); +- sal_uInt16 nPgNum = pSelectedPage->TRG_GetMasterPage().GetPageNum(); ++ for (auto pSelectedPage : aSelectedPages) ++ { ++ sal_uInt16 nPgNum = pSelectedPage->TRG_GetMasterPage().GetPageNum(); + +- if (static_cast(mpViewShell)->GetPageKind() == PK_NOTES) +- nPgNum++; ++ if (static_cast(mpViewShell)->GetPageKind() == PK_NOTES) ++ nPgNum++; + +- pView->HideSdrPage(); +- pView->ShowSdrPage(pView->GetModel()->GetMasterPage(nPgNum)); ++ pView->HideSdrPage(); ++ pView->ShowSdrPage(pView->GetModel()->GetMasterPage(nPgNum)); ++ } + } + + // force update of TabBar +@@ -233,10 +265,16 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) + } + else + { +- pSelectedPage->SetAutoLayout(pSelectedPage->GetAutoLayout()); ++ for (auto pSelectedPage : aSelectedPages) ++ pSelectedPage->SetAutoLayout(pSelectedPage->GetAutoLayout()); + } + } + ++ //Undo transfer to document selection ++ for (auto pPage : aUnselect) ++ mpDoc->SetSelected(pPage, false); ++ ++ + // fake a mode change to repaint the page tab bar + if( mpViewShell && mpViewShell->ISA( DrawViewShell ) ) + { +-- +2.4.0 + diff --git a/SOURCES/0001-allow-to-build-with-system-opencollada.patch b/SOURCES/0001-allow-to-build-with-system-opencollada.patch deleted file mode 100644 index e2cffd1..0000000 --- a/SOURCES/0001-allow-to-build-with-system-opencollada.patch +++ /dev/null @@ -1,154 +0,0 @@ -From f24c60870531689d95c056037e48cd29ad1d17bb Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Mon, 20 Oct 2014 14:21:22 +0200 -Subject: [PATCH] allow to build with system opencollada - -Change-Id: I6101099c57d429987e06bca0652c843f4a94f8cc ---- - Makefile.fetch | 2 +- - RepositoryExternal.mk | 16 ++++++++++++++++ - config_host.mk.in | 4 +++- - configure.ac | 35 +++++++++++++++++++++++++++++++++++ - external/Module_external.mk | 2 +- - 5 files changed, 56 insertions(+), 3 deletions(-) - -diff --git a/Makefile.fetch b/Makefile.fetch -index e8ccf5b..18b12be 100644 ---- a/Makefile.fetch -+++ b/Makefile.fetch -@@ -184,7 +184,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR) - $(call fetch_Optional,NSS,NSS_TARBALL) \ - $(call fetch_Optional_pack,NUMBERTEXT_EXTENSION_PACK) \ - $(call fetch_Optional,ODFGEN,ODFGEN_TARBALL) \ -- $(call fetch_Optional,COLLADA2GLTF,OPENCOLLADA_TARBALL) \ -+ $(call fetch_Optional,OPENCOLLADA,OPENCOLLADA_TARBALL) \ - $(call fetch_Optional,OPENLDAP,OPENLDAP_TARBALL) \ - $(call fetch_Optional,OPENSSL,OPENSSL_TARBALL) \ - $(call fetch_Optional,ORCUS,ORCUS_TARBALL) \ -diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk -index 5277aea..911dab1 100644 ---- a/RepositoryExternal.mk -+++ b/RepositoryExternal.mk -@@ -3371,6 +3371,20 @@ endif # SYSTEN_LIBGLTF - - ifeq ($(ENABLE_COLLADA),TRUE) - -+ifeq ($(SYSTEM_OPENCOLLADA),TRUE) -+ -+define gb_LinkTarget__use_opencollada_parser -+$(call gb_LinkTarget_set_include,$(1),\ -+ $$(INCLUDE) \ -+ $(OPENCOLLADA_CFLAGS) \ -+) -+ -+$(call gb_LinkTarget_add_libs,$(1),$(OPENCOLLADA_LIBS)) -+ -+endef -+ -+else # !SYSTEM_OPENCOLLADA -+ - define gb_LinkTarget__use_opencollada_parser - $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADABaseUtils/include \ -@@ -3385,6 +3399,8 @@ $(call gb_LinkTarget_use_static_libraries,$(1),\ - ) - endef - -+endif # SYSTEM_OPENCOLLADA -+ - define gb_LinkTarget__use_collada2gltf - $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,collada2gltf) \ -diff --git a/config_host.mk.in b/config_host.mk.in -index 0fefbb0..738c80c 100644 ---- a/config_host.mk.in -+++ b/config_host.mk.in -@@ -431,6 +431,8 @@ export OOOP_SAMPLES_PACK=@OOOP_SAMPLES_PACK@ - export OOO_JUNIT_JAR=@OOO_JUNIT_JAR@ - export OOO_VENDOR=@OOO_VENDOR@ -+export OPENCOLLADA_CFLAGS=$(gb_SPACE)@OPENCOLLADA_CFLAGS@ -+export OPENCOLLADA_LIBS=$(gb_SPACE)@OPENCOLLADA_LIBS@ - export OPENSSL_CFLAGS=$(gb_SPACE)@OPENSSL_CFLAGS@ - export OPENSSL_LIBS=$(gb_SPACE)@OPENSSL_LIBS@ - export ORCUS_CFLAGS=$(gb_SPACE)@ORCUS_CFLAGS@ - export ORCUS_LIBS=$(gb_SPACE)@ORCUS_LIBS@ -@@ -558,4 +559,5 @@ export SYSTEM_NPAPI_HEADERS=@SYSTEM_NPAPI_HEADERS@ - export SYSTEM_ODBC_HEADERS=@SYSTEM_ODBC_HEADERS@ - export SYSTEM_ODFGEN=@SYSTEM_ODFGEN@ -+export SYSTEM_OPENCOLLADA=@SYSTEM_OPENCOLLADA@ - export SYSTEM_OPENLDAP=@SYSTEM_OPENLDAP@ - export SYSTEM_OPENSSL=@SYSTEM_OPENSSL@ -diff --git a/configure.ac b/configure.ac -index 17feb1a..5d2198b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1641,6 +1641,11 @@ AC_ARG_WITH(system-ucpp, - [Use ucpp already on system.]),, - []) - -+AC_ARG_WITH(system-opencollada, -+ AS_HELP_STRING([--with-system-opencollada], -+ [Use openCOLLADA already on system.]),, -+ [with_system_opencollada=no]) -+ - AC_ARG_WITH(system-openldap, - AS_HELP_STRING([--with-system-openldap], - [Use the OpenLDAP LDAP SDK already on system.]),, -@@ -10342,11 +10347,41 @@ if test "$enable_collada" != "no" -a "$ENABLE_GLTF" = "TRUE"; then - AC_MSG_RESULT([yes]) - ENABLE_COLLADA=TRUE - AC_DEFINE(HAVE_FEATURE_COLLADA,1) -+ AC_MSG_CHECKING([which OPENCOLLADA to use]) -+ if test "$with_system_opencollada" = "yes"; then -+ AC_MSG_RESULT([external]) -+ SYSTEM_OPENCOLLADA=TRUE -+ AS_IF([test -n "$OPENCOLLADA_CFLAGS"],[],[AC_MSG_ERROR([export OPENCOLLADA_CFLAGS])]) -+ AS_IF([test -n "$OPENCOLLADA_LIBS"],[],[AC_MSG_ERROR([export OPENCOLLADA_LIBS])]) -+ AC_LANG_PUSH([C++]) -+ save_CXXFLAGS=$CXXFLAGS -+ save_CPPFLAGS=$CPPFLAGS -+ CXXFLAGS="$CXXFLAGS $OPENCOLLADA_CFLAGS" -+ CPPFLAGS="$CPPFLAGS $OPENCOLLADA_CFLAGS" -+ AC_CHECK_HEADERS( -+ COLLADABU.h \ -+ COLLADAFW.h \ -+ COLLADASaxFWLLoader.h \ -+ GeneratedSaxParser.h, -+ [], -+ [AC_MSG_ERROR([openCOLLADA headers not found. Install openCOLLADA])], -+ []) -+ CXXFLAGS=$save_CXXFLAGS -+ CPPFLAGS=$save_CPPFLAGS -+ AC_LANG_POP([C++]) -+ OPENCOLLADA_CFLAGS=$(printf '%s' "$OPENCOLLADA_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g") -+ else -+ AC_MSG_RESULT([internal]) -+ BUILD_TYPE="$BUILD_TYPE OPENCOLLADA" -+ fi - BUILD_TYPE="$BUILD_TYPE COLLADA2GLTF" - else - AC_MSG_RESULT([no]) - fi - AC_SUBST(ENABLE_COLLADA) -+AC_SUBST([OPENCOLLADA_CFLAGS]) -+AC_SUBST([OPENCOLLADA_LIBS]) -+AC_SUBST([SYSTEM_OPENCOLLADA]) - - # pdf import? - AC_MSG_CHECKING([whether to build the PDF import feature]) -diff --git a/external/Module_external.mk b/external/Module_external.mk -index c95ea20..688e335 100644 ---- a/external/Module_external.mk -+++ b/external/Module_external.mk -@@ -75,7 +75,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ - $(call gb_Helper_optional,NEON,neon) \ - $(call gb_Helper_optional,NSS,nss) \ - $(call gb_Helper_optional,ODFGEN,libodfgen) \ -- $(call gb_Helper_optional,COLLADA2GLTF,opencollada) \ -+ $(call gb_Helper_optional,OPENCOLLADA,opencollada) \ - $(call gb_Helper_optional,OPENLDAP,openldap) \ - $(call gb_Helper_optional,OPENSSL,openssl) \ - $(call gb_Helper_optional,ORCUS,liborcus) \ --- -1.9.3 - diff --git a/SOURCES/0001-avoid-problems-detecting-HTML-files-with-.xls-ext.patch b/SOURCES/0001-avoid-problems-detecting-HTML-files-with-.xls-ext.patch deleted file mode 100644 index e25edee..0000000 --- a/SOURCES/0001-avoid-problems-detecting-HTML-files-with-.xls-ext.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 15bb6158591e9d8350f817ca20129c2e947cceda Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Tue, 8 Jul 2014 17:01:27 +0200 -Subject: [PATCH] avoid problems detecting HTML files with .xls ext. - -Change-Id: I9955223aac20f3f640fde51bb7231666c269ca70 ---- - filter/Configuration_filter.mk | 1 + - filter/source/config/fragments/types/calc_HTML.xcu | 35 ++++++++++++++++++++++ - filter/source/textfilterdetect/filterdetect.cxx | 6 ++-- - 3 files changed, 38 insertions(+), 4 deletions(-) - create mode 100644 filter/source/config/fragments/types/calc_HTML.xcu - -diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk -index 39fabfc..787a175 100644 ---- a/filter/Configuration_filter.mk -+++ b/filter/Configuration_filter.mk -@@ -520,6 +520,7 @@ $(eval $(call filter_Configuration_add_ui_filters,fcfg_langpack,filter/source/co - $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,filter/source/config/fragments/types,\ - calc_DIF \ - calc_ODS_FlatXML \ -+ calc_HTML \ - generic_HTML \ - generic_Text \ - calc_Lotus \ -diff --git a/filter/source/config/fragments/types/calc_HTML.xcu b/filter/source/config/fragments/types/calc_HTML.xcu -new file mode 100644 -index 0000000..51bf8f1 ---- /dev/null -+++ b/filter/source/config/fragments/types/calc_HTML.xcu -@@ -0,0 +1,35 @@ -+ -+ -+ -+ com.sun.star.comp.filters.PlainTextFilterDetect -+ -+ xls -+ text/html -+ false -+ -+ -+ HTML Table -+ -+ -+ -diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx -index ffad7fa..1d29dd4 100644 ---- a/filter/source/textfilterdetect/filterdetect.cxx -+++ b/filter/source/textfilterdetect/filterdetect.cxx -@@ -132,7 +132,7 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence xInStream(aMediaDesc[MediaDescriptor::PROP_INPUTSTREAM()], uno::UNO_QUERY); - if (!xInStream.is() || !IsHTMLStream(xInStream)) -@@ -141,12 +141,10 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence +Date: Fri, 13 Nov 2015 09:56:53 +0000 +Subject: [PATCH] backport 5-1 idle/timers loop to 5-0 + +slideshow: cleanup main-loop usage, post-yield listeners, etc. + + This removes several attempts at reducing jitter in slideshow +animations. Now we have high-resolution (ie. not clamped to 10ms) +timers on Windows and a cleaner and simpler main-loop, we should +be able to use generic timer code-paths for all of this. + + This also allows us to further cleanup and simplify the main-loop +removing the now redundent post-yield handler concept. If there is a +short enough timeout, we will take just 1ms of delay before executing +a short timer anyway. + + Also removed some lingering comments from an old attempt to boost +priorities which broken audio playback. + + Tested: tdf#32861 - still works, audio still plays, no new jitter + in animations that I tested. + +Reviewed-on: https://gerrit.libreoffice.org/19947 +Tested-by: Jenkins +Reviewed-by: Michael Meeks +(cherry picked from commit 12dcf5e6e770b1933252a1f919663ba45ded4cdf) + +Change-Id: Iadc5e2a48828a18a599a86a8df14cb2b75dd425e +--- + .../source/primitive2d/textlayoutdevice.cxx | 5 +- + framework/source/services/autorecovery.cxx | 1 + + include/sal/log-areas.dox | 1 + + include/vcl/idle.hxx | 5 +- + include/vcl/scheduler.hxx | 48 +++--- + include/vcl/svapp.hxx | 74 +--------- + include/vcl/timer.hxx | 9 +- + sd/source/ui/slideshow/slideshowimpl.cxx | 47 +----- + sd/source/ui/slideshow/slideshowimpl.hxx | 3 +- + toolkit/source/awt/vclxtoolkit.cxx | 2 +- + vcl/headless/svpinst.cxx | 7 +- + vcl/inc/headless/svpinst.hxx | 2 +- + vcl/inc/osx/salinst.h | 2 +- + vcl/inc/salinst.hxx | 13 +- + vcl/inc/saltimer.hxx | 17 +++ + vcl/inc/svdata.hxx | 4 - + vcl/inc/unx/gtk/gtkdata.hxx | 2 +- + vcl/inc/unx/gtk/gtkinst.hxx | 2 +- + vcl/inc/unx/saldisp.hxx | 4 +- + vcl/inc/unx/salinst.h | 2 +- + vcl/inc/win/salinst.h | 2 +- + vcl/osx/salinst.cxx | 13 +- + vcl/qa/cppunit/timer.cxx | 2 +- + vcl/source/app/idle.cxx | 26 ++-- + vcl/source/app/scheduler.cxx | 164 +++++++++++++++------ + vcl/source/app/svapp.cxx | 99 +++++++------ + vcl/source/app/svmain.cxx | 5 - + vcl/source/app/timer.cxx | 84 ++++------- + vcl/unx/generic/app/saldata.cxx | 13 +- + vcl/unx/generic/app/saldisp.cxx | 9 +- + vcl/unx/generic/app/salinst.cxx | 6 +- + vcl/unx/gtk/a11y/atkwrapper.cxx | 2 +- + vcl/unx/gtk/app/gtkdata.cxx | 14 +- + vcl/unx/gtk/app/gtkinst.cxx | 6 +- + vcl/unx/kde4/KDESalDisplay.cxx | 9 +- + vcl/unx/kde4/KDESalDisplay.hxx | 2 +- + vcl/unx/kde4/KDEXLib.cxx | 16 +- + vcl/unx/kde4/KDEXLib.hxx | 4 +- + vcl/win/source/app/salinst.cxx | 19 ++- + 39 files changed, 390 insertions(+), 355 deletions(-) + +diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx +index 2eefc3f..99dad74 100644 +--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx ++++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx +@@ -72,8 +72,9 @@ namespace + }; + + ImpTimedRefDev::ImpTimedRefDev(scoped_timed_RefDev& rOwnerOfMe) +- : mrOwnerOfMe(rOwnerOfMe), +- mpVirDev(0L), ++ : Timer( "Timer to destroy drawinglayer reference device" ), ++ mrOwnerOfMe(rOwnerOfMe), ++ mpVirDev(nullptr), + mnUseCount(0L) + { + SetTimeout(3L * 60L * 1000L); // three minutes +diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx +index 8b75271..36adb9b 100644 +--- a/framework/source/services/autorecovery.cxx ++++ b/framework/source/services/autorecovery.cxx +@@ -1261,6 +1261,7 @@ AutoRecovery::AutoRecovery(const css::uno::Reference< css::uno::XComponentContex + , m_bListenForConfigChanges (false ) + , m_nAutoSaveTimeIntervall (0 ) + , m_eJob (AutoRecovery::E_NO_JOB ) ++ , m_aTimer ( "Auto save timer" ) + , m_aAsyncDispatcher ( LINK( this, AutoRecovery, implts_asyncDispatch ) ) + , m_eTimerType (E_DONT_START_TIMER ) + , m_nIdPool (0 ) +diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox +index d734876..6cb1348 100644 +--- a/include/sal/log-areas.dox ++++ b/include/sal/log-areas.dox +@@ -403,6 +403,7 @@ certain functionality. + @li @c vcl.osx + @li @c vcl.osx.print + @li @c vcl.quartz ++@li @c vcl.schedule - scheduler / main-loop information + @li @c vcl.scrollbar - Scroll Bars + @li @c vcl.sm - Session Manager + @li @c vcl.unity +diff --git a/include/vcl/idle.hxx b/include/vcl/idle.hxx +index 2e853b7..ba892a9 100644 +--- a/include/vcl/idle.hxx ++++ b/include/vcl/idle.hxx +@@ -39,8 +39,9 @@ public: + void SetIdleHdl( const Link& rLink ) { maIdleHdl = rLink; } + const Link& GetIdleHdl() const { return maIdleHdl; } + virtual void Invoke() SAL_OVERRIDE; +- virtual bool ReadyForSchedule( bool bTimer ) SAL_OVERRIDE; +- virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) SAL_OVERRIDE; ++ virtual bool ReadyForSchedule( bool bTimerOnly, sal_uInt64 nTimeNow ) const SAL_OVERRIDE; ++ virtual bool IsIdle() const SAL_OVERRIDE; ++ virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) const SAL_OVERRIDE; + Idle& operator=( const Idle& rIdle ); + }; + +diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx +index 973565b..d9a8678 100644 +--- a/include/vcl/scheduler.hxx ++++ b/include/vcl/scheduler.hxx +@@ -22,21 +22,9 @@ + + #include + +-struct ImplSVData; + class Scheduler; +-struct ImplSchedulerData +-{ +- ImplSchedulerData* mpNext; // Pointer to the next element in list +- Scheduler* mpScheduler; // Pointer to VCL Scheduler instance +- bool mbDelete; // Destroy this scheduler? +- bool mbInScheduler; // Scheduler currently processed? +- sal_uInt64 mnUpdateTime; // Last Update Time +- sal_uInt32 mnUpdateStack; // Update Stack +- +- void Invoke(); +- +- static ImplSchedulerData *GetMostImportantTask( bool bTimer ); +-}; ++struct ImplSVData; ++struct ImplSchedulerData; + + enum class SchedulerPriority { + HIGHEST = 0, +@@ -51,23 +39,39 @@ enum class SchedulerPriority { + + class VCL_DLLPUBLIC Scheduler + { ++private: ++ static void InitSystemTimer(ImplSVData* pSVData); ++ + protected: + ImplSchedulerData* mpSchedulerData; /// Pointer to element in scheduler list + const sal_Char *mpDebugName; /// Useful for debugging + SchedulerPriority mePriority; /// Scheduler priority + bool mbActive; /// Currently in the scheduler + ++ // These should be constexpr static, when supported. ++ static const sal_uInt64 ImmediateTimeoutMs = 1; ++ static const sal_uInt64 MaximumTimeoutMs = 1000 * 60; // 1 minute ++ ++ static void ImplStartTimer(sal_uInt64 nMS, bool bForce = false); ++ + friend struct ImplSchedulerData; + virtual void SetDeletionFlags(); +- virtual bool ReadyForSchedule( bool bTimer ) = 0; +- virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) = 0; ++ /// Is this item ready to be dispatched at @nTimeNow ++ virtual bool ReadyForSchedule( bool bTimerOnly, sal_uInt64 nTimeNow ) const = 0; ++ /// Schedule only when other timers and events are processed ++ virtual bool IsIdle() const = 0; ++ /** ++ * Adjust @nMinPeriod downwards if we want to be notified before ++ * then, @nTimeNow is the current time. ++ */ ++ virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTimeNow ) const = 0; + + public: + Scheduler( const sal_Char *pDebugName = NULL ); + Scheduler( const Scheduler& rScheduler ); + virtual ~Scheduler(); + +- void SetPriority( SchedulerPriority ePriority ); ++ void SetPriority(SchedulerPriority ePriority) { mePriority = ePriority; } + SchedulerPriority GetPriority() const { return mePriority; } + + void SetDebugName( const sal_Char *pDebugName ) { mpDebugName = pDebugName; } +@@ -82,13 +86,17 @@ public: + bool IsActive() const { return mbActive; } + void SetInActive() { mbActive = false; } + +- Scheduler& operator=( const Scheduler& rScheduler ); ++ Scheduler& operator=( const Scheduler& rScheduler ); + static void ImplDeInitScheduler(); + + // Process one pending Timer with highhest priority + static void CallbackTaskScheduling( bool ignore ); +- /// Process one pending task ahead of time with highhest priority. +- static void ProcessTaskScheduling( bool bTimer ); ++ /// Calculate minimum timeout - and return its value. ++ static sal_uInt64 CalculateMinimumTimeout( bool &bHasActiveIdles ); ++ /// Process one pending task ahead of time with highest priority. ++ static bool ProcessTaskScheduling( bool bTimerOnly ); ++ /// Process all events until we are idle ++ static void ProcessEventsToIdle(); + }; + + #endif // INCLUDED_VCL_SCHEDULER_HXX +diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx +index 78f758c..716a987 100644 +--- a/include/vcl/svapp.hxx ++++ b/include/vcl/svapp.hxx +@@ -459,8 +459,6 @@ public: + + @see Quit, Reschedule, Yield, EndYield, GetSolarMutex, + GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static void Execute(); + +@@ -468,8 +466,6 @@ public: + + @see Execute, Reschedule, Yield, EndYield, GetSolarMutex, + GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static void Quit(); + +@@ -481,8 +477,6 @@ public: + + @see Execute, Quit, Yield, EndYield, GetSolarMutex, + GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static void Reschedule( bool bAllEvents = false ); + +@@ -490,8 +484,6 @@ public: + + @see Execute, Quit, Reschedule, EndYield, GetSolarMutex, + GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static void Yield(); + +@@ -499,11 +491,15 @@ public: + + @see Execute, Quit, Reschedule, Yield, GetSolarMutex, + GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static void EndYield(); + ++ /** Acquire SolarMutex after it has been temporarily dropped completely. ++ ++ This will Reschedule() on WNT and just acquire on other platforms. ++ */ ++ static void ReAcquireSolarMutex(sal_uLong nReleased); ++ + /** @brief Get the Solar Mutex for this thread. + + Get the Solar Mutex that prevents other threads from accessing VCL +@@ -513,8 +509,6 @@ public: + + @see Execute, Quit, Reschedule, Yield, EndYield, + GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static comphelper::SolarMutex& GetSolarMutex(); + +@@ -524,8 +518,6 @@ public: + + @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, + ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static oslThreadIdentifier GetMainThreadIdentifier(); + +@@ -538,8 +530,6 @@ public: + + @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, + GetMainThreadIdentifier, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static sal_uLong ReleaseSolarMutex(); + +@@ -550,59 +540,9 @@ public: + + @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, + GetMainThreadIdentifier, ReleaseSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, AddPostYieldListener, +- RemovePostYieldListener + */ + static void AcquireSolarMutex( sal_uLong nCount ); + +- /** @brief Enables "no yield" mode +- +- "No yield" mode prevents Yield() from waiting for events. +- +- @remarks This was originally implemented in OOo bug 98792 to improve +- Impress slideshows. +- +- @see DisableNoYieldMode, Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, +- GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- DisableNoYield, AddPostYieldListener, RemovePostYieldListener +- */ +- static void EnableNoYieldMode(); +- +- /** @brief Disables "no yield" mode +- +- "No yield" mode prevents Yield() from waiting for events. +- +- @remarks This was originally implemented in OOo bug 98792 to improve +- Impress slideshows. +- +- @see EnableNoYieldMode, Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, +- GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYield, AddPostYieldListener, RemovePostYieldListener +- */ +- +- static void DisableNoYieldMode(); +- +- /** Add a listener for yield events +- +- @param i_rListener Listener to add +- +- @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, +- GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- EnableNoYieldMode, DisableNoYieldMode, RemovePostYieldListener +- */ +- static void AddPostYieldListener( const Link<>& i_rListener ); +- +- /** Remove listener for yield events +- +- @param i_rListener Listener to remove +- +- @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, +- GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, +- AddPostYieldListener, EnableNoYieldMode, DisableNoYieldMode +- */ +- static void RemovePostYieldListener( const Link<>& i_rListener ); +- +- + /** Queries whether the application is in "main", i.e. not yet in + the event loop + +@@ -1687,7 +1627,7 @@ public: + + ~SolarMutexReleaser() + { +- Application::AcquireSolarMutex( mnReleased ); ++ Application::ReAcquireSolarMutex(mnReleased); + } + }; + +diff --git a/include/vcl/timer.hxx b/include/vcl/timer.hxx +index 8835291..d3abf1f 100644 +--- a/include/vcl/timer.hxx ++++ b/include/vcl/timer.hxx +@@ -31,11 +31,9 @@ protected: + bool mbAuto; + + virtual void SetDeletionFlags() SAL_OVERRIDE; +- virtual bool ReadyForSchedule( bool bTimer ) SAL_OVERRIDE; +- virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) SAL_OVERRIDE; +- +-private: +- static void InitSystemTimer(); ++ virtual bool ReadyForSchedule( bool bTimerOnly, sal_uInt64 nTimeNow ) const SAL_OVERRIDE; ++ virtual bool IsIdle() const SAL_OVERRIDE; ++ virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) const SAL_OVERRIDE; + + public: + Timer( const sal_Char *pDebugName = NULL ); +@@ -51,7 +49,6 @@ public: + void Timeout() { Invoke(); } + Timer& operator=( const Timer& rTimer ); + virtual void Start() SAL_OVERRIDE; +- static void ImplStartTimer( ImplSVData* pSVData, sal_uInt64 nMS ); + }; + + /// An auto-timer is a multi-shot timer re-emitting itself at +diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx +index bf61d37..c1e1064 100644 +--- a/sd/source/ui/slideshow/slideshowimpl.cxx ++++ b/sd/source/ui/slideshow/slideshowimpl.cxx +@@ -538,6 +538,8 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, + mpOldActiveWindow = mpViewShell->GetActiveWindow(); + + maUpdateTimer.SetTimeoutHdl(LINK(this, SlideshowImpl, updateHdl)); ++ // Priority must not be too high or we'll starve input handling etc. ++ maUpdateTimer.SetPriority(SchedulerPriority::REPAINT); + + maDeactivateTimer.SetTimeoutHdl(LINK(this, SlideshowImpl, deactivateHdl)); + maDeactivateTimer.SetTimeout( 20 ); +@@ -746,9 +748,6 @@ void SAL_CALL SlideshowImpl::disposing() + + setActiveXToolbarsVisible( true ); + +- Application::DisableNoYieldMode(); +- Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); +- + mbDisposed = true; + } + +@@ -1789,22 +1788,6 @@ IMPL_LINK_NOARG_TYPED(SlideshowImpl, updateHdl, Timer *, void) + updateSlideShow(); + } + +-IMPL_LINK_NOARG(SlideshowImpl, PostYieldListener) +-{ +- // prevent me from deletion when recursing (App::Reschedule does) +- const rtl::Reference this_(this); +- +- Application::DisableNoYieldMode(); +- Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); +- Application::Reschedule(true); // fix for fdo#32861 - process +- // *all* outstanding events after +- // yield is done. +- if (mbDisposed) +- return 0; +- Application::Reschedule(true); +- return updateSlideShow(); +-} +- + sal_Int32 SlideshowImpl::updateSlideShow() + { + // prevent me from deletion when recursing (App::EnableYieldMode does) +@@ -1816,26 +1799,13 @@ sal_Int32 SlideshowImpl::updateSlideShow() + + try + { +- // TODO(Q3): Evaluate under various systems and setups, +- // whether this is really necessary. Under WinXP and Matrox +- // G550, the frame rates were much more steadier with this +- // tweak, although. +- +- // currently no solution, because this kills sound (at least on Windows) +- + double fUpdate = 0.0; + if( !xShow->update(fUpdate) ) + fUpdate = -1.0; + + if (mxShow.is() && (fUpdate >= 0.0)) + { +- if (::basegfx::fTools::equalZero(fUpdate)) +- { +- // Use post yield listener for short update intervalls. +- Application::EnableNoYieldMode(); +- Application::AddPostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); +- } +- else ++ if (!::basegfx::fTools::equalZero(fUpdate)) + { + // Avoid busy loop when the previous call to update() + // returns a small positive number but not 0 (which is +@@ -1852,14 +1822,11 @@ sal_Int32 SlideshowImpl::updateSlideShow() + // too high (only then conversion to milliseconds and long + // integer may lead to zero value.) + OSL_ASSERT(static_cast(fUpdate * 1000.0) > 0); +- +- Application::DisableNoYieldMode(); +- Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); +- +- // Use a timer for the asynchronous callback. +- maUpdateTimer.SetTimeout(static_cast(fUpdate * 1000.0)); +- maUpdateTimer.Start(); + } ++ ++ // Use our high resolution timers for the asynchronous callback. ++ maUpdateTimer.SetTimeout(static_cast(fUpdate * 1000.0)); ++ maUpdateTimer.Start(); + } + } + catch( Exception& ) +diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx +index 3e8f00f..f75b1b7 100644 +--- a/sd/source/ui/slideshow/slideshowimpl.hxx ++++ b/sd/source/ui/slideshow/slideshowimpl.hxx +@@ -275,7 +275,6 @@ private: + void setActiveXToolbarsVisible( bool bVisible ); + + DECL_LINK_TYPED(updateHdl, Timer *, void); +- DECL_LINK( PostYieldListener, void* ); + DECL_LINK_TYPED(ReadyForNextInputHdl, Timer *, void); + DECL_LINK( endPresentationHdl, void* ); + DECL_LINK( ContextMenuSelectHdl, Menu * ); +@@ -311,7 +310,7 @@ private: + static void setAutoSaveState( bool bOn ); + void gotoPreviousSlide (const bool bSkipAllMainSequenceEffects); + +- /** Called by PostYieldListener and updateHdl handlers this method is ++ /** Called by our maUpdateTimer's updateHdl handler this method is + responsible to call the slideshow update() method and, depending on + its return value, wait for a certain amount of time before another + call to update() is scheduled. +diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx +index ee1f9b8..f11e167 100644 +--- a/toolkit/source/awt/vclxtoolkit.cxx ++++ b/toolkit/source/awt/vclxtoolkit.cxx +@@ -1892,7 +1892,7 @@ void SAL_CALL VCLXToolkit::processEventsToIdle() + throw (::com::sun::star::uno::RuntimeException, std::exception) + { + SolarMutexGuard aSolarGuard; +- Scheduler::ProcessTaskScheduling(false); ++ Scheduler::ProcessEventsToIdle(); + } + + } +diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx +index 7c94f66..39dfe25 100644 +--- a/vcl/headless/svpinst.cxx ++++ b/vcl/headless/svpinst.cxx +@@ -259,8 +259,10 @@ SalBitmap* SvpSalInstance::CreateSalBitmap() + #endif + } + +-void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased) + { ++ (void) nReleased; ++ assert(nReleased == 0); // not implemented + // first, check for already queued events. + + // release yield mutex +@@ -324,6 +326,9 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) + + DoReleaseYield(nTimeoutMS); + } ++ ++ return bEvent ? SalYieldResult::EVENT : ++ SalYieldResult::TIMEOUT; + } + + void SvpSalInstance::DoReleaseYield( int nTimeoutMS ) +diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx +index 44795d5..0d11b1d 100644 +--- a/vcl/inc/headless/svpinst.hxx ++++ b/vcl/inc/headless/svpinst.hxx +@@ -157,7 +157,7 @@ public: + // wait next event and dispatch + // must returned by UserEvent (SalFrame::PostEvent) + // and timer +- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; ++ virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) SAL_OVERRIDE; + virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE; + + // may return NULL to disable session management +diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h +index b2d6133..9df7d02 100644 +--- a/vcl/inc/osx/salinst.h ++++ b/vcl/inc/osx/salinst.h +@@ -109,7 +109,7 @@ public: + virtual sal_uLong ReleaseYieldMutex() SAL_OVERRIDE; + virtual void AcquireYieldMutex( sal_uLong nCount ) SAL_OVERRIDE; + virtual bool CheckYieldMutex() SAL_OVERRIDE; +- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; ++ virtual +SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) SAL_OVERRIDE; + virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE; + virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pVCLMenu ) SAL_OVERRIDE; + virtual void DestroyMenu( SalMenu* ) SAL_OVERRIDE; +diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx +index eb53177..f49bb4c 100644 +--- a/vcl/inc/salinst.hxx ++++ b/vcl/inc/salinst.hxx +@@ -58,6 +58,8 @@ struct SystemWindowData; + class Menu; + enum class VclInputFlags; + ++enum SalYieldResult { EVENT, TIMEOUT }; ++ + class VCL_PLUGIN_PUBLIC SalInstance + { + private: +@@ -124,10 +126,13 @@ public: + // return true, if yield mutex is owned by this thread, else false + virtual bool CheckYieldMutex() = 0; + +- // wait next event and dispatch +- // must returned by UserEvent (SalFrame::PostEvent) +- // and timer +- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) = 0; ++ /** ++ * Wait for the next event (if @bWait) and dispatch it, ++ * includes posted events, and timers. ++ * If @bHandleAllCurrentEvents - dispatch multiple posted ++ * user events. Returns true if events needed processing. ++ */ ++ virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) = 0; + virtual bool AnyInput( VclInputFlags nType ) = 0; + + // menus +diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx +index 1e1a941..3907ec1 100644 +--- a/vcl/inc/saltimer.hxx ++++ b/vcl/inc/saltimer.hxx +@@ -54,6 +54,23 @@ public: + } + }; + ++class Scheduler; ++ ++// Internal scheduler record holding intrusive linked list pieces ++struct ImplSchedulerData ++{ ++ ImplSchedulerData* mpNext; // Pointer to the next element in list ++ Scheduler* mpScheduler; // Pointer to VCL Scheduler instance ++ bool mbDelete; // Destroy this scheduler? ++ bool mbInScheduler; // Scheduler currently processed? ++ sal_uInt64 mnUpdateTime; // Last Update Time ++ ++ void Invoke(); ++ ++ const char *GetDebugName() const; ++ static ImplSchedulerData *GetMostImportantTask( bool bTimer ); ++}; ++ + #endif // INCLUDED_VCL_INC_SALTIMER_HXX + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx +index 5e3282a..99cb2e3 100644 +--- a/vcl/inc/svdata.hxx ++++ b/vcl/inc/svdata.hxx +@@ -125,7 +125,6 @@ struct ImplSVAppData + VclPtr mpWheelWindow; // WheelWindow + ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung + ImplEventHook* mpFirstEventHook; // Event-Hooks +- VclEventListeners2* mpPostYieldListeners; // post yield listeners + sal_uInt64 mnLastInputTime; // GetLastInputTime() + sal_uInt16 mnDispatchLevel; // DispatchLevel + sal_uInt16 mnModalMode; // ModalMode Count +@@ -137,8 +136,6 @@ struct ImplSVAppData + bool mbInAppExecute; // is Application::Execute() on stack + bool mbAppQuit; // is Application::Quit() called + bool mbSettingsInit; // true: Settings are initialized +- bool mbNoYield; // Application::Yield will not wait for events if the queue is empty +- // essentially that makes it the same as Application::Reschedule + Application::DialogCancelMode meDialogCancel; // true: All Dialog::Execute() calls will be terminated immediately with return false + + /** Controls whether showing any IME status window is toggled on or off. +@@ -321,7 +318,6 @@ struct ImplSVData + SalSystem* mpSalSystem; // SalSystem interface + ResMgr* mpResMgr; // SV-Resource-Manager + sal_uInt64 mnTimerPeriod; // current timer period +- sal_uInt32 mnUpdateStack; // Scheduler on stack + ImplSVAppData maAppData; // indepen data for class Application + ImplSVGDIData maGDIData; // indepen data for Output classes + ImplSVWinData maWinData; // indepen data for Windows classes +diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx +index 697fece..3a800b3 100644 +--- a/vcl/inc/unx/gtk/gtkdata.hxx ++++ b/vcl/inc/unx/gtk/gtkdata.hxx +@@ -115,7 +115,7 @@ public: + static gboolean userEventFn( gpointer data ); + + void PostUserEvent(); +- void Yield( bool bWait, bool bHandleAllCurrentEvents ); ++ SalYieldResult Yield( bool bWait, bool bHandleAllCurrentEvents ); + inline GdkDisplay *GetGdkDisplay(); + + virtual void ErrorTrapPush() SAL_OVERRIDE; +diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx +index 28bca36..189b6900 100644 +--- a/vcl/inc/unx/gtk/gtkinst.hxx ++++ b/vcl/inc/unx/gtk/gtkinst.hxx +@@ -80,7 +80,7 @@ public: + const SystemGraphicsData* ) SAL_OVERRIDE; + virtual SalBitmap* CreateSalBitmap() SAL_OVERRIDE; + +- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; ++ virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) SAL_OVERRIDE; + virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE; + + virtual GenPspGraphics *CreatePrintGraphics() SAL_OVERRIDE; +diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx +index a304a4b..776cb64 100644 +--- a/vcl/inc/unx/saldisp.hxx ++++ b/vcl/inc/unx/saldisp.hxx +@@ -155,7 +155,7 @@ public: + virtual ~SalXLib(); + virtual void Init(); + +- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); ++ virtual SalYieldResult Yield( bool bWait, bool bHandleAllCurrentEvents ); + virtual void Wakeup(); + virtual void PostUserEvent(); + +@@ -382,7 +382,7 @@ public: + virtual ~SalX11Display(); + + virtual bool Dispatch( XEvent *pEvent ) SAL_OVERRIDE; +- virtual void Yield(); ++ virtual bool Yield(); + virtual void PostUserEvent() SAL_OVERRIDE; + + bool IsEvent(); +diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h +index 381ddda..72939e8 100644 +--- a/vcl/inc/unx/salinst.h ++++ b/vcl/inc/unx/salinst.h +@@ -71,7 +71,7 @@ public: + virtual SalBitmap* CreateSalBitmap() SAL_OVERRIDE; + virtual SalSession* CreateSalSession() SAL_OVERRIDE; + +- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; ++ virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) SAL_OVERRIDE; + virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE; + + virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) SAL_OVERRIDE; +diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h +index 450d07c..0c9c759 100644 +--- a/vcl/inc/win/salinst.h ++++ b/vcl/inc/win/salinst.h +@@ -62,7 +62,7 @@ public: + virtual void AcquireYieldMutex( sal_uIntPtr nCount ) SAL_OVERRIDE; + virtual bool CheckYieldMutex() SAL_OVERRIDE; + +- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; ++ virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) SAL_OVERRIDE; + virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE; + virtual SalMenu* CreateMenu( bool bMenuBar, Menu* ) SAL_OVERRIDE; + virtual void DestroyMenu( SalMenu* ) SAL_OVERRIDE; +diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx +index 58a52d5..e20bbdd 100644 +--- a/vcl/osx/salinst.cxx ++++ b/vcl/osx/salinst.cxx +@@ -554,8 +554,11 @@ class ReleasePoolHolder + ~ReleasePoolHolder() { [mpPool release]; } + }; + +-void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased) + { ++ (void) nReleased; ++ assert(nReleased == 0); // not implemented ++ + // ensure that the per thread autorelease pool is top level and + // will therefore not be destroyed by cocoa implicitly + SalData::ensureThreadAutoreleasePool(); +@@ -592,12 +595,13 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) + osl_setCondition( maWaitingYieldCond ); + // return if only one event is asked for + if( ! bHandleAllCurrentEvents ) +- return; ++ return SalYieldResult::EVENT; + } + } + + // handle cocoa event queue +- // cocoa events mye be only handled in the thread the NSApp was created ++ // cocoa events may be only handled in the thread the NSApp was created ++ bool bHadEvent = false; + if( isNSAppThread() && mnActivePrintJobs == 0 ) + { + // we need to be woken up by a cocoa-event +@@ -607,7 +611,6 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) + + // handle available events + NSEvent* pEvent = nil; +- bool bHadEvent = false; + do + { + sal_uLong nCount = ReleaseYieldMutex(); +@@ -702,6 +705,8 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) + bInAppEvent = false; + } + } ++ ++ return bHadEvent ? SalYieldResult::EVENT : SalYieldResult::TIMEOUT; + } + + bool AquaSalInstance::AnyInput( VclInputFlags nType ) +diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx +index 144d626..bac8a62 100644 +--- a/vcl/qa/cppunit/timer.cxx ++++ b/vcl/qa/cppunit/timer.cxx +@@ -126,7 +126,7 @@ void TimerTest::testIdleMainloop() + // can't test this via Application::Yield since this + // also processes all tasks directly via the scheduler. + pSVData->maAppData.mnDispatchLevel++; +- pSVData->mpDefInst->Yield( true, false ); ++ pSVData->mpDefInst->DoYield(true, false, 0); + pSVData->maAppData.mnDispatchLevel--; + } + CPPUNIT_ASSERT_MESSAGE("mainloop idle triggered", bTriggered); +diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx +index 901c44e..8f475de 100644 +--- a/vcl/source/app/idle.cxx ++++ b/vcl/source/app/idle.cxx +@@ -18,8 +18,7 @@ + */ + + #include +-#include +-#include "svdata.hxx" ++#include "saltimer.hxx" + + void Idle::Invoke() + { +@@ -45,35 +44,36 @@ Idle::Idle( const Idle& rIdle ) : Scheduler(rIdle) + void Idle::Start() + { + Scheduler::Start(); +- ImplSVData* pSVData = ImplGetSVData(); +- Timer::ImplStartTimer( pSVData, 0 ); ++ Scheduler::ImplStartTimer(Scheduler::ImmediateTimeoutMs); + } + +-bool Idle::ReadyForSchedule( bool bTimer ) ++bool Idle::ReadyForSchedule( bool bTimerOnly, sal_uInt64 /* nTimeNow */ ) const + { +- // tdf#91727 - We need to re-work this to allow only UI idle handlers +- // and not timeouts to be processed in some limited scenarios +- (void)bTimer; +- return true; // !bTimer ++ // always ready if not only looking for timers. ++ return !bTimerOnly; + } + +-sal_uInt64 Idle::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 /* nTime */ ) ++bool Idle::IsIdle() const ++{ ++ return true; ++} ++ ++sal_uInt64 Idle::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 /* nTime */ ) const + { + switch (mePriority) { + case SchedulerPriority::HIGHEST: + case SchedulerPriority::HIGH: + case SchedulerPriority::RESIZE: + case SchedulerPriority::REPAINT: +- nMinPeriod = 1; // don't wait. ++ nMinPeriod = ImmediateTimeoutMs; // don't wait. + break; + default: + // FIXME: tdf#92036 workaround, I should be 1 too - wait 5ms +- if (nMinPeriod > 5) ++ if (nMinPeriod < 5) + nMinPeriod = 5; + break; + } + return nMinPeriod; + } + +- + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx +index c3cea78..dd004fb 100644 +--- a/vcl/source/app/scheduler.cxx ++++ b/vcl/source/app/scheduler.cxx +@@ -20,10 +20,9 @@ + #include + #include + #include +-#include + #include +- +-#define MAX_TIMER_PERIOD SAL_MAX_UINT64 ++#include ++#include + + void ImplSchedulerData::Invoke() + { +@@ -39,15 +38,17 @@ void ImplSchedulerData::Invoke() + mbInScheduler = false; + } + +-ImplSchedulerData *ImplSchedulerData::GetMostImportantTask( bool bTimer ) ++ImplSchedulerData *ImplSchedulerData::GetMostImportantTask( bool bTimerOnly ) + { + ImplSVData* pSVData = ImplGetSVData(); + ImplSchedulerData *pMostUrgent = NULL; + ++ sal_uInt64 nTimeNow = tools::Time::GetSystemTicks(); + for ( ImplSchedulerData *pSchedulerData = pSVData->mpFirstSchedulerData; pSchedulerData; pSchedulerData = pSchedulerData->mpNext ) + { +- if ( !pSchedulerData->mpScheduler || pSchedulerData->mbDelete || pSchedulerData->mnUpdateStack >= pSVData->mnUpdateStack +- || !pSchedulerData->mpScheduler->ReadyForSchedule( bTimer ) || !pSchedulerData->mpScheduler->IsActive()) ++ if ( !pSchedulerData->mpScheduler || pSchedulerData->mbDelete || ++ !pSchedulerData->mpScheduler->ReadyForSchedule( bTimerOnly, nTimeNow ) || ++ !pSchedulerData->mpScheduler->IsActive()) + continue; + if (!pMostUrgent) + pMostUrgent = pSchedulerData; +@@ -94,22 +95,88 @@ void Scheduler::ImplDeInitScheduler() + } + while ( pSchedulerData ); + +- pSVData->mpFirstSchedulerData = NULL; +- pSVData->mnTimerPeriod = 0; ++ pSVData->mpFirstSchedulerData = NULL; ++ pSVData->mnTimerPeriod = 0; + } + + delete pSVData->mpSalTimer; + pSVData->mpSalTimer = 0; + } + ++/** ++ * Start a new timer if we need to for @nMS duration. ++ * ++ * if this is longer than the existing duration we're ++ * waiting for, do nothing - unless @bForce - which means ++ * to reset the minimum period; used by the scheduled itself. ++ */ ++void Scheduler::ImplStartTimer(sal_uInt64 nMS, bool bForce) ++{ ++ ImplSVData* pSVData = ImplGetSVData(); ++ InitSystemTimer(pSVData); ++ ++ // only if smaller timeout, to avoid skipping. ++ if (bForce || nMS < pSVData->mnTimerPeriod) ++ { ++ pSVData->mnTimerPeriod = nMS; ++ pSVData->mpSalTimer->Start(nMS); ++ } ++} ++ ++/** ++* Initialize the platform specific timer on which all the ++* platform independent timers are built ++*/ ++void Scheduler::InitSystemTimer(ImplSVData* pSVData) ++{ ++ assert(pSVData != nullptr); ++ if (!pSVData->mpSalTimer) ++ { ++ pSVData->mnTimerPeriod = MaximumTimeoutMs; ++ pSVData->mpSalTimer = pSVData->mpDefInst->CreateSalTimer(); ++ pSVData->mpSalTimer->SetCallback(CallbackTaskScheduling); ++ } ++} ++ + void Scheduler::CallbackTaskScheduling(bool ignore) + { + // this function is for the saltimer callback + (void)ignore; +- Scheduler::ProcessTaskScheduling( true ); ++ Scheduler::ProcessTaskScheduling( false ); ++} ++ ++bool Scheduler::ProcessTaskScheduling( bool bTimerOnly ) ++{ ++ ImplSchedulerData* pSchedulerData; ++ ++ // tdf#91727 - NB. bTimerOnly is ultimately not used ++ if ((pSchedulerData = ImplSchedulerData::GetMostImportantTask(bTimerOnly))) ++ { ++ SAL_INFO("vcl.schedule", "Invoke task " << pSchedulerData->GetDebugName()); ++ ++ pSchedulerData->mnUpdateTime = tools::Time::GetSystemTicks(); ++ pSchedulerData->Invoke(); ++ return true; ++ } ++ else ++ return false; ++} ++ ++void Scheduler::ProcessEventsToIdle() ++{ ++ // FIXME: really we should process incoming OS events too ... ++ int nSanity = 1000; ++ while (Scheduler::ProcessTaskScheduling(false)) ++ { ++ if (nSanity-- < 0) ++ { ++ SAL_WARN("vcl.schedule", "Unexpected volume of events to process"); ++ break; ++ } ++ } + } + +-void Scheduler::ProcessTaskScheduling( bool bTimer ) ++sal_uInt64 Scheduler::CalculateMinimumTimeout( bool &bHasActiveIdles ) + { + // process all pending Tasks + // if bTimer True, only handle timer +@@ -117,63 +184,70 @@ void Scheduler::ProcessTaskScheduling( bool bTimer ) + ImplSchedulerData* pPrevSchedulerData = NULL; + ImplSVData* pSVData = ImplGetSVData(); + sal_uInt64 nTime = tools::Time::GetSystemTicks(); +- sal_uInt64 nMinPeriod = MAX_TIMER_PERIOD; +- pSVData->mnUpdateStack++; +- +- // tdf#91727 - NB. bTimer is ultimately not used +- if ((pSchedulerData = ImplSchedulerData::GetMostImportantTask(bTimer))) +- { +- pSchedulerData->mnUpdateTime = nTime; +- pSchedulerData->Invoke(); +- } ++ sal_uInt64 nMinPeriod = MaximumTimeoutMs; + ++ SAL_INFO("vcl.schedule", "Calculating minimum timeout:"); + pSchedulerData = pSVData->mpFirstSchedulerData; + while ( pSchedulerData ) + { +- if( pSchedulerData->mbInScheduler ) +- { +- pPrevSchedulerData = pSchedulerData; +- pSchedulerData = pSchedulerData->mpNext; +- } ++ ImplSchedulerData *pNext = pSchedulerData->mpNext; ++ + // Should Task be released from scheduling? +- else if ( pSchedulerData->mbDelete ) ++ if ( !pSchedulerData->mbInScheduler && ++ pSchedulerData->mbDelete ) + { + if ( pPrevSchedulerData ) + pPrevSchedulerData->mpNext = pSchedulerData->mpNext; + else + pSVData->mpFirstSchedulerData = pSchedulerData->mpNext; + if ( pSchedulerData->mpScheduler ) +- pSchedulerData->mpScheduler->mpSchedulerData = NULL; +- ImplSchedulerData* pTempSchedulerData = pSchedulerData; +- pSchedulerData = pSchedulerData->mpNext; +- delete pTempSchedulerData; ++ pSchedulerData->mpScheduler->mpSchedulerData = nullptr; ++ pNext = pSchedulerData->mpNext; ++ delete pSchedulerData; + } + else + { +- pSchedulerData->mnUpdateStack = 0; +- nMinPeriod = pSchedulerData->mpScheduler->UpdateMinPeriod( nMinPeriod, nTime ); ++ if (!pSchedulerData->mbInScheduler) ++ { ++ if ( !pSchedulerData->mpScheduler->IsIdle() ) ++ { ++ sal_uInt64 nOldMinPeriod = nMinPeriod; ++ nMinPeriod = pSchedulerData->mpScheduler->UpdateMinPeriod( ++ nOldMinPeriod, nTime ); ++ SAL_INFO("vcl.schedule", "Have active timer " << ++ pSchedulerData->GetDebugName() << ++ "update min period from " << nOldMinPeriod << ++ " to " << nMinPeriod); ++ } ++ else ++ { ++ SAL_INFO("vcl.schedule", "Have active idle " << ++ pSchedulerData->GetDebugName()); ++ bHasActiveIdles = true; ++ } ++ } + pPrevSchedulerData = pSchedulerData; +- pSchedulerData = pSchedulerData->mpNext; + } ++ pSchedulerData = pNext; + } + +- // delete clock if no more timers available ++ // delete clock if no more timers available, + if ( !pSVData->mpFirstSchedulerData ) + { + if ( pSVData->mpSalTimer ) + pSVData->mpSalTimer->Stop(); +- pSVData->mnTimerPeriod = MAX_TIMER_PERIOD; ++ nMinPeriod = MaximumTimeoutMs; ++ pSVData->mnTimerPeriod = nMinPeriod; ++ SAL_INFO("vcl.schedule", "Unusual - no more timers available - stop timer"); + } + else + { +- Timer::ImplStartTimer( pSVData, nMinPeriod ); ++ Scheduler::ImplStartTimer(nMinPeriod, true); ++ SAL_INFO("vcl.schedule", "Calculated minimum timeout as " << nMinPeriod << " and " << ++ (const char *)(bHasActiveIdles ? "has active idles" : "no idles")); + } +- pSVData->mnUpdateStack--; +-} + +-void Scheduler::SetPriority( SchedulerPriority ePriority ) +-{ +- mePriority = ePriority; ++ return nMinPeriod; + } + + void Scheduler::Start() +@@ -205,7 +279,6 @@ void Scheduler::Start() + } + mpSchedulerData->mbDelete = false; + mpSchedulerData->mnUpdateTime = tools::Time::GetSystemTicks(); +- mpSchedulerData->mnUpdateStack = pSVData->mnUpdateStack; + } + + void Scheduler::Stop() +@@ -221,7 +294,7 @@ Scheduler& Scheduler::operator=( const Scheduler& rScheduler ) + if ( IsActive() ) + Stop(); + +- mbActive = false; ++ mbActive = false; + mePriority = rScheduler.mePriority; + + if ( rScheduler.IsActive() ) +@@ -257,3 +330,10 @@ Scheduler::~Scheduler() + } + } + ++const char *ImplSchedulerData::GetDebugName() const ++{ ++ return mpScheduler && mpScheduler->GetDebugName() ? ++ mpScheduler->GetDebugName() : "unknown"; ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx +index c261a37..302c4a7 100644 +--- a/vcl/source/app/svapp.cxx ++++ b/vcl/source/app/svapp.cxx +@@ -338,48 +338,86 @@ void Application::Execute() + pSVData->maAppData.mbInAppExecute = false; + } + +-inline void ImplYield( bool i_bWait, bool i_bAllEvents ) ++inline void ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased) + { + ImplSVData* pSVData = ImplGetSVData(); + +- //Process all Tasks +- Scheduler::ProcessTaskScheduling(false); ++ SAL_INFO("vcl.schedule", "Enter ImplYield: " << (i_bWait ? "wait" : "no wait") << ++ ": " << (i_bAllEvents ? "all events" : "one event") << ": " << nReleased); + ++ bool bHasActiveIdles = false; ++ sal_uInt64 nMinTimeout = 0; ++ if (nReleased == 0) // else thread doesn't have SolarMutex so avoid race ++ nMinTimeout = Scheduler::CalculateMinimumTimeout(bHasActiveIdles); ++ ++ // FIXME: should use returned value as param to DoYield ++ (void)nMinTimeout; ++ ++ // If we have idles, don't wait for the timeout; check for events ++ // and come back as quick as possible. ++ if (bHasActiveIdles) ++ i_bWait = false; ++ ++ // TODO: there's a data race here on WNT only because ImplYield may be ++ // called without SolarMutex; if we can get rid of LazyDelete (with VclPtr) ++ // then the only remaining use of mnDispatchLevel is in OSX specific code ++ // so that would effectively eliminate the race on WNT + pSVData->maAppData.mnDispatchLevel++; ++ + // do not wait for events if application was already quit; in that + // case only dispatch events already available + // do not wait for events either if the app decided that it is too busy for timers + // (feature added for the slideshow) +- pSVData->mpDefInst->Yield( i_bWait && !pSVData->maAppData.mbAppQuit && !pSVData->maAppData.mbNoYield, i_bAllEvents ); ++ SalYieldResult eResult = ++ pSVData->mpDefInst->DoYield( ++ i_bWait && !pSVData->maAppData.mbAppQuit, ++ i_bAllEvents, nReleased); ++ ++ SAL_INFO("vcl.schedule", "DoYield with " << (bHasActiveIdles ? "active idles" : "no ides") << ++ " returns: " << (eResult == SalYieldResult::EVENT ? "processed event" : "timeout")); ++ + pSVData->maAppData.mnDispatchLevel--; + + DBG_TESTSOLARMUTEX(); // must be locked on return from Yield + ++ // Process all Tasks ++ Scheduler::ProcessTaskScheduling(eResult == SalYieldResult::EVENT); ++ + // flush lazy deleted objects + if( pSVData->maAppData.mnDispatchLevel == 0 ) + vcl::LazyDelete::flush(); + +- // the system timer events will not necessarily come in non waiting mode +- // e.g. on OS X; need to trigger timer checks manually +- if( pSVData->maAppData.mbNoYield ) +- { +- //Process all timers +- Scheduler::ProcessTaskScheduling(true); +- } +- +- // call post yield listeners +- if( pSVData->maAppData.mpPostYieldListeners ) +- pSVData->maAppData.mpPostYieldListeners->callListeners( NULL ); ++ SAL_INFO("vcl.schedule", "Leave ImplYield"); + } + + void Application::Reschedule( bool i_bAllEvents ) + { +- ImplYield( false, i_bAllEvents ); ++ ImplYield(false, i_bAllEvents, 0); + } + + void Application::Yield() + { +- ImplYield( true, false ); ++ ImplYield(true, false, 0); ++} ++ ++void Application::ReAcquireSolarMutex(sal_uLong const nReleased) ++{ ++ // 0 would mean that events/timers will be handled without locking ++ // SolarMutex (racy) ++ assert(nReleased != 0); ++#ifdef WNT ++ if (ImplGetSVData()->mbDeInit) // do not Yield in DeInitVCL ++ AcquireSolarMutex(nReleased); ++ else ++ ImplYield(false, false, nReleased); ++#else ++ // a) Yield is not needed on non-WNT platforms ++ // b) some Yield implementations for X11 (e.g. kde4) make it non-obvious ++ // how to use nReleased ++ // c) would require a review of what all Yield implementations do ++ // currently _before_ releasing SolarMutex that would run without lock ++ AcquireSolarMutex(nReleased); ++#endif + } + + IMPL_STATIC_LINK_NOARG( ImplSVAppData, ImplQuitMsg ) +@@ -965,33 +1003,6 @@ void Application::RemoveIdleHdl( const Link<>& rLink ) + pSVData->maAppData.mpIdleMgr->RemoveIdleHdl( rLink ); + } + +-void Application::EnableNoYieldMode() +-{ +- ImplSVData* pSVData = ImplGetSVData(); +- pSVData->maAppData.mbNoYield = true; +-} +- +-void Application::DisableNoYieldMode() +-{ +- ImplSVData* pSVData = ImplGetSVData(); +- pSVData->maAppData.mbNoYield = false; +-} +- +-void Application::AddPostYieldListener( const Link<>& i_rListener ) +-{ +- ImplSVData* pSVData = ImplGetSVData(); +- if( ! pSVData->maAppData.mpPostYieldListeners ) +- pSVData->maAppData.mpPostYieldListeners = new VclEventListeners2(); +- pSVData->maAppData.mpPostYieldListeners->addListener( i_rListener ); +-} +- +-void Application::RemovePostYieldListener( const Link<>& i_rListener ) +-{ +- ImplSVData* pSVData = ImplGetSVData(); +- if( pSVData->maAppData.mpPostYieldListeners ) +- pSVData->maAppData.mpPostYieldListeners->removeListener( i_rListener ); +-} +- + WorkWindow* Application::GetAppWindow() + { + return ImplGetSVData()->maWinData.mpAppWin; +diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx +index 72881a6..23757e8 100644 +--- a/vcl/source/app/svmain.cxx ++++ b/vcl/source/app/svmain.cxx +@@ -508,11 +508,6 @@ void DeInitVCL() + delete pSVData->maAppData.mpKeyListeners; + pSVData->maAppData.mpKeyListeners = NULL; + } +- if ( pSVData->maAppData.mpPostYieldListeners ) +- { +- delete pSVData->maAppData.mpPostYieldListeners; +- pSVData->maAppData.mpPostYieldListeners = NULL; +- } + + if ( pSVData->maAppData.mpFirstHotKey ) + ImplFreeHotKeyData(); +diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx +index 7d92283..1766d7f 100644 +--- a/vcl/source/app/timer.cxx ++++ b/vcl/source/app/timer.cxx +@@ -19,46 +19,30 @@ + + #include + #include +-#include +-#include +-#include ++#include "saltimer.hxx" + +-#define MAX_TIMER_PERIOD SAL_MAX_UINT64 +- +-void Timer::ImplStartTimer( ImplSVData* pSVData, sal_uInt64 nMS ) ++void Timer::SetDeletionFlags() + { +- InitSystemTimer(); +- +- if ( !nMS ) +- nMS = 1; +- +- // Assume underlying timers are recurring timers, if same period - just wait. +- if ( nMS != pSVData->mnTimerPeriod ) ++ // If no AutoTimer, then stop. ++ if ( !mbAuto ) + { +- pSVData->mnTimerPeriod = nMS; +- pSVData->mpSalTimer->Start( nMS ); ++ mpSchedulerData->mbDelete = true; ++ mbActive = false; + } + } + +-void Timer::SetDeletionFlags() ++bool Timer::ReadyForSchedule( bool /* bTimerOnly */, sal_uInt64 nTimeNow ) const + { +- // if no AutoTimer than stop +- if ( !mbAuto ) +- { +- mpSchedulerData->mbDelete = true; +- mbActive = false; +- } ++ return (mpSchedulerData->mnUpdateTime + mnTimeout) <= nTimeNow; + } + +-bool Timer::ReadyForSchedule( bool bTimer ) ++bool Timer::IsIdle() const + { +- (void)bTimer; +- return (mpSchedulerData->mnUpdateTime + mnTimeout) <= tools::Time::GetSystemTicks(); ++ return false; + } + +-sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) ++sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) const + { +- sal_uInt64 nNewTime = tools::Time::GetSystemTicks(); + sal_uInt64 nDeltaTime; + //determine smallest time slot + if( mpSchedulerData->mnUpdateTime == nTime ) +@@ -70,11 +54,11 @@ sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) + else + { + nDeltaTime = mpSchedulerData->mnUpdateTime + mnTimeout; +- if( nDeltaTime < nNewTime ) +- nMinPeriod = 1; ++ if( nDeltaTime < nTime ) ++ nMinPeriod = ImmediateTimeoutMs; + else + { +- nDeltaTime -= nNewTime; ++ nDeltaTime -= nTime; + if( nDeltaTime < nMinPeriod ) + nMinPeriod = nDeltaTime; + } +@@ -83,32 +67,19 @@ sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) + return nMinPeriod; + } + +-/** +- * Initialize the platform specific timer on which all the +- * platform independent timers are built +- */ +-void Timer::InitSystemTimer() +-{ +- ImplSVData* pSVData = ImplGetSVData(); +- if( ! pSVData->mpSalTimer ) +- { +- pSVData->mnTimerPeriod = MAX_TIMER_PERIOD; +- pSVData->mpSalTimer = pSVData->mpDefInst->CreateSalTimer(); +- pSVData->mpSalTimer->SetCallback( CallbackTaskScheduling ); +- } +-} +- +-Timer::Timer(const sal_Char *pDebugName) : Scheduler(pDebugName) ++Timer::Timer(const sal_Char *pDebugName) : ++ Scheduler(pDebugName), ++ mnTimeout(ImmediateTimeoutMs), ++ mbAuto(false) + { +- mnTimeout = 1; +- mbAuto = false; + mePriority = SchedulerPriority::HIGHEST; + } + +-Timer::Timer( const Timer& rTimer ) : Scheduler(rTimer) ++Timer::Timer( const Timer& rTimer ) : ++ Scheduler(rTimer), ++ mnTimeout(rTimer.mnTimeout), ++ mbAuto(rTimer.mbAuto) + { +- mnTimeout = rTimer.mnTimeout; +- mbAuto = rTimer.mbAuto; + maTimeoutHdl = rTimer.maTimeoutHdl; + } + +@@ -120,21 +91,16 @@ void Timer::Invoke() + void Timer::Start() + { + Scheduler::Start(); +- +- ImplSVData* pSVData = ImplGetSVData(); +- if ( mnTimeout < pSVData->mnTimerPeriod ) +- Timer::ImplStartTimer( pSVData, mnTimeout ); ++ Scheduler::ImplStartTimer(mnTimeout); + } + + void Timer::SetTimeout( sal_uInt64 nNewTimeout ) + { + mnTimeout = nNewTimeout; +- // if timer is active then renew clock ++ // If timer is active, then renew clock. + if ( mbActive ) + { +- ImplSVData* pSVData = ImplGetSVData(); +- if ( !pSVData->mnUpdateStack && (mnTimeout < pSVData->mnTimerPeriod) ) +- Timer::ImplStartTimer( pSVData, mnTimeout ); ++ Scheduler::ImplStartTimer(mnTimeout); + } + } + +diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx +index b2212a4..ac872b7 100644 +--- a/vcl/unx/generic/app/saldata.cxx ++++ b/vcl/unx/generic/app/saldata.cxx +@@ -619,7 +619,8 @@ bool SalXLib::CheckTimeout( bool bExecuteTimers ) + return bRet; + } + +-void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult ++SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) + { + blockIdleTimeout = !bWait; + // check for timeouts here if you want to make screenshots +@@ -642,7 +643,7 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) + if( ! bHandleAllCurrentEvents ) + { + blockIdleTimeout = false; +- return; ++ return SalYieldResult::EVENT; + } + } + } +@@ -657,6 +658,8 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) + timeval Timeout = noyield__; + timeval *pTimeout = &Timeout; + ++ bool bHandledEvent = false; ++ + if (bWait) + { + pTimeout = 0; +@@ -717,7 +720,7 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) + if (nFound == 0) + { + blockIdleTimeout = false; +- return; ++ return SalYieldResult::TIMEOUT; + } + + for ( int nFD = 0; nFD < nFDs_; nFD++ ) +@@ -736,6 +739,7 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) + for( int i = 0; pEntry->IsEventQueued() && i < nMaxEvents; i++ ) + { + pEntry->HandleNextEvent(); ++ bHandledEvent = true; + // if a recursive call has done the job + // so abort here + } +@@ -745,6 +749,9 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) + } + } + blockIdleTimeout = false; ++ ++ return bHandledEvent ? SalYieldResult::EVENT ++ : SalYieldResult::TIMEOUT; + } + + void SalXLib::Wakeup() +diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx +index ff71bc6..c039ee2 100644 +--- a/vcl/unx/generic/app/saldisp.cxx ++++ b/vcl/unx/generic/app/saldisp.cxx +@@ -1878,10 +1878,10 @@ bool SalX11Display::IsEvent() + return false; + } + +-void SalX11Display::Yield() ++bool SalX11Display::Yield() + { + if( DispatchInternalEvent() ) +- return; ++ return true; + + XEvent aEvent; + DBG_ASSERT( static_cast(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() == +@@ -1890,7 +1890,8 @@ void SalX11Display::Yield() + + XNextEvent( pDisp_, &aEvent ); + +- Dispatch( &aEvent ); ++ // FIXME: under-convinced by Dispatch boolean return value vs. salframe. ++ bool bProcessedEvent = Dispatch( &aEvent ); + + #ifdef DBG_UTIL + if( GetX11SalData()->HasXErrorOccurred() ) +@@ -1900,6 +1901,8 @@ void SalX11Display::Yield() + } + #endif + GetX11SalData()->ResetXErrorOccurred(); ++ ++ return bProcessedEvent; + } + + bool SalX11Display::Dispatch( XEvent *pEvent ) +diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx +index 9c00f6d..7ac0789 100644 +--- a/vcl/unx/generic/app/salinst.cxx ++++ b/vcl/unx/generic/app/salinst.cxx +@@ -151,9 +151,11 @@ bool X11SalInstance::AnyInput(VclInputFlags nType) + return bRet; + } + +-void X11SalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult X11SalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased) + { +- mpXLib->Yield( bWait, bHandleAllCurrentEvents ); ++ (void) nReleased; ++ assert(nReleased == 0); // not implemented ++ return mpXLib->Yield( bWait, bHandleAllCurrentEvents ); + } + + void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, +diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx +index 30cfa9c..006df49 100644 +--- a/vcl/unx/gtk/a11y/atkwrapper.cxx ++++ b/vcl/unx/gtk/a11y/atkwrapper.cxx +@@ -872,7 +872,7 @@ atk_object_wrapper_new( const ::com::sun::star::uno::Reference< ::com::sun::star + uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster(xContext, uno::UNO_QUERY); + if( xBroadcaster.is() ) + xBroadcaster->addAccessibleEventListener( static_cast< accessibility::XAccessibleEventListener * > ( new AtkListener(pWrap) ) ); +- else ++ else + OSL_ASSERT( false ); + } + +diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx +index 2d8e26c..b59b962 100644 +--- a/vcl/unx/gtk/app/gtkdata.cxx ++++ b/vcl/unx/gtk/app/gtkdata.cxx +@@ -566,9 +566,11 @@ void GtkData::Dispose() + deInitNWF(); + } + +-void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) ++/// Allows events to be processed, returns true if we processed an event. ++SalYieldResult GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) + { + blockIdleTimeout = !bWait; ++ + /* #i33212# only enter g_main_context_iteration in one thread at any one + * time, else one of them potentially will never end as long as there is + * another thread in there. Having only one yieldin thread actually dispatch +@@ -584,7 +586,7 @@ void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) + else if( ! bWait ) + { + blockIdleTimeout = false; +- return; // someone else is waiting already, return ++ return SalYieldResult::TIMEOUT; // someone else is waiting already, return + } + + if( bDispatchThread ) +@@ -618,6 +620,9 @@ void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) + osl_setCondition( m_aDispatchCondition ); // trigger non dispatch thread yields + } + blockIdleTimeout = false; ++ ++ return bWasEvent ? SalYieldResult::EVENT ++ : SalYieldResult::TIMEOUT; + } + + void GtkData::Init() +@@ -885,6 +890,9 @@ create_sal_gtk_timeout( GtkSalTimer *pTimer ) + /* unused dummy */ g_idle_remove_by_data, + NULL, NULL ); + g_source_attach( pSource, g_main_context_default() ); ++#ifdef DBG_UTIL ++ g_source_set_name( pSource, "VCL timeout source" ); ++#endif + + sal_gtk_timeout_defer( pTSource ); + +@@ -917,6 +925,8 @@ bool GtkSalTimer::Expired() + + void GtkSalTimer::Start( sal_uLong nMS ) + { ++ // glib is not 64bit safe in this regard. ++ assert( nMS <= G_MAXINT ); + m_nTimeoutMS = nMS; // for restarting + Stop(); // FIXME: ideally re-use an existing m_pTimeout + m_pTimeout = create_sal_gtk_timeout( this ); +diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx +index 601fd21..9242b88 100644 +--- a/vcl/unx/gtk/app/gtkinst.cxx ++++ b/vcl/unx/gtk/app/gtkinst.cxx +@@ -401,10 +401,12 @@ void GtkInstance::RemoveTimer (SalTimer *pTimer) + m_aTimers.erase( it ); + } + +-void GtkInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult GtkInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased) + { ++ (void) nReleased; ++ assert(nReleased == 0); // not implemented + EnsureInit(); +- GetGtkSalData()->Yield( bWait, bHandleAllCurrentEvents ); ++ return GetGtkSalData()->Yield( bWait, bHandleAllCurrentEvents ); + } + + bool GtkInstance::IsTimerExpired() +diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx +index 06e7b6d..42f8ebc 100644 +--- a/vcl/unx/kde4/KDESalDisplay.cxx ++++ b/vcl/unx/kde4/KDESalDisplay.cxx +@@ -46,14 +46,14 @@ SalKDEDisplay::~SalKDEDisplay() + pDisp_ = NULL; + } + +-void SalKDEDisplay::Yield() ++bool SalKDEDisplay::Yield() + { + if( DispatchInternalEvent() ) +- return; ++ return true; + + // Prevent blocking from Drag'n'Drop events, which may have already have processed the event + if (XEventsQueued( pDisp_, QueuedAfterReading ) == 0) +- return; ++ return false; + + DBG_ASSERT( static_cast(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() == + osl::Thread::getCurrentIdentifier(), +@@ -62,8 +62,9 @@ void SalKDEDisplay::Yield() + XEvent event; + XNextEvent( pDisp_, &event ); + if( checkDirectInputEvent( &event )) +- return; ++ return true; + qApp->x11ProcessEvent( &event ); ++ return true; + } + + // HACK: When using Qt event loop, input methods (japanese, etc.) will get broken because +diff --git a/vcl/unx/kde4/KDESalDisplay.hxx b/vcl/unx/kde4/KDESalDisplay.hxx +index f4a4146..3e027fd 100644 +--- a/vcl/unx/kde4/KDESalDisplay.hxx ++++ b/vcl/unx/kde4/KDESalDisplay.hxx +@@ -27,7 +27,7 @@ class SalKDEDisplay : public SalX11Display + SalKDEDisplay( Display* pDisp ); + virtual ~SalKDEDisplay(); + static SalKDEDisplay* self(); +- virtual void Yield() SAL_OVERRIDE; ++ virtual bool Yield() SAL_OVERRIDE; + bool checkDirectInputEvent( XEvent* ev ); + private: + Atom xim_protocol; +diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx +index 3101d37..c758e18 100644 +--- a/vcl/unx/kde4/KDEXLib.cxx ++++ b/vcl/unx/kde4/KDEXLib.cxx +@@ -281,22 +281,25 @@ void KDEXLib::socketNotifierActivated( int fd ) + sdata.handle( fd, sdata.data ); + } + +-void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) + { + if( !m_isGlibEventLoopType ) + { ++ bool wasEvent = false; + if( qApp->thread() == QThread::currentThread()) + { + // even if we use the LO event loop, still process Qt's events, + // otherwise they can remain unhandled for quite a long while +- processYield( false, bHandleAllCurrentEvents ); ++ wasEvent = processYield( false, bHandleAllCurrentEvents ); + } +- return SalXLib::Yield( bWait, bHandleAllCurrentEvents ); ++ SalYieldResult aResult = SalXLib::Yield(bWait, bHandleAllCurrentEvents); ++ return (aResult == SalYieldResult::EVENT || wasEvent) ? ++ SalYieldResult::EVENT : SalYieldResult::TIMEOUT; + } + // if we are the main thread (which is where the event processing is done), + // good, just do it + if( qApp->thread() == QThread::currentThread()) +- processYield( bWait, bHandleAllCurrentEvents ); ++ return processYield( bWait, bHandleAllCurrentEvents ); + else + { + // we were called from another thread; +@@ -305,10 +308,11 @@ void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) + // temporarily do it while checking for new events) + SalYieldMutexReleaser aReleaser; + Q_EMIT processYieldSignal( bWait, bHandleAllCurrentEvents ); ++ return SalYieldResult::TIMEOUT; + } + } + +-void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents ) + { + blockIdleTimeout = !bWait; + QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread()); +@@ -324,6 +328,8 @@ void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents ) + if( bWait && !wasEvent ) + dispatcher->processEvents( QEventLoop::WaitForMoreEvents ); + blockIdleTimeout = false; ++ return wasEvent ? SalYieldResult::EVENT ++ : SalYieldResult::TIMEOUT; + } + + void KDEXLib::StartTimer( sal_uLong nMS ) +diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx +index 0a1aec3..7e432e5 100644 +--- a/vcl/unx/kde4/KDEXLib.hxx ++++ b/vcl/unx/kde4/KDEXLib.hxx +@@ -65,7 +65,7 @@ class KDEXLib : public QObject, public SalXLib + void userEventActivated(); + void startTimeoutTimer(); + void startUserEventTimer(); +- void processYield( bool bWait, bool bHandleAllCurrentEvents ); ++ SalYieldResult processYield( bool bWait, bool bHandleAllCurrentEvents ); + Q_SIGNALS: + void startTimeoutTimerSignal(); + void startUserEventTimerSignal(); +@@ -80,7 +80,7 @@ class KDEXLib : public QObject, public SalXLib + virtual ~KDEXLib(); + + virtual void Init() SAL_OVERRIDE; +- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; ++ virtual SalYieldResult Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE; + virtual void Insert( int fd, void* data, YieldFunc pending, YieldFunc queued, YieldFunc handle ) SAL_OVERRIDE; + virtual void Remove( int fd ) SAL_OVERRIDE; + virtual void StartTimer( sal_uLong nMS ) SAL_OVERRIDE; +diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx +index 1c21246..d61060f 100644 +--- a/vcl/win/source/app/salinst.cxx ++++ b/vcl/win/source/app/salinst.cxx +@@ -602,7 +602,8 @@ static void ImplSalDispatchMessage( MSG* pMsg ) + ImplSalPostDispatchMsg( pMsg, lResult ); + } + +-void ImplSalYield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult ++ImplSalYield( bool bWait, bool bHandleAllCurrentEvents ) + { + MSG aMsg; + bool bWasMsg = false, bOneEvent = false; +@@ -629,15 +630,22 @@ void ImplSalYield( bool bWait, bool bHandleAllCurrentEvents ) + ImplSalDispatchMessage( &aMsg ); + } + } ++ return bWasMsg ? SalYieldResult::EVENT : ++ SalYieldResult::TIMEOUT; + } + +-void WinSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) ++SalYieldResult WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased) + { ++ SalYieldResult eDidWork = SalYieldResult::TIMEOUT; ++ // NOTE: if nReleased != 0 this will be called without SolarMutex ++ // so don't do anything dangerous before releasing it here + SalYieldMutex* pYieldMutex = mpSalYieldMutex; + SalData* pSalData = GetSalData(); + DWORD nCurThreadId = GetCurrentThreadId(); +- sal_uLong nCount = pYieldMutex->GetAcquireCount( nCurThreadId ); +- sal_uLong n = nCount; ++ sal_uLong const nCount = (nReleased != 0) ++ ? nReleased ++ : pYieldMutex->GetAcquireCount(nCurThreadId); ++ sal_uLong n = (nReleased != 0) ? 0 : nCount; + while ( n ) + { + pYieldMutex->release(); +@@ -669,7 +677,7 @@ void WinSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) + } + else + { +- ImplSalYield( bWait, bHandleAllCurrentEvents ); ++ eDidWork = ImplSalYield( bWait, bHandleAllCurrentEvents ); + + n = nCount; + while ( n ) +@@ -678,6 +686,7 @@ void WinSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) + n--; + } + } ++ return eDidWork; + } + + LRESULT CALLBACK SalComWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef ) +-- +2.5.0 + diff --git a/SOURCES/0001-build-libetonyek-with-no-strict-aliasing.patch b/SOURCES/0001-build-libetonyek-with-no-strict-aliasing.patch deleted file mode 100644 index 0b7feed..0000000 --- a/SOURCES/0001-build-libetonyek-with-no-strict-aliasing.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 08fe34b1b00fee1ee9b4332c8e4b9142af63b4a5 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Thu, 5 Feb 2015 14:46:31 +0100 -Subject: [PATCH 1/2] build libetonyek with no-strict-aliasing - -Change-Id: I004133fb8a8e55cce74470078013e102d6c0514e ---- - external/libetonyek/ExternalProject_libetonyek.mk | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/external/libetonyek/ExternalProject_libetonyek.mk b/external/libetonyek/ExternalProject_libetonyek.mk -index b4b5589..6e090b1 100644 ---- a/external/libetonyek/ExternalProject_libetonyek.mk -+++ b/external/libetonyek/ExternalProject_libetonyek.mk -@@ -38,6 +38,7 @@ $(call gb_ExternalProject_get_state_target,libetonyek,build) : - XML_CFLAGS="$(LIBXML_CFLAGS)" \ - XML_LIBS="$(LIBXML_LIBS)" \ - $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ -+ CXXFLAGS="$(CXXFLAGS) -fno-strict-aliasing" \ - && $(MAKE) \ - ) - --- -2.1.0 - diff --git a/SOURCES/0001-but-only-for-dialog.patch b/SOURCES/0001-but-only-for-dialog.patch new file mode 100644 index 0000000..2a6460e --- /dev/null +++ b/SOURCES/0001-but-only-for-dialog.patch @@ -0,0 +1,26 @@ +From bba3f7bf8f831bf7f51de6441b3f15ed667e56fd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 16 Dec 2015 11:02:27 +0000 +Subject: [PATCH] but only for dialog + +Change-Id: I7e4f5c075ca4844f81a59071bed475ea1da4bf91 +--- + vcl/source/window/syswin.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx +index 3f2cde1..057b51b 100644 +--- a/vcl/source/window/syswin.cxx ++++ b/vcl/source/window/syswin.cxx +@@ -1135,7 +1135,7 @@ void SystemWindow::DoInitialLayout() + mbIsCalculatingInitialLayoutSize = false; + mbInitialLayoutDone = true; + } +- else if (!(GetStyle() & WB_SIZEABLE)) ++ else if (IsDialog() && !(GetStyle() & WB_SIZEABLE)) + { + SetMinOutputSizePixel(GetSizePixel()); + } +-- +2.5.0 + diff --git a/SOURCES/0001-create-a-master-document-template-type.patch b/SOURCES/0001-create-a-master-document-template-type.patch deleted file mode 100644 index 4ab2f7a..0000000 --- a/SOURCES/0001-create-a-master-document-template-type.patch +++ /dev/null @@ -1,2295 +0,0 @@ -From 2c9125d3fe8839fda09e30886c216285575aa19d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 8 Sep 2014 15:31:14 +0100 -Subject: [PATCH] create a master document template type - -of application/vnd.oasis.opendocument.text-master-template with -suffic otm - -https://lists.oasis-open.org/archives/office-comment/201002/msg00042.html - -desktop/icons/oasis-master-document-template.icns is just a copy -of -desktop/icons/oasis-master-document.icns -because I can't draw - -Change-Id: I0d18c79c4c893e97505052884ee8be97d0f117a1 ---- - bin/get-bugzilla-attachments-by-mimetype | 1 + - comphelper/source/misc/storagehelper.cxx | 1 + - extensions/source/activex/so_activex.cxx | 1 + - extensions/source/nsplugin/source/npshell.cxx | 1 + - extensions/source/nsplugin/source/nsplugin_oo.rc | 1 + - filter/Configuration_filter.mk | 3 ++ - .../fragments/filters/writerglobal8_template.xcu | 17 ++++++++ - .../filters/writerglobal8_template_ui.xcu | 12 ++++++ - .../fragments/types/writerglobal8_template.xcu | 19 +++++++++ - filter/source/storagefilterdetect/filterdetect.cxx | 1 + - include/comphelper/documentconstants.hxx | 2 + - include/sot/formats.hxx | 3 +- - officecfg/registry/data/org/openoffice/Setup.xcu | 4 +- - package/source/manifest/ManifestExport.cxx | 1 + - scp2/source/writer/registryitem_writer.scp | 8 ++++ - sfx2/source/control/recentdocsview.cxx | 2 +- - sfx2/source/control/templateabstractview.cxx | 2 +- - solenv/inc/mime.types | 1 + - sot/source/base/exchange.cxx | 5 +-- - sot/source/sdstor/storage.cxx | 1 + - sot/source/sdstor/ucbstorage.cxx | 1 + - sw/source/uibase/app/docsh.cxx | 1 + - sw/source/uibase/globdoc/globdoc.cxx | 5 +-- - sysui/CustomTarget_share.mk | 2 + - sysui/Package_osxicons.mk | 1 + - sysui/desktop/debian/postinst | 2 + - sysui/desktop/freedesktop/freedesktop-menus.spec | 1 + - .../icons/oasis-master-document-template.icns | Bin 0 -> 118979 bytes - sysui/desktop/macosx/Info.plist.in | 43 +++++++++++++++++++++ - sysui/desktop/menus/writer.desktop | 2 +- - .../oasis-master-document-template.desktop | 26 +++++++++++++ - .../mimetypes/oasis-master-document-template.keys | 9 +++++ - sysui/desktop/mimetypes/openoffice.applications | 2 +- - sysui/desktop/share/documents.ulf | 3 ++ - sysui/desktop/solaris/mailcap | 1 + - sysui/desktop/solaris/mime.types | 1 + - 36 files changed, 173 insertions(+), 13 deletions(-) - create mode 100644 filter/source/config/fragments/filters/writerglobal8_template.xcu - create mode 100644 filter/source/config/fragments/filters/writerglobal8_template_ui.xcu - create mode 100644 filter/source/config/fragments/types/writerglobal8_template.xcu - create mode 100644 sysui/desktop/icons/oasis-master-document-template.icns - create mode 100644 sysui/desktop/mimetypes/oasis-master-document-template.desktop - create mode 100644 sysui/desktop/mimetypes/oasis-master-document-template.keys - -diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype -index 6f72dc7..5ac0a26 100755 ---- a/bin/get-bugzilla-attachments-by-mimetype -+++ b/bin/get-bugzilla-attachments-by-mimetype -@@ -357,6 +357,7 @@ mimetypes = { - 'application/vnd.oasis.opendocument.text-flat-xml': 'fodt', - 'application/vnd.oasis.opendocument.text-master': 'odm', - 'application/vnd.oasis.opendocument.text-template': 'ott', -+ 'application/vnd.oasis.opendocument.text-master-template': 'otm', - 'application/vnd.oasis.opendocument.text-web': 'oth', - # OOo XML - 'application/vnd.sun.xml.base': 'odb', -diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx -index 51ee8c5..67d14c1 100644 ---- a/comphelper/source/misc/storagehelper.cxx -+++ b/comphelper/source/misc/storagehelper.cxx -@@ -263,6 +263,7 @@ sal_Int32 OStorageHelper::GetXStorageFormat( - aMediaType.equalsIgnoreAsciiCase(MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII ) || - aMediaType.equalsIgnoreAsciiCase(MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART_ASCII ) || - aMediaType.equalsIgnoreAsciiCase(MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII ) || -+ aMediaType.equalsIgnoreAsciiCase(MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII ) || - aMediaType.equalsIgnoreAsciiCase(MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII ) || - aMediaType.equalsIgnoreAsciiCase(MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII) || - aMediaType.equalsIgnoreAsciiCase(MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII ) || -diff --git a/extensions/source/activex/so_activex.cxx b/extensions/source/activex/so_activex.cxx -index 850ebab..d460bc6 100644 ---- a/extensions/source/activex/so_activex.cxx -+++ b/extensions/source/activex/so_activex.cxx -@@ -138,6 +138,7 @@ const char* aMimeType[] = { - MIMETYPE_VND_SUN_XML_MATH_ASCII, - - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII, -+ MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII, -diff --git a/extensions/source/nsplugin/source/npshell.cxx b/extensions/source/nsplugin/source/npshell.cxx -index 84aff99..82881fa 100644 ---- a/extensions/source/nsplugin/source/npshell.cxx -+++ b/extensions/source/nsplugin/source/npshell.cxx -@@ -377,6 +377,7 @@ MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII ":odt:OpenDocument Text;" - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII "-flat-xml:fodt:OpenDocument Text Flat XML;" - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII ":ott:OpenDocument Text Template;" - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII ":odm:OpenDocument Master Document;" -+MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII ":otm:OpenDocument Master Document Template;" - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII ":oth:HTML Document Template;" - MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII ":ods:OpenDocument Spreadsheet;" - MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII "-flat-xml:fods:OpenDocument Spreadsheet Flat XML;" -diff --git a/extensions/source/nsplugin/source/nsplugin_oo.rc b/extensions/source/nsplugin/source/nsplugin_oo.rc -index 6e14c09..ce57c04 100644 ---- a/extensions/source/nsplugin/source/nsplugin_oo.rc -+++ b/extensions/source/nsplugin/source/nsplugin_oo.rc -@@ -117,6 +117,7 @@ VS_VERSION_INFO VERSIONINFO - "application/vnd.oasis.opendocument.text|" - "application/vnd.oasis.opendocument.text-template|" - "application/vnd.oasis.opendocument.text-master|" -+ "application/vnd.oasis.opendocument.text-master-template|" - "application/vnd.oasis.opendocument.text-web|" - "application/vnd.oasis.opendocument.spreadsheet|" - "application/vnd.oasis.opendocument.spreadsheet-template|" -diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk -index 0465f17..36d7584 100644 ---- a/filter/Configuration_filter.mk -+++ b/filter/Configuration_filter.mk -@@ -488,6 +488,7 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_global_types.xcu,filter - writer_globaldocument_StarOffice_XML_Writer_GlobalDocument \ - pdf_Portable_Document_Format \ - writerglobal8 \ -+ writerglobal8_template \ - )) - - $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_global_filters.xcu,filter/source/config/fragments/filters,\ -@@ -496,6 +497,7 @@ $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_global_filters.xcu,fi - writer_globaldocument_StarOffice_XML_Writer_GlobalDocument \ - writer_globaldocument_pdf_Export \ - writerglobal8 \ -+ writerglobal8_template \ - writerglobal8_writer \ - writerglobal8_HTML \ - )) -@@ -505,6 +507,7 @@ $(call filter_Configuration_add_ui_filters,fcfg_langpack,filter/source/config/fr - writer_globaldocument_StarOffice_XML_Writer_ui \ - writer_globaldocument_StarOffice_XML_Writer_GlobalDocument_ui \ - writerglobal8_ui \ -+ writerglobal8_template_ui \ - writerglobal8_writer_ui \ - )) - -diff --git a/filter/source/config/fragments/filters/writerglobal8_template.xcu b/filter/source/config/fragments/filters/writerglobal8_template.xcu -new file mode 100644 -index 0000000..9cb8a8d ---- /dev/null -+++ b/filter/source/config/fragments/filters/writerglobal8_template.xcu -@@ -0,0 +1,17 @@ -+ -+ -+ IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION PASSWORDTOMODIFY -+ -+ -+ CXMLV -+ 6800 -+ writerglobal8_template -+ -+ com.sun.star.text.GlobalDocument -+ -diff --git a/filter/source/config/fragments/filters/writerglobal8_template_ui.xcu b/filter/source/config/fragments/filters/writerglobal8_template_ui.xcu -new file mode 100644 -index 0000000..305ae8d ---- /dev/null -+++ b/filter/source/config/fragments/filters/writerglobal8_template_ui.xcu -@@ -0,0 +1,12 @@ -+ -+ -+ -+ ODF Master Document Template -+ -+ -diff --git a/filter/source/config/fragments/types/writerglobal8_template.xcu b/filter/source/config/fragments/types/writerglobal8_template.xcu -new file mode 100644 -index 0000000..10c866b ---- /dev/null -+++ b/filter/source/config/fragments/types/writerglobal8_template.xcu -@@ -0,0 +1,19 @@ -+ -+ -+ com.sun.star.comp.filters.StorageFilterDetect -+ private:factory/swriter/GlobalDocument* -+ otm -+ application/vnd.oasis.opendocument.text-master-template -+ true -+ writerglobal8_template -+ -+ Writer 8 Master Document Template -+ -+ Writer/Global 8 Template -+ -diff --git a/filter/source/storagefilterdetect/filterdetect.cxx b/filter/source/storagefilterdetect/filterdetect.cxx -index 5917261..fa10c3c 100644 ---- a/filter/source/storagefilterdetect/filterdetect.cxx -+++ b/filter/source/storagefilterdetect/filterdetect.cxx -@@ -45,6 +45,7 @@ OUString getInternalFromMediaType(const OUString& aMediaType) - else if ( aMediaType == MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII ) return OUString("writer8_template"); - else if ( aMediaType == MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII ) return OUString("writerweb8_writer_template"); - else if ( aMediaType == MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII ) return OUString("writerglobal8"); -+ else if ( aMediaType == MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII ) return OUString("writerglobal8_template"); - else if ( aMediaType == MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII ) return OUString("draw8"); - else if ( aMediaType == MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII ) return OUString("draw8_template"); - else if ( aMediaType == MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII ) return OUString("impress8"); -diff --git a/include/comphelper/documentconstants.hxx b/include/comphelper/documentconstants.hxx -index 47d31a5..940740f 100644 ---- a/include/comphelper/documentconstants.hxx -+++ b/include/comphelper/documentconstants.hxx -@@ -75,6 +75,7 @@ - - // template formats of SO8 - #define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII "application/vnd.oasis.opendocument.text-template" -+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII "application/vnd.oasis.opendocument.text-master-template" - #define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII "application/vnd.oasis.opendocument.graphics-template" - #define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII "application/vnd.oasis.opendocument.presentation-template" - #define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII "application/vnd.oasis.opendocument.spreadsheet-template" -@@ -82,6 +83,7 @@ - #define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII "application/vnd.oasis.opendocument.formula-template" - - #define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII ) -+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII ) - #define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII ) - #define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII ) - #define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII ) -diff --git a/include/sot/formats.hxx b/include/sot/formats.hxx -index dc4feaa..4cfb94b 100644 ---- a/include/sot/formats.hxx -+++ b/include/sot/formats.hxx -@@ -176,7 +176,8 @@ - #define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uLong)139) - #define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uLong)140) - #define SOT_FORMATSTR_ID_PNG ((sal_uLong)141) --#define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_PNG -+#define SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE ((sal_uLong)142) -+#define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE - - #endif // INCLUDED_SOT_FORMATS_HXX - -diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu -index ca65cc7..51ff7c0 100644 ---- a/officecfg/registry/data/org/openoffice/Setup.xcu -+++ b/officecfg/registry/data/org/openoffice/Setup.xcu -@@ -233,7 +233,9 @@ - - writerglobal8 - -- -+ -+ writerglobal8_template -+ - - writerglobal8 - -diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx -index 82ce37f..1ced0a6 100644 ---- a/package/source/manifest/ManifestExport.cxx -+++ b/package/source/manifest/ManifestExport.cxx -@@ -147,6 +147,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa - || aDocMediaType == MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII - || aDocMediaType == MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII - || aDocMediaType == MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII -+ || aDocMediaType == MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII - || aDocMediaType == MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII - || aDocMediaType == MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII - || aDocMediaType == MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII -diff --git a/scp2/source/writer/registryitem_writer.scp b/scp2/source/writer/registryitem_writer.scp -index ea38cfa..80cbbdd 100644 ---- a/scp2/source/writer/registryitem_writer.scp -+++ b/scp2/source/writer/registryitem_writer.scp -@@ -1063,6 +1063,14 @@ RegistryItem gid_Regitem_Ott_Contenttype - Value = "application/vnd.oasis.opendocument.text-template"; - End - -+RegistryItem gid_Regitem_Otm_Contenttype -+ ParentID = PREDEFINED_HKEY_CLASSES_ROOT; -+ ModuleID = gid_Module_Prg_Wrt_Bin; -+ Subkey = ".otm"; -+ Name = "Content Type"; -+ Value = "application/vnd.oasis.opendocument.text-master-template"; -+End -+ - RegistryItem gid_Regitem_Soffice_Starwritertemplate_1 - ParentID = PREDEFINED_HKEY_CLASSES_ROOT; - Subkey = "LibreOffice.WriterTemplate.1"; -diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx -index af1469c..f88cfbb 100644 ---- a/sfx2/source/control/recentdocsview.cxx -+++ b/sfx2/source/control/recentdocsview.cxx -@@ -71,7 +71,7 @@ bool RecentDocsView::typeMatchesExtension(ApplicationType type, const OUString & - bool bRet = false; - - if (rExt == "odt" || rExt == "doc" || rExt == "docx" || -- rExt == "rtf" || rExt == "txt") -+ rExt == "rtf" || rExt == "txt" || rExt == "odm" || rExt == "otm") - { - bRet = type & TYPE_WRITER; - } -diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx -index cbda6e6..87be587 100644 ---- a/sfx2/source/control/templateabstractview.cxx -+++ b/sfx2/source/control/templateabstractview.cxx -@@ -40,7 +40,7 @@ bool ViewFilter_Application::isFilteredExtension(FILTER_APPLICATION filter, cons - - if (filter == FILTER_APP_WRITER) - { -- bRet = rExt == "ott" || rExt == "stw" || rExt == "oth" || rExt == "dot" || rExt == "dotx"; -+ bRet = rExt == "ott" || rExt == "stw" || rExt == "oth" || rExt == "dot" || rExt == "dotx" || rExt == "otm"; - } - else if (filter == FILTER_APP_CALC) - { -diff --git a/solenv/inc/mime.types b/solenv/inc/mime.types -index 7d39a4c..e5afd93 100644 ---- a/solenv/inc/mime.types -+++ b/solenv/inc/mime.types -@@ -189,6 +189,7 @@ application/vnd.oasis.opendocument.text odt - application/vnd.oasis.opendocument.text-template ott - application/vnd.oasis.opendocument.text-web oth - application/vnd.oasis.opendocument.text-master odm -+application/vnd.oasis.opendocument.text-master-template otm - application/vnd.oasis.opendocument.graphics odg - application/vnd.oasis.opendocument.graphics-template otg - application/vnd.oasis.opendocument.presentation odp -diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx -index 084b1b5..ff79cb6 100644 ---- a/sot/source/base/exchange.cxx -+++ b/sot/source/base/exchange.cxx -@@ -50,8 +50,6 @@ struct DataFlavorRepresentation - const ::com::sun::star::uno::Type* pType; - }; - -- -- - namespace - { - struct ImplFormatArray_Impl -@@ -202,6 +200,7 @@ namespace - /*139 SOT_FORMATSTR_ID_STARBASE_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII, "StarBase 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, - /*140 SOT_FORMAT_GDIMETAFILE*/ { "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"", "High Contrast GDIMetaFile", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, - /*141 SOT_FORMATSTR_ID_PNG*/ { "image/png", "PNG Bitmap", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, -+ /*142 SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII, "Writer/Global 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, - }; - return &aInstance[0]; - } -@@ -212,8 +211,6 @@ namespace - const DataFlavorRepresentation, ImplFormatArray_Impl > {}; - } - -- -- - static tDataFlavorList& InitFormats_Impl() - { - SotData_Impl * pSotData = SOTDATA(); -diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx -index 87fe013..9cc4204 100644 ---- a/sot/source/sdstor/storage.cxx -+++ b/sot/source/sdstor/storage.cxx -@@ -975,6 +975,7 @@ sal_Int32 SotStorage::GetVersion( const com::sun::star::uno::Reference < com::su - case SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE: - case SOT_FORMATSTR_ID_STARWRITERWEB_8: - case SOT_FORMATSTR_ID_STARWRITERGLOB_8: -+ case SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE: - case SOT_FORMATSTR_ID_STARDRAW_8: - case SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE: - case SOT_FORMATSTR_ID_STARIMPRESS_8: -diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx -index 879d372..e95a9b4 100644 ---- a/sot/source/sdstor/ucbstorage.cxx -+++ b/sot/source/sdstor/ucbstorage.cxx -@@ -355,6 +355,7 @@ SvGlobalName GetClassId_Impl( sal_Int32 nFormat ) - case SOT_FORMATSTR_ID_STARWRITERWEB_8 : - return SvGlobalName( SO3_SWWEB_CLASSID_60 ); - case SOT_FORMATSTR_ID_STARWRITERGLOB_8 : -+ case SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE : - return SvGlobalName( SO3_SWGLOB_CLASSID_60 ); - case SOT_FORMATSTR_ID_STARDRAW_8 : - case SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE : -diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx -index 3da9550..9cecce9 100644 ---- a/sw/source/core/uibase/app/docsh.cxx -+++ b/sw/source/core/uibase/app/docsh.cxx -@@ -642,6 +642,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium ) - SOT_FORMATSTR_ID_STARWRITERWEB_40 == nSaveClipId ) - nSaveType = 1; - else if( SOT_FORMATSTR_ID_STARWRITERGLOB_8 == nSaveClipId || -+ SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE == nSaveClipId || - SOT_FORMATSTR_ID_STARWRITERGLOB_60 == nSaveClipId || - SOT_FORMATSTR_ID_STARWRITERGLOB_50 == nSaveClipId || - SOT_FORMATSTR_ID_STARWRITERGLOB_40 == nSaveClipId ) -diff --git a/sw/source/uibase/globdoc/globdoc.cxx b/sw/source/uibase/globdoc/globdoc.cxx -index 3a6df50..2e1ae47 100644 ---- a/sw/source/core/uibase/globdoc/globdoc.cxx -+++ b/sw/source/core/uibase/globdoc/globdoc.cxx -@@ -51,19 +51,18 @@ void SwGlobalDocShell::FillClass( SvGlobalName * pClassName, - sal_Int32 nVersion, - bool bTemplate /* = false */) const - { -- (void)bTemplate; -- OSL_ENSURE( !bTemplate, "No template for Writer Global" ); -- - if (nVersion == SOFFICE_FILEFORMAT_60) - { - *pClassName = SvGlobalName( SO3_SWGLOB_CLASSID_60 ); - *pClipFormat = SOT_FORMATSTR_ID_STARWRITERGLOB_60; - *pLongUserName = SW_RESSTR(STR_WRITER_GLOBALDOC_FULLTYPE); -+ OSL_ENSURE( !bTemplate, "No template for Writer Global" ); - } - else if (nVersion == SOFFICE_FILEFORMAT_8) - { - *pClassName = SvGlobalName( SO3_SWGLOB_CLASSID_60 ); - *pClipFormat = SOT_FORMATSTR_ID_STARWRITERGLOB_8; -+ *pClipFormat = bTemplate ? SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE : SOT_FORMATSTR_ID_STARWRITERGLOB_8; - *pLongUserName = SW_RESSTR(STR_WRITER_GLOBALDOC_FULLTYPE); - } - -diff --git a/sysui/CustomTarget_share.mk b/sysui/CustomTarget_share.mk -index 862e57f..e4dde6f 100644 ---- a/sysui/CustomTarget_share.mk -+++ b/sysui/CustomTarget_share.mk -@@ -58,6 +58,7 @@ MIMELIST := \ - oasis-presentation-flat-xml \ - oasis-formula \ - oasis-master-document \ -+ oasis-master-document-template \ - oasis-database \ - oasis-web-template \ - ms-excel-sheet-12 \ -@@ -90,6 +91,7 @@ MIMEICONLIST := \ - oasis-presentation-template \ - oasis-formula \ - oasis-master-document \ -+ oasis-master-document-template \ - oasis-database \ - oasis-web-template \ - text \ -diff --git a/sysui/Package_osxicons.mk b/sysui/Package_osxicons.mk -index cd8343a..24a6998 100644 ---- a/sysui/Package_osxicons.mk -+++ b/sysui/Package_osxicons.mk -@@ -20,6 +20,7 @@ $(eval $(call gb_Package_add_files_with_dir,sysui_osxicons,Resources,\ - oasis-drawing.icns \ - master-document.icns \ - oasis-master-document.icns \ -+ oasis-master-document-template.icns \ - formula.icns \ - oasis-formula.icns \ - text-template.icns \ -diff --git a/sysui/desktop/debian/postinst b/sysui/desktop/debian/postinst -index 67072de..b9b6f24 100755 ---- a/sysui/desktop/debian/postinst -+++ b/sysui/desktop/debian/postinst -@@ -60,6 +60,7 @@ application/vnd.oasis.opendocument.text-flat-xml fodt - application/vnd.oasis.opendocument.text-template ott - application/vnd.oasis.opendocument.text-web oth - application/vnd.oasis.opendocument.text-master odm -+application/vnd.oasis.opendocument.text-master-template otm - application/vnd.oasis.opendocument.graphics odg - application/vnd.oasis.opendocument.graphics-flat-xml fodg - application/vnd.oasis.opendocument.graphics-template otg -@@ -123,6 +124,7 @@ application/vnd.oasis.opendocument.text-flat-xml; %PREFIX -view %s - application/vnd.oasis.opendocument.text-template; %PREFIX -view %s - application/vnd.oasis.opendocument.text-web; %PREFIX -view %s - application/vnd.oasis.opendocument.text-master; %PREFIX -view %s -+application/vnd.oasis.opendocument.text-master-template; %PREFIX -view %s - application/vnd.sun.xml.writer; %PREFIX -view %s - application/vnd.sun.xml.writer.template; %PREFIX -view %s - application/vnd.sun.xml.writer.global; %PREFIX -view %s -diff --git a/sysui/desktop/freedesktop/freedesktop-menus.spec b/sysui/desktop/freedesktop/freedesktop-menus.spec -index 09aeaf5..9c952a5 100755 ---- a/sysui/desktop/freedesktop/freedesktop-menus.spec -+++ b/sysui/desktop/freedesktop/freedesktop-menus.spec -@@ -150,6 +150,7 @@ do - icon=${link_target_dir}%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png - icon=${link_target_dir}%iconprefix-oasis-formula.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png - icon=${link_target_dir}%iconprefix-oasis-master-document.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png -+ icon=${link_target_dir}%iconprefix-oasis-master-document-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master-template.png - icon=${link_target_dir}%iconprefix-oasis-presentation.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png - icon=${link_target_dir}%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png - icon=${link_target_dir}%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png -diff --git a/sysui/desktop/icons/oasis-master-document-template.icns b/sysui/desktop/icons/oasis-master-document-template.icns -new file mode 100644 -index 0000000000000000000000000000000000000000..9115dfc4b443fda6eea466552158df12de698a3c -GIT binary patch -literal 118979 -zcmeFa2UHW?w>~@xp(#>C6f8&+5b3BCLAro+6?-p;V!?(8Dg%Vx6%gsDG?k(#AVnfo -zIw*+rCPj*X^qTKX&=_L$eeeCrz3cm5Sqo;LXP0N6IWv1sHiMoyap4MtD$m}fugV2M -zkinTNQj!pa-g8CfyeR~s=+2x&#?*c12xAQ0nXAZHj`k{HtVDO_gt!a@2`7W2ECd}k -zK664s9D*{MzQ=*^4u%lk#t@Ci>)ACxzIJ+4c)WJ4?Ih~c9b0W6YgO4zpjzB)w1BK$ -zZa0A$Yj9Lohw&(t68kZ_I;@Hc96gjfaO5CGmK%xNl?H;o&$jJYFQm@hc`q -z1dkVTjzA0H@vedp{*O)K2_yzTA(_OtF>w;#$KNL*Mly*x-H%DkjeksnF#eyIL@#6j -z_mWKF+n6|s@8j>2Fd&)4obJaY=EgrJK^XsL65lUN$RAJm%4dggcziPi%?sLKndv>0N}#^?vET1fOL${CmWN-Cm1fgK7ll$1nB#13FF;&pzwJ69d>vR -z0|;+#V24NP>pL}}>dc+=?eJ(_-FnAKbZ^a7M_n+|)~9($f0iGKTJ~I1g*tYzJcvjY`*1bVu1)SOeAs<89k2+=kJgO3uLB?D1$dwKDgw -z=$1lbSPhFutE!fG45FL!Pr|CeQdzmsa{$wjdt6!B4v$e%dfVTRg;2;3On+ULk`e$F -z6?1!gu_>tDUO2_(6{fE*Ur`aj3JTdhJ-`Y`uRyL!(9eWRj{J^xgXUNKejHIR0yg#ASq@{tu=FKTB -zEr0|0foW+;*}NHm8#g93H)EfpkRO=l=A?}q0VpN)qNxd3B0n%qO)sRR04OQ>9E=|! -z;3EJgN=gDyTs*#^0b~;xh#Y8;LxQ+CP>6}e*4JZwP{MFj=#J_0}N@b?73H$RO3|Ie}; -zAj@t*w(NDtve((vlP&ueWZAcnE&DrU+24^Zy98BfDOh$18stE_?1jj(7yf414UlCw -zAY1k-WZA38mVFDd!du9ey#xVE$d+A#s<03&y95n#AYJx6WZConFD|K$hKuY}r2}%l?^c -z*-elYHX&Q~E(Gi%TXrL=jt;QwMl{HQblKaHWpDp;%l>`u1s+pM%_Pr(L4PI)dOlA0 -zdJ2@_tAa!g#J7x4<~L+cKVOZ<=QFZ@oWm&VfdR*y!7udqJVuThB*L%s_`D@6Yk#N5 -z=Pp@Q_ZxpaVvrU7%lII6&XPGT`C}N#i}01h@Xg>mKz_{rWfP%UC$^XKjKpyD7fA&I5UGXn>y5R$N-ovNtaK;Dk -z@WrR@a3UPjb~xgL4Sn(Hh7N>dhM_&-XlD@DjEXR{H^Ab94Sex-2Jy|Phx*76WuPBG -zKoY(qXdN9re|=!24>v&#;Z4rX=rCP9tUlQ3X>04<0~%X>NDt9PO+jDnn$W@8b6QO; -zT|Y#t2kF2KP+jyaK^wGP7pn(+)wk*R>JhZsKwBF#i~3q`+kg(x)FG%<)pUHmtLvef -z$Fu0c+IpJ?^gWF^y|Rk-U0vX=3u(diQ1z2(^guP(MWB7vwXwP&yppo^ojJWG(0_P3 -zjqWGt@2Jh`w<>CTBYGW31FnNAW2e!5Rkb#CXm1s5tPb#(SJ>{QL(p#n`uB0u=-x_1 -z@2Nbem)oM{Ij2{LYoYS^X>?CTwM{MBO?f-PUshJj1JP?ksz6_s0QBXE-bGOhs}17I -z$ZEQ46Z9%@4OH@M8r@y`!KMc7v~^Ao;=9f1m4UwK`82w#1kpPxXcGM8wrIM}>6PGW -zs4#H~-C0;^Q;oKlpVP}LXuAB+7rX%a0z{9M(;)b7Rn&4u^xL7W@CPXW~@f!qLQZ5c7k33=yQ{RJ{Qr$-}Fk#nvRHG3)%u#LD|Vu^q;aTs;WMGxFxNQ -z)dB&Ol{Fo-2nKS%AS-1G-I`TlQ-!|yO|PP=Y5!ec3B7ssU2i2b=dY@+iAD69kSq-J -zsgvlI%yOGbv?b7Mg6mXm8&;E`mVw_xuhW3~HKMkXol|equtU@ukTg(dq)(!o(#ve# -zqi@KnVKuOLI}JZXw+XI*(lX}h9(>1BUn6*_O$GXfoH|w`9B;b~k^=TAnE=l~a0@v# -z?6$Buyc|l#O`;nzN^Hu}7Fz%winmpVB;j%>>CFVX={161-=d0D4?%DVxD0xcHGyt; -zU1U>+HkSu@FoKH%JTaSyD*!wQZ>t6x1*OpQ90V`4DMeocxLP2Bivm0$7vOIQ_*Q@i -z%;6Z!g)+!Tj)B=#kH;JGJL1mf8Wb2L`#o0D4QJ -zf9Npk0KwGg(NSvH4dvlu<3^3^?&<5Nwi$K)2`z^lMp1RSHs1nZ`19Ys4WA1@2LjwX -zb;|3}S@;ySe`Ql^A0fg|a2e!?gn;KlC_#L1J{0OO;ylGNGD7{p+$r2W>bkkPeP&%_ -zFSQLNxD0X{p~}zA&$m+obN?2=XM~nI&h^Ey-S=Z)2TWr5hi+<5a;O+M+RS+=LOgIT -z6znj9OdTOkOTDV4rSmi{AUQWLw+12p8Ga4?p={u{)m9NO&&3Fui-7?#^8IY&>9!^3 -z#_R8SlSK$Yjz0b#L7o^P2MRzYk64z;*ox6=*hqn&=!LCR)`D8 -z0Y1YhYHMdclq0q0H_04w8irm2oviIvkSAi74c&7XM&^nh9;S9Z08!fvgT)21%K?-D -zVxA66=FAnKwLtcpGe->%yAy1IfLuYqG8Jg0Z52RZ#4-!=br^P@MC>L(%sByAB?HZ- -zZ&sW@_Nn*^C4u8c0wxcwf!{!P9KJe0cc^W?-a#UNghCpMm%TKJe`{2t@U0@jmD-@LOxU -z8DudRgqQ{vU1457%5Kt<5 -zAva=#jUWp`1m`ite}1Xx`3VH2q6cyT9xH7(0{)GF{{<)&J;YM+O#-E&2XZE{TLI_ -z-Cfvj=TXFR6j;s)4&CUkZdVXz^$$xbVA)mFP1V)a?Lng9ho57Dx;j9&qKj}NcOf@2 -zXd!fVc652b&xsL$9d&S5J212%F|_NV28Qijp1^VqflCtNhZAUmx;`PMa97}{4fwY0 -zqCw0)0lNfn@koN~33jx>U9AMe>@He@L2H*cuvkm5kN}b5>4Q6)TM(O$PC|N}NP2K5 -zT?dHP+S1(V4aWm>2@sHI{>}b}`C<@y&b+zv4vD=09ES?-gqtx0g1`}*&cG3xZ>DfF -z3fRVh`wfXL4pNCjhjcW+P1J<&?P(p@zpX`4)(Gr|KwBG|>ytbksIf55U*e9^# -zp63?-iKP{pO+!QdoKIENr+e@dP+Pxy#Vif|^q$-;_R~^wxA&g{=KHaRww6~^R?ZRD -z)z>3=wmfNNZ9(V&8#1pCRh5+$<*fm547BbW<9axHS!iq7&#p18%YJq(YYhax`~+VS -zaAu;}!dgoxI7hXzQE)D44T7VAw+J{xBG7s`YI#^oK@kP_h}Pwl+zaRV3&Bw3@fe=Rsj#w4ml#!X0lLKZ2 -zR;GL|A#f2Q2{i;Ztpb-G;iMoJ!~2Tz^0E?eT5@u-GBcV&;Rvu(AVymKuqo}=q3$=W -z{&lFdrZ5m|Jrc`K2!6EYVN>dFLfvax^P5nqAl4%gOK2_@=fj5N)YSCXb0-TdKDd66 -zlMZe)5l2gmhbBHxZ!L6m?1%ul^;9UmVr -zFU&*5&CSIHuSIimuCZB-TD1yZNyWjz&Tg{;T8?FdmfNhLVrS>zfL9`_)#x>AIBnLV -zxwyD(crd)YeCyW1{2&}w&==qS{ae5f-zMOXZ{c^v|7}D4ZA1NSL;Y<-{Xf@+!g`L{ -zVd-IuOJ`3WIk0!P(XaYZj603?9yoIH>?I2riya-sf=*X)nN1;eYe(N(;@p>MT>befY^xGYrnp -ziDLWfA3Xj*LyUyM73(HXp7-Vo~g%(Sdiw$m--}rfv6xZpsLi_?K)!@x2C@X5wQt3YVrOk$F#~-wEa;nIK?806^|zp{ -zHj>*Al(w#UW#k{4Z@+V0@OB*Qk9OR=;@mlJ2EXplA^wC0T1N-DKiiKz%>Poqjsax$ -zBP&o!JHD0Df7iNO+|)eJyZxK@-!2}~GyL1d1I@>>lD}QNpPPYyyLf-Qcz?TidXP4F -z8SL-NWPe{K`};E4|GAgR>OdE-j{ZYIMq2Htnzq7TL19V?mpNPqwEs7*ihh@q(Pc|r_Y5Q7xGBL7^Wm#Llsk8IW5Zu|sU(iU!z!# -zGEz4=c|}rEx^QB2@@voJ1d>1<=-kbRzkoOtJ9lKUCZ5>v(QRy;Dp%GSoFs$-t+zT- -zwEue~N}ap9o^`ftv~nJ++1T_6nINy9k%ELgD0S}YZaYILw>r?do0EKg(YYhdcX+tY -zRST*Eox3{FxvO*0LKz@#lsb3w-P{R2Nav39a{J?*yC0<9b)a)MkBj0%-S-04Lo8sFyLDvw5(*f|5_Idn6)?)(I#M^#t*Zmwx;ms=H}9HT -z*lyjA6hJxanpZmhsay9O*Z;|G-Mln9=gr_>b?eCe*?#O*{ujG-Ke7Vlv*TO&{MX&O -zdEV{cy#IFV{&wrWy(;*(TSw{Dy}#YMzumfj*RA{hPwyaq2KwU*b2h4B?oYx0_0O@o -zc-yr|~Mf9>(_HN*sTe_aGg -zIZ5Sz&+;2fVgmZVOn{V=RQ^rW|ALB`z>Z%fK*~uf{})JpXPW!{8rU^S*^HEvRHkhG -zUq^`v?4g_hDJQA?UuXJ-2Qh(t6cZrjB$a;=?Y{vN6F4|U!JCwmRHk71--UMO#-Bxr1F14_p>iCfn(%nfRvL|{yD~fgyem% -z1LR9U%1J8!M{E?Fi3yOM0a8v#F4EjX^q@1Mke?~^ho0!17B_QP_l_^E|4>4i_ -z$7X&+BIP8Ne^~rEDUb0R!_glJkaCjBe~y(T5;1|}-xKH}FMB@QXrE(Fvt` -zDcLRrMkFK?7J`dXOfp*Hkdo~}U_?SPVIjCE#U!I84k_6#1V$tz6BdGtQcN;h;*gT< -zLSRHfGGQUOD8(eBB@QXsE(As-Boh{bi&9K7TH=tB?LuHgLNZ|?xG2RWqa_Y0*)9Y| -zBqS3Sf{Rj2GFsx0lI=oZL_#uQA-E{TB%>t`DcLRrMkFK?7J`dXOfp*Hkdo~}U_?SP -zVIjCE#U!I84k_6#1V$tz6BdGtQcN;h;*gTt`DcLRrMkFK?7J`dXOfp*Hkdo~}U_?SPVIjCE#U!I84k_6#1V$tz6BdGtQcN;h -z;*gTt`DcLRrMkFK?7J`dXOfp*Hkdo~} -zU_?SPVIjCE#U!I84k_6#1V$tz6BdGtQcN;h;*gTt`DcLRrMkFK?7J`dXOfp*Hkdo~}U_?SPVIjCE#U!I84k_6#1V$tz6Z#i| -z?B|&MWVFO#>Cd(cfs_&n$%N>IVEZ{{G#M>%DDnL-1b+7UgUE~ok&s+~{|6G7fyr4( -z#!`>V7W5+QFO4Rf{h1TuG7u!3>};T?v1HN8MIf0aTAFG*AP5CS6hub@4hJts8$%G) -zz!_Cl11(imE`!S#jnAAr1wn$|?nVt4>vk8nGB%G! -z>u$tnm6fkbJ_S#|h&ekHSYoarmA95LS4 -z9pfDQ)@*|rc?Z|ITZk!ry&qupC~KlXdU?;zey&F6l(XaZF$S+qN__ZJ&R@P!y7jR` -zkZG#4i-O$>mZrz=RlGZSm3)n_JU!xM)#LuGJX8FOh)&1;+sk_%uKS{4*7QEF$jOS? -zx~sMuQ?_q!r19bQS^EthM;Na#e-KIB^=YfKT1Hr&(wFL}yc7}H<~Huj2P6+kc`Q?z -zy>o&l(dm`<&;`|4Y|yHJz@jUPpSHdf3NNdSd+c{AV~yHPc8_%%!;WS%e39FmfRc>% -za%6bD#>{Xh6_t*ULFEn~cIT*LjHmi;w8Pn#a{QM(t-il$+nKT!mM_@Vfmd1Wd-FTF -z*56S*>F);XH1b{a&gOG{$8y>1ebQ>zvf~Xk!$Vs)mTzcVV^{ntWZRKt{ZFmlmB(8T -zk1aQy@(wz)A=H8vm(BRXpK5S2UUVj5!`EjjqUlzNJ>5%nS9JJ7kzmW^U}$C -zQsJdTrjh1}3&vg*@>{ogIj$(;I-Gs#=FM_5Jkj&=DnQM*j8s9x`IIcH-c%0*8%N?_Q<60>^H+c`b1y{9oo*3%2 -zvpi5Gshf6qr+9?hivyNgh16Zc(^$O-aid(Y)+mCJHTbM@&I-_R7=YrH9) -zNjkx^{)nc)?U`=ohlu2MCdGKEdO)coLh -zy)`iubx}eV)`!RH?{^xdSys>98oP)ejW?Glm9^zr -z?pgvREXU7MoY#^r5E^?q(*GC1eNPW^8u6b?X+D@SPySmxTn -z=gddsVW5yKonVsb42v~M+FUwuS3yCc)3W~NYuk5Hw;_M3u<9O_>6Pf49Jqs_g*?*_ -zQ8-pkS6n-1$bqYV7Kh+YH2D7s-_tc8IDAhP<511RTrYoZKzKA2Qj~``LEX0m9qAaw -z)Rjh>gO0tq5?{lF^6yvWP#dt|K?hwif-N+T23A{$LP0|l%6oXuzdpYtXh`70(|v7` -zbm^U~ubfuDrQ)iOM8SbPX35%}++Uk-aN+_snF_O+<*&JJacw=8`mpuPwfZY%3Yrl+ -z%=Is=#yu|yl+OG#ydMNfRP<1I(e%WS6c5BD&hjz+#t?I7y6ctMIOr1N5$X6rUOK@_CjO@q*0VRy -z)u*uB;Zrs;ihg`{gSbV>rfQj`HjbQ@T@YL((>YVSiMf=U2^Rmv8aj^Ie7+X5&+m<_ -zih!I4VvbyC`}8;N!>Lx77{3wnw0uKH5vru@9y~iHcdhxBL3~^h6!sa^Kf!ee2EZ -zx3cb4XUO7G*)JJmhXq~GrLrgYCG9vz1q`SYTkh&2ub%@3Z4Ed|LW3 -zkLB#Hgxr6|Rm`n({>&1C_c@p#jL{~hqs_`or3&JS7ki^ByMeM#$o?Iv(^ -zC&o{4dLY|6$+BVPfuwUcu1|bzzgO@)o$9mtsTlXYO8(q1%SPRJYUI$t*$_dxL8rBbFxJJ$2veJ!$w-BN`Y!X}?| -zh1s4d;HQV49m{sm2~mQ12K0n{yIX^-HF=J59>d_GE4*o&6$0qQ{qz*24>W~Ne-gOV -z<}Ph3K_kL-nq`k#bAdqU&8bIpt9AI6`uqFS$vX*HG8_2oC?!srCZb;4NHp5DE9~V< -zHa7`vceBCPTn?6U%cHLD88%m5_jNysH|ImwC114GHuQ-I8nP=mxs;WaRZnlvFgA~h -zYZ_cCKEA%;5fST#tVP~kd~t?{OY07=K5iY$UYceDAzvOAL0BAp6w{6x*S>LMf=?fJ -zuEDx{XK0}lT=Fbs15d(ihC!6@zs6Sv>QDgW^o+-67`LyIWR^Z$NAN3BQ>f -z>5(E#+fvAPKTUHyNTIE*4W!^h#|s(f&tfxofeFOMim*0It!mF~wq2ZXduCEchs#@Y -zuShK$i$%x%)3cY~vC7=p9wEMYbH}Hv>W<>dN-iiTZFO~Ze*UnLF5@rl)GH3c*Lpsn -zpcl_lf^p48dk(d0VnS|Dey#@T#R(RApOkd2sHng_oOaO3Us!3F;UbvB}BF3A^HQR~&HznaQ%* -z2pn8$1A-cU#bA~~yn=Lsi~$1BqZ4RnwJaZtBbN)-?M*X}Wo3zWT+EYTS{-+9m(ig& -zvWlA}By7A{^pD^+Y|O%-3UJx#*REa5V@;4u${c>D{mi^?KlE9{J3l`^mL{)Twp0J$ -zjdou!3H8#6MWqvi&d&5fGM9J;;3HbJDEBaK*rKwsGVI|)-n+vmc4I`-dL<89&x~*k -zCU`&E$%I?NV$t$QKs?%6DTZYwiYw<)WF(E0aWO1h`ljshXM4e{)}!l!TyUUjCa=P=K{VQ07%U64 -z2<@;|7xUDkFD)&N#WfcvtHI-)a5t_elJ041&^nNvw7IyN@9w~VIk7Tw@nA*{?FAZs4n^p^s%A;B^IFmOnVNs_{q#DnjJu7ZCdJcL!+_i0t4HC_q -zz6>5vTKW61YB-)OddP4!I8{eMwe~v2VH}cQjcxu~B&MOS&%}Nr;mplACtTd2G;@hO -zNgjiz`YaCHAQL*~t=-+-k`k!%<~W8u2QN`uT3SL}281g_H1DHO-p7QJW6lEx{9G;T -z!5WT#%->3*bw^ltX$OhVmgB^9(Z}ymzQPyedz29R^0Z|iG&XN -zaoM1+D_i8DrB1D?tSHD&-p1(3?o($T+Pr*%LG7hf2q@qkg0-Y -z9NkC%fGfHfy*!M|cH~_0-g7(-wM4ys%^4MJz7m*B`tCXG4C>fvkHyo-V^Ulcv|M=IFXAj;Qsk#q8a1Xkbtk$gW_RKez2c1QY -zT2EszZNdZX?Wx!kf7ty=Tbh}}_Y22$0-Vj**Ad5{@h-LS_ -zypO(a&%6^{Ky6Y|xOwK?$B$0$^%WZ~d%iX<3D61w&zgi=Q=_M$gY-vp3RgNm0N00! -z0Ylhuxf%q{O2iXlQA5 -zUk2_K_G3ZO+PsMc3u@2HV(}G}W93Q1R>KWq`r%w*S|&~g(;GK!YH^b)g}g>F4h{}F -zYgV}CCR}bW1j$S3czup{z0}r8)(oxLn7j+GKaoG%6^sph5vJZ`}uI^p6=JCO{NO?M4 -z%!??d^IMfZInebUbvs0TlmQM-T17j+D^Puu=9n#fvRO?OJoB@`E(6*-hVc_QK-0V{ -zGCbFOZ<%aU>hat~U>QL%i()^q=W?l3HfnM8z;#cB(Y={>zm{;h(H`Z4_?ROKUYvPv -z2CBBLgx?^hH~~~B;R8v+iFsj%^l>qC^0VV@`e#C*6UDv9ni`&;DjEy+F$Lun<{ExG -zf+=>vrC#evxcd2Bu~6>jYWAzDm?Wt@QPhCLo49^d%IzXQktXvUA#C7Ej&+pY&)_4d -z3!d%gZ=idsH>@;3V%aSshQNHd?|X@1MfyyTcM$|NLITpN7x -z?-S(oJh0S8Tl5tMlFUZACQ@As8ajXP$n6^yPOup#e7JpsOY63?>kRo`ym%3onE3v3 -zUNd-hUK-3@K?OG?FRexiu4G}>gXpq^MMOmIpQhcYkJHf)5kVUt-hapO0SgM8!mkkB -zmKRA$t>9wxAKnzIdKl_7Z9MiU%lnr$So9#Ke+!TwMd7 -z2Q{|gK=OqdCV@&U%t#f -zvdYX`3)aro%+AlxPs@}c;0E8`A&j5!K6D=YGWBPPxYL5_O6({uCfLl?&u@8g@D^!S -zRBt7J2Hd98M8$p^1%+mFau&Uf2q~YV$cZ}V$b4gdDJQny94*cj)n0yiMBlV=AbrEw{0FjHdsdeT=>BHR7M=)eNAyNhgId#lEu;(E;>b!cQ%+DxKE`v -zU<#hQ=>~2-_Qsa_zCY}KEQTMgVu1#`bQ+OG+sEzs(Y4xY;O5J7Uo|-BX}ua!5d%u7 -z9mT9%{^5he=%_gq>9O2GC(MutKgz5lJ1 -z26y<*)xMxV9enM>qkTeKY~IAh#o^SH*qLB1+efjnOV+Gea! -zPO$fe_;riVTok>`h4#D(o_i@Xfs442?EqSNT;0lQ3;3VuMHH3_7fFIoDN_C7FKP}4 -zqNc$frRZJ2Nj+wMI!$JtipEBd4<9}h-^^rVDfbgfUI{6_3NDkyhg4_ktAea^U}kp@ -z4@Pibp*73K0&lD|@H6tHU=DBaTkaedNKoHTT^q4dpeLLD)D)<&v0Xo6*ECt$u!zPb#N<;g)-mo^@lp^D|z2|YhpkkbM>(0ICa3PVuFD&wsZktc|g&C -z;Lo|r4=Mz~R3%QAuHK>^_u`5dQYn`Nh;XSzW@M~+AElrCiC*oYA(FqjTJz2%(RXOD -zt8{Hh>6sn0Qz}}U`ck3%>y>9lYYXW4?y@QgF$&Ui`C@!dP9E7rEhr$pi8@*+ObFWZ -zK2%oUx&x9C9}PTk?ueC!hTNXcftG9z7V-Tnlw9d=PSrIf?Wo*Xx8lrFuwzjGpOw`f -zJbXx1Qc}VJs#ZX1MXxevz_~*~)SzxmN1kmHL*?;byn_*^_xdz^di|oel3W^k7b=FA -zJEJdCGp|?OxSvr?F(4(Py6yJ$eXbj-Gov@T$i=Lc;#H)*3%wQkL`Ta97p&IVf#NWE -zJ+pgf=TNOGOZe8q9}jqZxme>-XpQBN0xe#T)v|Y3P_7#=9ESZJ1z%YLlBpa;n3VeE -zigZo4Rf7p;n*GK&+RM*n?F_Va7L{t6{Ou`6Q1I7 -zE8E^q`$UYO+^Um09G^ATjjFgrEA6shjoQ0QeZ)spX(WBdf7>4BTThubT|1l8V{Fyk -z)dfF(EMqw=xJ(_?FCWU}c -z?An(Zb~j>2LctFDhk9=Q=fD?a`*DZPE0{^-@0 -z?F^@N+_`cc2fD)hkMV4}p*yK2GFbbtZ3arR9AQNToz1u0X|v6G -zY*h>2vyY+FUi&NqcM3ezX&oO^ZOX40SJrv7bZreyo+6HFDwD=npxlr*JVwQ~7!Hth -znArKyVkcIDeTpDv})>Bb51MB^R=}AU*15? -zE5+>m$EB+0U%6$USd_Kn#Otx~Ng=LlBl8?YBtsZuzeDEg9Z+ -z8_Um7RNq;1PWVhJc|A-JEoVQ{{v@ZNLWo_J~zgbzSEZ -zb&j~MQH%C;xI8psCZe714Q;;VR) -zwT0r+0*Ru0esPD`{@KKq+x<+h9h&+w*O;EZ^?v%5cGy0dg-L06GQrh^<^mQpf)c0fPd%fq -zh?DB-p--JYXq(De@gZqhDV6yCWtAdeBl@J1HCFzK!L1ZKL5K6;a|YKrHVx(p@$MFN -z(@wDcY0`N$aaex{Qfuq77M)I=$P4u^%VuI&(ZsNEx<^+Tzml8I9de2c!gzZoyxa*s -zBCUKt?Mj!WE6D1_<-!ggAMw1bxdWR(ukV6bSo1Yb*o0lZ!7k+9*s6GA?yOOV4WM!K -z)W&tU%`uzq^OC#PoK*TnnU^6Jv+a1%n6lWA-4z95q`AIRZnTb=k2^$7uI%~arKXRk%w6;``KbcR6)-9bS8~f -zAgwQ40XD0+gCK0X>{(ku8Z0Z68I3Q#s1i(T_NnOoL4~Fl)^e@g6Y}9ooVaFu`o^v& -zR9uaBj%))TW=#UT=%|dF7=;&2967GXtfmD%2!@ReEQ{Ujcwj^+#5c`=Q%Tc*{9YOD -zEqV|3Rf)5k8*Z8`x%_FB)FIg;1}R2s^;ph_G&z;iK_k1=*y#dk4?G9$g<Un$ogZHc5`dUaG`WMj^0`HR%xg&IY2J7n$v}DWH77o@>OfoxDD-}kL`xkSkPag -zn~}l~))qy(NNzNe=v^zxsgbvHwJ)1g7(bup^F?{Nj>Jg`MY%s$2{{)OtZTS& -z*P~Tkwtj*;R?Emmc7-U0d~$lrpjvTZmq+6gBWgZhWh2=zDEiKuiI@zZVy22Hi(WU40oKK(L9Ik|wbDarK>{u-yq2eMLtwj^*-#_Sp*LJi&a(WF*H#Nl$SO(5}Z|*Y4ub)jQsGb}+L)YBVu_@~YbUVD7_lE9- -z)}G|ACkJ|lX*jA39S&t*KgRWX1vD^Sekj^EKqB#`#PZD=1GP$vZq%WFvu)V1U8~a3 -zQ&}kuJX{CUoOmAUY`^Gh=rFpUqi++-YMpead$en}$;;YUTt>G!Uy|QCFvh-PO5&wT -zUX3oxu5J4oMR=rk-ILm=dnW&F@fPvQQC&VEF}3Y6v^!dR(lSR{LTQ$?g<;*x?|++tWBjWcs93@hk7;?KM<;O)}(hUvA(0pkYu58d0$ -zAX*Lmk*=jw#=6c&&&rB>@3^FcTDjpAL&2V7DYw}Qg-(f&U|`hFk&4Mo&%pVc23_s| -z8Eh#PUD3zw@$&a0l4Y++7V>#mD-PdU?Y=fgO=!^j{LyJD`2@VF!4349O-loW_}(%^ -zuRr0hxXC5bq=*sx69=7C_i -z^ELW=^wAm;3Jkkeo$_KI_*#Bqe8^jIS$(qg_$hg_=FP*U>8y#7n$at11D^1SKkB*G -z`HXg;YwEhnafZ;~DXE)JyX7nWie%&?mC`%>)@F9M#kWnqce>5JpZ{o=Je9E5(_u^Eho!aFrGpo-7CoDc?uT?sZ8y2ExP&&Bg&7m1QJ-)LcGkfoGc3xK1@!Sxx -zmhv3DYD96x4iR34JD*SA8n=m7$l%P%fi}9VV>){BBwznni4g+>PNDxcn_ZiuZfL)! -zm9H2IjQN4H9oXgTh~DNF -zI^|I95R&u6G5NsO(GclOkL$+M9A%sqkV`;uTA8=^t?`y8)vW^BAxhU? -zY*95`aXxn~c*;YW6+PbR9pCo{T0K1j0+jX#!>_c%zwZySj*qWgh8ez3+my!oFosoA -zh&9A7@%!E&=kRz|+2qG9R~6yu_udzdB?Y_iEL+!u(wS<_1e@1^mKEJYepY6~*C3p| -z)NaeksXH;4(ItwsiRkjtA!Yq|4eTU4`wceSx)49sB#-SfC~-@V{ma@ns`SgDM -zKZ6HUmGG_0Zl7H#j?|T7n6O>Tsr%;b4<@l8I48p90X(JVb~Dfu(ff}dd+erPIaPA{ -z+*(tI`sm5>*uD_I(^x~FrkO^o^!4_MU2ALD -zIWm12H8x%Xt-@l_Cr@APy~9_t6eV!j)ZyVAbD7crkm?F<)qn9CV#kVRkR4MGfiF25>Mkt8G3!Hoe;pdz+<}U1@7u5)b;} -zSi{m{ds=M8)BNV@+MB6MCEms{Mdj%;QB5da=noF24Z9V(0bQd{-|=P7S*LexPPX3M -zD^_k_UhDaR%FL<4LU9W3_Drh>wXBe_xZ$GNK&4R1g9aZi!CZML*j(x(ZX7bf<_)-1OkKDYosOU$)U-o$l)}=tT9VMbugdEH0j`ihj~L -zghk(g*501F8>!zGF}R8&*<`0=5WlngXTV&Vei`$a4 -zBW6M+M!nnLEGofZISehC4aIk^onVlivJwb(so@GUK|UO?FF`$547|_Cw|%jgyW$a9 -z%kw%LZNSs|(+LYH9mwPL>@{x%}Fz6SeFyQ@nfVS7=f5sf#_k -zFdK*cmW%ndsH|^`8m!BR<6;4u;R6!Jp|kHEWPJ}F$T72}H -zGP4Le{$ANd;~NRRL(oL1z}xHTH7DrC-fmLMFnW-fIaD+rE6>2UKMiymO+TPA%>YF3;F{AR20{-I~~Li@@-YGGXL#5t_}6(I02 -z#kfMKPKViGDrn1X+Tz&dPm={TFYMdx!R=OXI{j7Cij`N=xEo(>yReOU__p0!EI(az -za;71(_*lB}^QmEMxWUniLJ90v@acWG^=U6UX-vY`>xprhjb>TSTkc;xvLT;&Z3MfU -z;yG0a{JxuajK7QHV%(d%bl5=gRhhn1>jRYN1R&#r3=|)_WnFJxX#e4r*N#2_ztwwd -zq?fTunTJ`_<;{3W95v+Bi30cF3(Kv2#wINIo2XYRQm9&q8tI(gJ1sS#!JKz*9gI0< -zT>HYSBJGmfea5UppD^!BbsU>5oXte^%dQo6s>psG8Mz}nZ0X!(@DP${nOl1Xz&q(&EtyPuk1ZKP$J!QF5ybp -zzUcvIbkcxEc^R)&hA7Tc9v*{)6D+;77j0)g)}au;c;LkHqw&?JnAN-Hd3bBt3wVxD)Rt5(LyLvCTk(CXMit)s-i07k*JI}>~ -zw-h=jxI{bfRB_V2*O#9jG6OFnLt5&3YH=z@ZNY2HvJiCG_~+M_k^cz{J@?x3utnwM -z-`AG^zP9}LwdMcouPygB-0)ew=a|@Re}+*;>DG59P3!8|?cCjMunm6cZ!M}nGP}9E -zM?8DOkIGug*^gaEA4Hq3A+CLVH!U58XVrnjCsps{d*aHlFgJYOHl4mrx5#ayshH8V -zrnOa@y5qilz8@0TUHdxpO1GO)!=Y=ZZ>Du07;8*jXAthAvSSGo6BA^y34RIfrrNu6 -zBvBgofQ34Sp;;VO^=&`e-gyPOonkfi#Stxh;3W8*5=z@#h7zVv72c(al3CQO1zAG_ -ztkBq(#*8#}lNdQo8NBxkNL*e%h}Mi7Rz!h!IIbqF<8cXUqDo1AK3xP}PI7y -z7B^=@hgV+RXYwWw)r%UiHt%noaSdDCmYhQkx3sjlL$iy(Thys&QAWdqKB(y}Fdn>z -z_QlFpRL9G~(QzFdi0WlX6@Fo|9F9kg<3Qw4##Hg!S~?IrC#T+<3l3A-&@0$gb=he} -z)WDmDwCmPlUA9;Ex62G&gW{P|g+DpdLl>P)qjl8~hugBfYO}UsMJhgAis*rRY1jK_ -zGnH37Vm0sm=uKm`0UojwU3{YuGtimbXxS5GC+bvvvYdLLZeUO;(my&s>QV1;Q>Cjrq!9@=a$7BHO#Ufa(RyqXxB`*C*_4cX7pnBf5poAQbrflw;_ -z*-HYb={AowTaqw`nB#LKA#iGs&^Jeh6)CH2`U<@UFK|tNEj;T3ej(~>UQZ90>$>#{-q%qegpRGy+Ccoiy$<0`k4iE^p(uqy5qG-)e}xmM2s -zroVUjRqomd+Cxx0nC3$!TodLHBhT3aS?EF&Ajt(YHRbNgda-@||Hs!`$3@k>d&7H% -z0frtzz#tU?X#_z)7(!8yRFn=8kdTnBVWdP+N0g8br9lvoj*$?hk!}>}&Y^kNc;CP0 -zob$x{pZeK*_F7k8-z#+Y=(0*dKY~InCajnZT3U^)&I`e)r>e4-

g32wdV~*>SmIfka2IcgX<7GIz?)iOGoOZ -zweZT|(~my??t&M}5#K6EK%u@xW1V24LBfdc2aQ~i3g*H^`gVaxuF297N8dB}Yl<;J -zkHlD^FuqGlr{R#_Rq&e7jX%v0es(@UVLMxEufjX+=2gF4QTc;wi3|mhcs_ -zHIBm7o7^v6N|!(=oo9juMF?WQ&Hlkbkl>9hL%3tr@)eSuAPZWA33J*#QSgj^n(J@dNPX`?ubWL*_W_>4z(jyC~=p{=Z{$Lmd -z%|vs{%OO?wS#mxckAq}7jR}XUi=)UX+ -z2_&4ixhC(ZWqaNyKjn%3&4A-s0C&w20?!b8ckL=k5`sRs{#?XrhhSGRgsPLXc;C^* -zsVBcvyv!lav{E6XQflJ0KzqcZrZbz|e25UjPnUmtd|~36=6xKKKQ*NC=Q(Ji`L*m6 -zaF9Sk@{SemSa-Ce1$ia=UQ>obU?hP38I?TvUkOWZhuNGDmdgT+`L`8DkDA#IeNmE) -z5LzY4u-4Dp1nGQ15;5x1%*H{o_H@CW8pb3+261nUg8n{d&~28MnTg3*K|I6aD7lVp -zwq??pZudMyrl3{ip|vY?Y0f#cu$9#)3)aL+p_Oy#y~`|SelGe-_z7rNo$$G7&llyc -z`v;sQWS}KVV11{ouExR>Ofmc!gpg3%xZ(gt;cor3*D!3D-xtt? -zNhH3c5bQPWGpsBi_Dc0;2OSlc{F13t+(jdJmL;I)chB7W1xc>A(d5ebA>@7J?iN%sG25Ytbk3n7!m?*#xHQ -z{fWu1CTQ}vJ2Y7CVmV^Pz46YwI|ML4082g?on?jR{C)q!C0EkBmPlk- -z7CF=}m=^p__raq_$k^K%=MRiPH?3p&FETez&w-j5If+aXr9L)i(7x=CMy`tyd>TZ} -zO&FGEiy5f)Gn7xqBwU^nJNa&1^yBxYLC#1dXs;uzuB0w|{llsV; -znLTVn6T@HZXB{YRIwN%mC#cMQ7ORmpT}zD&t4ScdmeLq`sQyNz|IW -zMvpwjxwG#+Mk-YpTO&EO#DJo_vgX3$7&k!A;2^`~6L7E^RpfdAcK8|psqpKpq4c{5 -zY2)ABO|6h9osITSrI>O(lv)O-65eQHzrPao=8qVR0A@>)?c;X%3H!R)jnU8sf&@!N -z4r3TfK!MSUg^X->%@$MP#s2(;?Ey2KpS;=Tk;^_F$n;9>!HTDC+)mkw<*m>9K<-Mx -zfw~hUG#WOhTO->0lj)9-<)EFinfR?xOZeL}aM0zJjfUj>$jYg-aA8VyWO)P^wwhrNLS3OoG1xpUzQR?ERf3OWYLc%~lpB*bakd+aYhFZH~GT=mJr;Oj) -zl9;8Kn`Cg02skr&oyFvj?N^$HtUZE;)L1VNcbwj}mGY@!VMZNRgXj>@y~Z4(bVRcK -zG1A?iuQIY~1Ak44P~oipN$8oVQ7WL<&m5oKA2=L`3Kq?ABw7^3~dd -zPwMHqW^M(^v9Z}z@422>0@HRKNItkc%_^;PTv|;DFkzuwoIl23vA1U`!S#6vKA}(? -z9SOGicfYEN1P3nyd>}6N2ntZb0~_@$B7*+UrZ@D3u5Er&q9T<72GUoZ*xS}B1KS1V -zIN6T(P}&WmrG2ccmS^~dvcmY&ie#NK);CX4R~daJek@ik-O;7)8w&0E+z(pwxtr;W -zdBSb@zCsDxBe%LumM -z_3mr{kDnRm9{j308+r-x=ShWBX3u;;o+E`hl9L=5<-Hqf&n4~q+d{Dm(PDK<_>M%` -zv*X7-%{%eB -zBJeL~FUPhi+~BIMnB?ljZID@dr{Iq6Wp~997r@9ORs7oX!%W*V -z{hv%m3URe}FL}#*9#NU?DurS%0f`fHtr%S_9$I?5VmS`F?}5qZtyJZ%Q(*%{C9S7` -zy~O?X@Lw=0Eec$dnw9pkOA6dglk@%W+IL^ -z&{T0SoP&pg6D1LezupW@)(d#0b;JuGc7Y#h;m@4R$^B#}{kYII+?+g^AHllkhf%!} -zUsLQ;bNM2ci!%v`aUeUQz7YKfSo#!wK_85+{C4jhm+7ec9Ucn$(UJ!}-gc(sug}`> -zr|%HGSt=3+jAP8qlZvX*0x?A6oj)Y#_o7UwFPR3OSPrhqk{-|Cr?NC;3^B~ -zpN4Y2B^*;Va&$%+eJBcfy@X-2u4y8(*jeWULzKR53T*ah%F^67^|os0idaKAyJb)>*dfU_GPJ&e*Jtk+o9wm#o8^C)+33Kx4i3hqMeeGIeIg03Aqc-;ruLJU$X8Jbn{m4Xq -zBO!k2UZxRTQ{l+1dS1iHuDlM!Jyd|tH7jDoSu|=GeKU~l)P4u^6mU%*5pN1*^r=i9 -z&iMB6S4)w%wX!EDK=>~%_7@d*i!tZHnX=w0> -zAtE>S4nx2Jd{+hr*-$3b(5ACOeqLWlSamlaLK^r0IR%QEt#py5Q}>O#oda&sz`(2me?o22Mt9iA2QYm3W4m*bqR}Km~WHNbxIhO%s -zm~o80z#Skx1_Pb)8>sQa0q-GGn6o_0?Bp`a0a2(kP`Y6qpbbR -zr>d1p4~vHeti)qE%8lTx@cM8VKE!`lrMq_?wf5qEH9W?|V`xbzu&?PZ{(RV){mfDEN26)!> -ze^nLefr~=rCBCGc%uw1SxEX=ag?qP=Yj$J@l3?;NhC-TO6tEuPMMm9Zj?NS8H9gT? -z#cDpE|C*$xw~TNw-?d=snnAPkllT(IO@p{neuL4{q>hK;vl5iBC0Zmok;nO(&#(iv -zJ73B{dUy7BV=kG%($M_8s69Y{2lA1Jb#Z@l7x4jb>)& -zt;`-m)hzH!NKKF}kb9%Lm87{+_J?47gk_fS>smNAn*)LfLni48SgRwu{Wc)qckgmS{p%>mH9>Atn;8 -zwA8mj9F1Gp*7Ssw(X+se<@sPEtPB)co`s$H{!m=M4s(r2=E{RZN?4x|Y~|@w3ThZ5 -z_)$SXtH}hjPWb}|W9P4=l4IZ>!q`AE<=lCV@bbPP{J7_6 -z3Hzj?EgDJ|gWAr|Q$+BsfJ_&Rmq!R}x^`S8CwkBZn^Pd`o2$e`e_B*<1@X|N2w=Wi -zwXyIsFnH0P6nXXw!fVLQZ)eD63M5|2o}N;pgeG1I#JN6q|9J3@XWc#Fn5#)GydV&^ -zSe&w;f^;OVa;0>ae8sqtJ51EFfl)OlY0<)-O+MhfV8s26Jvk68 -zO3dQX1ABT^RAfv0q!*yS3+D -z;5!C{XK_mo#zhGm0gNL70%;>g9mIuK1_V|SZa0Jj7Jv~3#|FRy8kl8V#^WCMBbJo` -zR(N#-2(U^yQB6UNaDW;tnr@y)5SQx1}epNH~^Nl=L>{yOKj)n8(9Jz -zTvmq>_*;*nlm%xe17@RgKhGOxHJZWE>iB;-R}Mq;+@aKUK7)nZbzKbeZl -zg96l$u&LQs&&ez7!p7yh)gb0|7_YAQbq9evclEcoIzEKOH0<$6Y5N|;6^ga&q(c_+ -zOe)L-sFz=thrEui^K#oYf-vM8VwWCH)EbAe$}jVG5V9ytDe&QdKi89lX8;q=p|P>2wFsU+cw$5mcU_dQksFGHKeyN%ejNR|29m%m -zM%fKUB2B^*P@ -zN(rh%C~yUp61l;HF!q^G_gc0$3kUN$l|~3)VuMjO_nu*CX(*32eOD@MWWG;~0V1lX -zg!lIK^>w4b^fztw&X$|Lem$A9kqvl<} -z$%GC63C319(r;DrOcu2Y$I}4abOwsY7t@-w;zTaD7(^Uk6W0JOoH;9mqxN -z)*e_|08y^L=*MlC2i8x-86k3K5$op>z#&YXD)1tGQnA13L~aDHXM!i4QcB1=3IR1VUI23*y+XIkg>Z%!g3|VlrI -zAyed}DP&E>5pV|20woZ$VZzc_mDC2^q3sR2O2`6KKQVn~&iJy3Ocf?BO{5pdE?xe7 -zj~JQ?voc_1V{4k6G;he=X>wM=>QWLW0s>6%?~{^l$S12_irRP>pdk%(3Xs8Pr1vut -z0LA`r{0^`Q1eg~M_A)F1W=^pbd)N{+eHxk|cLt2}U1XPLvMElypmWXT@kH%dPay8q -ztG>enVvMeytl&I}Zm%=jj2j?gJufoAWVzh_+y`)seBbs~6g2qj_sGQY70kxFWC;hW -zIc+4gB)_X24B5Rl0U{&sLPkbQP2KxSZe@TnNxevB%!)fMa2}Lj7?y0vuk3)j0OH0m^pQ%^wCyNM7#B(si!sd625xR -zC`#88OtM!{!?>9K0TNUsSTcE1x*sa4;@Gc$*57h4Q$kj+zjA5>!RA|_vDVfZKx3(4 -zzZyVn)vE~hskq9k?E)yZ7D%Zf2zK7Sf|;}DU-6ba6RWOrH@~33X=eo@7;^)kB=D&m -zE`nJPpQVO{T6mS#U1WtTg@VvXV^^h@0{jvHz5are!so!GQlL`mN%VlDc-+VfAjI1Pvj1)mAVj*pL5iow7hhNNd$shW8W>FLNjAVlS3qNIjV(CAH>Q1BK!sy-ZqT@ -zQg-(~Jz~}csBA-+I$Uy7C%Sb2Fwuv6Hx>fXBG+WQ6K2yv9Yl;E@$<5T)>x}hVOb_e -zM@NH&77Yo+{MEZugcni079yf@@m;oWjlQ5bqLGPc;*d17v=16WY3AnVvwhnOP-}rK -z)gaqa+)ANBT`@KLQhW*<#@re!>~(T{#LB@@;QiRo?;IGI1Grt%l6sE>F}Ew9jy770 -zpE%4AHkUS`t6Vv-ZJ>a$jCxM^U&gEo{uqR#RhS--kdXY1JOEU@KUd>O;jDze#hch$ -z$OBIInTL}IhlDA0P{6=O8h0*$a@KF6oWZ)4$-T}1j0sX(4J2?kK>{~81DoVTb8j@@ -z@lb!h(S4%&PXml>d^1UEq-pY8XQXbiC0s^Qi|F^-QIkQ$jN65qi<>h1>({TZL$US+ -zHOxdz;OD%XNvrZ_{b1X;q~(I=`4B7I4-X`eiK~wbAKN-{^{QtYPl_QiG7J+X3Q5@M -zbLScXP}$wrr#G-54R%O8_&jHDx%$&$`AnR>b3FxbZwO>_8!$(L$ein4Z+X-U9miyd -zfN9=+HH#-te)dEI>@1|LdRmA^8R}Y(##RAGPYfP_jxwDB-yLI{ypNOy7>Z3Z;x3MA -z&KxNX(zzr6wsXG_`!Uu-V!C -zk*!vpJJThIbDpCvARS}@npg_tFD$SS)C<6}9P17-m}w~1P39Gm9AHmNHU+H1r6*P} -ziv);ac4Xxu@cR#t`oTo%iJ?(CcLhx=SLQ_Sj -z)NNiDKtYw(x6#`|f$6$GiUrodT@z(JAAsq18fB~nD=-P)hy=b2$_rpOg9dP=rZ@^9 -zNP}POS(MQTG03Z}C@(G~j1LJ&;U5l?SM%A9M4}GsX5SqX3JkSyTkrzmDV)fT_fM42 -zL@(LCheX1C<3KA%Q@;}lOObyUF>999p_0|B=&b^lp -zU`nFDq=TJ5f8L!7KhFTddb)oiDDD?Q)2%U5)G#%Ev%h%LXUvh02YImm(aGrzCUQ7K -zMDj=DUH4Id?!ur>xlL;DL-wZee;tLB^xFWjCl%*BmWM-#rfIM)AYd#J)X&fZ+tDp` -zH#L#cCkGQJ$1f*j!x>76g7W^LD0?`4jgc01Wf;<;zJP51|DP0!^^?bek#vjpI7y2~6y@)@ -zurR!DpXM -zUl}cZY{adMCI;X1-j-l`~Z|C%BZj=NEIe`0Ehq0-?LU| -zohROYM@{~XFLH_jP)toj!zFf@O#wmwtS|#Wxk;ig8@#fr>NAirz@jv33`DMsRUjIy -ztW>Zt#Nyu)2^XY6K1gO@aw) -za6QRYk(gGnRE%bI-s~mV2M1(#awgvC+uYovu|>7)jOoWc6woJVO|s6T>sEvlY_gAy -zKBA8KNrEx>5wO%G0#t`gJugyiER>H93_K&Mkh!_J&h%qfZ%^Kn9n1@&M^AGmE~Ei_ -z8Gbt72G$TLEj2YY5SfP^sL2m3#5FOCGBtM;07On7VFPyLTpnSV1h$@N96g^tH3ZnLV`!ytW*K6q-?5hb1!=-);&r`xt -zS*qg|TyxyPhN=tCz|zl112VxLQ$4}K7^6^_RV;+KTLB@V3|P9LZ=y~~0GJ{%z@oIR -zDX@hn`AhE6I-#g~dDE-O`3@`{HG4|K2P|+km^LMOZE4TRL>+)z`}2!e6V8Gld68X` -z`ok~%r%h*oX9h)twI5oTpYN92Emp`GRS-r%Kfinajb|T83#4$2!Q{jJAag2g^I#wd -zG~c6$3r@(PbJu*BLM?i$t>Z3AXl%M(G83U8HNkp_LE3rwr&|yv!3J>rdTVjw-VvkDcyY{hKlj_tdzxP6P$4A@{RJFEd2#Cp9-03FK^Z41Fg -zsVc`3oYeSQAx^P3ryzu2456-R$9^%DXLLCvmF+U -z#V4sRog#x?eDUBw_eU|jzvMfRZ>i6$8)w4T)ABVC8%Ze&OND7OP-5Rivwbt?=sdOb -z)VSzL7fVLqi+1H(L5!9AsZ0r1D0*7T^c3oa$+%K5pQgerpcMU{VQCNQ83~7lf%P>D -zk~=)E$8>^N3#mdNci&+*tP0CY=%&!qSjSrjmpGUsi%p^E5+mz}k8sbs8A|sp;;>l~ -z3H%X{b20kAI-$)_sI`bQo!S){2Fk2Bmz_H2Zj6!g$lLb_mi@>sn$T6uSiz)nb`(*k` -zibbdJj25{ZP*<|czK4(46_P*syexVOlNujXRFPaDB_IpM(oV@i!Yc;pe8Un0Y2kY@ -zul!}AJ#7n{pNy!R-J2{qW&4qNZO^(j!nVgTE#JYDd;1a}u>K@1puAs?!t$G+hKnM! -z$w0`Y49^G_Clyr3zS3BxGCE=v>Fvj@_qMW_D4;$!!~jIs*Y|7(Bfej6m8ep;`0bfB -zUSz0i-Dr5O%>PKKS4g1BJwY@w$@6SGGxBM7VBFYD_h?gLo+F;2@HWg!@1oyji-KZA -zTZ@ksUOr2JLhowV9p8F=1=`N{#UtlBm$BI!;kg`_e6}rXQTT9iC*nu0dWy(|e`>G! -zC@~p1&HphS%k-$+VSeEACo`wY#Jy;eJKvUeQnoEhW}o0uZ$hD#s9YJ6;&4&YNDC2B -z3mmfG++6lGi#!hU%>0~vv9QmdTAB3}R8%^n0MgeW25mn2QdAM2U4PG@xpuoWCA=#d -zKzlzA#)7K1E)x77&kcyam)-Hv(U|=Ddtg0n$^A_S%>bln_*Q8M@r^Rv{_Qy-zT1(f -z_QgGZz22ey;OQr#JL8JFXH`j>FTPxLcSkP~g(c%tzZ?2AxAOT@?9SrIF@b%ce>RA@ -zb-$b7v!&@*FumWMbt!n+tG5koGg=3UmvsjUzYZ-=@gSPwF51OJI#g3zla^A?N#1v@ -zyW~f&6?4p3C+wGQUGoVhVi>JtcB8GLW-t0k^;OQ}3>WjEXBGxmtDFXk4!lCFaDPhU -zeRV1-8BsY!^4uS)8w5MHN$!=GIw -z=+CZ@;Clu;F())yECH|{@imoS&j#;Ty6#A7+Z -z$FFlQ2w#ibe7j=!EzU5syg?fTiC++Gklz(hM#uh?@4933+gKs(3bK%%@OiK(Z>Z_W -z=R-)GB@4Q~e0J=$Ea9PdHrZ_3t0NhopUp*U!Fz)2tS2(m?o0AHCudHWeaP;aKVGmZ -zUaZt*5MfpO^)+ZZv^^gHlzA`5Bhgo^R;vb&)L!QMNRcHS8-+cgctfeixU+1Q^W^%& -zVHVGynTq3i9NVkU?T*5fA?J6x8;%ei04+tQzg)C6W1p9)xBnDB>sti3_i>wzAk!{f -zn>sI*YOdM$cv1C(l*K`ps%Vx|l8My&omqXq*V?hdt7t%(fe5yylT)_(Q#d`X)i{RlVcVS2Lt$5HO`5$bkpmJ#I)(~9iY0AEgn7~;#Q+VLFYbzo8#<01LyD3gsWtkf%6i=@EJyYT)7iS3m*9PP6{4b}kqOY#Ttp8RV -z^`C4g)J{4|V1mc*y9u`2OOBX*f7_3Uc4xB>dk2wSX4t#Ukr6Y7?QSnKw>Fn;>wP-} -zGiwR-7holal?uskTNc)0)~@Kpss5>g4*Tui@fGYhG>tVb%DwR9JpVauaWFhu+&iA5|$9PZJVMRUvX*<2tMv*SsPA2uXn)UHIAmF!$n!NxsI~6sOQc1+qI-X -z=aN2mB{IxuQV6!HpL?$(dWo?uca)iR$dWKWQZ-mMDK66J5>PeKv+N$1ygfA(+ss@& -zCfbX8G62>Vmrsg6i#UMi^<@MQNKenwW;H?R&oh|OTw$z6jf}WnbHqgFA;XE7k9{jx -z&Lh92r5|Sy^v<^<-Xx|6J9Xf`B>P}c=+T>*Kaj^0e%t`j^?@JghCqbC=*5 -z-b*@##UpmvCA~Kj7FExcpUm7k`*A^v3}U(Rt2z9@$HLb10jKYhs6kPN%LvEunHv>f -zPX9UQd3gM8ZlaoUaZ@DDWZ)h1;9&05^Y!6~36n~Es65;JMVpmC$&kFIK)9&Rz4sDK -z2rPwisu4?8E!INsvDu$R)jj>AxhH)%Y2&3*Vhs{IBdr$9pxlF%9Q&d=Ae(%Qplz3< -zX%J`m!qg70T^~FUyNAiKt|Bpbddj4^)>NSK!t2H4gGp1}%e%9@3Sn9bhh*o(l44B? -zn9TVPTDHD+izmgEthGgk1YM?7rMwN9zIb?qPFK}{=qeVPOTO+awgU^%CdGI+H+*0^ -zbxl7msw>CtPyVv$aL)4L|d)y|K57ArosZTaE>( -z`%GOyBgwOsrih;~zj;ro2g7o@n@N6Z=E?=H-%>D9n-_g_E@|AKPA~7n#fmRJ8<>4o -z&NcyhX2Y1%q=eoSEUd)|;(p8GPV{<=Dh&;i68)&lUtW*t2ayMHHkLzAAqoGyUJUL| -zgp)m4YTja4Bt!r4L -zotm?%ROIoFi@zEazDbqT;q~I>b&6{h9(V446Na1`zhD{_t5|fZk@l})oEG2yb-?$M -z3FFD9zTfTJ=-#+fzWo{3AbM1lI9IAF|1`BtMy_sEQgZPW(~AH8W;x+`yoIoH+D@{( -zD_!NbqH*QQk>nz|YkdsA=}sM?d~bs3K^{lx*93IGKh6?Sp*1O&>I;hPmKFtt76Mwi -zhC%@WdM7#XwWx_&s&`Ev*kf{{DM-xxb`!l;`6s@$B={>`Gn5GvSv|PCboR)*b>!gq -z*r@BB;fvyXD>(*r5=H@7t^HGsi_KztWVkCYhfmB1{wHz$!%HkW2mZ3JVAu!w`=t|R -zFa7E2j2dAcVi_-{%I60LCP^|^zB0b6YrG$DAb&gZ8*@#K5yAi5wQR+NG9NDwHYZz0 -z4nXG9Bo!7T~N*Z;_K(h(K*DUEdcNyC(V#wOmDj-4Dasl{W4l# -zDmhBwAUwXKbJpvJX4~4+6LUvBDptx6h+Y%5?$oUnO^gl@4z48 -zltkK2)Smx2)Y7BwhSVq~M05-lP*8lI(cAD0DE*W^;hCpD(p>q;$x=O;E`H&lfv$AT -zZ$CulxTlWb7oXU;?~;eP9Yx2v0K*;2m -zfTjuzUsE`}9q2oL@OUEigtijN^Z*dUF^UtObZlZvHv%i7-J> -zikbbJe}`_~WzW?wOs=tG)sCh>qob&>kolRYTz8li({ge&g+4PUBGLfPxfCGan`jlu -z6&zE$MawAy%vR1e3?n{>4Z^<`u7Bz>gFv -z@TN*)Gc&|;QInfn4M4lNkZWkruIonccZx94>Ev>9&~!uyKT8YWVj;oH{l53~HwJon -zusT~-esc8t_<;UPAW%;iDryxKou(-lS0eJuq?Yib(+m`+iARk@P(u{O3qocgy3E17 -zFe^nQ4C#C9oO%n*k4E~|z=J=5@JmSzt#)wP=S<p{5C-+y4*V}>rOaB~|XlSJ$Q=Kw|~=YmS98ze=8L!&`$ -zmpe_{j^MK30DD9f)Ejks{VCySc{_sls#dj4xGGPos9hOGySk7HfHr(j2jP?4!N{#m -z6_r0U9x#b!fRWuhNU1+wdjZgBH~L3U1Cj6ijD>ans=0q4%?QPay&V3|W$LirTbm)q -z1x_R{57uk+K&OPMC8IpOj!m1Vl1JV6iV5s)co6hFEQ}#c2=JT=P9Gs9&6rZh3Ncu3 -zey -z2+ouiQZyt=!)GOfv@N^*JHK{FzQxYamIp$lzuQWIy~=)bE1EdH_o@pFR1 -zde#M|8_WH4FIYf9p^)Nv7$0i_MVHwU{NGo01sy0NalWt0JQmL`s#b?Adr5E*IPqCg -z3QM5PQJ>4OfkaNSVPDaup7?o||9qa)K^h1Cd>ux_w*K;iqS$&?;Xf>3rm|2_Hh#pQ -zO^K>EE%+xqeZ%nP=kd$G;b}-B*Z*d|{%u1#D=ogBVQIoWY!;o1|U?}J|iJAd~VBd?s9C*o{Z~Y27py}YzB21q4eOTDL8yCMr$cfF~CjF4mVM4<)5xxmT(CMz~&k-Qnr1A1ZAtIQzG(=fiA -zKw3`6)F>kkL?_Z@RUWD%||#F6c>>HLDESP57>X?<^39{1kihM -zNdPlOeB*^56?Os?LAEz_#e?YSCF=z|0zjS2%?D*x1ql540 -zqrA@jJOH@>7JzR(cvYmdogPRc$_O;IyC(;}-xp&c@7k;;;eYN~6e84s=qIPR0}H_U`_Cxb^{~ABy0#h&^K-4TElUuTW}d -z1Y4cKLT!PLQnT?4E#lBk>W3;;i4^)hH|=})qLv=Nj}ElGghocbxX20X!GCuD7X~Fo -z()7GbI`LsT5Bv?)!AIW3f&;S1BF>Mre68#yd`lQ*V8@5Z8G+;eKjr=CfKte675!i7 -zm~QbzOb479`rpzqqvfgErAX&QPA#+8r;aE5UE$52;hw|19uxY$a))EBPa>6u -z0_;+)Cqxiy?FXuILT0_q+A1}egi`L1632i{pY>$@r?Si@3bls?SN;Cv3Iy%z$$ia) -z?SsCG2l-=i(OML@V`^l>SffKCtyx-B*rRzk)8V(FGbxcJ$`RH>7I{jxJ80qgb6Xmu -z>E8G98YxYVv?(>?RjRgwJiB`QSRuatk}E4M=h|!sdkdz1HIQYfW$;dmEs-%p*rF%c -z%Y#NQEKOi%Qm75)DGL+6pp?G8^=N(hXDlNLX>ueA)3KGdufnYTj+yxiqNR)~+BGc= -z;iXExd|0zkx0pd`VVe4+4I{JKjf3g=PW@t-`3<43Kj$Y%qAr?nF$LeFKpLjsDtm%w -ziLxHM>vJtw8+$RKsy&Ma;EdM{7!7%%n1=H>3e%DqhDaw1K-Kt|F2nlcBE#zBR{f`5 -zO|#e=U!jE7tXDPsqbGM^*71EBYAL)%6^+VL->lvK^jV_P#1oX1rycHMnTH9FrM!|jsK}FpgB52=Gts3l0zYT -z+shkNl#Es(wJ%M|pO3e8DR}?IGo!C@z4>`bqg+XmkJPGD$Wm%k=Dv@7$(sEBr&r@n -zB|*RS6<+UDv)3?A*w(inAqnp2aM?b|8k}Kt2B`e&oZ{uEtO$7Af!=vwC)cW~Tx^SsMf4f(fOBUyM5la&M7yIgZ_D3*T*aaw|va4MK~`_ -zdMXt~e$kT1$=M{~V|a$u54lw_Iu500xp>ZJoH<+_8Z7w0 -z>n}*9^}h4>)AfP|?dFcc6Uk$tE$Te{aBr*i!1hNTO~bf)W%AbWGkZsa`loA7KXtIO -z#y=nkh?Oo}WA)m(gPLXtzN?)zN|uF)MC~++Dk)K-Z>_3&f5!CI@#buwr}ZLT6#=10 -zi6N}P)B=nwY5&$-$9b9*^Iy%Xj!It>az^@bH=OEsQgPKR&!^khg)qK@cz$KuM`zwJz~@sRODC8-`>NoFGMq<6@|fFFYPYZ#T2ofh -z>GSy->f=6R8nZC(#csj=ob`Z}hqVMbCxoPFFn$UD#AYNe=)Y!}H -z)NojAQM@M&MQhgR=Hq(#^5)4a1u0FHnBW7$kLM$GC8_#|D%2B_W%B2<)h3#9FOrNO -z@ew6$jDag$I}~Eg5StY@l?$t)^J8UhDNcT;WDa0M9`AhX11f``armN7mcFdxI0!mJ -zPh4R}! -zPN5n7CAtc=o|BdlIULdFNaJByr-{i_&4_u!_Q`*0hOGksWVos?WyU!EQ!-pOxD!d5 -znhDF@I98j@>bg`Wc+1x5Yzu}1x=EAv~=|BtRa_Db*~@2JB*_g2Gw -ze@PwRQ;}~OD#;vHwE9NjJ3-23c-PA~5wEH`wiEjOJ7#$M820%4ii~hx;qLXd_b|&O -z`hE3H2K%ZnapHW?GaEs-Ohn~nc1%d#G3t9xZ(78&wPDK`6M_!R#LiRwtC3@s>b9lhV9_StIz?{I7I*U9P9TsHm1xL -z%F7u_o@(ZN=bf{V@1ru??gr%i_~>4O28p)HCb8J)N(dBgSEqi6W4ox{FX4F5VAjAV -z;<$CdR(En?U#g&f|1g}WucTMD<_A~fXs;AdIn4FFvE68l{U5-k1f)tG;%Jgm`Sdx9 -z)N;7r5uX4OVhmM^$;AX$i#<^U+FCG&V_0Whg@=h~ko3C^m`Y9TZSguknz3b#uEVyH#~|y_B)`Wp%&8!M{M}PlpMYsk#QGV|nV*SJ!JXTYdew)9;$u -zrPy)ypGiSevm!EcyaZi)X+<+ybv?29Bxhd8BwrBVm7zxLzASh9mYkK~i#}g6$O#;5 -z#~0-{*W%Zg{!A5*_&DxU_{~S0)zalcs!(FA;4MNl(o%V}WXGPJ-U^z3v~g8SU7p>Q4UMui)pVXcZ^+Z9Pi$glWQm -zi;*wdW})=U$(-`;!ueHfy4|yI&rIyob3y4b`U=0F@g9ae_hZ2hc=fR>C=U%+bO$_n -zB!zLGBd=XroJiiM4HZAT7H4(8V=t*WgB`E1iT27^zw)zymrjoYp5|WhPqX$9 -zFvN>L{jfB(tzx`L-VH)NhMCC$)tP`hVH%p6rCZ0xdFYIsXk2u1eLjHDX5hS*1}{h0 -z_Yk4ti))9q1HF0owaW?fom1nyj-lDi9>K@+mkB9G9F6IV<7UMeQC>f9*2xd6!*dPy -zWS?y}TzSviv%!V{uoFBUAA=|Qy{Bc2vTUcCeUaiVKY&nBJ|k~SXawXu;y(*F-s -zvtQm7V;fDr>j4m|KWDEEzsaHmeRhK(DB->nS&Z1uwL?dG^1-I}mtIe0n3)C9B~+4Y -z-9Bb8J6b*v)j4Cdwc|KOaM}7u<}$wUYsfv%ZrSn(S>|!Dew8-mDzO>Q1;6h6|Hd*4 -zO!cAK{mBCt-ILAFwTpY>Oogz1x_&yf*Thz-Waoy9&&j>i4ayIG)G2oh;+NLuvVs`3 -z+D|e_#f2DsF<_Q|VhbbKnMZJ_>eE*MjC?s8ZU_(%mG+m+r!bh^dvdam73P}#NAC8v -zy}z^DVad@PvM3+M?*A_a*<3<@^p1`9-X;qP)HG~4b+Cs2Dw`TSR$|{lU@d)9EJ$^y -zpMGiRM90Bs?>|^)`p>gL!n7ghi0z0-QR5YbU2oPL30c>boMXwa%vl#&0kfmrQJ0g~~o<9-%50*9b^!ne5)UZ~vONQ9J{}ZvC&8GUF -zDbP>M_ZK&91hhoD{~MMSfB(nH8Qc6J-+us05wMo<{saf6Fl4qzq?h09k^J86K@dLX -za@?6FF^5t>cbjo_ZJqQHtrS@XqQXYY*& -z*+B5bdy(x1aR_P=Z1BE>0}Vu-rvDuPdezcbi4}jbqt%KKq(Z@41YxM1x~Q5C@fMWQ -zV6(t%any3XH$&1Jtccc2B&`kE7BdI=Z6dS=I=I&2Cho6ATPdo|2y>^|y?Xs>nH@L8 -z4H^nmV1vTWXsJ0Fa5O%Q%% -z?tNlSJ3jc5J67A9b#kPy5J#nKc3_;J^QwQ-77IfEoA1jxpsC}7J)xC=y7Ci@O1}9& -zKoHSLQrUhhaQv2osVhz*xgW;o$o#W$^_yjC9kJK?FL;R5|B!oJVTi0Qoc`vd{1>Ck -zp}xtqbNEZ?9aa~M+VLSpngkUw1xI2dcWkyK%=N}amZ713!r-mP$5mgE>3 -zzql-Q?EV)v{1?_4U-(T(c~?QU?_$nL-_)cOzk9@v_&#Or`oEAgFNfO3>`0j_UN)}@ -zo<86yovLBBwPu538QedZX(JI}q2zfDTO(q@hW=jPl;S?m_-OHxk+JU%e~MO6?iQ1m -zAMc+9tRi!wR7&l2JbLso@gnBR0eSepxF0iwYxmRxn;YAg?)BZ@JjZ%dMQ5@ZTNeWU -zJDOqc)~N>oLZ)bFPSw4f$D#6r*tswNv40KHY6m5fgz`>0IkR5S&xfqKajHwAeJDW6 -zE-hz;d-CN|6((j=sr63Jz!?+hzfdl`T(zV46KlAeQ=L!ZyU6rN;`g4~dEzIOJ{`s{ -zKRavyHRk4;BU$a1z&A1}g0dHo2d97k|M2L>h1B#VwwwPeKvS~YIrwRSho}7ap02#N -z%e#9V_^b+8eva3nv?;N=gM`>t_->H4{`w0V?*9L=_a@#{e_#CYxz{bXNG?T5=o*rQ -zipY4AArhjblp!G*D^teXAS4Nel&K70>-i6U -zcdc*h^L5XCzt7ocpFO`S#Z71q(_8FTAa~y1F5~JL*2KzbfQ2LLDE7kj;%}#<^9yA8<7bk>zPJ&UJvr)u61bMC`me;lY7EWew=@07OaA! -z_r_@cR_(Lw2F#DF{EpmNX1)6VAINYUy7j|ghAruR-X^QE%_wR8E}2E20daHO57+-! -zxXR98O7Z4t?_4=n1VzPe^jQ2UO*rI57 -zyhnd9Voytjn;rrjdJFu5;{XC3}B{9NXOF;$h)85e$@g_n*ddT!*g5iofvAcA7q< -z(zxGg+#qBv=<~xuJ8fNO{bq6dO!F7RGM;ABh5j{U4vdp)%CIBQ(`-fo4cuf3vZg<5px%kKCCu%w0D2GdLGB?cYOT;9M0hHqxHP3 -zADE80>nE@r3*+43{6{U-`LgI%!cF;GF3kIzvYDlDpC721tbb!}!~2h|rPYK#qqOMN -ziV6k&s^^z^ckn`nY1vyhtL>=yyK_lrlWy2Vt@V?gHjoo6(%`e6YNv@1C!fgQMj!NJ -zhsi?RM+*AgP%w}aSHF^*d%aXNSdSY~H-zE7RG)Fl4ski!x4@k!#lB7J*oXLm9FoRL -zvccpQTp?V8L*}Xkgpf|)akL}ZP~&Zby#Gy_qUfC0>Zm~|Q!fV;LZfQ-*T2d&n;V{K -zmGpj4GdeiTjnlc@ -zj?qJ+nN~U%98?u2USqRkrC7ym=~yUqzieTCIm=wfA_3CSJo!@`9ES0p+zSHFerhZa -z`8<`deN;%G-S`y33TxsdGi9EXzv!Y~xMlsf+fDWvOkUiE)I-0&bh?&w=CV$+Bag8P -z0=f@NhgZB@WTlLdJO@at11=k5+U|a&Y-IY$?Qk{TwuNZBI$i2B;M=J~jp@EC@WP9K -zJNyFM2Z1~ub?R@;KL*=8`2BA-@9q3@?QWQ#&IhxBC+M(Vei*FGT=f#-k&Cb0Og8My -zp8n#YaIto4&lP_CM|(LF(v&hwWC!t?%xQvtq{V)}+%T1JHA=57*>wO3`Gi|7w|`%Ce#po9xzVw6nyvAh+IZ -z)x>byF?M}!Z0EScC8baTGXXue#ScX%=&Q@@xX -z#qPxsF*ADg@2I>+^{~(HDkh26>ACNz1Ip-&(jRNWX5=Gq^l8c>O3?g0^fyK8ws-4- -zQJ|TPZtO_Tc -z$N%P*_0N?zu6*NKdK|Zb-I0L!($qytS2qtg8{T4WJ(Ti5<MEfYTkPdvTGZ|NnD -zqBr0uOa&WP-d7oD)EC%7DQBxvq&?a3lJ#@ssKUwXgg86Db9>hLrF7eAt}L+u*A*F^mCIcqz!?^U=h>p$9jdhgf2-~PpNvuatx6EvS5 -zslFaDes@`*r|^*fP1lV~`$I{ZE9XkX{4OgPXsifZRRoQlv-mm|H7LtFkETr$Eo)rK7+CRR%0`s*(FS&36zGG5o-9<9EyS>+a2O -zPpw9C^OOfMu34_=3ML}UKTE!5vp9-lvgV6iN%Ih9LPa$A-?C*Sn5#d?OgKH62~96<;;VGuAkcK%`{KcMxwDP(3Ucx_Zfi1tNygEAC`-!O -zN71bJ=10n%=Akcsi|1b7D*IuTmM2koVBO0AByiBIGHV~cI6=zUOq7+Ed7a@i!oSYX -z2e@>hXn0&Pdp7|oB<)=H{w>Q7`?AyB7AnFD10`-!CA%Ktf5So7xxRybPTR9UqjE%E -zu;5X@NfA*s(_n>Zjv)1~{DwVmVqwDr86%)&GD4Kmc -z^_z6w>>X>S8Mm{PgE6|>lQW_gBYPyc+DfgxcJ|C`+}_91d5y1p>fGy--qrh6^DZ1O -zIrYh@{(tgOzXh5wmJD5f(bzU*`(pU~N!ObG;!8=jq8H;Yu1NfL;8XGa=dIM2(|>-k -zZbZ|>j}&2%R-lrE9hI*UyVIW{otp{lDXmY&`J&*sV)LmEl!AV#aqEq_a1_gej2Ag= -zB1Zj6U0$oK7juIPB$a2~cTZhx)JIPs~lAbq|pID`nQBiEx$*JzJ_+rxOHcH5R`t+&$ -zYNJbU>$Iv3Q&ov+T8-kR65hoQyUe5udhbqr5x?^GFxy3W-R}n+Qb$c>t&|+N)D)W3 -zzj$Tme9c*LYw2++ZlYFB?{pciow>oe?U6c3fT3^n!|XH)N|b0Rz0;#Sl`qfMXEx3B -zyu}^Mnzj4%ezXMYmEE5i8d666J`;gFW}cl%B1r0a$6`QTJ}6<@9U_B>pfo^t!9V{~ -z&G4Vp4J7ziY8M{<6;XqK{u``6Ylv&&kWWq;&C1@hSeq4Zb5khwG!eFYyb{ -zI#@2+U)KwGV6Blc;Hn$cgE5C^DBaPYP%G~4iGp>uM -z_^mAYktdF%ciZys-jRLc-}pt-z0(il&*Rh|Ecf(#n+#{n*lZO%!yH~%7E}4Hpse}9 -zo~fVZS(V!J_pjyba`Stvu-y4JBg5~^B()&Kc>~>H2xMJKy-(*+m^USVWHF9(1-)7! -zz2B4RI+$a9?o~tbGgC>D|EqCjJHJSoD@c3KjW^rhl0qluho_v>(U0Hr-Xkla4-M1! -zzv=o>kw|7e?%1qPEinrD+O`8JTnb0MG>9m&aTA>0)WuSpJBXh8zyA{eFQq!S&nmS; -zX;9OWg{Z({+jcfYlkRAnR=NOtkzem4v>x?;X7{NP#nFNpzq1TfPF;k~uWC?wDwI5N -zPHm;Ra37*3mT-mfo5+#_b{&A*F3;5d4mA!V#5y`uq@3z?lz`kzNnvItvUnu*#;hkd -zWBW%b94%YiN&W9@#<-!^MWxonQ4x>Mf%8=#;*`8*RMko^W0TP@HH+-2Y7F^e8_i1l -z7O(!d&{Ytj^8CowQY+E&b?~yKGiu7*w}5_y@a<&L+Mmhfs_bH}Fg>-ui;WIAxRd5HT}=?WFc%uQH0+_sW;pJ20J~FnO^#QYBTOaei<$pd -zc&_#8mN37-FL{;S9N-qg(Em$@S{Ia>S -z`|487Sj{OMt+C5_uB2@}KK|a9gQR(5HRaz+vq#>o$0LI!5wer)>N1%e+~&5RvNN=D -zBz};4XqCHWT|lRr560sEuPXEVr4TCV{Qp*&$IMeuXuw0rZ|7c^1Jju8(WClWM~@2V -zUvsjywFjG6G%VzFyHo3_Eh<4y=aaZp60#n!Z4J&iZD>-kgD3s-daa1$0ac!Y@6BRK -zUtJw}44V$+);pYzpTRq^&cTf%X1<3WsywWpX0nHI@3jn%Z2cvaq~!9Oayeq=)+^_? -z8HPm{KIeyJ_#N(ZS04Q-L#aFy(;cm~-MnMsf=ql^Xnb^}g3+!GwMTYOQBqU9bPLZ* -z;3Yo$Yc`gf?fTFm%lvz2^}4H3S}K!JoT~j9B_FSTfF=rFaKsa!$HxDk-u3#Vji> -zhu^c4ijzVF>k#(}VYl9*(PGP&_pQ$Mn5j~d>jxaQ&S({$s}s{o4>u4td7YGR$wWYM -zAHt<2Z0)ZV=})Yd2@m9i5AT4hzoT-}x&$@(*aycw)#|vkVuf1|Xpyu!Pj}_aw|{l` -z^dt=b)?7yFQh*|2%?2 -zOLQeIv&U05;VY-=;-Lo1YSFu+xA>Fl2aXF*Yk8X183Y6{d9=SwDhrz`3V$#?JL}il -zHEw>B9pS}ebvuP@hyJ>~PRe{Ih)0A^vO>#2Ns`CpTRJ;ebIZGL2I%-+9yb(wwiLk2 -z$41wTOp?@Ih!0-~!mX$xVzi5VZ1~ipBtbFny3L3hAtJP#xG`RS=jiCD%J7&6-C)4w -zw|-as%I4Qn75uc1?}U~gB(462C+|yTzFi=QFfx>C*9C{i8FelAAk=29Q^$X7Vc%9| -zR~~l{Mdu(F`4Y7{r{kVK2C@*&)wE7i$S1$7Z1qk3?GOJ*$Xg;-HzRy1B0O$u{a=JS -z#&>G*M@?y2uOpbib9L$-Chd*oV?oPLlla4?hJf_XB(9{5ccBd55v};BhClGdsi~NxVR+dpeTrhvkE3bA>moKb_42xTiX$Zc -z@Ot=4QBwQ>kf?9UJW~oTc4ioKacVe@GUvB?g~!Q3Rr$t&n>0Q=RS&js$EmqXf5l)T -zh(?}!ki;K3b@uJi=_n|Zvo(ChpzaEMLyIg=|$%nYi5%!m#% -z^i2RNpLxbd>`lqbbAK(A!ok!r{Rv9i`?d}oNsz}=1Ayn-!+kXk8W=yp?-m{&8Xfg( -zg$G`RvNk8eSB})J$H>>HA>4i)=2mtM=63%$QWS%^kq6u>zCueobp>G`;aFX#tDXYU -zkNG)wuTqr77|xhRzl^J*qiHHTfK6U -z$~gJ$k?*+hR%^U-9#@pbdTJ#QEtT=~oNeL0hoG9FfqZQ5a$OG)dXrW>JG>;mO=w{E -zGd_Yf8F?I&kM%XETl;|HR+;?R#khwxG;W>^G+U;XZzf}IV_Pui@YMAWI|L45Gd(eRaHb+Njk>kta{yik_{ -z6K~qd$E*$I9VDWrGX5~J(P~Fvx0|_R`3M{5tcEtJ2&Zh9iMeh3Dq3~jA^ -zLG4_AR?kFJU;5};096ljlH#v<0@u#bWa(Jv0T$dd;S -zik(+sLa6rvk -zQ<6Qtus5|5XMQp^qT#TVlyl9%O#*Cw+W>PchWy|@>QF24eh=V~vCH@HLkdcP34$nJ -z$H{3_I6VIZ@I`PiF*BctC{hm2p6G}sa*iK;yv5Cv9c)E*lKD70qMD!UojID~Wjbwfm`|?j`X*p2jn!Z7BJ=l~2^gzTC8i53&=ki9S@YLh5V;aKCyJ3n5 -z36XGIJiBoesd1-H3j&(;pwx*0pMX=tj^kphRQx|*^k4Oaxtp&i(>{9C!rYzJst0g{ -zoj95j=Gof!Gcb`myK6gK3PIw9Ju^BVk`T@BobW}&an*isTi -z$h0L3SgjmvF`LdRGotMXM3c7xexyVANdbnSF*Y)-4V*(7j+DyG?gF)o&+Z=JV9c8* -zTet2t{GmloN@}dI{`RCamlvq=@3ZjF!SJ)~|>VmOdxJ88_ -zh>Mj(;UFbI0q>iudUaPZLiz&Oju6YMpG5Psk>XY7Xr#lpi27#nNqHbp(A;)dE)vgg -zsU`^E2~{*2?P++fmi!Q?1zHBS@8&1%TXRo5m34CL->*hB-@a|z9E(VhI%DV@&v~FN3z!&aN8;{FtW;g;$ex>rk&foc0yBoZM -zY-8$kwMS)tm5y{dq+6ZMfUY%9iTWRCG)h^Ljqnpp1})uzXCtn5sQR6Awfpm3zV7m| -zVk21GJy=}l7GRp*t=Qb6Vn)?FF#03S;SRWc*LHpLL0t3({a@qVm3|lMlv|2(TSUG46-D -zy{~w1-}L(Lu`n&Lk`nI1EBwyY`D)dhvi{PY@tIpd)Wd?gJ^FssD=7kapH?$VfO=tK%_=}^?+Yx<@H?)UJm$5IuU!N&86saD8cRTu)p6T%ibM -zd|`E>>8{n;Z+(+(yAUOT@k%=-C|_1M-Dt8`gQ~szT1A9n{4RWh^Pf*adfV=fKi9U# -zH=N`BA$@|3s5FN2e8vkZnGMwtL^TP-NY355OW79NIxTI?V1U3HZ4R=&=+&WK2}B>R -z!DGzGctmkv5ZUvtML$%~_^~gqtb -zV%zEyIC1M3E7XD&4y496LZ<{Z!b8(t_)~5Zf4_zTC6Btz10D-6g_7JY@&%HR@cMiWX}5Gth*qE!hmEu5Xl -z$`kebHHZHlCm^~k<3T&RoQ>qEAH(iih;jtY4Nv353xRdULcbhoTZiHr -z+uMhy*b%KB3fm@Ny>DD^zizryZh_T@g{rPmQ;##eE8GZUUG2Dg2XVj=P&jP)FFf~X -zq?OOhsiDWWs8(lr`1#LB^Gw$dF;QsFP*M!xxI!y`wY2Ohmr5~GnXTg5=syKLM+TNh -z{ZyiuoDWk@Luot}5|HiV$O@E_#I}~mj`0eP8-56%AN!_?$-Hbs^L_D6IZdX=L0X@Z -zk(QoukHhqK5AbMLZ~

WE=CZMFV9Pi3@g+&e+unrq=>hCNu -z({I%mV~v!=#Kct|wt&^5SU>FOno?i@I=yZe9xJ!MF`ztG_usy%Iw-PF5}?2fSB{Hr -zSvYIk%R}mcra&h^>S>!W{K3)$Y@zFt-?82jnqMpc4n4I#5UI}ja#3h2I496{aOeepH?srx9(%(viU -zSLSdF8))^fFa^#K4Zp7=ItZJB04#)hc8>;CU-XjKbf33!8U0;luO&-Bxx6!-DpB^O;%DFeo_*Aclc#}l%0FV+XPu)klFgs6gyQ8oWGs1yE|N(8uq -z2Vm8PB+9E|jT3v~HL1sA`2u(Nmv@zC8UKrTY|8!ER1&yCmofPpCnfQx&X -zNL%qxTnUd|1|rN)_9;y|A*%a-hj8p|9npN&J@7k~*96`;VI<|zd -zFqv>uVSKgpcHB(G#Vj+)RnwgAnCpEt^B~}8Rt!ph*djIU78uZ142lxEv -z%k)ZPqplI8tnk%jAFKeh)q8T-m&tLDrGsuWAXbboV`4fp;T}m~OSWJ0$!B7tZb53Q -z0h{?7q2&c;Ufk0r)0~=H;)%$77iJ02ZrM3HHbRL^pB*@;zN?A}7uSiuS_gUARJemH -zl;?Hr?ZMPAvsq -zcdYhvBHGf^@zzQfr)=Ns>wUUsR+;0YqhHQ1hx#pbvn)(jR#w{iu0p2;vmfzbk@-Ot -z(fX%Or7b^Fk0k1Unb|k{%w=Wi#`1*ZYIf;#x|6N9ciYTlaK*(<{-n)wxk(|IuI2_y -z{t$G^Bc9OF@pf}@nc7ekYU}7Y(>lb2J0vI9zhc&_{Mm^EX!0`V=~EER!sSx-wZy8v -zNfu9*lKHxZh9p7F2bZCg<~@xUxi9=TkFwEpsA3{Ec*V!ZgnV0TR;md|3aACP^-qx1 -zCKAliwbA;;ya{1op_dk`3xJ6mP8?HUkUv@yBR@S*qlqB;w&ah0)z;vHIHL^H6Bt#2 -zK+&OUWIYj%pw66kDkMbn7J$*Ha!v`)tL$wI#ZJi}VZ>tYBQMS%wK4`<_TB@lv-=Pk -z(fuAvFu!zd+FCCyvwweA(Cp1i2hw2bI_fBG!pme2nUblaL9OHr`n2D+cj(14+ZcJT -znKzxL{D_NTjmk+p(K%EsLTw_`pm`c3zuDIk@}0YGb?Q!lFn^>*#T8|224k*;F{d-4 -zA;|40HC~VkMiCWC7wW2!!zwv~K3#<&{;Jrt-*)v8f7I1I$H-T4Z|na~)K4|?)ms>I -zVdsIHzz}%sAAmT2hKSCPm9)>S^chBh%g)Zu;v7N$9IssY)`A_u -z1Rgv(kD2hIVxh>bgSnUkch1CQ`cJUrAzqw@rslF6=3!hsfd2>jV4-AU^t6fEMD>${ -zn8gvzaOcMEUnCGgm)ZnFz3{KnCn{~yf3HhxYN~!PvkM4Ts^;WPhBAiHYmqFCr|Lm{n?d?^` -z#JHBS2cyE+vp+gWMT44~dk9GUh^QZkGT3p}z`F`?&QxqL8BJZYpP~O!56}S~42=ly -zV{~{agkMUGZDIzk0V)6?KBGP0Zb&sACnc1WTz~@PvGDzDhQS -zpf?*3fdzE?XC4BgYV13ktp-EWy$(|b7K6?RLb37M@6sn?Rs1?aN%YfXnhwk)ROpwI -zW41VCwGfD)nx=J~+e^VG(KsF{{uAm7zXHF_oq0@~0Hs;epve2HnHe`>jtwTGwUJf> -zZ3WjcePtPNqs{0nctc?Dg1!Pu)~dhwnZ9q|KELx$B9#3cBplUT09&cqD{kDkvysUx -z+!7ul_~N-g!B?D|&KMd-3|B%;;u_A{4BTsgro=>pkl)81gzgbhbcFxg#T47dHiTX# -z|0D_o5$Q^5R59!&8ZUk_o18nh@(4gPGWPiR$?F8@5V)O`Kqcx|Tq1ZRBq#UOf~f$- -z$HBsw+k&y-wa^gjl=S>M>00$u6m58%bkO3!OP -z;N1m`@k$J+XeEn(rtA{~YeN`c$f$u_t?TGe7Q{Dr#*d#P$a&9Yf-FeI%tn0>?%=qT -zaEEB*y?_6HDF;&xfO;`jarz$0*`gO-;>^*|-kuKZ{4yu!H0XRcl>uQqq4LL%A6{9; -z_Qzof2J^FG>jXiS_+SjnemR*$tI^6nm9L(_t$Pb9C#N<7*+Btq=i%{`NV%0GFlY4g -zV=c)XED1I0t<&KE0#pMBuf)L)GhsW-3Ph?0Dbmo<@zz+}+N*F0Oh!zVFFd(w*ZAg1 -zA#Xxj+Si$OV5SfI!B=z>=W31CPF_i@8!DH&Z~IiJWO1ZO4bhS@_Cu~vcv@%Y&YfT- -z9|Hrt|9L#&y9iIU2!2ZwY$D;P7GX}aC@hfppPxg!dy(+cm8HZW(&{h=&e{@+jK5>J -zQ5X^PE@m~CKx3hJa5cevg^&G&7eUTrEFt`>5DE75C+w*S2)qtBQGVfrwQ~DU7^dpQ -zyZybk?a-{FGZ$mWa8;4}3}M$K1!-Vvy3lF3|2&1s_ODgA(r<8byol&!&@Digbz);< -z84l4gNp&jp(bNe>b=7@m9)PX_x9GdExSNxm-4H;7rK0BJi=!p8al1`dshy0uStm;4 -zo0o+ej+4xx*@3o5#1%(JYY{{;zY89rwKPvV5UtdDcKQebJ!62W(a9GHfuR5O!fWGI -zMuQ>}puv>d;_N7>!-LrBPC~1}P&nmIa75&Rmmr%2%wk>_aN^p@KWeld3X!R^aB4v< -zbf{v~i57%|a9pwkv>qrkGI))Pe|yj>*ov?{hY2X3Cm7Ix;^)%%QZJp=L;EAGz$tpOg_Q6dj*KM3?hFnEgmTZS(2KhDi1HBn50G%$;Piv?SsJ=T -zn7fOeL)srQ1aew}2=Cg#h{2WsIQFyuEx~&?Pe=!(6}4eGOehn9bb}^R>lj-I9u?5W -z^ZUrhFg0Y}r4Fcg+xKCX;Q}9Th;9u1`}fG|ti0>sqndaXsFSugzSi#2CAF`Y3=$s} -zsiYSC%dVPQnyei%j9+*pH1MzGool?=emsb={FQl`gl)J()(5tmyrwg&!#2!74fPQR -zTif{;?`&${=3Q?)bl|{qFdtHznCW6mRj@I}l!_+^y4d9McRx1i-)e&?df^BylRTpI -z2}7HjXXBqH?J%qzI%qk8|LS$_+&NRHOCr=-Q+}!)CNL3~@qYZNB7f7vRoRMLaaa?S -zyJV`K9%cnYcTicd3QIs_bh3^OF*&cpBdcD66cG0ayIBrwK_0tK$OjN25Um4chqayr -zFE9_kw19XS%w{a)8;SrS6UR8~G%U$lh@)Wl6P?nN1B;PXCtB}C1!qbLNcj=Lj+~Ia -zH39M}V_sd -zC2+THcm@nsnyfz9wsUQ&H}(MwJk=2?J3&BP43n6)D?|fn#RZ`=W{^S6}kQI?+o@0YC9*i*ok2R=QzH!%2Y7?;L8&gyDdVBdo -z_de0lepNP>XdB}RCws{)JkOwRuNw6U{Jsoa7{7g?s3#cD#l2q9edHN9Ftq0a*bDP1 -z`|+UXhQ_ZDF5BALUbdjb$NnWTR=Ua?qA}{==okkU3JCFc4CBpt1F$&s%`nnao@Yq0 -zUzZ5Y&24QItrj$bgU6e$NiC17?Nd!VPtXB=9cThWqzVkAVIOBHAw^ME?@9ci^-^ -zJ;UYzW(wf8yAcLNet>QmrH2Zn=zgcp5i_5`0rFc>B%znLv8B=tKs7t%{V0O&-YJ+F -z8;BkQZ)T{I!$Ke}f7JrBuJvJZz>pQz*AF8S?fM$~W`GBN0){yK#?1T%27=~Xa1o5mwh`rhad_D|SK1L7)6D;iOrIj!us@@57 -zI9x)EuUFv*ylG%$#7OKhz*Ey5EF~^1B|DsoPll?j%$>rZHt`WQb^&-WKRnpPjcfg* -zq@O=e>ZwVYXE8{w_)&@#+CN+r0~wy=ed*FCP7*!ksbigGs8Witc*-d;tHrBoR64Nl -zDmz<%tT0DV-k^`vsbU3o^7fjGiG|smXPV?jzEI|Xi(5a1i#&UJ0IW5 -z;xVD@g0!>&2Zcp$NoI2qM8Sq*F#hGgTsP;vI}AzmFik#&CB_5e%>W15sj$e2qvAop -zAS%Y$ZP%*ydHxO41lK4C0cdhJAfU|PK6119$c|%oVK8?nV`Dug=8J8(*1zY(eaqM* -z0x`LZ6Ez0mf!`xx-G+_UyH2JnR@bwQB3>I*W7HM^HWZo7l$D58k!7{Oi?e -z(4S#?-`Y8FR|+6f_8z)?R9xKOdJv~mKQ#~E?RX>~&c -z-{#tM;dhoLGbYb}!5q!*mUl7#8K3h4gB^P~-3|mkxG{O4x)^SY3~V8H1<@Qkqf7Sz -zy*UWQ_16O$z4yYl%x$>AeIr94<3aLW0ZUSbd%bwyB+=O);!00}vMQSc$~S-R9zXb) -zOk!aoi!y9I96Qu!R7XYikQ0pKiQS-IyzY7En}<^y!GeI_NMbXx%xd1Qz`~@h22pHG -zE(i#K28TwKF9Y~}^Am~s-o5}FZ-WKDbCxTX;R+6EzTtBW27^-ygDF7xprz-&A`=Jbvx{%E``El)mO%A2y39R@z4XngIN_NebGYn~Lsi)`6wJ3aWT -zGz3BD8EjBY0a?HE<6sNm2T3XD#((h8q0c(VgAe4$$uZcG-9@B?spSqkk~#EgcNL@z -zT-{`cCmcWYbh+DEZpm4kOTlDi;pL3yE<9}rTun~Men9jKJtRtYp6ALyeX0@(2hB03 -z=(jf;g`i(?{D2cc0~&tNH+4nm)KLO8iox7?KmxG)!f_I#;6H#P2JsCJaHgQ;s^lHj -z!~me$;i6D@$?G*jbKfD3(U>-40{1it$G(Me&~?uPP6+fnw05VFhkYw -ztKjE9FPF3Mds?I%Woq46m2G;XKQSN>S;5<@;OzmiME#}N4?t^1KnB&{QQegeO?VQC -z(6d^J6UXO4$3aqpC|B_Ofosy{{s8Z-gND1CVUKH!#Sa0tj>(%b0wxKOb)Xu#^Z|la -zGrxMjLjZJbk$v#}4#xLlVj4i2fhywIkE5Gyp@9@bt6+~)P5dDN?0*YlSH?^rQ_X|b -z$OlK*%wu}*r$d~!3ERS};Y(xXn?d{~>MxgDR%K5Cs&nJdybK&Pbzp>LebM&{T)`Kl -zSdS(@6*|4}8zM!O-<$ztgU=Os^Pe8%rW+p2(s!dvXud0ezY%MJTM7^lgBM2qRTJC6 -zXSs!;^JF~jF=K~cR*jM{4-U&f*l`b4LmbKe&{GzFRlxDa4lo{VKkh|nF7+uIDd<}h -zcraj-ziJ5pXw{g7pT7w^GAI|c1mv9o6p8r&PrtKq3sT!LNXzjEz@AyeT?ma>%3^>f -zz!JRt{APcD9&&_~ibC+>Qq`&2CVQ%~U3#mxlPMJ7Mjg>D+JH#{K=Rv8IKKA!(#A>* -zX`j~p!R-n3s}Tiw5ZZRe%DaAp%pL&B3y0norI4vRQ*1eKcp-Q_EEgW|CBOX%QbY5D -z`~lpI6CkxWnUs*8{=Lx>Djn(&piNEGNb#gDnX(ICtWAjC1Ha_CdxVfV+N!%*pr1jb -zXqhriD%dHUxQ&Hi)rda*9w*J(eUePwm!Y6Uh1@9knCp_m0*%toB?A@;2uO3`{aWc0 -zC6E~b{Cj;V{G(?p1mIm3hx0hGqh$52h4Ze3B43c2{jxu^9KLu2vZW;cOd-0X<7)EX -znQK$Zr?%I7L1UjeoOR(_fnFQ^(& -zSz&=rY(>E&b3Y0f0 -z){Hfn0!|G5ax}nIad2?RbxQ1eT!n)arWdV_MJIkLWlhwno -z@X2nKbeFr{d;fD~BF|I<{*QL?gaiFK#MtK2C`4x}cRI&&WZ;=xhpX -zmQ-)s4)(~V?*yq6hR_DB^ckSm*w(G+!E9Iq%5RWqkAO>ES5=(j*S4nvv(BMOSiLKful -zieTa{fU!%#fJ9ikiru!)*KzldS=7|kROXuis=oZXZZzT}zB+cRhRRpmn%UbTCyk+APH&gz*79P{h?y7YW@Mp-L{Gd)i -z9+8@UBs^mGs387mXt)Gv84zoMjEf&Xbf|wAu+Br6h@fq}Q2j`NS%nF~^YWrT@U30y -zs)?mML-uf8kmmUX%?rVygOfctoYy&{M(~*Uy4!Vmx@j*@h}aVy4meN;|6VK5+i^Fm -zQ;N0q`jXNVu9^S%LT3GKnhrx@$vxkO;|RL*yS3Hk{NR~k!ykE_z9taD)b%SoJ8Mt@ -zjZp#Khhqs(iDE66Gv9W1_@LKjHELPZ`@K|67veji7LCUhfc+xM11f%EI -z$zbTaeWz-z9wR-$_*y~R>cfVnFFJ^O{$7#-ycqJT2{~)SH)a{X>0)R*5)MM`Up(j#$ljIhM8>aIN4O -zx8zyOa=&ts1jaG_P95<_W1~p9)Fn&{J_2W~UQZ?cbw+6ngPo(Qe01x+L$Xqf`tH>} -z;pNPvr!YM;Ii+pV53pl{&M>rX8bn6H>Ftp}eoEUJY3iEn!`J0J$8b_VFqx7C_(>D1gQ-$d_| -zb+cOM;1Mf^5>Z~3I6p3~pZ7Z@&Nr3hgM=F#T&1V##=e?gHe3E>cHu|-DkN?-F0Fu@ -zQIdc;mHCy;&Cytt7ej~uOlr6-)Y-xoz-<{F+|w!S@U7>XnX9LOV=gpgWYeV5EYR=>?G{Ea{1ghp(6!U(KmP -zj+1cIc`OY9z0-hXzY@EDSlkQc2SIcQV9@u_7t6ogLPl1$)e~S7p6%OzVt#7ngUS4T -zdE!HlnfbjTU?fcieifv^4rqY3f^LgqylhQA_u7a!STayQ9a^fws(X^x -zvY#k863Pq$S|QX42Xn@UV4UZ;6Ff-NjKvq6_klQYRsbuDiJ6TNO`+^0pz2`%b6vlr -zzsKx=S?_!daUXX2+Vj#c6h(rFKv&5Bg*uV%Nj}`aO!4Dzq^|j3;5H=s(B6<~5K#z1 -z6bb`rVc%9ke0WRKo>wI}Vkya%W;3l3Q9y4Rf -ze92$~O3(yR-yy5Gu41YN!%v`SELTVCWYZYf8WalnItLBrlOL%}r!wkXBzE -z4hz7)7_|umEXG8>11qq_c!$#}gCQ3HvO&rW7!VC&PK0q}GVEB9G6ul+LxL7mc`%UU -z&E1I;%90YG?`OP@cK4K6GSFYfSBLGHfx -zIB(!NasE6fxGE>$D)9b*)`u4fbDwrAC+2l{9*1Zqkj|C=%zXs^nfTC2*+yK0`n_y* -zv1~OIZd66@?OdwDrp{$J5Cb3`-owg*25Tq}*lgF5ZDn{6_YYt|Iu!DNk9p);au-aj -zO1MOoKy6~2eClE7EPAfsTC$`d1y+Ua9`s5kQyYZINO4U8SD%D0G6ZQ|%w#kU|f%*^7!b{Xv0Nt3#tb|M_oRN)|>zlG?T -zp1boMJ7GS~Cjr@9^ELqPfEKE1kga6|fizg?#jI$d?{bI4RZJne0VIGF?g#uuHQkL? -zXB+oI-+PG7#;Ib9LcKrj$<#B}jNe0W6^q`>@frcJwY;<>&k2%8k|FicWOXf;WZ`oK -zB4+Scr(NL6J&W^Q2lj~(b2*7JF^XBb&THBrlLmcMpO1_rK~(MXBCx` -z3yl6>@Z9*AVutPwhxPvqy`mYvO`xfvy{4S?Y!{ngOJ4%EU?4{I+={l-)4|nE(wxUAg2h> -zt^l^324at~tSvgn+R-@zq<}9VzBxEFB#0qlbUDV$=$S1V(4Cj02O$wVzDJT<U#(*(EWKBFlZjky~u*PB%Ij}j9RSM!8Oq|~f?4S3N%ppSz(kjCJMj>)f -zQ(cqB640$W8;a#5ExeP4;QW(=Hel9`%*C9@$pxO-spz2(h%{z5aIN`v&IQ`QeHqx@ -z7oA;r^CJv)K${^V#}M<_7ICp+M{>=t6*%@ykdpIjvZ~CN;mFNbZ2R*DgSwg7c=Zhp -z>)#hKHJqEuybMk3oht9DA#vi`M(x4^*=No~fj=AmH3?EM|9qr6h9XGMtNU=9Ih9P2 -z=E<3stIC#!*nM8nDH2XI7Q%1gR)U0-|8BmZF#(X`pnirR -zj~Ox&u!a4%`(vVD3oI|r0^$<*-^~<6E7t}5x~>7x(%Hz<*MSKD -zz`;@gAXd=Zj?;#uxqq#BdgC76V)#>@zK^+7r)&ux{zPgEnZdKlncnjgkUUYWK-~%G -z(RGGJ5<4^6sj?LZNX~FyUpeu|9x}3qypqFdvm2IGA-fahUp_>lNuQ`yqt;=lQpq)d -zEiVjBQRw^Dm|YX3d}D^09wGmwp+9CTtX)Szb2>SYry)O22HxN{^{_A^nP0qki%6ve -z!(}dW37vWuPmE%3L1_RAhMB8r1qEkqYU9$qCZ5*zL4f=@XgdI^j|n=oLG#RMEPk9E -zWm@OY!o4L(4G4d77LKaz#f#4qFVk^wv26Z&{9;?Dg3`A99oXFn$T$MU7IO&D)-^Z2 -zsg}^3X>l8i_5#EGyC{NgL1HC*=8R#dA<^WwKH=ftAfoeE;V4LRCgT$rSuKcu9eSnD -zx)MB~G4qz-3P_+u4M!M1#M8jwD?8M|vKF9!SF5bB4}Yrgb6H&zC}_B5awS{*HHQ16 -zQP8_R?(1IWN_AjK!VsFb!NU~=liCwv;=cXwEKSHrY;Bit20S>(o^w#bj5ReZKJTr; -zh^hTA7J>-XpznYE{Mpq?9K)iiJRuk!AbNCdN-v9wTJsC-v{W-`K$ivM19*V3gES%-w*FUas7xa3>Pn+AhK_4Q8=+} -z=gw(BAqLY@dEzz*kZ^Pr4AzdqUMc>d4zn@s)gelyNW#4>p3qjB{~H0>+nBozH;s6W -zMhQ*BV9}zb7a&DIft21yXD+xtj`JMc0|IXQ-Tl*T|9B^Lb#%a&s0=OXyE^n)k--RQ3h -z>7L<(8Ox7q`=G$re41WWd*KDRbO7K^25>uT`Q`o**hvovYr==d3P;-j6fPKiF)=ar -z81+LQJSg_Km$g7YOsQbk}2$K -z782aEe0d-AE@rf+j^gQ4wP5(rs)_o;BM{#vfUZ9eu!JYvs!CNy8Y%LXx&H#Ub%D+s-8(!{m^@O`g;`^l6e -zkTu^qaMRp(O++>u@nC>Z2AKxIEKTgR)>Ww?zg^g`(dA?N@em{c?-T>_67{jT&)7}| -zgTU>SCc>B{A%A6I$UzhG`td&b#;%Z|-!(;%a%ac@wCNzLCB~$CN%Xrr9HXZJ?bD$C -zi`)lSN-Ydj~tWl2>}uQpkCGd^UE&e5_V8r0_u$K|>Ak?1Ya -zyF9v465U|52Z=UH5S?hzMRW#vO%7@R%wp67eN?|shsowNS%+q3PN -zz4lsnTi1QvYd1W=J)jXt+&TdI{u>zs@qGkr0YDkgx(knvZa93p`#bH-^lN(&9SB}p -zS~6S%;M(I_3!tDN&FN$%U(bWf7C^e=aSZ65vh4hS{rAJV@5y>wl22!H^Qlv=B2@49@OV`&j6fBnr+02$~24}Y*n8U{d8fJz8t -zbIvb+4NRjB0Pyank9^d;f|JHkuPy^<@mQ_kj -z3_b89Sfd`uT38z<0U3Va?}heC{}rRj>2{dbP?n_hneR`5KfN^Vk}nA&?t=BJ0bu9fXacDG&zoUl -zj$=P3&Q#hDb5Zk^8Vr`79xZHvUj2@81Mz@V0t}{c4xc-;j@V|2yO)1HFQf|u;CN~? -zv9EnV!$Ei&2&BmRfg4owQg4v)H?|)L0RUxB{r#OMCvi(lgMcAOXYG9A3oI?O1CM{8 -zZ4_AA0YT*lK)?&bKgEgxW#ZRa=o-xm6%IHMnmgE; -zu24_&ldwD#0Cq|^Hk%-L%CQCj)RrJR)&U?bnZerW2ka>TBwc_OxJdTrYNL*D-I-V6 -z$Eg_VS;fmVkMb>n9`$6fJ{|Zy=H7b1m|r=o{DR|3Q3Fh8DGMl>u}&?R#T$)|`*})G -z>)8LrMge649unZi4X<6)YSEnuO##V7fRd@UkQ#HP&D^~o_RGO8*l_I -z3@LAYx$`JNCl_}um^`9E9ng3C3gr9vP6DY>b(&`eJ{UKF1XR(0h77 -zSA6L>GBrLY`3o4uSZl+*uZ%4}x3m_5Z-FizSN8+7^}7lHro`5M|JvKJqvqlB4`^8Z -z){krneY10tc&X`tti|+V2U0QGL0JqvLm$F&CRWY0o%5S8jiRFDY}W=)$NU>mEg -zH6Qvf532{xzDQ1FiJ8mr;(=1$`jyTtXck#voQ -z1QCb$w9vVNmhwY(FCu(e#U?Io=ae!nr<2F*Y+>mQt~04eja)mR7P|3R=0Cx^tO}Ga -zG~B#Ohw^^-`oaV;Bx(lPk9Zl`mudWCaoH=9ljg%+2RwpTEgtO>b^Sa9pKRTyzeioS(-=K+GZHYRp{YAO3`6{tA27}Z@|)j$W}T4uVYmP -zZLt)9vP&csiY^x^r<^+G -z8@w!sRZ^Z}phsydrp^&qCS8){=hv4)n+F-dl -zi{k;UzOd${`A+{J)fXwRo{T8yVHEf7OG;=E6 -zNFuNE7KZVMaP-+WF2m>v74?2jYlr?*@eb#MZ=t#%ugDF=eFt;h?9M-?Iho?yplq;e -zbT2U%_Pn&XLxHwh>Pk)Rv)cpbl>o2)y4Vf@~KqwswJP*?dAoZp>K{} -zTVXnPmP~%w`~93zNO>@udcGX3wM%o0S-cC8tfS7fSd-Jh1xx~agOx!AN!ieHrfTDb -zC~W0KhaeL>Av$WOxa`0>EsQiSz`Pc9C{M9-Dw_>I>oEOoW0nrB!GHD@Zh$SZ$J!90 -zOl#53MpY4>GJj|NPdRo`TT!a#97bz};xj#z&CI3rhSVCQ)?R7$N;>_h_RcSC&qDvC -zoQO|o*3MQr`0Hwlc`^>D=YP_??z{nrz>)1-~)g+PP|<+Xv;MXYyeqUT? -zVpqSG?987f_(;<=dbA0VV4_QssK*xB>#o(a5i;i3*`IM4=1Un8n^NCB7nZH#K^dbu -z-24#n5?=&eYhV@u6x@=*9Gy${0NLm2jpSE>-k)Zx`lQG)0-HMXcy&z -zS_!YAkixmvj8r{>X7|H{t$40Y|AdPlpm4K|7pqSdG~(^YH_vxz)OEtYqz}4zGH#Vw -za?T**i6`(mKI(z-g3@Ww)xBq`mcB -zdhFffuoa#rl2?iiNGTO7{slLeB8VLUQ@!+$%sVELqFNGnucmY^`(e8{dmSO1obtg4 -zj%UOGjPKSRuow0e7pzHHZ?oLv8YiJbd@eeXZ{M5Ec#2ha`$9O6Uh~DPvH~$+1N|C~ -zHdjSjrPo&i<3KnuAUFUfq2`2?={HD^Ty~FQNDR89$>CAqiw^vpi6^hVdUD1BdqoiE -znwpOQyVV>A+MP*2YvW%1@$SX*? -zJ1;eSd%h;D9!7HL7H5==bWBS#puI=2#w)Q7-}zLdT)Z~;?YxoeF1i5 -zY!?@=rz#LV5EVLAJJX2dJ~Eu#i)C9ur70JCBOiQcLdGlNu;i2<__EfGh>+4O*m -zR|PC}+v%G4%yLL=Xm`yY%qt{BgICGS!d!F0rbZzz!_t1o#CY*=?c);O+LI|;Gq>1T -zB=zk{(e{5XGK*$SgI#`IFT#c_#$)TDE~Zr;`ellOYea2-<_e>bX$*AV)DJcaJy<^f -z7tNHt^ej@kW2aWP&?!WZ?hQDK7DtQSkGy!#tf@GIJ>tW&{=qdG_h3=bz?H|Rab{xq -zNVdwJCe);;V~u4csUkFd;mGW2Vz?mmP-%&m>8$6{@>jt^Gh2dz+2(UYZX0yK^NJr; -z?gh9S%U5rku61ARgGqi#{KZ1C4`rXA-kE;&xIdhm{W@FzZ0V!Hho8LmQPS*1eKLF!Ld1OQDB0d6zq||uSWYWu-H(U -z2{)`E2dyby0Zm2SqXzfr2_-gT`_;(GUeB4#L9N+PbXxF%#ddotk8BcDU{SRZzmkP# -zL{5KD_f+kvItB4Kh)IXNDlT1?tcVDJVVAn9hYttyTfZ&;{Oqy3kyd>`&brGd%{IF5 -z6DsJUJKf!5jH>tUcg|Ybcgj1p=?*yv72Abh^fWLQ{|1jP^98mG8y1Xd6%_^IqEU|t -z-+QpTYim2o>A2gl`yn62t5Yw6tcvJTZ!;TnpARfW0IQ1SY3UW>o`%ApC41Pbh{09@y{diI&xG#BY -z9+jr!q5G__#y_2hWk|p8kQBe@BvX5>wEPbSZG6)WPPb&MXUIX=Kg+CDK#k`Dm}#>0Q_zY=4Aa^Q^7QjgJxzfw -z>8-kpC7QKUz8Jqpk~{SNUfU;@yqNUHC9c@*bnUqi<~gNBbf5o_K&dpe;o{j!;+o^4 -zMD*@6-MfiWc`#x20p;&9O!;~Jd@Cen4~FgIjPz7Sy_zQP)<;i!f4^jARo*j;jB9XN -zmKqMg=uyUmuGwiOe}kKbh{fDeVB)_SUH*&$3cOeeU_DzOt4$k?5Hj)NjgEPw=BeC# -zm!+Vk{*r{IQ9=en-tr5psVJE;QninK(yO1**H=N9dOepPUQi6(?h6*U6~!nFsr6{< -zMim(li=Ckb1=}t1p(#xwuFD7K7U81jxHf&Qn@yZFT&o6>qc|34lbx!vZ^z~U3bB*E -z|5xW%=|<@KsUqv0=+IQJA)VL$j3<>M!N&1qp}GiS$jLi_8nFO!#A>ar7h<;T0m6bmF{TVfwJ&hR3_`qx`-LN2OvJ`|rXurv;2;<4S6)>IQ?unr$hvjdB&= -z;7#1X&vG_ZH?41tROv^DHn#Hgmb+2LGOozh(i^BhEWAQIA;)NOjyi(xE;p+>Th_Sn -z0qZ`zbaktUPeMV7Ht)@PU*dD3wg18heQHdm8p{jj(+U{JvxyAJQ_$d>YdxDeRHF -zPuwT$Tk!RR*>Cic;0(abTqxD1-0U_sZI!Ob09F`PN|e}Y|5w*%=|Jv*mqEBLBNvyi -zPXgM8hS1lH9M2FIXi75V%fi=W9`5_Fq#ruai8hUy%%`tC+EqB%D`!r0ah?6>aQ@7(b -zI>2{jH?Px&Dm?b6vS+BM+2?C>CFxNfR!C{KJa7GkSD0Vb>ZuAHz%6^c0Z-7KFqL8I -zGP}PJ;EFAo5sU%rDO2uB>ZaiV0j=yiUKusMDqji}aQwL#@55OT732`2uUwG)D`%(3C>u$o&U)RXqsN_T3kS$Qr#Az2| -z^B7m5kx@q6Y+;)U`i>VpUPaF!=Ph$;^S;50lWX~|$a-=p2ikqA_}EMSwc`ILTcBgU -zM_?JL_{jdKQ*B)K)t2Znngf85iF5Oagik>_O-mc7)UP$4-iXRz+dm#gwsQyEWVdu^ -z{q9F;78OPb)|1_3V2&XLt{R6Jot5g0qHo%R?R>l#$;G_dSG -zSTotzue9N*)XiY}j_=KcGraWY)zU29qdhycE)Mby9w{xkDeVuNQ8*}Btx)D~vc5fF -z%|1j-8I1<-i_!7qm1W=RAT7X^NK34ZcD;C;GS6GUp_0ZJ})F`%En{ZkYn -z(}J?Y%i+cS_9v0s5N&L~*DUY&kS-z}?B{aNHrp-fp>XwO#qCv$cFCfkPt -z&6}w_o~*K-7mQYKnVC^uMa&}Ae%461;EC*Dr3o>^jCDWcM*VHxUVM -zQ}I=lkM_7ETO8-!h`aF({^XL&<%bQy=^=Vk5}if=|a{e1B4JXpOCeS3!P0WE=ZA-Libf!?kZoZ4hY!B$&VQ6ToBzW0!u` -zP3HV?$xpf`wdD7s#DpX%#Jogy&r69&w%y`}nh1V_7Y&{DU+=)twsHJ&}-e`@)vRfr{IF`lZnmB^}tL9OR#&n71 -zAN!wcWroKB2iJb(%Z?aeajC@gFgIQTH*eDineA_2yg!|JnPwKbq!w#g>W(Uq`y7X1 -z*Vdg9HynIxSorn>#%d7n_XARUC$V_wT;ZJ)_+tGT3=?OI8Z|Uv$tUIL6p>qE>7r_CNR<@biC+Eu2kMcwx0IX0%RDc5iW%-aB|e^l -zZPBOlu_SQ#ug)Pw{%{`LtZn5WAv#s)6y&9W7{8%dzleu_g(h!420H*D&eGY+R8V!1 -z!XgOhqW^uZBA$$v+pra;+Hs))!-^x+5cMZpaqh&|%0uFs{x9Tzc^i|2^~Nzal#hIF -z{3k$m3P9%J`>=g9fzF`C?{@TJbioZngW`pO@8TpZ=b;YNYLWI-1`H+(ve -zU!O3zrmpE^IK)9ef7LC{lm65>Nn8!DZXsz9dGwS)?Qk=m)HvHUA#yDSpBlGVkXcdt -z)8L1yfRPU(&;v6|oVA3v7^YQ>=N4X&L0Bs%IIepAS-VLVBG{0KNNk>Ozn?t{>c8=+ -zbwJD6M3ecTVPtcjcB$|hGXw6j*^g9hvB#o#lu(X -zEhQ=4d00|c&lX&9I={F?pv3IKyc=|C7%|o%JI$$@{Mv6J78^jW*??3k -zd@*s?AV`p<_V(Gui>khpg^V-NO{{w?8BUge1wRFzTH;SA1CkgYH*& -zxU&jY^s}};%krh@`AqN5glqQwG1$ZkYk=((5%gooG!_|g)bQV?teW5Y4Q`GyyEm5` -zaBn)-SMdlQ;)1UIYAt!6l71a=L;{a@cq_mtM6_o5Ll&Lxyun%pj*>%JCggxrc&VLZ>4=nQiC -zRe7l~*slh5)W`rqwqdOiJBOR*=xJ$+V(Pst(}cz;uRY#9tu^|+oqg=M-mVcvZhJ@} -zUg!dNDhhBiTOWZCSgYJ4rJp4r`J(25g+EVqSb=In57x&f -zL-w|E39%Emr7s`PF!-<^I$sko;o7zGjbaJyKhavqT>v(!YxG}OZxT(NC_nN?wrcW2 -z5)>ZA=EEYvS3kq?84N9I70_`y>)s)vrR(AQ!-X9Ev?5BRTPxXW(nNL5*wDaPu6AdbiH -zNCDI3YqjjV*VG=6#|Sp?^9m$rz!bnxax{;g4Z6W*2+8VGqVTm0x{Wqh;h%75>SQ`R -zpfxxL5R=COTZDWHV>D&sJw(yplEFtGJ)I@97tJ?}NsBzsmFvK}mi`B0N8d}$uu@Z= -zM+68CDTZIZF7WWQdr0&jvMsQcfaUlv2Yb7wf)%nrk>GLfv$DwbXlVDqi{@nPP8-;c -zy!YDl!CtHN3p&ujaR_psJ0hI4s(tj)?s{#>vL4u%TsHo^-UJhUlpezfMmMb;v1GjW -z5y3m$i%@|g8O#eXvYYJVFY19?gL=>m#M!HGO1|ff?WJ4BFf(q|@U58r07YaWgN!mK>7%3&~y8`IocN9s@SLaI(g{y_1)sbg%%24a5(>FN$1=u{CAMb~?Bsn-1T~+=rRBR_?(3x4V3GV-~8)UzmOp -z&TT#X66rDAPe}lV)=;0W?etSx5Wi4(X;+E1D}z#5u%M|DKY4muz@hw6nH0D| -z0`I`*Q2a1QD&{a0=1&M1l)L}V!$a>c@?gN;J=nX+QkmT@bwhp2=eCiB9>~Ggf!2xr -z)AZYRlrfwgI5#;C)MZdd7wcRB4h&PYC5$3$TXeF%EQ_yS!kWD*a97Lnrc`W|Bp>Ct -za#^>E-nRS(Uvn*Rf0E_50-W}J3$8a97dTlxJ$O9xAeF&V8Q&H3DPvEkcdJd%#2quF -z?ZssH_Qf40VC4Zd+Nmilh -zPcq$Z8)B7aWT5eLT!TQ@SHuOO8EnnBAQ9#}nY$6igCBw5h#*{gX+VyGb5$qKD%!Su -zaPZKdbt#k#VmhABBQ+X}E3nyG7MbNjtrj?x!;M!3?2-)yd)2Bc3QxK)S -zaR=sJK|PywKzE&XhAy!0*p_ei4hQ7=h=0aGqOws*n2zZqXYi%J^oNlb98U5* -zrQpoUX6UMrtqfbj00(3smo;;jJL5gV3xzp2J>6L{!M}ar>*K#VB1LL8Wsg6NZhava -zOdgyv>VS7i3x+V!jNSc>8!T=q-e74o-hAL2;Ca9k63IvU{JN#IBAu+Nd_>sOJ7f2R -zf^#mLL7L3J&s)VCv+>1>(FR_o#o18J{YrfDB-d~5MNut%%1(T9ln{``Oa1PPN+tU! -z6VE&qyv43P9o&WNH)gl|KN2vyg#L+uahMNryc_x}SoQ7&>)>%%w?L7q#_zo6shMDiEw#X7NgL|Z$ibK2l7Hn!qIuSzKa+{D`hKckH{6l -zZ(6;MDCc>Ga;w=<)b&|pf?IPic37vKgEA_YGnu!Ibc?o%O9Z*ad!3)gn`)azMSUXf -zBD5)wndX_Y#C@<$aMb?O#wd-Y0Jj8ev>`3F+#K;7DN06_FKS~y8tJg -zg-S&Nx(z&kn$^GJ8Z{~}2{^%U|2Lg&e9i>_?56(baI8p$_t{d~-^`cg6uJI(`Wd@)?8^b!y&n+@g=HEnE5bgx9#g5qhTAF1i -z3MH2F@Q@@1gMk7&fOWp&&0xU9fGRlAxy2Y#{OgxWO -z-4O0n>J-8LL|Ca)nmKmo7%Z*SoZ4dHS#=7X;|0UJ?k!Yt7~g7(C-~3*dA7V -z2mI`OfXB1zyAIc6KOQg@{eKJ7%yc1Ech)!sB!6gn+^{p#9TV|NgPIJAu?|2DlbY3NW^p<=lh+7Apl1 -zh=jLSfHyrDG?dQL1+I1co_IifsZ$HIe>;GHvNMGF-T->bs80Qz^Ol`3ZF8{&=#&eg>lG{lM~!-823IQQTB -z^LG!aI|>1un6xUh&ur8|iUY~%TV8%bJ!!!5@5(#YwoREPB>x6g^Q@kR?!@~&`uf4= -z9dIBT9mgoM+kW$wb`Rqo*#}}(>Li%~2Tx=dr6&mGTpR1$MOe}DrWlcxYrFr^NVDFs -z{VyYJGTUfIoV9p)SEN&g%YZxu!mk8PPbDmovi7Fo)=+;r85P(U5n0_h_=nKe#t#vG -zq7mQ`ShP;bhJX>-Oh56%T*LT&ZgI0)G*UP|a;8fC6e5yCKU&bjVLo*_Exk*AkXD-a-7Zb3TNbMF?D-lJ3yYNq|?xQOuGDKkXcbzY}DXYyIH*?tqY7o)GBs5}ZU60RJCs#3y%8FCr4Jy3(ZK-Cve7@r -zw+_Pqd^XUuU!5(*bbUC8(fhw^LiM*he!v&xLfiy~@eh#T42!=z^q&W!RC>e4b~4q2 -z@apj0cz`&J!^a+3omsP_?50$G^y -zi@%f$y9#^+>Cr`kjumf!?%2=+szUdkHZZgES`eBH3&bXpTBl1Z7%b+=J59CeZv5tp -z`-^r_<9D)NZST)u>@PR6&9gO}P;X=X%NrGF% -zO>~#Rgu5hIw)U~M1h?grdzI0fzNnLW!Zqu&Ge`f(<;3oz$F$D1pGwxc*?qF1(*rSs -z{PI=HE-F#2a=qzsf5VY1p|A0r^y;`V5Llnuk^*zKTBK$bcPS2jH8*|!tc9tA!J$>5 -zSl5S<->;%X<@tum>cMkeY(uBzEz~nfGMce;f&0tpSwXVz4;PFgHSJ0jsyl7e!TCp_ -z`g_I!Zo=q=$V%WsfTF!<)Y8YK_fL-JZx8hMLFJj-M#npffU?<~F1OWm-U-2-{M#LJ -zPzN6{Sk#c_e;n}9zWGPVfv^M)^=X0}SHFjwC3##A{0>yQ0sQ4*R{zzY(h`tW7=Se7 -z-T^u~7Q4s!xJwDpq5%P_$KI-hDZ2xjK@DAjmKtjy&#kwy6Fz8SAo%0olD}1MD|Y -z-z4<=(F4T>ABUL%R9OB`XQ(zA30>U|Tz6VBt+L&p7%dDL?TAE^L4n{ -zkt@eN28JAcU74BcKY(Yhqs~Yh&mB}~bPNY0XzO@JKz7W^0@MpC<9^Rc;8UY`UZ;yP -z%EHv=p|$}o=k>v!o72Z8;h#qCzlIR-rJ|NT^adyaM0_>raL*(EXnhz4G0@v{-^OiN$vE1Gw1(##t8&4Z=?z1 -zp8#neg&nrVmWnb;XAMVXN>DO8`%HU_);nWN;{7P8aZ!E;9_*sEw?C^B5;$g=UFu+8 -z^sIXqx8pN?uTHqLNdeS3lWUyDKSiI8Mto4IA^ue)t#4=`5HZJdUG#{(RIkK!G-CNE -zmQ$BE&QHg*lHNkJc)6{<%%zB1IZ-9gwdRAI^=emue*B={oNl>NamOu7opSG9eF%J3 -zmIuIVBZ_3jI_+BS=zhr4dVzF(R{T_1tGHFaSciGy0CiKhd+5ieJTFC$hFTTScG`2d -zM~36~+Dvp!ra8~5_2;Ryd%(ghZ!niE@XSn@*wR7bM$EXP#WMPkaHj#CKGb`ybB?nV -zGvS~_HGT?5wA9s+etp}rD5s0sGKYVVAS2zU)aPfIMgI?J)c@ect0G-_{$gZs|BQu9 -ze(z+sp$bxpe@zS+pIc~^5E}3so*wBF?-Z|@U_KjizJI#e+FN|$(tg*@{Tant7$rV` -zM)A4+dlw{wo&;%!s{2`w@R%_S3J#3{2ade&0}6 -z<^6G$7kLWuP1rS!KjCg0!ms7A-1NIfPww3_$G_jic0B}VeNFBB7*w!{87IL+W$#wf -zeuJZ{-hgYaGDDcSjX7YqeX+Lt?OjxG7cdvuiu}TjEb1TZ-ZH9bU{6)KZm5JU`F7B+ -zTD^K(A^P2aGFIF*!gwj-Jiy&exD%my^+>C9llVaIb&0e@s|(ZZ6IO4@gGNcj_DcX- -z&IV}TKyHA1~y;X@NYMt~SRB_6>{jK9XAZG269&i|dr -z+zIa8PG14XE=>8N)eLi~k-SVS$26|@gm4ncTz&>Q^cDmF2Q>h`1A^)#t+uU(1bJRK -z4WzTAUo{p-;9CTW9BMisu%|(?f}-?4^oP*p;&Tu;R|vQaV4(~6v=CWSj4Cpg+dXD$ -zeTQPY;_p% -z1V~cu_kDI^_r=4{rIt(URgR0_Sng`LVQO=W%5is1TA`uWCzR~8`6x%k6Gl{OGLSb^ -zPm--g=1heJ$G9p`@2$FAlBZU)3GV8YF5^}3dD2~C?g9DJE8C}5xAD)&Rn(;;V90UL -z?O7gAOFuUwLDpCpL`}C-1<=W0(4zY+XPA*3P5>e*`OzsT&jF*k#ajZqUy -zq|ipSp*Nc7*$Cqq2fn^U_wS<%I5DTuvM)J{Xx~*6S7&3F&%lD`#~oO8?FyN#<8}5F -zIgTO@2{|L!?b}qH(85rUz`z; -zCHQGGv_^2%oZjlVt-8Ad-Jm5JajbO8(U;-?TQ*DL<)fZPT6 -z>m|RO6N9PzbtM(_sB64B*9sFJAL*1*AZwk_(V&)_Jkljnd+`F3I1TY_f^=IMgb(}7 -zPQJ5I6n0@DD)VzwwhId{Nu4qf3b2PEFDZ60yj|DiR|b3Rf`M8F;m(3T3TD}>6)=Q9 -zVuci5>?0R~v^1yV%o8Quq3Nk^s_4zFbr&Vwt2@};db)le_C*eJQPTA$JYr9Slqu=M -z&e#!NLBB-ef|-}i4sa8Q@m_jZL*-f-CQz4(I1>ITc+^8`pBrZPiTsO^_52K#$WBxF -z92f_{Ocq+c -zP^}@#n7nSser%y^hfes977+H7qB8@ufpmt5;Do99O%sj0>9_`GIM_E#{yMK&_`U?J -zOWc#oJ_ZaLpu#!>xoRrsTZV6m7@wvExJ>TVzeaRtB@%hexEHI8fA|)xh=6_Q`Cco! -zLAS0quFOGZ6`)R;Es0i9rE$$OVa>`+8>F1?sQYGMK0iLlj94?KLmX5S=J)h8=*My> -z`SrZFMn@NZPA#jGA%)|m_hX91899t)1Q4n4Ujnqev+xh2-MG&~!?lY{#=0Iq0iHS& -z?^w+8@X~AY$`ImBK82L}V=LV|r`)O@=0p@&algU~G_)`g&Y^ -zSyab>@*v|@Ktq@fAx>Y^tgXb8ZZ1AkOAz(G9y5ZJhSo?orTK0-nEUv1RB()jodC4* -zv5Uww1H#7qH?fE**LIB$Cxz_caoQrYDSzpF17>ECrr@jruwnR28_ouDu=AkIAG=mO -z!8k5sRRhT*p}-Z`GVbo_0V`50%we6rJ1r+^{(R2h1J8x6Dej(b2WGtdVsRr(5#aR~ -zH}r_q?3zRTmM@}wd{UtD*j=j*_q6Y$HC)a`ip0}XGWH{Ba~>&V+u4MMLoUNf-Zc%i -zg;RAwWc2hKFny>Nw6i?D#mz4SFi@GmOV+Zl!&-1BwW$u*aCq;G-Yds*)FK~<4>mq) -zz`q0D?NgY7%WE-iR_=USM7qUtztLII`5DP5+OilYB27pxoo?W7Eo;cJRqgBQ>UyXg -z7gxs6o;Vl(t3iX5*gVfM%OvlvUgo%QB=ZANQcI}QdubptP-GSfX5W1X`|E&J_7SkI -zwgr{}ZKtijZ@~Xw$m_ht6Apib_vsq>Tc(cfB6;R_IyYbW`+Z)!gVI$W_A?P>T0qsB -zVYxS<3H&s(4UH(Pqk^#JyiPp}IY#4t@@q{Z!fDigB6~E*>@C39r& -zyc22+GBsm=jj0@s`GRh}!J2yHtFFV^g4<=!udw47%P%<(&@D0$mOj0T)*0^&j}A(0 -zdWKRyU}C;-uD$rqrEa!oJMOc!b4{mkX6>OR2fGA;6I`*ve{ZcJVMdl#P@A~`-`p(f -zitT37Hz)Rw=xrq_wX(bY2VY(A8$+GKv0uJ=5~wY8*mk53vq2%sA$`x_ONyVpx_s+! -zuL<83JxVvqYL{W7Nm{cfxDw2o*=$6WO+GAYMsZ8KDYr`*zMbGK@#qni -zT+&h3+bO3XRyXs)c5`ZrB6f)Qx9FbkPY?e-#@#s;KOrSHc<}>ZR -zIlKYdOHr3n+eeB{JPAb${J@b4iYqjyOC3Z67bia`&i%iT)I%Ze3-^w6W!^Aymx#|L -zB-Teii0-V1FeRpm%;2pvX4JoAlriA*>EX@;8N^u@D#_ZV-~QpWC6QhEWL_t{0COV} -zuxw|6)g$xR%8Daew~eXl-o44n-amf)|FP6}-ehHYNlLC(ySOh2etNX-m@)4AxmKE} -z5W0z+;ZA7S$8wdtW>!Y`JnV>s8FEGj+J7-^iJZR1a3osusdXxv{OOa23x({m*Fmf+ -z=!7@dG&=jjJK$CnHfwbZU_49^zow7ct4<0azw&5q0-rmM36mFw+`YO5)Lxpg<7NMp6>S;wHQ -zAY~&#w+Vtcz#@nJ{f7szdl6IWriaA!={!Y-F0GwTxUxTS(s&{UtT~mMOb>koduroz -zEJD}56sx8&)}+!6^bdutpROfcK0PFAEPqO&3Px<-jc;BPd -zw$a>+ObQ;Q7Ml5EX1uo?b=@|dANxOHcLGhv^s -z<-&gDwf`m_ww}7@X}+P%4gPih7Jh*&^jxx3Fw4KG)Wm^uQ_#S4)S75%3{aJ8m}TRc -z4?U?w;NXYBN$*1#+=Yhsl<>cNyX`*aG&}h)u19ayE&GvBwZ4Q@xZ+|<4xtZr`#_^z -zMM{x&mDTWQ715kWS6E!k(e46NhjPm6weNa+ui1UEtG3{<6h$25r%w8Ybf;|#kTVf8 -zPR(;1jJF#0#LOH@$ESdZsRq#!#OL8dc__T2?r*zC7>@u;h0(4q1(V~>&ya=Uzro{z -z2XSr7NQS_R!qj>ez((e;4vj98;+hAo*~=DJS^51{8Po#IGSnU(V1G!7+*ldZ4e8h9 -zZwlZW@f%%Qp#V3#Lm&<4820}#9Ekbi&Gy;G_;hJ{`T~zx;+L#}k(Mm2Uld@^B_hqK -zd2al?-(+es(X0<+M3!-G#;{5%3vU1p{?q@Bksb{`#Y@Pr(HDYMo|fCLM=1cI-1dmqIckb({_6|U00E{A+q)15@wQ14UkqTa`L*XunHYcD;?$DT=`c)C -z98muj(X8|O1uSkq)#-%Z)xM&4ek}8YjLYBG`|XE!HSNh;t5u1pf}z(ZrWE5Hn{^El -ziv4%j4sB&!0MhCVa_VZG-B!HmxT!Z3AiQ@znKDnb!3e<&*jHH{fL*sQ8Z?YXfxAqM -zXai5uG~V*R1Vkt=6xIbAqDNakX{EWA?F<|a&8erBYm{01TJ{^bI{vxOGFM_%vlMA?-=cGD`o;I=bNHC*iCPXse2VQra -zVzO)T>K8+iSaKcuMycRh4LU$75Dn#q>1@HTisSs;Kdh34Dm93f4_!!>QXAt!)qPZ* -z`CapCKjF)qhb51HRlAM`~9qvsiATsWPktvrfxI!@)uD0?a+9qf}+;GgG5 -z-0$wEd=7iUZk!RNznx^|AX{MsXN}FlMt~PR7E$8M;+|6lCOC9_~f62jim_vxqSXp!*<@hhxrZc%Ct`- -z{hx7ZS>p_gFG#DNNQ){>ODz6e1=HwEw3>{H%1U?}QF7Q2IFG9#3+Y0iWJ!{^5Ox@2 -zs}aewLh0g-f4Y4Pfn1XP-;8&678@S3Q4ZKi#&7V|l1sAb2u-WY`^?%G2F_9uzZH>z -z6og=_X?*gIM(62bFBY=5T24{)vr?i=ikks%GUa8I+JV4vUOS=s((Hew^op^x8$@4q -z3r_9xvNdbb*{~K#h_$2J`wik^C8J2QBe1i;VZPn}A!nlG!d6KB)#K^DbtuAReM8^k -zMoWvA+eee`Zu2aOU9sM0i&EtiFD~}`DVjg>|7=#dnpk9AckyH@I7#DsxtTcj71r*^ -z;G+ri)t?c%71~&ch)eZ7M?aUB12`0<=1yJQ+-mGQ@KET3oY^|*DhfkoOnJag5deE( -z-hdf>-4}fKDBq&@^e4;{j6A7@r3!ho4@wwi!(3ngS(QN+GAE_JY3@7?%y(h33N43G -z2g47`_yWE4v!Fl#Rof~ZVQntJAjNMvvDh7ixn%9XkLjEId`=Xy>YL!@06Bai4Ow|s -zWG%>YQ3SlJ`{UM6pkzl{{!3NZfPzLUk5BKZAv^2{Be|Q7_%+a0<(P!NbEcH$O)1HN -zLOvWRtf_gGlKEh}1So{LK$q%errpsui|k`7nUa6Jymq!X9k7&Fy`B0dP7y8fTqO@W -z5<3_`xRb}r{KskZWRu&bGFNJw3DTw##Z4Mmt~!nOb4Qp2!a&j_>nfOnLZ3=_iDb~! -z6*V?Aocby^E`Fuc*R4WJVnfn&i|I@>zzfbvJooYu_nxEuZr!HH8nCrO4A|UzV`@CL -zNr&!q08h=z;h+|SBFi@h-c=TQ(ecNWj|xLeAB=Cx275;iqOJpo_P@Gg-#a)S6@jqK -zapf=g4t>_RIhH1BZrbXzq@m&Uh*-E+=1&;d{)$bqjs}WMBf5JWdEs->0$}@t-DIHD -zPW^wi_T}+VcJISCDWyfSmKdR=NGoNTQBi3@i!E!(mSqygKBIanyQGv|sW3#u*bRjd -zAtB3TMn(-|8AHr4+wV+IzvugXp5OAmpZD|n!^e#KoO7M)T>H7M`+8J+@8$`WBRS9P -zYB9{Ex#nMK=PC73g$p4ZRud2<+u6u3@tj*={EOWWRY$`Lj_Ae6Z8%4xI>xW15MHI1 -z*_@yzZw8Di>3ptaP`w}o(MhpS+wZ;Yyak;yo}?w&Whr{Z|FepEd}YS+^#g>3u%Lcq2;+v -z+or|V9eB7AzL)i`MRbGL{X4TOpRV2->3P(81RSePNnNvS-s@v6{XNpXxPFwY#W7(HYy%ZeX>+vID>u+VpR2Q -zqf1ujNNpSU$sy`zZ9Ez24=IE?0%CK|t_5*ILJwCT9;&Z{hIWHH?@t%HYD)DOZ|g&s -zCW7d9_$ndX0~g61)<61JoTNuG5p$r|>I63CE$eH01wO9;5?xh=@@gT$Q=uU$Gx|Y06!l06YGz};vzHW4no@l^XPffl -zBG)4~bVKJhBNTN}R<-nRFfIRcRt}GvspqyJ_Oy-06qC+l9a>X3*J}BR{LM%b<_zaY -z4#FNZNOpX<8RWc}uZXyiT=&sqXo-mX*oGC8`HoeWu2E4&GfS+RCDjz|jvnk8=JkqF -zs$-C`n6TlBv)=5fGc~@~RYn_5F$y)5;mkSHuQxoZI;s;gtP=wDXWI@3%_T-gvIZ#h -zsP_J%sN!ng_KOJ}U^n=inu`iUk#5>^hpQw?78Dv#aaLtkJuL}l3alG;HS<-BE}zQa -z>%>W|>6Q<1k-06guzp9o8GAm#Y(_A%BPCx_+}Nl|Et6$vheHKCt90Fr==^Bi4mmv% -zF>I#6Z@mr;^QJ8MJi($fWdl@->UYNE5~Py1R8t4kMkxt+E!shK?x*9$ag%#Oe8N6F -zb~GrT_S2%b6gHI~*zBE9tE;`7TcOWuyboTA19qcT -zv+S9hnbQ-+x?QkJhw;hioB{&PPt<8%&_l**)zLg(;kcak8sBO}kXyK$T1;BeE(AJk -zbR?7#2wT2;xCaq%)XvJkIIg&Ik!)r_0I#A(aID3QCCb?-PlS=Th}z5wgiJ7`7rIksK9AcpRI9$h@Uwn -z)R8P7`F{2cpX@t0)K|ie#vEP<)2o(n46@KMrAlx~9N(&2&fmAd(Y4h2tVp+T2DN#9 -z5BFh|=G%^h#n7oBEjYE*$Nx+$EO(hesT1b~ef1p?uZWvmAQFK)C`R?x62LbYLch(NI|1x+`FB4Kh4p5XKFuwUI&U` -z<1=+PA_w>ezSWqk`Ca`m1S2_U!JfQD)KvfS&Z3?=Nyd-xiYAI0Q&yMXSspp*sgJ&7 -z!|Hyr2L8P_@S0Hen?gz7;q6IJW)uzllt`gn{AjddIX{FoULVBfBFY|7X#**Dd?)Ma -zvEa`OnaT{BtSgQTTXRS(b3!4$ -zpU$6Qb+9qpIzJvpZ$*S3^ciLk`{p%(VT~-`JB$_9dvnAL*V@$_h*7wB;%6Wn@Gj1G -z=iIo?=w$o~j1+!hylczlx6hv+>y9C#$1E74 -z;`o4V?P@T+5VKko{S3vWhAcHa^*nz%E8x5g*P-d#n#X<5#Jm*|yzy_2aq=jV6o$Wy -z+!>ImKUX>3ZAAc0(T(tNAX=P2aj^`rek%N4$FZr37*1@9CEZ(JB -z4}Lp^h#!BV95eCZv*(@<&t)YDUz;vUs)JhjIx2>+AWN2W^lv6-OtMtmGNUV|`1O_4 -ziK{C)(bfD>y!53VG((B@)FE4>I~+OUwHUn-ds -zX0LZ-Z`Tc(bE;h~N~4H6axyD}rla$x*-IyC>9?|C5op%1#F?EU+O!;TyjIbGuQzA1 -zD|D$BXQRE7wlL@xcJE-{X%Eg}G|e2$K#znie`Yps_p~zgCU=E0Zrw-g@k= -zFzaVKB%geQ2h$pZxS8~*`w27lHeUEpx+kSgp`U=L{+9L%H+^ka=*7C;mISo~gjBH& -zzq9hYF*3mv$7T7>_Np+d>&WuriuHajB_M}gel$9!C;>A!h0GknB^eh6ynrH>s#ZMv -zQmT>0TB)AqFFw%4X0+6iW!;u@Rgm5M*D#h*?R-6Kc(Iz#X+XA^k$A|_XE~F*6Q=D0 -z`PVpojYKi-)DF#>dlsjBIRng}j?Kgw?l73;j!x>QJ|RD9ES$B=-j`Z?I8O)DO(0-i;3@KjSBGcX>V3h2nt$pFjg8p+7nfuN4pV`{1D21-s^eNRxtxao(}7?F|V6&%X*%p>6k(avNoONAC|v#g-~pmL$B2~#_P -zZ)qNG$8K=j(~|J>#X&R>sR`m!?7P_aa+9B;a!13(IcLMT=Za&`$m^n^h3!J-`{*}T -z#M~q^^hSY%4nm1~l18`Jp1UzJro!OeNAIbhX@Ny63_j|zy%W6|LHpkDfiMbGw_Vuq -zxfXF(H*}*axXjVKQ5vZ46FRou7G7GQ2_yGi3eF_t5EcnYgP$=BWEOL-H7rEukP9a- -zOTUZKO<_}X6hkaHHB_{t|9;q43$>md14M3(*_-DZ0M}n0Ii65|Bt8=z((X(W%Cp4G -z*Y$Ew@*KY|j!#k?(K8*=Cq*a#7B^5l5jxi6OLRs?Vq7@xD=}8RpkBl9_;6s*8zW|; -z8(e1cKHRqvZ~M-+BvHOjZ$p@>c8FEW6T77a=~W_BImC6JYaG_cTM11qEsq(a1>oE# -zGEG$XA^?@G((6XZVS-1jo+Ey^4sRk|&)^@Znx7y?$LLx$%R2H7NgIpU0w5+iSs(20 -zqj#fFaWKQ+O;B%Y-G#k_YMCMS>9mC6FFyHK%I7L)m+;&MBIRMH1>@@(zRyaDM$49j -z<$o5Gj2UyW`vW9?7>JDvS9t{6LJWe_h%O4 -zW6DY8(dE8XB4zhPpt6B^$K}q*R+TPxVnDUT`-E-n^O3Ehwi+iYY{r6()buJAl*t^k -zWMkB#O5|K4B}1ds)NRavX@qSW_`)7h>ZSRdcqEXguRMuTF8wz9HaICMpevJJXsTA) -zIllL?coD@5_8v8yh`JMauC()V)6h`zo~z!Pr8BehkJxD?Q<3973Sw^yB@+WG;5vS+ -z-j4RVqk27vlHU2Z`nk)18{S>Qa0ARN6^?z5g?Z(|>afS5EoX(H>}ONmD}T6fpi@aA -zkYpcdJS;Cq^BTlwq4~s)E*Dt!-{l8vY*Am -zIs!PoZ&gP9up3l7EXY}w!-$R@LgppaT8#yvVGl}qjl_ZtLhgAdVqwAb+m}}c)6b68 -zImC8i=13{6Iw5zEx@qD*UPdIkw*d|>(M=5V3JOE2%%S;TnTf_fL+{{J*3YB0p5yn8 -zE6L;J4N&tUz;z^%L%c|^sO>Qtlj}OOn9eu0QHL^WNF9WE-U#Cx(*_sJy8^p(Wr*wB -zcc}C${(y;Fh#q+b1U=20Fg~%&ZB(o>Jz2CCieTJh#!B?i1UQ*bOuY+B*hMd<4uDkVz)|dyeanVT=J|H`yUzwTT{T$~vFI#B*LXiyTvV -z%;l=L(;drWVUNx)u!MS_h(I3>V=zzNML^I*2{r4H31sfsUU+ke&fE?{zne-UKVbSS -zSOqg#u1P?k>UYV9qd}hFr69Hd=uLlSn5}uUGUA2$y4BDp2V*9Oh&sJX6>=~0xU)P< -zj*&Stu@LflSK-aE)_Y!L(kJH{*?arFNGw&Tt5rN8atwJbL6j$Q|NSC!ll5S%jY_Sz! -z;x9D*O7%Mxu?14yefM1iX4(ZWBN03nj3_nLQP!q(&PNW^^13}g%txA{W|rqV_}6T% -z4eoV(Dy~SsmKdO`lG`py4y;z0UQTrJlo;-;nx{(GR7fVSzn{e$!IaJn&S&&Z7=78S -z@M^9xAbr|-ph)kt&+OYaT~7&5PuuFq^77Vdz0QR+!U%ij%d@@hx)L^llYT39FItgN -z=U#I8uXPj)%P^6(6-&YgmOrJmhSt5-vadUki2S*Vyw352wze{ziBlw!Bgehr+WPes -z62W-P47*i%x$Y=2@m?@qwwo;H|6n~aPO&EVHX5N!M;d6;6Por18FaAa@1SgOFNdop -zhr{&g;)*bI)_TR5Z_a51@ntzu|FshSlX{=FBw|>>E|#dbijd)FsZ}D7d$NlZC+&NB -z#yt5=#3}}HEx_fP--q#=#Cjp8=db8~uo>#*78383j9}D57g^3lxd(s>AN*l)b_$4U -z$hr`_mKS$%f$Px6?eW414&^WM{FS~aAo0BN($Mr1F;F~_ZZXDryHy7X(n0eJZsPIB -zB3``vl?r%D5SIk6$Pi={{fpp0j|WvRt8}v~hM?TQ^JXI+OQ&Fe(D~Lk&>AU?UDa+~ftI~SimyM0kvz|Hw|6BHmpEh?r@$B51cfA>XH#zShG-dOPbw| -ztgHUa!%v+vvl>Dek%(cpHiwS`c}x28q(~rcwGlIcto@}W62X|slMs~~7x|4KES^C3 -z2J$zH4KIyEBR`>DTp`hof9kAKxb_~EL-5JWCMUGAZ4)}!DkbY2%;tG5+4jla9)U9< -zINEF! -z1^}VZo);sqvOAiBM;`oHPVx^b%wFx(EVV7gE2Vi_Kp2$|Zex=AxQgwZ+a`sAQU4^Y -z-vna({A3x+kUXyo$oIS$uLEs290R>m{jUUN!25zM&=qkqJsH0>zl`ckNGUkA6Bcr>E)$v!j%< -z0L3_^+i$3*O!77t|;w#D6A8k4sTIcW#WlTxa35I&DdXVO~ -zXkI#K4d;hn%TDu*M>9}+m^KGflq0~B|3t}p==$p^#e#2&Mbn*rJouaG#jjQthHu=% -zh#7Rym+bCPLTT~($jHN>tyJGOXnWrk1XqLVc`Q!YT^DdkU-+B+&@ki2uRkH^OZU7_ -zdI#Di3gCE2_9d7ILxyh;UD-ceCSrWCY&yhR<9`tDk4mQuPQ>VAx(yiKTI;OKrgt6^ -zg0e}exU6~*2f1nX&tSOM+jNU~Zmdxwc_R -zz&a@M9PclCtEB3hMwiM}KO6q|{!;yf@oUuNg|0-wge|*6G*5+&&!38hjpb~ -zZPb(}eZqa*)A6iiHw%ShIoxR-7*<#0!V{*pqtgkPu4Hg=#lp*iz#VgOq>;35?X4{* -z#<-*}&TM&!x(>oU0#l$ry24>LMtIpQULqdfx_jHcO(MNOb4ps&5%RqF?}aKqDzYON -z1yVdUcZNMd_0~Bn}vy03*Sr(k*g{+;jF -z33%r}Er5S1?ENxT1o-n{fnfTP&qgl?6FWXzHsW9RDrK)*18wmhQi4yAW$oqO^iN7F -zK8TSSxAp%leBtxGH2v%?0hN;2$2;M@0hvz2evKIg%b6hwg3QM9~!tuLB-c|a=o!MLXe7G_kX-pG-6tx1%(_(WA -zVk$hC=YSpfPkr=DJ4w9|L!5K{Ri&odAO<}=Z_$X~wRQ!3`PGxN2IzEUZt}~B_3bFo -zY7cwdy-dJ~0jteZToPbnyhAl3S)p>NAOClSWht*|bfD;s{pq_xZu^ky`&LWW7| -zEGzzPjB&AZD_88_mUk}!?G@9x{214Q3ecSa7n=Nd#eSMO41Pia8Y28&NE&){0abhi -zAfsTLP=ir`<3j^Yp?%BrItOGszT>8MjD}LBJ>Ix0kQZ=Pm%8*rQ|YP8;8$aINS#AI -zImcKQ_J>Vx_&O1qaU*_Fnp2=sd`{rpK*Tp~QBqIOLNAU3ovUM#d -zw(d7-P{zeM<4dv%!9{)RTzUOY^}GB?kfVj!PtKal|Qw8_G+ba%QEw?2itdA -z=I+e~M(T^Bjfj=}6Ph$$Sw65UW}X6g|EVpvK+?8Na9|26t?&6E{zFy}S1*X$5HT-9 -zx+r(U5D481Z(;$?6E4mcllu3K@ow*!|L-iF-^O$_bivbjZG*Sl<@2(4g@A3NWG}{3 -zXX&(;1e{;wJuRz}T=l<5e2?-gw^B@V{f^#x;(K=-xBHmYi-FVKs2tz*-d0b25*gA4 -zWR2-)2SVk%EFcB#dfy*$nb)5D~&qBD^sfNSTV&hrJQ>(i0RPlep~Nb`GAIbAoW -zYNMWE%f9o{uUAe2LKmn%L-qE~r>5<*rjtM?>0)+-CA-|sYB$-}z8YB6#6&1UM*Xd- -z&-owc#4J)`J%&ExAN6hb5QRP&ZGz5Ty1(Z8^H`!EyhzDTIzNcapP$uwZNPU~%R4lYSz%Ig0RepO%Y#t^HzG82qqHt--1zym=jv;A -zQ}9<`?^8aH)Yn=6um-`zDjDbQB$iFQEo$`H`lMywtfosp!rpGJiTr>M6-fooC8z~T -z(eJW)*t%195Wz38xqdcICGlj2jT<e*f;L-tOV+Z?Q9=mVZDl=@Ky -zObp2UZx(6xDoC>2C84L1OBCpr!)Nd=2`ioUNpap%5myEKGfWl!-3#HIJYX9e7>>j)4JbwKp~{G#yAGrwJuM~8qs*B$$ZjHP0NljkjhHFIz^MJ`O+Me7KuK{^tTF$!RF-MHL> -zQ}$O;*gu)`U#6`0<-{ZpW7~Uo9onRVcVB2ivIdr@A4@et>PWrLgoPw(@H1tt_MO)Q -z(I1nB;)jafj8;-#o~oH1>a@LvOrG2ls42EW_)$glZ46PmA*}*=m(x~m@9&HEP0%V$ -z*pJUK5Bv*{0zGlc#Yvzi-v3QVH^@Mjy(Mf{w@5!8EE*WDE!Eil)y(3qP)wO-$oiO> -zz%PC>M|?K-m$o_!r5Xw(4^FRW&r1G|g&Kw8K7j`cB;nDXO{=b3p9cn{bO9SW&tw74 -z@&k^2)US5Xe+f2Cz%T)cNu^xzm?n*C_pEmj&BR^ntZT`o1mR02f6ndGy^`NjzPkt6 -zoke)i@A7}vC^8{7#@%oLZ-s^2n;-$@S+82jm*Nm-DtE|m(iQ^SJoo;aRynOczo9|7 -z)A0wHSh_3Q3qf@&k>wufDE0agD3i?C3iK;Y6^a;2DYGkW8#C;_X43sVbCbeEX_yq0 -zCn&)$94NIiYb=#sQb-;b&V#K1$orBuwZmuafKL>+G^R(hdfcHK^;REa(Oenpneyen -zytk80o78YYs8DUM*pjhSO|r2plUPI!X6KJ`D7-pszeDlTFQo(R&9T{}WG<_n4H)|` -zr|K_H@o64SS;d9z*rcd&SEwt)FLj4hk0=a@uNrzSNm#-o`X{J-*P0pH@t3 -zn%w=L+cx}Dl_-J3|CdzQDSWD6eN0ntojZBgvN_<&hUrf67bcDPWk-UBw=^e>U-BF; -zdfWn^{AbL_P(3EE)bR($m|sVxYlYq30N50SQB^6NDW73-iK8*>ZK0T4u7}BEoBf;s -zJkEjxI$i%Nt<*fP+PKZcu*YUu44O{@AZ&3SwC%dEf3lu>K7V>zYX~LLzwN_H4G* -zHH;Z;i+V%2seq0PBgo5X*l5P%=^S_8rf!O?#T_x)DdC9AyVF*}HZ)KctKDq0Q4e*B -z>{AG-1B6;vb)5B+sQDMToM;Ez$0lndrk`^9=ZAUonsb+Fmxl3JI4%?(6SfSMJ+24` -zu>Zx(w$Lt1=Jt~T382FBFoCO=BycHg7Zoe21cd#4Xgx80Xr@wEc2#->?&u%yB0im1 -zx_VgWo^~*?sGsrXUCuAfg|v@OWVOQmQrU? -z75pxYYAS;D|EuUV$-8*84)=3k7$@wPbzhil0HmFC+{+F&zhct4`_M{(TMXh1lJUXO -z5bmV_JP)A5KVO?G9wEP=(6l!@2Ef`=Iab_iy8!;dv;A4=GcfgA@q6gucyJW -z>74#sY~i+9ZNV!Y1UBwzo5f8z9-9X}`0&_btV>(Lc!g$ox)}<UWu`=8tX+`R-u1PdK0Fc9yQR*dOugR|V|T_m$UfSs;5;9!U$}|IODxS-sYtL<7IQ -zVDk8thQXl>jAlXQ25>gDI2n%Z34HtETrO{V0^rOimln=xGWDBb)Xm@iO3Y|PMtkC7kyC+&et{$uVb!OLoeBdqd}dn -z__!2}J2PDc%N>9C*_8T@xglCnuV{Ezy!X|Ql%cqqc#EIJ`KP&u#NGt%B2>YcAe=)6|lndvBS@c*VE2|$@M@qcYx4t -znnyiiC8;)GOw^oPO8*{qE^Grfgc{gga;dM#6#Vj$Mv!&SZIm7M=?=ftha4vMO}K$2 -zGp?%l6wS~(bxMYxXI;!Y;GqF<^bgklySQdaL6`I0AAj+ws2LN4>}W@Yv#+|q-);uu -zVwP684E&Pu{|Hq6M*VLU@|%+d8v8HW`THV&j|Kk!7}jvPPw10kaHiv|HJ+R`<%L~*R;ah>}*pe=}h)o1F|xP>ye?%)m_ -z&gi^L*LyUP^KpqL)xN9q$>opdYH4 -z&cZAdYNFvon;b19U*YU*hxu?CZ~ir#?9^;J3|fxLS}7Q{c?so_zF~oX09gz9Wks7n -zm%3m;yFL*9fBf*;LIIlQsm$)%2?}>!S$2h|8iL~mo!L~t5*M6iF7C61uv8F>g-+e7 -zGHV8O8kk1|pCHSIuenz@L4BdsfBVQj+b2-=g$)W8q7SOqwiQx?9gMe{gf^~qxS^z6 -zl&=f4cf|H1Z$O*kN$dvY086O%y;=eI5^{>-)zW}3nzvR!F4-OM^8wH)sQ0cHh^T&Y -z{h@zINyuEB2R=k-AE4$7t%=w&@Yb!1BEfL#^92Jm8Vx|-&?Dvn8^NHcSiztZi~RmS -zL=3}simZm9vP2y{&tt;ba1iPRk3-2L6bsRY2=H%?hmro}fQ{h0wf-3EX*>B%(4i6l -zAKHj>{m-dC5f`ThldKd(R(OIjM}jl?r;Rvxpbv9;lauSxWySgO_%B!$4YPw?~3KlnSFpyxp -zw-9YyRE4g4g@<$9jcQeuwRdd*-l@~W9tlPV7zS<^R};aoDzG_3Y-HLm=$vjNZNUoe -zeMk4Eh#0OYEH1_$QAQX3TCIg8z(WPVRgVi5@qikA=u6+saE+s+1lb~BD*z|W$KKHq -z -zFhEh;ko=t^Eiq?##741*d*_O; -zDsJ7`VDnCdndTuf}~5Lty}FUsNQ%0$i@A -zIqFz$kpd_3QdD`gO9u~Elz@?I0+INk2iDqaB8;Yo$|vs~ezJ}g9m$%DtbFx38_<%= -zVL6GcSU*V~0z68W?7L?qtqL6m8??u0D%Yzj7sW>wXyY>v&G8f1LpCOFfQ)!`QNlN< -zt^ZjEKU`NC{x* - - -+ -+ -+ UTTypeIdentifier -+ org.oasis-open.opendocument.text-master-template -+ UTTypeDescription -+ OpenDocument Text Master Template -+ UTTypeConformsTo -+ -+ public.data -+ public.content -+ -+ UTTypeTagSpecification -+ -+ public.filename-extension -+ -+ otm -+ -+ public.mime-type -+ -+ application/vnd.oasis.opendocument.text-master-template -+ -+ -+ -+ - - - UTTypeIdentifier -@@ -1118,6 +1142,24 @@ - - CFBundleTypeExtensions - -+ otm -+ -+ CFBundleTypeMIMETypes -+ -+ application/vnd.oasis.opendocument.text-master-template -+ -+ CFBundleTypeIconFile -+ oasis-master-template.icns -+ CFBundleTypeName -+ OpenDocument Master Template -+ CFBundleTypeRole -+ Editor -+ LSIsAppleDefaultForType -+ -+ -+ -+ CFBundleTypeExtensions -+ - stc - - CFBundleTypeMIMETypes -@@ -1343,6 +1385,7 @@ - org.oasis-open.opendocument.formula - org.openoffice.text-template - org.oasis-open.opendocument.text-template -+ org.oasis-open.opendocument.text-master-template - org.openoffice.spreadsheet-template - org.oasis-open.opendocument.spreadsheet-template - org.openoffice.presentation-template -diff --git a/sysui/desktop/menus/writer.desktop b/sysui/desktop/menus/writer.desktop -index c4cea12..e22a7b4 100644 ---- a/sysui/desktop/menus/writer.desktop -+++ b/sysui/desktop/menus/writer.desktop -@@ -22,7 +22,7 @@ Icon=writer - Type=Application - Categories=Office;WordProcessor;X-Red-Hat-Base;X-MandrivaLinux-Office-Wordprocessors; - Exec=${UNIXBASISROOTNAME} --writer %%FILE%% --MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/msword;application/vnd.ms-word;application/x-doc;application/x-hwp;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.lotus-wordpro;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.ms-works;application/vnd.stardivision.writer-global;application/x-extension-txt;application/x-t602;text/plain;application/vnd.oasis.opendocument.text-flat-xml;application/x-fictionbook+xml;application/macwriteii;application/x-aportisdoc;application/prs.plucker;application/vnd.palm;application/clarisworks; -+MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.oasis.opendocument.text-master-template;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/msword;application/vnd.ms-word;application/x-doc;application/x-hwp;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.lotus-wordpro;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.ms-works;application/vnd.stardivision.writer-global;application/x-extension-txt;application/x-t602;text/plain;application/vnd.oasis.opendocument.text-flat-xml;application/x-fictionbook+xml;application/macwriteii;application/x-aportisdoc;application/prs.plucker;application/vnd.palm;application/clarisworks; - Name=%PRODUCTNAME Writer - GenericName=Word Processor - Comment=Create and edit text and graphics in letters, reports, documents and Web pages by using Writer. -diff --git a/sysui/desktop/mimetypes/oasis-master-document-template.desktop b/sysui/desktop/mimetypes/oasis-master-document-template.desktop -new file mode 100644 -index 0000000..a47588c ---- /dev/null -+++ b/sysui/desktop/mimetypes/oasis-master-document-template.desktop -@@ -0,0 +1,26 @@ -+# -+# This file is part of the LibreOffice project. -+# -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+# -+# This file incorporates work covered by the following license notice: -+# -+# Licensed to the Apache Software Foundation (ASF) under one or more -+# contributor license agreements. See the NOTICE file distributed -+# with this work for additional information regarding copyright -+# ownership. The ASF licenses this file to you under the Apache -+# License, Version 2.0 (the "License"); you may not use this file -+# except in compliance with the License. You may obtain a copy of -+# the License at http://www.apache.org/licenses/LICENSE-2.0 . -+# -+[Desktop Entry] -+Version=1.0 -+Encoding=UTF-8 -+Hidden=false -+Icon=oasis-master-document-template -+Type=MimeType -+Patterns=*.otm -+MimeType=application/vnd.oasis.opendocument.text-master-template -+Comment=OpenDocument Master Document Template -diff --git a/sysui/desktop/mimetypes/oasis-master-document-template.keys b/sysui/desktop/mimetypes/oasis-master-document-template.keys -new file mode 100644 -index 0000000..3cd4d5e ---- /dev/null -+++ b/sysui/desktop/mimetypes/oasis-master-document-template.keys -@@ -0,0 +1,9 @@ -+application/vnd.oasis.opendocument.text-master-template -+ description=OpenDocument Master Document Template -+ default_action_type=application -+ short_list_application_ids_for_novice_user_level= -+ short_list_application_ids_for_intermediate_user_level= -+ short_list_application_ids_for_advanced_user_level= -+ category=Documents/Word Processor -+ use_category_default=yes -+ icon_filename=oasis-master-document-template -diff --git a/sysui/desktop/mimetypes/openoffice.applications b/sysui/desktop/mimetypes/openoffice.applications -index 26a3494..8af25f6 100755 ---- a/sysui/desktop/mimetypes/openoffice.applications -+++ b/sysui/desktop/mimetypes/openoffice.applications -@@ -5,5 +5,5 @@ OFFICENAME - expects_uris=true - requires_terminal=false - uses_gnomevfs=true -- mime_types=application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.text-flat-xml,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.text-web,application/vnd.oasis.opendocument.text-master,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-flat-xml,application/vnd.oasis.opendocument.graphics-template,application/vnd.oasis.opendocument.presentation,application/vnd.oasis.opendocument.presentation-flat-xml,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.spreadsheet-flat-xml,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.formula,application/vnd.oasis.opendocument.database,application/vnd.ms-excel,application/rtf,application/msword,application/vnd.ms-powerpoint,application/vnd.stardivision.calc,application/vnd.stardivision.chart,application/vnd.stardivision.draw,application/vnd.stardivision.impress,application/vnd.stardivision.mail,application/vnd.stardivision.math,application/vnd.stardivision.writer,application/vnd.sun.xml.calc,application/vnd.sun.xml.calc.template,application/vnd.sun.xml.draw,application/vnd.sun.xml.draw.template,application/vnd.sun.xml.impress,application/vnd.sun.xml.impress.template,application/vnd.sun.xml.math,application/vnd.sun.xml.writer,application/vnd.sun.xml.writer.global,application/vnd.sun.xml.writer.template,application/vnd.sun.xml.base,image/x-emf,image/x-pcx,image/x-photo-cd,image/x-pict;application/vnd.wordperfect;application/vnd.lotus-wordpro;application/vnd.openofficeorg.extension;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;application/x-hwp;text/spreadsheet; -+ mime_types=application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.text-flat-xml,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.text-web,application/vnd.oasis.opendocument.text-master,application/vnd.oasis.opendocument.text-master-master,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-flat-xml,application/vnd.oasis.opendocument.graphics-template,application/vnd.oasis.opendocument.presentation,application/vnd.oasis.opendocument.presentation-flat-xml,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.spreadsheet-flat-xml,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.formula,application/vnd.oasis.opendocument.database,application/vnd.ms-excel,application/rtf,application/msword,application/vnd.ms-powerpoint,application/vnd.stardivision.calc,application/vnd.stardivision.chart,application/vnd.stardivision.draw,application/vnd.stardivision.impress,application/vnd.stardivision.mail,application/vnd.stardivision.math,application/vnd.stardivision.writer,application/vnd.sun.xml.calc,application/vnd.sun.xml.calc.template,application/vnd.sun.xml.draw,application/vnd.sun.xml.draw.template,application/vnd.sun.xml.impress,application/vnd.sun.xml.impress.template,application/vnd.sun.xml.math,application/vnd.sun.xml.writer,application/vnd.sun.xml.writer.global,application/vnd.sun.xml.writer.template,application/vnd.sun.xml.base,image/x-emf,image/x-pcx,image/x-photo-cd,image/x-pict;application/vnd.wordperfect;application/vnd.lotus-wordpro;application/vnd.openofficeorg.extension;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;application/x-hwp;text/spreadsheet; - -diff --git a/sysui/desktop/share/documents.ulf b/sysui/desktop/share/documents.ulf -index cff9422..2073c17 100644 ---- a/sysui/desktop/share/documents.ulf -+++ b/sysui/desktop/share/documents.ulf -@@ -40,6 +40,9 @@ en-US = "OpenDocument Text Template" - [oasis-master-document] - en-US = "OpenDocument Master Document" - -+[oasis-master-document-template] -+en-US = "OpenDocument Master Document Template" -+ - [oasis-formula] - en-US = "OpenDocument Formula" - -diff --git a/sysui/desktop/solaris/mailcap b/sysui/desktop/solaris/mailcap -index 43c0207..910fcbe 100755 ---- a/sysui/desktop/solaris/mailcap -+++ b/sysui/desktop/solaris/mailcap -@@ -40,6 +40,7 @@ cat << END - application/vnd.oasis.opendocument.text; %PREFIX -view %s - application/vnd.oasis.opendocument.text-flat-xml; %PREFIX -view %s - application/vnd.oasis.opendocument.text-template; %PREFIX -view %s -+application/vnd.oasis.opendocument.text-master-template; %PREFIX -view %s - application/vnd.oasis.opendocument.text-web; %PREFIX -view %s - application/vnd.oasis.opendocument.text-master; %PREFIX -view %s - application/vnd.sun.xml.writer; %PREFIX -view %s -diff --git a/sysui/desktop/solaris/mime.types b/sysui/desktop/solaris/mime.types -index 4758d47..a5ee683 100755 ---- a/sysui/desktop/solaris/mime.types -+++ b/sysui/desktop/solaris/mime.types -@@ -32,6 +32,7 @@ application/vnd.oasis.opendocument.text-flat-xml fodt - application/vnd.oasis.opendocument.text-template ott - application/vnd.oasis.opendocument.text-web oth - application/vnd.oasis.opendocument.text-master odm -+application/vnd.oasis.opendocument.text-master-template otm - application/vnd.oasis.opendocument.graphics odg - application/vnd.oasis.opendocument.graphics-flat-xml fodg - application/vnd.oasis.opendocument.graphics-template otg --- -1.9.3 - diff --git a/SOURCES/0001-default-n-up-printing-of-notes-to-sensible-2-x-1-not.patch b/SOURCES/0001-default-n-up-printing-of-notes-to-sensible-2-x-1-not.patch deleted file mode 100644 index 70c3c70..0000000 --- a/SOURCES/0001-default-n-up-printing-of-notes-to-sensible-2-x-1-not.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 93c47f3f0310135c5d6216de9b4d25fd7c06e7dd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 18 Sep 2014 11:32:39 +0100 -Subject: [PATCH] default n-up printing of notes to sensible 2 x 1 not 1 x 2 - -i.e. throw away the maFirstPageSize cache based on the initial slide view which -is typically in landscape mode - -So that if we change to notes which are usually in portrait mode, and then -visit n-up print, we get a default layout based on the notes orientation and -not the slides orientation. - -I hate printing - -Change-Id: I8b7b81ce1eec0f9c5ecd7509b311cf4026958c2c ---- - vcl/source/window/printdlg.cxx | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx -index cf9642e..d9ebf7c 100644 ---- a/vcl/source/window/printdlg.cxx -+++ b/vcl/source/window/printdlg.cxx -@@ -1787,6 +1787,14 @@ IMPL_LINK( PrintDialog, UIOption_SelectHdl, ListBox*, i_pBox ) - sal_Int32 nVal( i_pBox->GetSelectEntryPos() ); - pVal->Value <<= nVal; - -+ //If we are in impress we start in print slides mode and get a -+ //maFirstPageSize for slides which are usually landscape mode, if we -+ //change to notes which are usually in portrait mode, and then visit -+ //n-up print, we will assume notes are in landscape unless we throw -+ //away maFirstPageSize when we change page content type -+ if (pVal->Name == "PageContentType") -+ maFirstPageSize = Size(); -+ - checkOptionalControlDependencies(); - - // update preview and page settings --- -1.9.3 - diff --git a/SOURCES/0001-default-to-as-character-caption-contents.patch b/SOURCES/0001-default-to-as-character-caption-contents.patch new file mode 100644 index 0000000..3df8ebe --- /dev/null +++ b/SOURCES/0001-default-to-as-character-caption-contents.patch @@ -0,0 +1,817 @@ +From 91739f2ca569b30383fe2f1cef8816fa8bf0554a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 10 Sep 2015 11:07:55 +0100 +Subject: [PATCH] default to as-character caption contents + +this FindFlyFrm variant returns the Selected FlyFrm + +the other one actively searches for the FlyFrm that +matches the XEmbeddedObject argument + +Change-Id: I2f9271c01337b4a32d7b644f82d16d85c2dc5b51 +(cherry picked from commit d9729bc06d676a36120f3da252d1a4fa39d103d8) + +GetCurrFlyFrm just forwards to GetSelectedFlyFrm + +Change-Id: Ia0b83a3aad71a72ae2135c5d7f6ddb6d9644b10b +(cherry picked from commit 8df51f799bb830db52c7be2d04b575b0443b76ec) + +bundle duplicate pattern into a GetCurrFlyFrm method + +Change-Id: Ib12b825ef9cc6e2b57e9320d435e3863d319cf0f +(cherry picked from commit 7473aacc73f8572e20f6f2a3a1d10001c5cc477d) + +GetSelectedFlyFrm+GetCurrFlyFrm -> GetSelectedOrCurrFlyFrm + +Change-Id: I4348c4cf54dcd5504c52cf8ab550572257eef50b +(cherry picked from commit a5aab0cce45309afae81b3ec0be8ace1ca0ca17d) + +GetCurFrameFormat->GetSelectedFrameFormat + +Change-Id: I2f1eb4567b6e073991d95dbcecdc79b24010f2c1 +(cherry picked from commit 4e6194fe8357efc5afa8d094e209ea94335b5923) + +split out useful code as standalone makeItemSetFromFormatAnchor + +Change-Id: I385549b4841dfc715aa984bcc257d78c9f1c3ed4 +(cherry picked from commit d961c9273104f552a8207e63c33e33f1e265565d) + +Related: tdf#93676 default to as-char inside captions + +This will (hopefull) improve round-tripping to doc[x] for new documents because +word can only have as-char elements inside frames so we get a like-for-like +conversion if the defaults are used. + +Change-Id: I3913b9b624dd5ba57ed07140bced8e3dca289cf5 +(cherry picked from commit 93ab0ff24cb71c36c9e7958046e96d7472b5af90) +--- + sw/inc/fesh.hxx | 14 +++- + sw/source/core/access/accframebase.cxx | 2 +- + sw/source/core/access/accmap.cxx | 2 +- + sw/source/core/access/accselectionhelper.cxx | 10 +-- + sw/source/core/frmedt/fecopy.cxx | 8 +- + sw/source/core/frmedt/fefly1.cxx | 118 ++++++++++++--------------- + sw/source/core/frmedt/feflyole.cxx | 2 +- + sw/source/core/frmedt/feshview.cxx | 6 +- + sw/source/core/frmedt/fews.cxx | 60 +++++++++++--- + sw/source/core/inc/UndoInsert.hxx | 1 + + sw/source/core/undo/unins.cxx | 16 +++- + sw/source/uibase/app/docst.cxx | 8 +- + sw/source/uibase/ribbar/drawbase.cxx | 2 +- + sw/source/uibase/shells/basesh.cxx | 18 ++-- + sw/source/uibase/shells/frmsh.cxx | 8 +- + sw/source/uibase/shells/grfsh.cxx | 2 +- + sw/source/uibase/wrtsh/wrtsh1.cxx | 2 +- + 17 files changed, 159 insertions(+), 120 deletions(-) + +diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx +index b3bbfcd..efc9b3d 100644 +--- a/sw/inc/fesh.hxx ++++ b/sw/inc/fesh.hxx +@@ -187,7 +187,6 @@ private: + std::unique_ptr m_pChainFrom; + bool m_bCheckForOLEInCaption; + +- SAL_DLLPRIVATE SwFlyFrm *FindFlyFrm() const; + SAL_DLLPRIVATE SwFlyFrm *FindFlyFrm( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& ) const; + + /// Terminate actions for all shells and call ChangeLink. +@@ -362,6 +361,7 @@ public: + bool IsFrmSelected() const; + bool GetFlyFrmAttr( SfxItemSet &rSet ) const; + bool SetFlyFrmAttr( SfxItemSet &rSet ); ++ SfxItemSet makeItemSetFromFormatAnchor(SfxItemPool& rPool, const SwFormatAnchor &rAnchor) const; + bool ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet = 0 ); + const SwFrameFormat *NewFlyFrm( const SfxItemSet &rSet, bool bAnchValid = false, + SwFrameFormat *pParent = 0 ); +@@ -373,9 +373,17 @@ public: + - add output parameter */ + bool IsFrmVertical(const bool bEnvironment, bool& bRightToLeft, bool& bVertL2R) const; + +- SwFrameFormat* GetCurFrameFormat() const; ///< If frame then frame style, else 0. ++ SwFrameFormat* GetSelectedFrameFormat() const; ///< If frame then frame style, else 0. + void SetFrameFormat( SwFrameFormat *pFormat, bool bKeepOrient = false, Point* pDocPos = 0 ); ///< If frame then set frame style. +- const SwFlyFrm *GetCurrFlyFrm() const { return FindFlyFrm(); } ++ ++ // Get selected fly ++ SwFlyFrm* GetSelectedFlyFrm() const; ++ ++ // Get current fly in which the cursor is positioned ++ SwFlyFrm* GetCurrFlyFrm(const bool bCalcFrm = true) const; ++ ++ // Get selected fly, but if none Get current fly in which the cursor is positioned ++ SwFlyFrm* GetSelectedOrCurrFlyFrm(const bool bCalcFrm = true) const; + + /// Find/delete fly containing the cursor. + SwFrameFormat* WizzardGetFly(); +diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx +index bfffd2d..bfe07b4 100644 +--- a/sw/source/core/access/accframebase.cxx ++++ b/sw/source/core/access/accframebase.cxx +@@ -53,7 +53,7 @@ bool SwAccessibleFrameBase::IsSelected() + if( pVSh->ISA( SwFEShell ) ) + { + const SwFEShell *pFESh = static_cast< const SwFEShell * >( pVSh ); +- const SwFrm *pFlyFrm = pFESh->GetCurrFlyFrm(); ++ const SwFrm *pFlyFrm = pFESh->GetSelectedFlyFrm(); + if( pFlyFrm == GetFrm() ) + bRet = true; + } +diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx +index 7e47ad3..18d9ce5 100644 +--- a/sw/source/core/access/accmap.cxx ++++ b/sw/source/core/access/accmap.cxx +@@ -2598,7 +2598,7 @@ void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm ) + else if( pVSh->ISA( SwFEShell ) ) + { + const SwFEShell *pFESh = static_cast< const SwFEShell * >( pVSh ); +- const SwFrm *pFlyFrm = pFESh->GetCurrFlyFrm(); ++ const SwFrm *pFlyFrm = pFESh->GetSelectedFlyFrm(); + if( pFlyFrm ) + { + OSL_ENSURE( !pFrm || pFrm->FindFlyFrm() == pFlyFrm, +diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx +index cec0612..5269503 100644 +--- a/sw/source/core/access/accselectionhelper.cxx ++++ b/sw/source/core/access/accselectionhelper.cxx +@@ -156,12 +156,12 @@ bool SwAccessibleSelectionHelper::isAccessibleChildSelected( + + // ... and compare to the currently selected frame + bool bRet = false; +- SwFEShell* pFEShell = GetFEShell(); ++ const SwFEShell* pFEShell = GetFEShell(); + if( pFEShell ) + { + if ( aChild.GetSwFrm() != 0 ) + { +- bRet = (pFEShell->GetCurrFlyFrm() == aChild.GetSwFrm()); ++ bRet = (pFEShell->GetSelectedFlyFrm() == aChild.GetSwFrm()); + } + else if ( aChild.GetDrawObject() ) + { +@@ -218,10 +218,10 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( ) + sal_Int32 nCount = 0; + // Only one frame can be selected at a time, and we only frames + // for selectable children. +- SwFEShell* pFEShell = GetFEShell(); ++ const SwFEShell* pFEShell = GetFEShell(); + if( pFEShell != 0 ) + { +- const SwFlyFrm* pFlyFrm = pFEShell->GetCurrFlyFrm(); ++ const SwFlyFrm* pFlyFrm = pFEShell->GetSelectedFlyFrm(); + if( pFlyFrm ) + { + nCount = 1; +@@ -290,7 +290,7 @@ Reference SwAccessibleSelectionHelper::getSelectedAccessibleChild( + throwIndexOutOfBoundsException(); + + SwAccessibleChild aChild; +- const SwFlyFrm *pFlyFrm = pFEShell->GetCurrFlyFrm(); ++ const SwFlyFrm *pFlyFrm = pFEShell->GetSelectedFlyFrm(); + if( pFlyFrm ) + { + if( 0 == nSelectedChildIndex ) +diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx +index 987625d..ab55d84 100644 +--- a/sw/source/core/frmedt/fecopy.cxx ++++ b/sw/source/core/frmedt/fecopy.cxx +@@ -126,7 +126,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpText ) + if( IsFrmSelected() ) + { + // get the FlyFormat +- SwFlyFrm* pFly = FindFlyFrm(); ++ SwFlyFrm* pFly = GetSelectedFlyFrm(); + SwFrameFormat* pFlyFormat = pFly->GetFormat(); + SwFormatAnchor aAnchor( pFlyFormat->GetAnchor() ); + +@@ -467,7 +467,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, + + if( IsFrmSelected() ) + { +- SwFlyFrm* pFly = FindFlyFrm(); ++ SwFlyFrm* pFly = GetSelectedFlyFrm(); + SwFrameFormat* pFlyFormat = pFly->GetFormat(); + SwFormatAnchor aAnchor( pFlyFormat->GetAnchor() ); + bRet = true; +@@ -1264,10 +1264,10 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf ) + } + else + { +- // fix(23806): not the origial size, but the current one. ++ // Not the original size, but the current one. + // Otherwise it could happen that for vector graphics + // many MB's of memory are allocated. +- const Size aSz( FindFlyFrm()->Prt().SSize() ); ++ const Size aSz( GetSelectedFlyFrm()->Prt().SSize() ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev(*GetWin()); + + MapMode aTmp( MAP_TWIP ); +diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx +index 2937f04..e35b98e 100644 +--- a/sw/source/core/frmedt/fefly1.cxx ++++ b/sw/source/core/frmedt/fefly1.cxx +@@ -236,7 +236,7 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, bool bNew ) + OSL_ENSURE( rFrm.IsFlyFrm(), "SelectFlyFrm will einen Fly" ); + + // nothing to be done if the Fly already was selected +- if ( FindFlyFrm() == &rFrm ) ++ if (GetSelectedFlyFrm() == &rFrm) + return; + + // assure the anchor is drawn +@@ -254,8 +254,8 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, bool bNew ) + } + } + +-// returns a Fly if one is selected +-SwFlyFrm *SwFEShell::FindFlyFrm() const ++// Get selected fly ++SwFlyFrm* SwFEShell::GetSelectedFlyFrm() const + { + if ( Imp()->HasDrawView() ) + { +@@ -270,6 +270,22 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const + return 0; + } + ++// Get current fly in which the cursor is positioned ++SwFlyFrm* SwFEShell::GetCurrFlyFrm(const bool bCalcFrm) const ++{ ++ SwContentFrm *pContent = GetCurrFrm(bCalcFrm); ++ return pContent ? pContent->FindFlyFrm() : 0; ++} ++ ++// Get selected fly, but if none Get current fly in which the cursor is positioned ++SwFlyFrm* SwFEShell::GetSelectedOrCurrFlyFrm(const bool bCalcFrm) const ++{ ++ SwFlyFrm *pFly = GetSelectedFlyFrm(); ++ if (pFly) ++ return pFly; ++ return GetCurrFlyFrm(bCalcFrm); ++} ++ + // Returns non-null pointer, if the current Fly could be anchored to another one (so it is inside) + const SwFrameFormat* SwFEShell::IsFlyInFly() + { +@@ -281,11 +297,8 @@ const SwFrameFormat* SwFEShell::IsFlyInFly() + const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); + if ( !rMrkList.GetMarkCount() ) + { +- SwContentFrm *pContent = GetCurrFrm( false ); +- if( !pContent ) +- return NULL; +- SwFlyFrm *pFly = pContent->FindFlyFrm(); +- if ( !pFly ) ++ SwFlyFrm *pFly = GetCurrFlyFrm(false); ++ if (!pFly) + return NULL; + return pFly->GetFormat(); + } +@@ -332,11 +345,8 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos ) + SET_CURR_SHELL( this ); + + // Determine reference point in document coordinates +- SwContentFrm *pContent = GetCurrFrm( false ); +- if( !pContent ) +- return; +- SwFlyFrm *pFly = pContent->FindFlyFrm(); +- if ( !pFly ) ++ SwFlyFrm *pFly = GetCurrFlyFrm(false); ++ if (!pFly) + return; + + //SwSaveHdl aSaveX( Imp() ); +@@ -968,21 +978,11 @@ void SwFEShell::SetPageObjsNewPage( std::vector& rFillArr, int n + // wrong place or which are ambiguous (multiple selections) will be removed. + bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const + { +- SwFlyFrm *pFly = FindFlyFrm(); +- if ( !pFly ) ++ SwFlyFrm *pFly = GetSelectedOrCurrFlyFrm(); ++ if (!pFly) + { +- SwFrm* pCurrFrm( GetCurrFrm() ); +- if ( !pCurrFrm ) +- { +- OSL_FAIL( " - missing current frame. This is a serious defect, please inform OD." ); +- return false; +- } +- pFly = GetCurrFrm()->FindFlyFrm(); +- if ( !pFly ) +- { +- OSL_ENSURE( false, "GetFlyFrmAttr, no Fly selected." ); +- return false; +- } ++ OSL_ENSURE( false, "GetFlyFrmAttr, no Fly selected." ); ++ return false; + } + + SET_CURR_SHELL( (SwViewShell*)this ); +@@ -1026,13 +1026,8 @@ bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) + + if( rSet.Count() ) + { +- SwFlyFrm *pFly = FindFlyFrm(); +- if( !pFly ) +- { +- OSL_ENSURE( GetCurrFrm(), "Crsr in parking zone" ); +- pFly = GetCurrFrm()->FindFlyFrm(); +- OSL_ENSURE( pFly, "SetFlyFrmAttr, no Fly selected." ); +- } ++ SwFlyFrm *pFly = GetSelectedOrCurrFlyFrm(); ++ OSL_ENSURE( pFly, "SetFlyFrmAttr, no Fly selected." ); + if( pFly ) + { + StartAllAction(); +@@ -1058,6 +1053,16 @@ bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) + return bRet; + } + ++SfxItemSet SwFEShell::makeItemSetFromFormatAnchor(SfxItemPool& rPool, const SwFormatAnchor &rAnchor) const ++{ ++ // The set also includes VERT/HORI_ORIENT, because the align ++ // shall be changed in FEShell::SetFlyFrmAttr/SetFlyFrmAnchor, ++ // possibly as a result of the anchor change. ++ SfxItemSet aSet(rPool, RES_VERT_ORIENT, RES_ANCHOR); ++ aSet.Put(rAnchor); ++ return aSet; ++} ++ + bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet ) + { + bool bRet = false; +@@ -1106,14 +1111,8 @@ bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet ) + { + SET_CURR_SHELL( this ); + +- SwFlyFrm *pFly = FindFlyFrm(); +- if( !pFly ) +- { +- OSL_ENSURE( GetCurrFrm(), "Crsr in parking zone" ); +- pFly = GetCurrFrm()->FindFlyFrm(); +- OSL_ENSURE( pFly, "SetFlyFrmAttr, no Fly selected." ); +- } +- ++ SwFlyFrm *pFly = GetSelectedOrCurrFlyFrm(); ++ OSL_ENSURE( pFly, "SetFlyFrmAttr, no Fly selected." ); + if( pFly ) + { + StartAllAction(); +@@ -1143,10 +1142,10 @@ bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet ) + } + + // Returns frame-format if frame, otherwise 0 +-SwFrameFormat* SwFEShell::GetCurFrameFormat() const ++SwFrameFormat* SwFEShell::GetSelectedFrameFormat() const + { + SwFrameFormat* pRet = 0; +- SwLayoutFrm *pFly = FindFlyFrm(); ++ SwLayoutFrm *pFly = GetSelectedFlyFrm(); + if( pFly && ( pRet = static_cast(pFly->GetFormat()->DerivedFrom()) ) == + GetDoc()->GetDfltFrameFormat() ) + pRet = 0; +@@ -1164,7 +1163,7 @@ void SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Poi + pFly = static_cast(pFormat)->GetFrm(); + } + else +- pFly = FindFlyFrm(); ++ pFly = GetSelectedFlyFrm(); + OSL_ENSURE( pFly, "SetFrameFormat: no frame" ); + if( pFly ) + { +@@ -1200,35 +1199,24 @@ void SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Poi + + const SwFrameFormat* SwFEShell::GetFlyFrameFormat() const + { +- const SwFlyFrm* pFly = FindFlyFrm(); +- if ( !pFly ) +- { +- SwFrm* pCurrFrm = GetCurrFrm(); +- pFly = pCurrFrm ? pCurrFrm->FindFlyFrm() : 0; +- } +- if( pFly ) ++ const SwFlyFrm* pFly = GetSelectedOrCurrFlyFrm(); ++ if (pFly) + return pFly->GetFormat(); + return 0; + } + + SwFrameFormat* SwFEShell::GetFlyFrameFormat() + { +- SwFlyFrm* pFly = FindFlyFrm(); +- if ( !pFly ) +- { +- SwFrm* pCurrFrm = GetCurrFrm(); +- pFly = pCurrFrm ? pCurrFrm->FindFlyFrm() : 0; +- } +- if( pFly ) ++ SwFlyFrm* pFly = GetSelectedOrCurrFlyFrm(); ++ if (pFly) + return pFly->GetFormat(); + return 0; + } + + SwRect SwFEShell::GetFlyRect() const + { +- SwContentFrm *pContent = GetCurrFrm( false ); +- SwFlyFrm *pFly = pContent ? pContent->FindFlyFrm() : 0; +- if ( !pFly ) ++ SwFlyFrm *pFly = GetCurrFlyFrm(false); ++ if (!pFly) + { + SwRect aRect; + return aRect; +@@ -1416,7 +1404,7 @@ SwFrameFormat* SwFEShell::WizzardGetFly() + + void SwFEShell::SetFlyName( const OUString& rName ) + { +- SwLayoutFrm *pFly = FindFlyFrm(); ++ SwLayoutFrm *pFly = GetSelectedFlyFrm(); + if( pFly ) + GetDoc()->SetFlyName( *static_cast(pFly->GetFormat()), rName ); + else { +@@ -1426,7 +1414,7 @@ void SwFEShell::SetFlyName( const OUString& rName ) + + OUString SwFEShell::GetFlyName() const + { +- SwLayoutFrm *pFly = FindFlyFrm(); ++ SwLayoutFrm *pFly = GetSelectedFlyFrm(); + if( pFly ) + return pFly->GetFormat()->GetName(); + +@@ -1437,7 +1425,7 @@ OUString SwFEShell::GetFlyName() const + const uno::Reference < embed::XEmbeddedObject > SwFEShell::GetOleRef() const + { + uno::Reference < embed::XEmbeddedObject > xObj; +- SwFlyFrm * pFly = FindFlyFrm(); ++ SwFlyFrm * pFly = GetSelectedFlyFrm(); + if (pFly && pFly->Lower() && pFly->Lower()->IsNoTextFrm()) + { + SwOLENode *pNd = static_cast(pFly->Lower())->GetNode()->GetOLENode(); +diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx +index cd9804a..4d17b2a 100644 +--- a/sw/source/core/frmedt/feflyole.cxx ++++ b/sw/source/core/frmedt/feflyole.cxx +@@ -43,7 +43,7 @@ using namespace com::sun::star; + + SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >& xObj ) const + { +- SwFlyFrm *pFly = FindFlyFrm(); ++ SwFlyFrm *pFly = GetSelectedFlyFrm(); + if ( pFly && pFly->Lower() && pFly->Lower()->IsNoTextFrm() ) + { + SwOLENode *pNd = static_cast(pFly->Lower())->GetNode()->GetOLENode(); +diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx +index fe38a22..54d79fb 100644 +--- a/sw/source/core/frmedt/feshview.cxx ++++ b/sw/source/core/frmedt/feshview.cxx +@@ -1772,7 +1772,7 @@ bool SwFEShell::ImpEndCreate() + SwFlyFrm* pFlyFrm; + if( NewFlyFrm( aSet, true ) && + ::GetHtmlMode( GetDoc()->GetDocShell() ) && +- 0 != ( pFlyFrm = FindFlyFrm() )) ++ 0 != ( pFlyFrm = GetSelectedFlyFrm() )) + { + SfxItemSet aHtmlSet( GetDoc()->GetAttrPool(), RES_VERT_ORIENT, RES_HORI_ORIENT ); + // horizontal orientation: +@@ -2083,7 +2083,7 @@ Point SwFEShell::GetAnchorObjDiff() const + + if ( IsFrmSelected() ) + { +- SwFlyFrm *pFly = FindFlyFrm(); ++ SwFlyFrm *pFly = GetSelectedFlyFrm(); + aRet -= pFly->GetAnchorFrm()->Frm().Pos(); + } + else +@@ -2631,7 +2631,7 @@ void SwFEShell::SetChainMarker() + bDelTo = true; + if ( IsFrmSelected() ) + { +- SwFlyFrm *pFly = FindFlyFrm(); ++ SwFlyFrm *pFly = GetSelectedFlyFrm(); + + if ( pFly->GetPrevLink() ) + { +diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx +index db791c8..a850f62 100644 +--- a/sw/source/core/frmedt/fews.cxx ++++ b/sw/source/core/frmedt/fews.cxx +@@ -48,6 +48,7 @@ + #include + #include + #include ++#include + + using namespace com::sun::star; + +@@ -395,14 +396,18 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rText, con + if( LTYPE_DRAW==eType || pCnt ) + { + StartAllAction(); ++ SwRewriter aRewriter(SwUndoInsertLabel::CreateRewriter(rText)); ++ StartUndo(UNDO_INSERTLABEL, &aRewriter); + + sal_uLong nIdx = 0; ++ bool bInnerCntIsFly = false; + SwFlyFrameFormat* pFlyFormat = 0; + switch( eType ) + { + case LTYPE_OBJECT: + case LTYPE_FLY: +- if( pCnt->IsInFly() ) ++ bInnerCntIsFly = pCnt->IsInFly(); ++ if (bInnerCntIsFly) + { + // pass down index to the startnode for flys + nIdx = pCnt->FindFlyFrm()-> +@@ -423,7 +428,6 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rText, con + { + SwDrawView *pDView = Imp()->GetDrawView(); + const SdrMarkList& rMrkList = pDView->GetMarkedObjectList(); +- StartUndo(); + + // copy marked drawing objects to + // local list to perform the corresponding action for each object +@@ -452,7 +456,6 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rText, con + aDrawObjs.pop_back(); + } + +- EndUndo(); + } + break; + default: +@@ -460,14 +463,49 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rText, con + } + + if( nIdx ) +- pFlyFormat = GetDoc()->InsertLabel( eType, rText, rSeparator, rNumberSeparator, bBefore, nId, +- nIdx, rCharacterStyle, bCpyBrd ); ++ { ++ pFlyFormat = GetDoc()->InsertLabel(eType, rText, rSeparator, ++ rNumberSeparator, bBefore, nId, ++ nIdx, rCharacterStyle, bCpyBrd); ++ ++ //if we succeeded in putting a caption on the content, and the ++ //content was a frame/graphic, then set the contained element ++ //to as-char anchoring because that's all msword is able to ++ //do when inside a frame, and in writer for freshly captioned ++ //elements it's largely irrelevent what the anchor of the contained ++ //type is but making it as-char by default results in very ++ //good roundtripping ++ if (pFlyFormat && bInnerCntIsFly) ++ { ++ SwNodeIndex aAnchIdx(*pFlyFormat->GetContent().GetContentIdx(), 1); ++ SwTextNode *pTxtNode = aAnchIdx.GetNode().GetTextNode(); ++ ++ SwFormatAnchor aAnc(FLY_AS_CHAR); ++ sal_Int32 nInsertPos = bBefore ? pTxtNode->Len() : 0; ++ SwPosition aPos(*pTxtNode, nInsertPos); ++ ++ aAnc.SetAnchor(&aPos); ++ ++ SfxItemSet aSet(makeItemSetFromFormatAnchor(GetDoc()->GetAttrPool(), aAnc)); + +- SwFlyFrm* pFrm; +- const Point aPt( GetCrsrDocPos() ); +- if( pFlyFormat && 0 != ( pFrm = pFlyFormat->GetFrm( &aPt ))) +- SelectFlyFrm( *pFrm, true ); ++ SwFlyFrm *pFly = GetSelectedOrCurrFlyFrm(); ++ SwFlyFrameFormat* pInnerFlyFormat = pFly->GetFormat(); ++ GetDoc()->SetFlyFrmAttr(*pInnerFlyFormat, aSet); + ++ //put a hard-break after the graphic to keep it separated ++ //from the caption text if the outer frame is resized ++ SwIndex aIdx(pTxtNode, bBefore ? nInsertPos : 1); ++ pTxtNode->InsertText(OUString("\n"), aIdx); ++ } ++ } ++ ++ if (pFlyFormat) ++ { ++ const Point aPt(GetCrsrDocPos()); ++ if (SwFlyFrm* pFrm = pFlyFormat->GetFrm(&aPt)) ++ SelectFlyFrm(*pFrm, true); ++ } ++ EndUndo(); + EndAllActionAndCall(); + } + } +@@ -649,7 +687,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, + } + else + { +- pFly = FindFlyFrm(); ++ pFly = GetSelectedFlyFrm(); + pFrm = pFly ? pFly->GetAnchorFrm() : GetCurrFrm(); + } + +@@ -1167,7 +1205,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, + Size SwFEShell::GetGraphicDefaultSize() const + { + Size aRet; +- SwFlyFrm *pFly = FindFlyFrm(); ++ SwFlyFrm *pFly = GetSelectedFlyFrm(); + if ( pFly ) + { + // #i32951# - due to issue #i28701# no format of a +diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx +index 8ef9263..f99783a 100644 +--- a/sw/source/core/inc/UndoInsert.hxx ++++ b/sw/source/core/inc/UndoInsert.hxx +@@ -203,6 +203,7 @@ public: + @return the rewriter of this undo object + */ + virtual SwRewriter GetRewriter() const SAL_OVERRIDE; ++ static SwRewriter CreateRewriter(const OUString &rStr); + + void SetNodePos( sal_uLong nNd ) + { if( LTYPE_OBJECT != eType ) NODE.nNode = nNd; } +diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx +index 58bdcf4..64541bd 100644 +--- a/sw/source/core/undo/unins.cxx ++++ b/sw/source/core/undo/unins.cxx +@@ -1014,14 +1014,22 @@ void SwUndoInsertLabel::RepeatImpl(::sw::RepeatContext & rContext) + // #111827# + SwRewriter SwUndoInsertLabel::GetRewriter() const + { ++ return CreateRewriter(sText); ++} ++ ++SwRewriter SwUndoInsertLabel::CreateRewriter(const OUString &rStr) ++{ + SwRewriter aRewriter; + + OUString aTmpStr; + +- aTmpStr += SW_RES(STR_START_QUOTE); +- aTmpStr += ShortenString(sText, nUndoStringLength, +- OUString(SW_RES(STR_LDOTS))); +- aTmpStr += SW_RES(STR_END_QUOTE); ++ if (!rStr.isEmpty()) ++ { ++ aTmpStr += SW_RES(STR_START_QUOTE); ++ aTmpStr += ShortenString(rStr, nUndoStringLength, ++ OUString(SW_RES(STR_LDOTS))); ++ aTmpStr += SW_RES(STR_END_QUOTE); ++ } + + aRewriter.AddRule(UndoArg1, aTmpStr); + +diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx +index 77e79af..381fe8b 100644 +--- a/sw/source/uibase/app/docst.cxx ++++ b/sw/source/uibase/app/docst.cxx +@@ -129,7 +129,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) + // so that this family is being showed + if(pShell->IsFrmSelected()) + { +- SwFrameFormat* pFormat = pShell->GetCurFrameFormat(); ++ SwFrameFormat* pFormat = pShell->GetSelectedFrameFormat(); + if( pFormat ) + aName = pFormat->GetName(); + } +@@ -195,7 +195,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) + rSet.DisableItem( nWhich ); + else + { +- SwFrameFormat* pFormat = pShell->GetCurFrameFormat(); ++ SwFrameFormat* pFormat = pShell->GetSelectedFrameFormat(); + if(pFormat && pShell->IsFrmSelected()) + { + aName = pFormat->GetName(); +@@ -429,7 +429,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) + break; + case SFX_STYLE_FAMILY_FRAME: + { +- SwFrameFormat* pFrm = m_pWrtShell->GetCurFrameFormat(); ++ SwFrameFormat* pFrm = m_pWrtShell->GetSelectedFrameFormat(); + if( pFrm ) + aParam = pFrm->GetName(); + } +@@ -1177,7 +1177,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, + SfxItemSet aSet(GetPool(), aFrameFormatSetRange ); + pCurrWrtShell->GetFlyFrmAttr( aSet ); + +- SwFrameFormat* pFFormat = pCurrWrtShell->GetCurFrameFormat(); ++ SwFrameFormat* pFFormat = pCurrWrtShell->GetSelectedFrameFormat(); + pFrm->SetDerivedFrom( pFFormat ); + + pFrm->SetFormatAttr( aSet ); +diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx +index 0cbea13..55b6d44 100644 +--- a/sw/source/uibase/ribbar/drawbase.cxx ++++ b/sw/source/uibase/ribbar/drawbase.cxx +@@ -287,7 +287,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) + aCol.Init(m_pWin->GetFrmColCount(), aCol.GetGutterWidth(), aCol.GetWishWidth()); + aSet.Put(aCol); + // Template AutoUpdate +- SwFrameFormat* pFormat = m_pSh->GetCurFrameFormat(); ++ SwFrameFormat* pFormat = m_pSh->GetSelectedFrameFormat(); + if(pFormat && pFormat->IsAutoUpdateFormat()) + m_pSh->AutoUpdateFrame(pFormat, aSet); + else +diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx +index 0a9c64f..360d7c3 100644 +--- a/sw/source/uibase/shells/basesh.cxx ++++ b/sw/source/uibase/shells/basesh.cxx +@@ -1008,16 +1008,12 @@ void SwBaseShell::Execute(SfxRequest &rReq) + ? FLY_AS_CHAR + : FLY_AT_CHAR; + rSh.StartUndo(); +- if( rSh.IsObjSelected() ) +- rSh.ChgAnchor( eSet ); +- else if( rSh.IsFrmSelected() ) +- { +- // The set also includes VERT/HORI_ORIENT, because the align +- // shall be changed in FEShell::SetFlyFrmAttr/SetFlyFrmAnchor, +- // possibly as a result of the anchor change. +- SfxItemSet aSet( GetPool(), RES_VERT_ORIENT, RES_ANCHOR ); +- SwFormatAnchor aAnc( eSet, rSh.GetPhyPageNum() ); +- aSet.Put( aAnc ); ++ if (rSh.IsObjSelected()) ++ rSh.ChgAnchor(eSet); ++ else if (rSh.IsFrmSelected()) ++ { ++ SwFormatAnchor aAnc(eSet, rSh.GetPhyPageNum()); ++ SfxItemSet aSet(rSh.makeItemSetFromFormatAnchor(GetPool(), aAnc)); + rSh.SetFlyFrmAttr(aSet); + } + // if new anchor is 'as char' and it is a Math object and the usual +@@ -2284,7 +2280,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) + if((nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType)) + { + // Template autoupdate +- SwFrameFormat* pFormat = rSh.GetCurFrameFormat(); ++ SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat(); + + if(pFormat && pFormat->IsAutoUpdateFormat()) + { +diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx +index 4868fdf..3a4e956 100644 +--- a/sw/source/uibase/shells/frmsh.cxx ++++ b/sw/source/uibase/shells/frmsh.cxx +@@ -176,7 +176,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) + aCol.Init(nCols, nGutterWidth, aCol.GetWishWidth()); + aSet.Put(aCol); + // Template AutoUpdate +- SwFrameFormat* pFormat = rSh.GetCurFrameFormat(); ++ SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat(); + if(pFormat && pFormat->IsAutoUpdateFormat()) + { + rSh.AutoUpdateFrame(pFormat, aSet); +@@ -498,7 +498,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) + rSh.SetObjTitle(static_cast(pItem)->GetValue()); + } + // Template AutoUpdate +- SwFrameFormat* pFormat = rSh.GetCurFrameFormat(); ++ SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat(); + if(pFormat && pFormat->IsAutoUpdateFormat()) + { + rSh.AutoUpdateFrame(pFormat, *pOutSet); +@@ -644,7 +644,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) + } + if ( bUpdateMgr ) + { +- SwFrameFormat* pFormat = rSh.GetCurFrameFormat(); ++ SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat(); + if ( bCopyToFormat && pFormat && pFormat->IsAutoUpdateFormat() ) + { + rSh.AutoUpdateFrame(pFormat, aMgr.GetAttrSet()); +@@ -1111,7 +1111,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq) + } + aFrameSet.Put( aBoxItem ); + // Template AutoUpdate +- SwFrameFormat* pFormat = rSh.GetCurFrameFormat(); ++ SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat(); + if(pFormat && pFormat->IsAutoUpdateFormat()) + { + rSh.AutoUpdateFrame(pFormat, aFrameSet); +diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx +index 39e18fd..60e95f3 100644 +--- a/sw/source/uibase/shells/grfsh.cxx ++++ b/sw/source/uibase/shells/grfsh.cxx +@@ -381,7 +381,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) + } + + // Templates AutoUpdate +- SwFrameFormat* pFormat = rSh.GetCurFrameFormat(); ++ SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat(); + if(pFormat && pFormat->IsAutoUpdateFormat()) + { + pFormat->SetFormatAttr(*pSet); +diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx +index 37f0553..ead7e47 100644 +--- a/sw/source/uibase/wrtsh/wrtsh1.cxx ++++ b/sw/source/uibase/wrtsh/wrtsh1.cxx +@@ -1709,7 +1709,7 @@ OUString SwWrtShell::GetSelDescr() const + break; + case nsSelectionType::SEL_FRM: + { +- const SwFrameFormat * pFrameFormat = GetCurFrameFormat(); ++ const SwFrameFormat * pFrameFormat = GetSelectedFrameFormat(); + + if (pFrameFormat) + aResult = pFrameFormat->GetDescription(); +-- +2.4.0 + diff --git a/SOURCES/0001-delete-hidden-pages-before-deleting-unused-masters.patch b/SOURCES/0001-delete-hidden-pages-before-deleting-unused-masters.patch new file mode 100644 index 0000000..b28b133 --- /dev/null +++ b/SOURCES/0001-delete-hidden-pages-before-deleting-unused-masters.patch @@ -0,0 +1,52 @@ +From 0f0cea28c75a6565c7803b54536d4a8720ead160 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Tue, 22 Mar 2016 09:03:56 +0100 +Subject: [PATCH] delete hidden pages before deleting unused masters + +Change-Id: I40b624c0e6e6cff2c88815f7d16e862f09d79d5c +--- + sdext/source/minimizer/impoptimizer.cxx | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx +index 03ba917..53600ed 100644 +--- a/sdext/source/minimizer/impoptimizer.cxx ++++ b/sdext/source/minimizer/impoptimizer.cxx +@@ -518,27 +518,27 @@ bool ImpOptimizer::Optimize() + if ( !maCustomShowName.isEmpty() ) + ImpExtractCustomShow( mxModel, maCustomShowName ); + +- if ( mbDeleteUnusedMasterPages ) ++ if ( mbDeleteHiddenSlides ) + { + SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) ); + SetStatusValue( TK_Status, Any( OUString("STR_DELETING_SLIDES") ) ); + DispatchStatus(); +- ImpDeleteUnusedMasterPages( mxModel ); ++ ImpDeleteHiddenSlides( mxModel ); + } + +- if ( mbDeleteHiddenSlides ) ++ if ( mbDeleteNotesPages ) + { +- SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) ); + SetStatusValue( TK_Status, Any( OUString("STR_DELETING_SLIDES") ) ); + DispatchStatus(); +- ImpDeleteHiddenSlides( mxModel ); ++ ImpDeleteNotesPages( mxModel ); + } + +- if ( mbDeleteNotesPages ) ++ if ( mbDeleteUnusedMasterPages ) + { ++ SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) ); + SetStatusValue( TK_Status, Any( OUString("STR_DELETING_SLIDES") ) ); + DispatchStatus(); +- ImpDeleteNotesPages( mxModel ); ++ ImpDeleteUnusedMasterPages( mxModel ); + } + + if ( mbOLEOptimization ) +-- +2.5.0 + diff --git a/SOURCES/0001-disable-failing-test-on-rhel.patch b/SOURCES/0001-disable-failing-test-on-rhel.patch deleted file mode 100644 index 9775d58..0000000 --- a/SOURCES/0001-disable-failing-test-on-rhel.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 793adaba0568a89a521274d354911b03a7e09161 Mon Sep 17 00:00:00 2001 -From: rpmbuild -Date: Tue, 27 May 2014 20:03:53 +0200 -Subject: [PATCH] disable failing test on rhel - ---- - sc/Module_sc.mk | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk -index 2b82efa..5d92799 100644 ---- a/sc/Module_sc.mk -+++ b/sc/Module_sc.mk -@@ -57,7 +57,6 @@ $(eval $(call gb_Module_add_check_targets,sc,\ - )) - - $(eval $(call gb_Module_add_slowcheck_targets,sc, \ -- CppunitTest_sc_subsequent_filters_test \ - CppunitTest_sc_subsequent_export_test \ - CppunitTest_sc_html_export_test \ - CppunitTest_sc_opencl_test \ --- -1.9.3 - diff --git a/SOURCES/0001-disable-libe-book-support.patch b/SOURCES/0001-disable-libe-book-support.patch index 9174b3a..b7d87b5 100644 --- a/SOURCES/0001-disable-libe-book-support.patch +++ b/SOURCES/0001-disable-libe-book-support.patch @@ -1,4 +1,4 @@ -From 05d0763302dd6cebfa60d760667670b3c46b2f2b Mon Sep 17 00:00:00 2001 +From e7836800ed8edc25284ac690acee2ce0819d5de1 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 21 Aug 2014 16:10:51 +0200 Subject: [PATCH] disable libe-book support @@ -10,14 +10,15 @@ Change-Id: Ie915a9bd2acf7f3aeb8b0933252da33c17043bc4 filter/Configuration_filter.mk | 14 -------------- writerperfect/Library_wpftwriter.mk | 2 -- writerperfect/qa/unit/WpftWriterFilterTest.cxx | 1 - - writerperfect/source/writer/wpftwriter_genericfilter.cxx | 4 ---- - 6 files changed, 27 deletions(-) + writerperfect/source/writer/wpftwriter.component | 4 ---- + writerperfect/source/writer/wpftwriter_genericfilter.cxx | 6 ------ + 7 files changed, 33 deletions(-) diff --git a/configure.ac b/configure.ac -index 2f19999..bde14a8 100644 +index ed71d8f..32fa8ae 100644 --- a/configure.ac +++ b/configure.ac -@@ -7757,11 +7757,6 @@ AS_IF([test "$COM" = "MSC"], +@@ -7583,11 +7583,6 @@ AS_IF([test "$COM" = "MSC"], libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"]) dnl =================================================================== @@ -28,12 +29,12 @@ index 2f19999..bde14a8 100644 -dnl =================================================================== dnl Check for system libetonyek dnl =================================================================== - libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1 >= 0.1.1]) + libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1 >= 0.1.2]) diff --git a/external/Module_external.mk b/external/Module_external.mk -index 7049278..0e7fd60 100644 +index 6d38fd5..25cb2d9 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk -@@ -35,7 +35,6 @@ $(eval $(call gb_Module_add_moduledirs,external,\ +@@ -34,7 +34,6 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,CPPUNIT,cppunit) \ $(call gb_Helper_optional,CT2N,ct2n) \ $(call gb_Helper_optional,CURL,curl) \ @@ -42,10 +43,10 @@ index 7049278..0e7fd60 100644 $(call gb_Helper_optional,ETONYEK,libetonyek) \ $(call gb_Helper_optional,EXPAT,expat) \ diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk -index 39fabfc..300c926 100644 +index 29e672b..213e981 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk -@@ -370,13 +370,6 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu +@@ -362,13 +362,6 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu writer_OOXML \ writer_OOXML_Template \ writer_layout_dump_xml \ @@ -56,10 +57,10 @@ index 39fabfc..300c926 100644 - writer_Plucker_eBook \ - writer_TealDoc \ - writer_zTXT \ + writer_ApplePages \ )) - $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters.xcu,filter/source/config/fragments/filters,\ -@@ -431,13 +424,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters +@@ -425,13 +418,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters OOXML_Text \ OOXML_Text_Template \ writer_layout_dump \ @@ -70,31 +71,31 @@ index 39fabfc..300c926 100644 - Plucker_eBook \ - TealDoc \ - zTXT \ + ApplePages \ )) - $(eval $(call filter_Configuration_add_ui_filters,fcfg_langpack,filter/source/config/fragments/filters,\ diff --git a/writerperfect/Library_wpftwriter.mk b/writerperfect/Library_wpftwriter.mk -index db6afdf..e6ea0f5 100644 +index 8557991..288c929 100644 --- a/writerperfect/Library_wpftwriter.mk +++ b/writerperfect/Library_wpftwriter.mk -@@ -42,7 +42,6 @@ $(eval $(call gb_Library_use_libraries,wpftwriter,\ +@@ -49,7 +49,6 @@ $(eval $(call gb_Library_use_libraries,wpftwriter,\ $(eval $(call gb_Library_use_externals,wpftwriter,\ abw \ boost_headers \ - ebook \ + etonyek \ icui18n \ icuuc \ - libxml2 \ -@@ -57,7 +56,6 @@ $(eval $(call gb_Library_use_externals,wpftwriter,\ +@@ -65,7 +64,6 @@ $(eval $(call gb_Library_use_externals,wpftwriter,\ $(eval $(call gb_Library_add_exception_objects,wpftwriter,\ writerperfect/source/writer/AbiWordImportFilter \ - writerperfect/source/writer/EBookImportFilter \ - writerperfect/source/writer/ImportFilterBase \ writerperfect/source/writer/MSWorksImportFilter \ writerperfect/source/writer/MWAWImportFilter \ + writerperfect/source/writer/PagesImportFilter \ diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx b/writerperfect/qa/unit/WpftWriterFilterTest.cxx -index 904daab..fb44878 100644 +index f8f9f85..d928f52 100644 --- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx +++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx @@ -32,7 +32,6 @@ WpftWriterFilterTest::WpftWriterFilterTest() @@ -104,9 +105,24 @@ index 904daab..fb44878 100644 - doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/"); doTest("com.sun.star.comp.Writer.MSWorksImportFilter", "/writerperfect/qa/unit/data/writer/libwps/"); doTest("com.sun.star.comp.Writer.MWAWImportFilter", "/writerperfect/qa/unit/data/writer/libmwaw/"); - doTest("com.sun.star.comp.Writer.WordPerfectImportFilter", "/writerperfect/qa/unit/data/writer/libwpd/"); + doTest("org.libreoffice.comp.Writer.PagesImportFilter", "/writerperfect/qa/unit/data/writer/libetonyek/"); +diff --git a/writerperfect/source/writer/wpftwriter.component b/writerperfect/source/writer/wpftwriter.component +index eaf751a..4b8efbf 100644 +--- a/writerperfect/source/writer/wpftwriter.component ++++ b/writerperfect/source/writer/wpftwriter.component +@@ -34,10 +34,6 @@ + + + +- +- +- +- + + + diff --git a/writerperfect/source/writer/wpftwriter_genericfilter.cxx b/writerperfect/source/writer/wpftwriter_genericfilter.cxx -index 05f6542..831bc38 100644 +index 3f508c4..7e10b9e 100644 --- a/writerperfect/source/writer/wpftwriter_genericfilter.cxx +++ b/writerperfect/source/writer/wpftwriter_genericfilter.cxx @@ -32,7 +32,6 @@ @@ -117,16 +133,18 @@ index 05f6542..831bc38 100644 #include "WordPerfectImportFilter.hxx" #include "MSWorksImportFilter.hxx" #include "MWAWImportFilter.hxx" -@@ -52,9 +51,6 @@ static cppu::ImplementationEntry const services[] = { - { &MWAWImportFilter_createInstance, &MWAWImportFilter_getImplementationName, - &MWAWImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 }, -- { &EBookImportFilter_createInstance, &EBookImportFilter_getImplementationName, -- &EBookImportFilter_getSupportedServiceNames, -- &cppu::createSingleComponentFactory, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } }; - - } +@@ -64,11 +63,6 @@ static cppu::ImplementationEntry const services[] = + &cppu::createSingleComponentFactory, 0, 0 + }, + { +- &EBookImportFilter_createInstance, &EBookImportFilter_getImplementationName, +- &EBookImportFilter_getSupportedServiceNames, +- &cppu::createSingleComponentFactory, 0, 0 +- }, +- { + &PagesImportFilter_createInstance, &PagesImportFilter_getImplementationName, + &PagesImportFilter_getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 -- -1.9.3 +2.4.2 diff --git a/SOURCES/0001-disable-swui-test-on-RHEL-7.patch b/SOURCES/0001-disable-swui-test-on-RHEL-7.patch deleted file mode 100644 index c22940c..0000000 --- a/SOURCES/0001-disable-swui-test-on-RHEL-7.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 857152e54d3c969a7b0056d71bbb6f9f6eeec347 Mon Sep 17 00:00:00 2001 -From: rpmbuild -Date: Fri, 30 May 2014 09:15:36 +0200 -Subject: [PATCH] disable swui test on RHEL-7 - ---- - sw/Module_sw.mk | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk -index 53a19bb..6702d9f 100644 ---- a/sw/Module_sw.mk -+++ b/sw/Module_sw.mk -@@ -47,7 +47,6 @@ $(eval $(call gb_Module_add_targets,sw,\ - endif - - $(eval $(call gb_Module_add_slowcheck_targets,sw,\ -- CppunitTest_sw_uwriter \ - CppunitTest_sw_htmlexport \ - CppunitTest_sw_macros_test \ - CppunitTest_sw_ooxmlexport \ -@@ -60,7 +59,6 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ - CppunitTest_sw_rtfimport \ - CppunitTest_sw_odfexport \ - CppunitTest_sw_odfimport \ -- CppunitTest_sw_uiwriter \ - )) - - ifneq ($(DISABLE_CVE_TESTS),TRUE) --- -1.9.3 - diff --git a/SOURCES/0001-don-t-copy-stylesheet-s-HelpID-if-this-s-a-rename.patch b/SOURCES/0001-don-t-copy-stylesheet-s-HelpID-if-this-s-a-rename.patch deleted file mode 100644 index 631ac91..0000000 --- a/SOURCES/0001-don-t-copy-stylesheet-s-HelpID-if-this-s-a-rename.patch +++ /dev/null @@ -1,33 +0,0 @@ -From e4cf5d1a98469c17133f33fc8220e6b41f65e9a0 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Mon, 8 Dec 2014 18:06:01 +0100 -Subject: [PATCH] don't copy stylesheet's HelpID if this's a rename - -This causes problems for renamed copies of std. styles, as they have -special handling in SdStyleSheet::SetHelpId, which would set the API -name to std. value too. That means that there would be two (or more) -stylesheets with the same API name. On export, only one of them would be -exported. - -Change-Id: I19d243bd3f73995e8de2d251e3d8b7f93219c3a9 ---- - sd/source/core/stlpool.cxx | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx -index 095054e..94f8f96 100644 ---- a/sd/source/core/stlpool.cxx -+++ b/sd/source/core/stlpool.cxx -@@ -699,7 +699,8 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily - if( !aParent.isEmpty() ) - aNewStyles.push_back( std::pair< rtl::Reference< SfxStyleSheetBase >, OUString >( xNewSheet, aParent ) ); - -- xNewSheet->SetHelpId( aHelpFile, xSheet->GetHelpId( aHelpFile ) ); -+ if( !bAddToList ) -+ xNewSheet->SetHelpId( aHelpFile, xSheet->GetHelpId( aHelpFile ) ); - xNewSheet->GetItemSet().Put( xSheet->GetItemSet() ); - - rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( xNewSheet.get() ) ) ); --- -2.1.0 - diff --git a/SOURCES/0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch b/SOURCES/0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch deleted file mode 100644 index fc24346..0000000 --- a/SOURCES/0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch +++ /dev/null @@ -1,64 +0,0 @@ -From a771f5e490bb14d81378b57fa096c4a30b29fc28 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 26 Jan 2015 15:00:29 +0000 -Subject: [PATCH] don't strip font names of apparent script suffixes anymore - -e.g. "CM Roman CE" should be left alone. - -bump font cache id to invalidate old cached lists - -I think this practice stems from Window 3.1/Word 95 where the encoding was -included in the font name -http://www.webcenter.ru/~kazarn/eng/fonts_ttf.htm#charsettbl Microsoft Office -still generates RTF files with weird-ass Win 3.1 style fontnames but any actual -existing fonts that happen to have names that fall into that pattern should be -left alone now. - -Change-Id: Ibb704048d63b33ce510d6b1076700c6e94a0af2a ---- - unotools/source/misc/fontdefs.cxx | 29 +---------------------------- - 1 file changed, 1 insertion(+), 28 deletions(-) - -diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx -index 61f6a07..006ab90 100644 ---- a/unotools/source/misc/fontdefs.cxx -+++ b/unotools/source/misc/fontdefs.cxx -@@ -332,34 +332,7 @@ void GetEnglishSearchFontName( OUString& rName ) - if ( i != nLen ) - rName = rName.copy( 0, i ); - -- // Remove Script at the end -- // Scriptname must be the last part of the fontname and -- // looks like "fontname (scriptname)". So there can only be a -- // script name at the and of the fontname, when the last char is ')' -- if ( (nLen >= 3) && rName[ nLen-1 ] == ')' ) -- { -- int nOpen = 1; -- sal_Int32 nTempLen = nLen-2; -- while ( nTempLen ) -- { -- if ( rName[ nTempLen ] == '(' ) -- { -- nOpen--; -- if ( !nOpen ) -- { -- // Remove Space at the end -- if ( nTempLen && (rName[ nTempLen-1 ] == ' ') ) -- nTempLen--; -- rName = rName.copy( 0, nTempLen ); -- nLen = nTempLen; -- break; -- } -- } -- if ( rName[ nTempLen ] == ')' ) -- nOpen++; -- nTempLen--; -- } -- } -+ nLen = rName.getLength(); - - // remove all whitespaces and converts to lower case ASCII - // TODO: better transliteration to ASCII e.g. all digits --- -1.9.3 - diff --git a/SOURCES/0001-drop-useless-test-for-ant-apache-regexp.patch b/SOURCES/0001-drop-useless-test-for-ant-apache-regexp.patch deleted file mode 100644 index 961915b..0000000 --- a/SOURCES/0001-drop-useless-test-for-ant-apache-regexp.patch +++ /dev/null @@ -1,71 +0,0 @@ -From cb6511354b500d1b1bd8ff140fdf0ea106b174d4 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Wed, 3 Sep 2014 16:20:40 +0200 -Subject: [PATCH] drop useless test for ant-apache-regexp - -It has not been needed since commit -1de48c417404464ca1e34e5c5d1c82a9342349bb 4 years ago. - -Change-Id: I53ceb5d8d6c02c7a13c86cdd884e4fc378a2c492 ---- - configure.ac | 44 -------------------------------------------- - 1 file changed, 44 deletions(-) - -diff --git a/configure.ac b/configure.ac -index f65ab66..897cb1e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -12311,50 +12311,6 @@ EOF - AC_MSG_ERROR([no, you need at least Ant >= $ant_minver]) - fi - -- if test "$ENABLE_MEDIAWIKI" = "TRUE"; then -- AC_MSG_CHECKING([whether Ant supports mapper type="regexp"]) -- rm -rf confdir -- mkdir confdir -- cat > conftest.java << EOF -- public class conftest { -- int testmethod(int a, int b) { -- return a + b; -- } -- } --EOF -- -- cat > conftest.xml << EOF -- -- -- -- -- -- -- -- -- -- -- -- -- --EOF -- -- if test "$JAVACISGCJ" = "yes"; then -- JAVA_HOME=; export JAVA_HOME -- ant_gcj="-Dbuild.compiler=gcj" -- fi -- AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2) -- if test $? = 0 -a -f ./conftest.class; then -- AC_MSG_RESULT([yes]) -- rm -rf confdir -- else -- echo "configure: Ant test failed" >&5 -- cat conftest.java >&5 -- cat conftest.xml >&5 -- rm -rf confdir -- AC_MSG_ERROR([no. Did you install ant-apache-regexp?]) -- fi -- fi - rm -f conftest* core core.* *.core - fi - --- -1.9.3 - diff --git a/SOURCES/0001-f22-openjdk-for-ppc64le-has-both-these-dirs-but-jawt.patch b/SOURCES/0001-f22-openjdk-for-ppc64le-has-both-these-dirs-but-jawt.patch new file mode 100644 index 0000000..0217b2d --- /dev/null +++ b/SOURCES/0001-f22-openjdk-for-ppc64le-has-both-these-dirs-but-jawt.patch @@ -0,0 +1,27 @@ +From e13b0657a3a05139f751124145aa10758c59d1dd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 1 Jul 2015 08:34:58 +0100 +Subject: [PATCH] f22 openjdk for ppc64le has both these dirs, but jawt is only + on one + +Change-Id: Ie770ecceb8c8f5a6fa882a9f5d5a26806b029589 +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index aecbe8f..8964c96 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -7058,7 +7058,7 @@ then + my_java_arch=ppc64 + ;; + powerpc64le) +- AS_IF([test -d "$JAVA_HOME/jre/lib/ppc64le"], [my_java_arch=ppc64le], [my_java_arch=ppc64]) ++ AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64]) + JAVA_ARCH=$my_java_arch + ;; + x86_64) +-- +2.4.0 + diff --git a/SOURCES/0001-fdo-36772-Move-the-scrollbar-and-sheet-tabs-in-a-sep.patch b/SOURCES/0001-fdo-36772-Move-the-scrollbar-and-sheet-tabs-in-a-sep.patch deleted file mode 100644 index 7a1c592..0000000 --- a/SOURCES/0001-fdo-36772-Move-the-scrollbar-and-sheet-tabs-in-a-sep.patch +++ /dev/null @@ -1,396 +0,0 @@ -From 21c291f571daf25a7ed15f7baf551a6aac08f35f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= -Date: Mon, 25 Aug 2014 18:20:58 +0200 -Subject: [PATCH] fdo#36772 Move the scrollbar and sheet tabs in a separate - row. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Change-Id: I57d891d9f6e89dafb4840a577ba55baa734fdcc2 -(cherry picked from commit 1d1d1c62caf2ee6a96946e96d782e03f3ef80439) - -Move the scrollbar and layer tabs in a separate row in Draw - -The reason for this is that the height of the scrollbar is theme-dependent -and makes the tabs unreadable if it's too small. - -The same has already been done for Calc (fdo#36772). - -Reviewed-on: https://gerrit.libreoffice.org/11480 -Reviewed-by: Tomaž Vajngerl -Tested-by: Tomaž Vajngerl -(cherry picked from commit 20800ebc7ef05637134c3915798e13a272663341) - -Conflicts: - sd/source/ui/view/grviewsh.cxx - -Change-Id: Ibe22cf5e7d5863ccf276c19bfa969f5b5fc16a5a ---- - sc/source/ui/view/tabcont.cxx | 3 +- - sc/source/ui/view/tabview.cxx | 60 ++++++++++++++++------------------- - sd/source/ui/dlg/LayerTabBar.cxx | 2 +- - sd/source/ui/inc/FrameView.hxx | 4 --- - sd/source/ui/inc/GraphicViewShell.hxx | 3 -- - sd/source/ui/view/drviews5.cxx | 3 +- - sd/source/ui/view/frmview.cxx | 2 -- - sd/source/ui/view/grviewsh.cxx | 55 ++++---------------------------- - sd/source/ui/view/viewshel.cxx | 11 +++---- - 9 files changed, 42 insertions(+), 101 deletions(-) - -diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx -index e609277..dbecb26 100644 ---- a/sc/source/ui/view/tabcont.cxx -+++ b/sc/source/ui/view/tabcont.cxx -@@ -39,8 +39,7 @@ - - ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) : - TabBar( pParent, -- WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT | -- WB_MULTISELECT | WB_DRAG | WB_SIZEABLE) ), -+ WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT | WB_MULTISELECT | WB_DRAG ) ), - DropTargetHelper( this ), - DragSourceHelper( this ), - pViewData( pData ), -diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx -index 286f1c1..a1ac0d0 100644 ---- a/sc/source/ui/view/tabview.cxx -+++ b/sc/source/ui/view/tabview.cxx -@@ -57,9 +57,6 @@ - #define SPLIT_HANDLE_SIZE 5 - #define SC_ICONSIZE 36 - --#define SC_SCROLLBAR_MIN 30 --#define SC_TABBAR_MIN 6 -- - using namespace ::com::sun::star; - - // Corner-Button -@@ -343,7 +340,12 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) - aBorderPos = rOffset; - aFrameSize = rSize; - -+ const StyleSettings& rStyleSettings = pFrameWin->GetSettings().GetStyleSettings(); -+ -+ sal_Int32 nTabWidth = pFrameWin->GetFont().GetHeight() + 4; -+ - if ( aViewData.GetHSplitMode() != SC_SPLIT_NONE ) -+ { - if ( aViewData.GetHSplitPos() > nSizeX - SPLIT_MARGIN ) - { - aViewData.SetHSplitMode( SC_SPLIT_NONE ); -@@ -351,7 +353,9 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) - ActivatePart( SC_SPLIT_BOTTOMLEFT ); - InvalidateSplit(); - } -+ } - if ( aViewData.GetVSplitMode() != SC_SPLIT_NONE ) -+ { - if ( aViewData.GetVSplitPos() > nSizeY - SPLIT_MARGIN ) - { - aViewData.SetVSplitMode( SC_SPLIT_NONE ); -@@ -359,12 +363,13 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) - ActivatePart( SC_SPLIT_BOTTOMLEFT ); - InvalidateSplit(); - } -+ } - - UpdateShow(); - - if (bHScroll || bVScroll) // Scrollbars horizontal oder vertikal - { -- long nScrollBarSize = pFrameWin->GetSettings().GetStyleSettings().GetScrollBarSize(); -+ long nScrollBarSize = rStyleSettings.GetScrollBarSize(); - if (bVScroll) - { - nBarX = nScrollBarSize; -@@ -372,7 +377,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) - } - if (bHScroll) - { -- nBarY = nScrollBarSize; -+ nBarY = nScrollBarSize + nTabWidth; - nSizeY -= nBarY - nOverlap; - } - -@@ -403,7 +408,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) - } - nSizeRt = nSizeX - nSizeLt - nSizeSp; - -- long nTabSize = 0; - if (bTabControl) - { - // pending relative tab bar width from extended document options -@@ -412,39 +416,30 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) - SetRelTabBarWidth( mfPendingTabBarWidth ); - mfPendingTabBarWidth = -1.0; - } -- -- nTabSize = pTabControl->GetSizePixel().Width()-nOverlap; -- -- if ( aViewData.GetHSplitMode() != SC_SPLIT_FIX ) // bei linkem Scrollbar -- { -- if (nTabSize > nSizeLt-SC_SCROLLBAR_MIN) nTabSize = nSizeLt-SC_SCROLLBAR_MIN; -- if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN; -- nSizeLt -= nTabSize; -- } -- else // bei rechtem Scrollbar -- { -- if (nTabSize > nSizeRt-SC_SCROLLBAR_MIN) nTabSize = nSizeRt-SC_SCROLLBAR_MIN; -- if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN; -- nSizeRt -= nTabSize; -- } - } - -- lcl_SetPosSize( *pTabControl, Point(nPosX-nOverlap, nPosY+nSizeY), -- Size(nTabSize+nOverlap, nBarY), nTotalWidth, bLayoutRTL ); -+ Point aTabPoint(nPosX - nOverlap, nPosY + nSizeY + nScrollBarSize); -+ Size aTabSize(nSizeX, nBarY - nScrollBarSize); -+ lcl_SetPosSize( *pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL ); - pTabControl->SetSheetLayoutRTL( bLayoutRTL ); - -- lcl_SetPosSize( aHScrollLeft, Point(nPosX+nTabSize-nOverlap, nPosY+nSizeY), -- Size(nSizeLt+2*nOverlap, nBarY), nTotalWidth, bLayoutRTL ); -- lcl_SetPosSize( *pHSplitter, Point( nPosX+nTabSize+nSizeLt, nPosY+nSizeY ), -- Size( nSizeSp, nBarY ), nTotalWidth, bLayoutRTL ); -- lcl_SetPosSize( aHScrollRight, Point(nPosX+nTabSize+nSizeLt+nSizeSp-nOverlap, -- nPosY+nSizeY), -- Size(nSizeRt+2*nOverlap, nBarY), nTotalWidth, bLayoutRTL ); -+ Point aHScrollLeftPoint(nPosX - nOverlap, nPosY + nSizeY); -+ Size aHScrollLeftSize(nSizeLt + 2 * nOverlap, nScrollBarSize); -+ lcl_SetPosSize( aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL ); -+ -+ Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY); -+ Size aHSplitterSize(nSizeSp, nScrollBarSize); -+ lcl_SetPosSize( *pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL ); -+ -+ Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp - nOverlap, nPosY + nSizeY); -+ Size aHScrollRightSize(nSizeRt + 2 * nOverlap, nScrollBarSize); -+ -+ lcl_SetPosSize( aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL ); - - // SetDragRectPixel is done below - } - -- if (bVScroll) // Scrollbars vertikal -+ if (bVScroll) - { - long nSizeUp = 0; // upper scroll bar - long nSizeSp = 0; // splitter -@@ -564,7 +559,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) - } - nSplitPosX = aViewData.GetHSplitPos(); - lcl_SetPosSize( *pHSplitter, -- Point( nSplitPosX, nOutPosY ), Size( nSplitSizeX, nSplitHeight ), nTotalWidth, bLayoutRTL ); -+ Point(nSplitPosX, nOutPosY), -+ Size( nSplitSizeX, nSplitHeight - nTabWidth ), nTotalWidth, bLayoutRTL ); - nLeftSize = nSplitPosX - nPosX; - nSplitPosX += nSplitSizeX; - nRightSize = nSizeX - nLeftSize - nSplitSizeX; -diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx -index fa14066..db9a764 100644 ---- a/sd/source/ui/dlg/LayerTabBar.cxx -+++ b/sd/source/ui/dlg/LayerTabBar.cxx -@@ -48,7 +48,7 @@ namespace sd { - * default constructor - */ - LayerTabBar::LayerTabBar(DrawViewShell* pViewSh, Window* pParent) -- : TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_SIZEABLE ) ), -+ : TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL ) ), - DropTargetHelper( this ), - pDrViewSh(pViewSh) - { -diff --git a/sd/source/ui/inc/FrameView.hxx b/sd/source/ui/inc/FrameView.hxx -index 40bdffe..120570f 100644 ---- a/sd/source/ui/inc/FrameView.hxx -+++ b/sd/source/ui/inc/FrameView.hxx -@@ -163,9 +163,6 @@ public: - void SetDrawMode(sal_uLong nNewDrawMode) { mnDrawMode = nNewDrawMode; }; - sal_uLong GetDrawMode() const { return mnDrawMode; }; - -- void SetTabCtrlPercent( double nPercent ) { mnTabCtrlPercent = nPercent; } -- double GetTabCtrlPercent() const { return mnTabCtrlPercent; } -- - void SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes); - bool IsNavigatorShowingAllShapes (void) const; - -@@ -200,7 +197,6 @@ private: - sal_uInt16 mnSlotId; ///< SlotId, which was initial mentioned - sal_uInt16 mnSlidesPerRow; ///< slides per row on the slide-desk - sal_uLong mnDrawMode; ///< draw mode for the normal window -- double mnTabCtrlPercent; - /** Remember whether the navigator shows all shapes () or only - the names ones (). Not persistent. - */ -diff --git a/sd/source/ui/inc/GraphicViewShell.hxx b/sd/source/ui/inc/GraphicViewShell.hxx -index 632a31e..3f35b78 100644 ---- a/sd/source/ui/inc/GraphicViewShell.hxx -+++ b/sd/source/ui/inc/GraphicViewShell.hxx -@@ -72,9 +72,6 @@ public: - protected: - void ConstructGraphicViewShell (void); - virtual void ArrangeGUIElements (void) SAL_OVERRIDE; -- --private: -- DECL_LINK(TabBarSplitHandler, TabBar*); - }; - - } // end of namespace sd -diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx -index 2e98ec5..fbe01c1 100644 ---- a/sd/source/ui/view/drviews5.cxx -+++ b/sd/source/ui/view/drviews5.cxx -@@ -113,8 +113,7 @@ void DrawViewShell::ArrangeGUIElements (void) - // Retrieve the current size (thickness) of the scroll bars. That is - // the width of the vertical and the height of the horizontal scroll - // bar. -- int nScrollBarSize = -- GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize(); -+ int nScrollBarSize = GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize(); - maScrBarWH = Size (nScrollBarSize, nScrollBarSize); - - Point aHPos = maViewPos; -diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx -index 3121d64..c114d81 100644 ---- a/sd/source/ui/view/frmview.cxx -+++ b/sd/source/ui/view/frmview.cxx -@@ -194,7 +194,6 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * - mbClickChangeRotation = pFrameView->IsClickChangeRotation(); - mnSlidesPerRow = pFrameView->GetSlidesPerRow(); - mnDrawMode = pFrameView->GetDrawMode(); -- mnTabCtrlPercent = pFrameView->GetTabCtrlPercent(); - mbIsNavigatorShowingAllShapes = pFrameView->IsNavigatorShowingAllShapes(); - SetPreviousViewShellType (pFrameView->GetPreviousViewShellType()); - SetViewShellTypeOnLoad (pFrameView->GetViewShellTypeOnLoad()); -@@ -228,7 +227,6 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * - bool bUseContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); - mnDrawMode = bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR; - } -- mnTabCtrlPercent = 0.0; - mbIsNavigatorShowingAllShapes = false; - SetPreviousViewShellType (ViewShell::ST_NONE); - SetViewShellTypeOnLoad (ViewShell::ST_IMPRESS); -diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx -index 253a6e7..01af5d6 100644 ---- a/sd/source/ui/view/grviewsh.cxx -+++ b/sd/source/ui/view/grviewsh.cxx -@@ -30,9 +30,6 @@ - - namespace sd { - --static const int TABCONTROL_INITIAL_SIZE = 350; -- -- - GraphicViewShell::GraphicViewShell ( - SfxViewFrame* pFrame, - ViewShellBase& rViewShellBase, -@@ -59,10 +56,9 @@ void GraphicViewShell::ConstructGraphicViewShell(void) - { - meShellType = ST_DRAW; - -- mpLayerTabBar.reset (new LayerTabBar(this,GetParentWindow())); -- mpLayerTabBar->SetSplitHdl(LINK(this,GraphicViewShell,TabBarSplitHandler)); -+ mpLayerTabBar.reset (new LayerTabBar(this, GetParentWindow())); - -- // pb: #i67363# no layer tabbar on preview mode -+ // #i67363# no layer tabbar in preview mode - if ( !GetObjectShell()->IsPreview() ) - mpLayerTabBar->Show(); - } -@@ -88,58 +84,19 @@ void GraphicViewShell::ArrangeGUIElements (void) - if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible()) - { - Size aSize = mpLayerTabBar->GetSizePixel(); -- const Size aFrameSize ( -- GetViewFrame()->GetWindow().GetOutputSizePixel()); -- -- if (aSize.Width() == 0) -- { -- if (mpFrameView->GetTabCtrlPercent() == 0.0) -- aSize.Width() = TABCONTROL_INITIAL_SIZE; -- else -- aSize.Width() = FRound(aFrameSize.Width() -- * mpFrameView->GetTabCtrlPercent()); -- } -- aSize.Height() = GetParentWindow()->GetSettings().GetStyleSettings() -- .GetScrollBarSize(); -+ const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel()); -+ -+ aSize.Height() = GetParentWindow()->GetFont().GetHeight() + 4; -+ aSize.Width() = aFrameSize.Width(); - - Point aPos (0, maViewSize.Height() - aSize.Height()); - - mpLayerTabBar->SetPosSizePixel (aPos, aSize); -- -- if (aFrameSize.Width() > 0) -- mpFrameView->SetTabCtrlPercent ( -- (double) maTabControl.GetSizePixel().Width() -- / aFrameSize.Width()); -- else -- mpFrameView->SetTabCtrlPercent( 0.0 ); - } - - DrawViewShell::ArrangeGUIElements(); - } - -- -- -- --IMPL_LINK(GraphicViewShell, TabBarSplitHandler, TabBar*, pTabBar) --{ -- const long int nMax = maViewSize.Width() -- - maScrBarWH.Width() -- - pTabBar->GetPosPixel().X(); -- -- Size aTabSize = pTabBar->GetSizePixel(); -- aTabSize.Width() = std::min(pTabBar->GetSplitSize(), (long)(nMax-1)); -- -- pTabBar->SetSizePixel (aTabSize); -- -- Point aPos = pTabBar->GetPosPixel(); -- aPos.X() += aTabSize.Width(); -- -- Size aScrSize (nMax - aTabSize.Width(), maScrBarWH.Height()); -- mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize); -- -- return 0; --} -- - } // end of namespace sd - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx -index 28e272e..4d6804d 100644 ---- a/sd/source/ui/view/viewshel.cxx -+++ b/sd/source/ui/view/viewshel.cxx -@@ -914,13 +914,12 @@ void ViewShell::ArrangeGUIElements (void) - if (mpHorizontalScrollBar.get()!=NULL - && mpHorizontalScrollBar->IsVisible()) - { -- int nLocalLeft = nLeft; -- if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible()) -- nLocalLeft += mpLayerTabBar->GetSizePixel().Width(); - nBottom -= maScrBarWH.Height(); -+ if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible()) -+ nBottom -= mpLayerTabBar->GetSizePixel().Height(); - mpHorizontalScrollBar->SetPosSizePixel ( -- Point(nLocalLeft,nBottom), -- Size(nRight-nLocalLeft-maScrBarWH.Width(),maScrBarWH.Height())); -+ Point(nLeft, nBottom), -+ Size(nRight - nLeft - maScrBarWH.Width(), maScrBarWH.Height())); - } - - // Vertical scrollbar. -@@ -930,7 +929,7 @@ void ViewShell::ArrangeGUIElements (void) - nRight -= maScrBarWH.Width(); - mpVerticalScrollBar->SetPosSizePixel ( - Point(nRight,nTop), -- Size (maScrBarWH.Width(),nBottom-nTop)); -+ Size (maScrBarWH.Width(), nBottom-nTop)); - } - - // Filler in the lower right corner. --- -1.9.3 - diff --git a/SOURCES/0001-fdo-37682-paint-the-right-area.patch b/SOURCES/0001-fdo-37682-paint-the-right-area.patch deleted file mode 100644 index 3ae339a..0000000 --- a/SOURCES/0001-fdo-37682-paint-the-right-area.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 4f64ac19904ff0867e2e22c6c54b44ec2e351a97 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Tue, 9 Dec 2014 22:12:03 +0100 -Subject: [PATCH] fdo#37682 paint the right area - -Change-Id: Ic3d1f6e47bf068e60dca711c97e3f6b194d14049 ---- - svx/source/unodraw/UnoGraphicExporter.cxx | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx -index eeb664f..eb1523b 100644 ---- a/svx/source/unodraw/UnoGraphicExporter.cxx -+++ b/svx/source/unodraw/UnoGraphicExporter.cxx -@@ -764,7 +764,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, - // Use new StandardCheckVisisbilityRedirector - ImplExportCheckVisisbilityRedirector aRedirector( mpCurrentPage ); - -- pView->CompleteRedraw(&aVDev, Region(Rectangle(Point(), aNewSize)), &aRedirector); -+ pView->CompleteRedraw(&aVDev, Region(Rectangle(aNewOrg, aNewSize)), &aRedirector); - - aVDev.Pop(); - --- -1.9.3 - diff --git a/SOURCES/0001-fdo-69036-do-not-try-to-create-a-sfxApplication-when.patch b/SOURCES/0001-fdo-69036-do-not-try-to-create-a-sfxApplication-when.patch deleted file mode 100644 index 47dec0e..0000000 --- a/SOURCES/0001-fdo-69036-do-not-try-to-create-a-sfxApplication-when.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 6698a143ebf961519884aefb8b00dc2d61c66818 Mon Sep 17 00:00:00 2001 -From: Norbert Thiebaud -Date: Fri, 27 Jun 2014 10:29:46 +0200 -Subject: [PATCH] fdo#69036 do not try to create a sfxApplication when we are - tearing-down - -This was triggered by connectivity calc driver, which on shutdown -was trying to 'dispose()' it's connection -which in turn would, if the shutdown of calc was already done -try to re-create an sfxApplication instance, just to delete -illusory inexistant documents... - -Change-Id: Ic166367ca399d613743f379ebbfbffb5813701c0 ---- - include/sfx2/app.hxx | 2 +- - sfx2/source/doc/objxtor.cxx | 35 ++++++++++++++++++++--------------- - 2 files changed, 21 insertions(+), 16 deletions(-) - -diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx -index 3f81077..fe12622 100644 ---- a/include/sfx2/app.hxx -+++ b/include/sfx2/app.hxx -@@ -149,6 +149,7 @@ public: - SfxApplication(); - virtual ~SfxApplication(); - static SfxApplication* GetOrCreate(); -+ static SfxApplication* Get() { return pApp;} - - // Resource Manager - ResMgr* GetSfxResManager(); -@@ -202,7 +203,6 @@ public: - bool IsDowning() const; - void ResetLastDir(); - -- SAL_DLLPRIVATE static SfxApplication* Get() { return pApp;} - SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl(); - SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl(); - -diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx -index 1fbe840..32e8b6c 100644 ---- a/sfx2/source/doc/objxtor.cxx -+++ b/sfx2/source/doc/objxtor.cxx -@@ -462,12 +462,17 @@ bool SfxObjectShell::Close() - if ( pImp->bClosing ) - { - // remove from Document list -- SfxApplication *pSfxApp = SFX_APP(); -- SfxObjectShellArr_Impl &rDocs = pSfxApp->GetObjectShells_Impl(); -- SfxObjectShellArr_Impl::iterator it = std::find( rDocs.begin(), rDocs.end(), this ); -- if ( it != rDocs.end() ) -- rDocs.erase( it ); -- pImp->bInList = false; -+ // If there is no App, there is no document to remove -+ // no need to call GetOrCreate here -+ SfxApplication *pSfxApp = SfxApplication::Get(); -+ if(pSfxApp) -+ { -+ SfxObjectShellArr_Impl &rDocs = pSfxApp->GetObjectShells_Impl(); -+ SfxObjectShellArr_Impl::iterator it = std::find( rDocs.begin(), rDocs.end(), this ); -+ if ( it != rDocs.end() ) -+ rDocs.erase( it ); -+ pImp->bInList = false; -+ } - } - } - -@@ -501,7 +506,7 @@ SfxObjectShell* SfxObjectShell::GetFirst - bool bOnlyVisible - ) - { -- SfxObjectShellArr_Impl &rDocs = SFX_APP()->GetObjectShells_Impl(); -+ SfxObjectShellArr_Impl &rDocs = SfxGetpApp()->GetObjectShells_Impl(); - - // seach for a SfxDocument of the specified type - for ( sal_uInt16 nPos = 0; nPos < rDocs.size(); ++nPos ) -@@ -528,7 +533,7 @@ SfxObjectShell* SfxObjectShell::GetNext - bool bOnlyVisible - ) - { -- SfxObjectShellArr_Impl &rDocs = SFX_APP()->GetObjectShells_Impl(); -+ SfxObjectShellArr_Impl &rDocs = SfxGetpApp()->GetObjectShells_Impl(); - - // refind the specified predecessor - sal_uInt16 nPos; -@@ -607,7 +612,7 @@ bool SfxObjectShell::PrepareClose - } - } - -- SfxApplication *pSfxApp = SFX_APP(); -+ SfxApplication *pSfxApp = SfxGetpApp(); - pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(STR_EVENT_PREPARECLOSEDOC), this) ); - - if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) -@@ -713,7 +718,7 @@ BasicManager* SfxObjectShell::GetBasicManager() const - #else - BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this ); - if ( !pBasMgr ) -- pBasMgr = SFX_APP()->GetBasicManager(); -+ pBasMgr = SfxGetpApp()->GetBasicManager(); - return pBasMgr; - #endif - } -@@ -787,7 +792,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer() - - OSL_FAIL( "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?" ); - #endif -- return SFX_APP()->GetDialogContainer(); -+ return SfxGetpApp()->GetDialogContainer(); - } - - -@@ -804,7 +809,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer() - - OSL_FAIL( "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?" ); - #endif -- return SFX_APP()->GetBasicContainer(); -+ return SfxGetpApp()->GetBasicContainer(); - } - - -@@ -947,7 +952,7 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp - // but we should have filtered quite some unnecessary calls already. - - #ifndef DISABLE_SCRIPTING -- BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); -+ BasicManager* pAppMgr = SfxGetpApp()->GetBasicManager(); - rTheCurrentComponent = _rxComponent; - if ( pAppMgr ) - { -@@ -1142,11 +1147,11 @@ void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew ) - if ( i_fromInitNew ) - { - SetActivateEvent_Impl( SFX_EVENT_CREATEDOC ); -- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) ); -+ SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) ); - } - else - { -- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) ); -+ SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) ); - } - } - --- -1.9.3 - diff --git a/SOURCES/0001-fdo-82496-Change-picture-option-by-rightclicking.patch b/SOURCES/0001-fdo-82496-Change-picture-option-by-rightclicking.patch deleted file mode 100644 index 5cbab76..0000000 --- a/SOURCES/0001-fdo-82496-Change-picture-option-by-rightclicking.patch +++ /dev/null @@ -1,78 +0,0 @@ -From caa08b214542fdf1bed3912b9c4fac36e5d87eb2 Mon Sep 17 00:00:00 2001 -From: Jennifer Liebel -Date: Tue, 2 Sep 2014 12:40:20 +0000 -Subject: [PATCH] fdo#82496: Change picture option by rightclicking - -Change-Id: I31fb1a1f89030610a9d11b9236e8cde22dbc0ca5 ---- - sw/sdi/_grfsh.sdi | 12 ++++++++++++ - sw/source/ui/app/mn.src | 1 + - sw/source/uibase/shells/grfsh.cxx | 3 +-- - 3 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/sw/sdi/_grfsh.sdi b/sw/sdi/_grfsh.sdi -index 15c00cc..2eb2ab2 100644 ---- a/sw/sdi/_grfsh.sdi -+++ b/sw/sdi/_grfsh.sdi -@@ -62,6 +62,13 @@ interface BaseTextGraphic - DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; - ] - -+ SID_CHANGE_PICTURE -+ [ -+ ExecMethod = Execute ; -+ StateMethod = GetAttrState ; -+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; -+ ] -+ - SID_EXTERNAL_EDIT - [ - ExecMethod = Execute ; -@@ -224,6 +231,11 @@ interface BaseTextGraphic - StateMethod = GetAttrState ; - DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; - ] -+ SID_CHANGE_PICTURE -+ [ -+ ExecMethod = FuTemporary ; -+ StateMethod = GetMenuState ; -+ ] - SID_GRFFILTER_SOLARIZE // status(final|play|rec) - [ - ExecMethod = ExecAttr ; -diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src -index f62c8da..79b797d 100644 ---- a/sw/source/ui/app/mn.src -+++ b/sw/source/ui/app/mn.src -@@ -1239,6 +1239,7 @@ Menu MN_GRF_POPUPMENU - MN_FRM_CAPTION_ITEM - SEPARATOR; - MenuItem { ITEM_SAVE_GRAPHIC }; -+ MenuItem { ITEM_CHANGE_PICTURE }; - MenuItem { ITEM_COMPRESS_GRAPHIC }; - MenuItem { ITEM_EXTERNAL_EDIT }; - -diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx -index d5ecec5..0e13b38 100644 ---- a/sw/source/core/uibase/shells/grfsh.cxx -+++ b/sw/source/core/uibase/shells/grfsh.cxx -@@ -178,7 +178,6 @@ void SwGrfShell::Execute(SfxRequest &rReq) - } - } - break; -- - case SID_EXTERNAL_EDIT: - { - // When the graphic is selected to be opened via some external tool -@@ -191,7 +190,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) - } - } - break; -- -+ case SID_CHANGE_PICTURE: - case SID_INSERT_GRAPHIC: - { - // #i123922# implement slot independent from the two below to --- -1.9.3 - diff --git a/SOURCES/0001-fix-KDE4-detection-on-aarch64.patch b/SOURCES/0001-fix-KDE4-detection-on-aarch64.patch deleted file mode 100644 index 18537e3..0000000 --- a/SOURCES/0001-fix-KDE4-detection-on-aarch64.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fdb81f1a2012e558eaeb7fcf762736f1afcdeee9 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Wed, 3 Sep 2014 09:36:22 +0200 -Subject: [PATCH] fix KDE4 detection on aarch64 - -Change-Id: Iafe65564e8c2534cb03497d82d7dd3498abdf7c8 ---- - configure.ac | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index c0b5658..f65ab66 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -11045,9 +11045,12 @@ AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT) - AC_SUBST(SYSTEM_RHINO) - AC_SUBST(RHINO_JAR) - -+# This is only used in KDE3/KDE4/TDE checks to determine if /usr/lib64 -+# paths should be added to library search path. So lets put all 64-bit -+# platforms there. - supports_multilib= - case "$host_cpu" in --x86_64 | powerpc64 | s390x) -+x86_64 | powerpc64 | powerpc64le | s390x | aarch64) - if test "$SAL_TYPES_SIZEOFLONG" = "8"; then - supports_multilib="yes" - fi --- -1.9.3 - diff --git a/SOURCES/0001-gtk3-Resolves-tdf-96333-fix-RTL-menu-positioning.patch b/SOURCES/0001-gtk3-Resolves-tdf-96333-fix-RTL-menu-positioning.patch new file mode 100644 index 0000000..b5e4f20 --- /dev/null +++ b/SOURCES/0001-gtk3-Resolves-tdf-96333-fix-RTL-menu-positioning.patch @@ -0,0 +1,27 @@ +From e6e024c747eaaa58ccd7ed542c7c31fcb6911090 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 18 Feb 2016 17:20:34 +0000 +Subject: [PATCH] gtk3: Resolves: tdf#96333 fix RTL menu positioning + +Change-Id: I22c5186371e558ed84da81c43400379c218ca816 +(cherry picked from commit d7a292ce490eeb8ff02e145e0a55f41f4c179541) +--- + vcl/unx/gtk3/gtk3gtkframe.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index 3914de5..6902256 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -1613,7 +1613,7 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u + if( m_pParent ) + { + if( AllSettings::GetLayoutRTL() ) +- nX = m_pParent->maGeometry.nWidth-maGeometry.nWidth-1-nX; ++ nX = m_pParent->maGeometry.nWidth-m_nWidthRequest-1-nX; + nX += m_pParent->maGeometry.nX; + nY += m_pParent->maGeometry.nY; + } +-- +2.7.1 + diff --git a/SOURCES/0001-gtk3-avoid-empty-target-clipboard-warning.patch b/SOURCES/0001-gtk3-avoid-empty-target-clipboard-warning.patch new file mode 100644 index 0000000..4fec7fd --- /dev/null +++ b/SOURCES/0001-gtk3-avoid-empty-target-clipboard-warning.patch @@ -0,0 +1,42 @@ +From 7b422cce4ebc291d5eff723dc0fd4497ab412ed5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 4 Dec 2015 14:11:24 +0000 +Subject: [PATCH 1/3] gtk3: avoid empty target clipboard warning + +Change-Id: Ic6b46eb2c81398f0ab2e7539e5cdb27a508c8893 +(cherry picked from commit 66fedc0966ad0c732cada974ea910d7a98beca15) +--- + vcl/unx/gtk3/gtk3gtkinst.cxx | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx +index 9f15db0..e9210d0 100644 +--- a/vcl/unx/gtk3/gtk3gtkinst.cxx ++++ b/vcl/unx/gtk3/gtk3gtkinst.cxx +@@ -572,13 +572,16 @@ void VclGtkClipboard::setContents( + aGtkTargets.push_back(makeGtkTargetEntry(aFlavor)); + } + +- //if there was a previous gtk_clipboard_set_with_data call then +- //ClipboardClearFunc will be called now +- GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); +- //use with_owner with m_pOwner so we can distinguish in handle_owner_change +- //if we have gained or lost ownership of the clipboard +- gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(), +- ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner)); ++ if (!aGtkTargets.empty()) ++ { ++ //if there was a previous gtk_clipboard_set_with_data call then ++ //ClipboardClearFunc will be called now ++ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); ++ //use with_owner with m_pOwner so we can distinguish in handle_owner_change ++ //if we have gained or lost ownership of the clipboard ++ gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(), ++ ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner)); ++ } + m_aGtkTargets = aGtkTargets; + } + +-- +2.5.0 + diff --git a/SOURCES/0001-gtk3-gtk_gesture_get_point-may-return-false.patch b/SOURCES/0001-gtk3-gtk_gesture_get_point-may-return-false.patch new file mode 100644 index 0000000..d527ee7 --- /dev/null +++ b/SOURCES/0001-gtk3-gtk_gesture_get_point-may-return-false.patch @@ -0,0 +1,53 @@ +From a645619a5740b1eb43795f07fd80f25e240821b5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Dec 2015 20:51:06 +0000 +Subject: [PATCH] gtk3: gtk_gesture_get_point may return false + +(cherry picked from commit 23d5775ecf04c001ecf86b6012aef4d1a3f2f063) + +Change-Id: Ibd175c65babdde48132692fd1979a00929356bb4 +--- + vcl/unx/gtk/window/gtksalframe.cxx | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx +index 616f73f..9e03f14 100644 +--- a/vcl/unx/gtk/window/gtksalframe.cxx ++++ b/vcl/unx/gtk/window/gtksalframe.cxx +@@ -3611,22 +3611,23 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame + #if GTK_CHECK_VERSION(3,14,0) + void GtkSalFrame::gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame) + { +- GtkSalFrame* pThis = static_cast(frame); +- +- SalSwipeEvent aEvent; +- aEvent.mnVelocityX = velocity_x; +- aEvent.mnVelocityY = velocity_y; +- + gdouble x, y; + GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture)); + //I feel I want the first point of the sequence, not the last point which + //the docs say this gives, but for the moment assume we start and end + //within the same vcl window +- gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y); +- aEvent.mnX = x; +- aEvent.mnY = y; ++ if (gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y)) ++ { ++ GtkSalFrame* pThis = static_cast(frame); + +- pThis->CallCallback(SALEVENT_SWIPE, &aEvent); ++ SalSwipeEvent aEvent; ++ aEvent.mnVelocityX = velocity_x; ++ aEvent.mnVelocityY = velocity_y; ++ aEvent.mnX = x; ++ aEvent.mnY = y; ++ ++ pThis->CallCallback(SALEVENT_SWIPE, &aEvent); ++ } + } + + void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame) +-- +2.5.0 + diff --git a/SOURCES/0001-gtk3-implement-SAL_INVERT_50-rectangle-case.patch b/SOURCES/0001-gtk3-implement-SAL_INVERT_50-rectangle-case.patch new file mode 100644 index 0000000..3de82c7 --- /dev/null +++ b/SOURCES/0001-gtk3-implement-SAL_INVERT_50-rectangle-case.patch @@ -0,0 +1,110 @@ +From 63d5cc018d268a8d269cb2353ddaeb68fc74d64c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 30 Nov 2015 10:22:46 +0000 +Subject: [PATCH] gtk3: implement SAL_INVERT_50 rectangle case + +missing stipple effect around slides in layout panel + +(cherry picked from commit a80dea3e77c2a8465cdd309c5f740fb8102dd826) +(cherry picked from commit 442d064188a2d50406e485d033accfffe4bd54e9) + +Change-Id: I8a55c6bda1e742e105ba22e4566658099ea16f46 +--- + vcl/headless/svpgdi.cxx | 73 +++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 71 insertions(+), 2 deletions(-) + +diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx +index 06030d9..0afce7e 100644 +--- a/vcl/headless/svpgdi.cxx ++++ b/vcl/headless/svpgdi.cxx +@@ -913,9 +913,76 @@ SalColor SvpSalGraphics::getPixel( long nX, long nY ) + return aColor.toInt32(); + } + +-void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert /*nFlags*/ ) ++namespace + { +- // FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME ++ cairo_pattern_t * create_stipple() ++ { ++ static unsigned char data[16] = { 0xFF, 0xFF, 0x00, 0x00, ++ 0xFF, 0xFF, 0x00, 0x00, ++ 0x00, 0x00, 0xFF, 0xFF, ++ 0x00, 0x00, 0xFF, 0xFF }; ++ cairo_surface_t* surface = cairo_image_surface_create_for_data(data, CAIRO_FORMAT_A8, 4, 4, 4); ++ cairo_pattern_t* pattern = cairo_pattern_create_for_surface(surface); ++ cairo_surface_destroy(surface); ++ cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); ++ cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST); ++ return pattern; ++ } ++} ++ ++void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ) ++{ ++#if ENABLE_CAIRO_CANVAS ++#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) ++ // FIXME: handle SAL_INVERT_TRACKFRAME ++ if ( nFlags & SAL_INVERT_TRACKFRAME ) ++ { ++ SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, unhandled SAL_INVERT_TRACKFRAME"); ++ } ++ else if ( nFlags & SAL_INVERT_50 ) ++ { ++ if (cairo_t* cr = createCairoContext(m_aDevice)) ++ { ++ if (!m_aDevice->isTopDown()) ++ { ++ cairo_scale(cr, 1, -1.0); ++ cairo_translate(cr, 0.0, -m_aDevice->getSize().getY()); ++ } ++ ++ clipRegion(cr); ++ ++ cairo_pattern_t *pattern = create_stipple(); ++ ++ cairo_rectangle_int_t extents; ++ basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); ++ ++ cairo_rectangle(cr, nX, nY, nWidth, nHeight); ++ ++ if (xDamageTracker) ++ extents = getFillDamage(cr); ++ ++ cairo_clip(cr); ++ ++ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); ++ cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); ++ cairo_mask(cr, pattern); ++ cairo_pattern_destroy(pattern); ++ ++ cairo_surface_flush(cairo_get_target(cr)); ++ cairo_destroy(cr); // unref ++ ++ return; ++ } ++ else ++ SAL_WARN("vcl.gdi", "SvpSalGraphics::invert unhandled XOR (?)"); ++ } ++ else ++ { ++ SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, unhandled SAL_INVERT_TRACKFRAME"); ++ } ++#endif ++#endif ++ + basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ); + basegfx::B2DPolyPolygon aPolyPoly( aRect ); + basegfx::B2IBox aDestRange( nX, nY, nX + nWidth, nY + nHeight ); +@@ -928,6 +995,8 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv + + void SvpSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ ) + { ++ SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, unhandled points case"); ++ + // FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME + basegfx::B2DPolygon aPoly; + aPoly.append( basegfx::B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints ); +-- +2.5.0 + diff --git a/SOURCES/0001-gtk3-stop-the-ever-shrinking-size-of-toplevel-on-eve.patch b/SOURCES/0001-gtk3-stop-the-ever-shrinking-size-of-toplevel-on-eve.patch new file mode 100644 index 0000000..e357f9a --- /dev/null +++ b/SOURCES/0001-gtk3-stop-the-ever-shrinking-size-of-toplevel-on-eve.patch @@ -0,0 +1,105 @@ +From 3b31d0dc86d75f8283951f3fd6a4f48ff649ed99 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 4 Dec 2015 13:07:57 +0000 +Subject: [PATCH] gtk3: stop the ever shrinking size of toplevel on every + restore +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +for getting and setting the window state, work on the toplevel m_pWindow. Leave +the "geometry" alone as its for the purpose of the current known size of the +toplevel window contents + +Change-Id: Idf701aacf4aed4eefbca1bc1ebebaf38d1c82e27 +Reviewed-on: https://gerrit.libreoffice.org/20397 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +(cherry picked from commit 7242ed0567297c3c5186b4095496fc01448359f4) +--- + vcl/unx/gtk3/gtk3gtkframe.cxx | 41 ++++++++++++++++++++++++++++------------- + 1 file changed, 28 insertions(+), 13 deletions(-) + +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index 966dc80..576946f 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -1703,6 +1703,28 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState ) + TriggerPaintEvent(); + } + ++namespace ++{ ++ void GetPosAndSize(GtkWindow *pWindow, long& rX, long &rY, long &rWidth, long &rHeight) ++ { ++ gint root_x, root_y; ++ gtk_window_get_position(GTK_WINDOW(pWindow), &root_x, &root_y); ++ rX = root_x; ++ rY = root_y; ++ gint width, height; ++ gtk_window_get_size(GTK_WINDOW(pWindow), &width, &height); ++ rWidth = width; ++ rHeight = height; ++ } ++ ++ Rectangle GetPosAndSize(GtkWindow *pWindow) ++ { ++ long nX, nY, nWidth, nHeight; ++ GetPosAndSize(pWindow, nX, nY, nWidth, nHeight); ++ return Rectangle(nX, nY, nX + nWidth, nY + nHeight); ++ } ++} ++ + bool GtkSalFrame::GetWindowState( SalFrameState* pState ) + { + pState->mnState = WINDOWSTATE_STATE_NORMAL; +@@ -1717,10 +1739,8 @@ bool GtkSalFrame::GetWindowState( SalFrameState* pState ) + pState->mnY = m_aRestorePosSize.Top(); + pState->mnWidth = m_aRestorePosSize.GetWidth(); + pState->mnHeight = m_aRestorePosSize.GetHeight(); +- pState->mnMaximizedX = maGeometry.nX; +- pState->mnMaximizedY = maGeometry.nY; +- pState->mnMaximizedWidth = maGeometry.nWidth; +- pState->mnMaximizedHeight = maGeometry.nHeight; ++ GetPosAndSize(GTK_WINDOW(m_pWindow), pState->mnMaximizedX, pState->mnMaximizedY, ++ pState->mnMaximizedWidth, pState->mnMaximizedWidth); + pState->mnMask |= WINDOWSTATE_MASK_MAXIMIZED_X | + WINDOWSTATE_MASK_MAXIMIZED_Y | + WINDOWSTATE_MASK_MAXIMIZED_WIDTH | +@@ -1728,10 +1748,8 @@ bool GtkSalFrame::GetWindowState( SalFrameState* pState ) + } + else + { +- pState->mnX = maGeometry.nX; +- pState->mnY = maGeometry.nY; +- pState->mnWidth = maGeometry.nWidth; +- pState->mnHeight = maGeometry.nHeight; ++ GetPosAndSize(GTK_WINDOW(m_pWindow), pState->mnX, pState->mnY, ++ pState->mnWidth, pState->mnHeight); + } + pState->mnMask |= WINDOWSTATE_MASK_X | + WINDOWSTATE_MASK_Y | +@@ -1932,8 +1950,7 @@ void GtkSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen ) + + if( bFullScreen ) + { +- m_aRestorePosSize = Rectangle( Point( maGeometry.nX, maGeometry.nY ), +- Size( maGeometry.nWidth, maGeometry.nHeight ) ); ++ m_aRestorePosSize = GetPosAndSize(GTK_WINDOW(m_pWindow)); + SetScreen( nScreen, SET_FULLSCREEN ); + } + else +@@ -2963,9 +2980,7 @@ gboolean GtkSalFrame::signalWindowState( GtkWidget*, GdkEvent* pEvent, gpointer + if( (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_MAXIMIZED) && + ! (pThis->m_nState & GDK_WINDOW_STATE_MAXIMIZED) ) + { +- pThis->m_aRestorePosSize = +- Rectangle( Point( pThis->maGeometry.nX, pThis->maGeometry.nY ), +- Size( pThis->maGeometry.nWidth, pThis->maGeometry.nHeight ) ); ++ pThis->m_aRestorePosSize = GetPosAndSize(GTK_WINDOW(pThis->m_pWindow)); + } + pThis->m_nState = pEvent->window_state.new_window_state; + +-- +2.5.0 + diff --git a/SOURCES/0001-gtk3-wayland-dialogs-work-a-lot-better-if-a-min-size.patch b/SOURCES/0001-gtk3-wayland-dialogs-work-a-lot-better-if-a-min-size.patch new file mode 100644 index 0000000..ec731c4 --- /dev/null +++ b/SOURCES/0001-gtk3-wayland-dialogs-work-a-lot-better-if-a-min-size.patch @@ -0,0 +1,31 @@ +From f4ac9a55997efbe9c71b7f87ef138e378d95583c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 8 Dec 2015 15:10:45 +0000 +Subject: [PATCH] gtk3+wayland: dialogs work a lot better if a min size is set + +instead of just an initial size, because we can set a size-request for the +minimum size and that's a reliable thing + +Change-Id: I83916715cb9e3dceb6e88f3ca8fc86920677c026 +(cherry picked from commit ebafc4fef20944c9c0ba75fbea064bf285a73735) +--- + vcl/source/window/btndlg.cxx | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx +index bb0f0a3..16a695f 100644 +--- a/vcl/source/window/btndlg.cxx ++++ b/vcl/source/window/btndlg.cxx +@@ -208,7 +208,8 @@ void ButtonDialog::ImplPosControls() + nY += maCtrlSize.Height()+IMPL_SEP_BUTTON_Y; + } + +- SetOutputSizePixel( aDlgSize ); ++ SetOutputSizePixel(aDlgSize); ++ SetMinOutputSizePixel(aDlgSize); + + mbFormat = false; + } +-- +2.5.0 + diff --git a/SOURCES/0001-gtk3-wayland-enable-manual-movement-of-toolbars.patch b/SOURCES/0001-gtk3-wayland-enable-manual-movement-of-toolbars.patch new file mode 100644 index 0000000..0ab0b43 --- /dev/null +++ b/SOURCES/0001-gtk3-wayland-enable-manual-movement-of-toolbars.patch @@ -0,0 +1,149 @@ +From 0f58534c4c3825f569a01774b7f8bb1808b37886 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 15 Dec 2015 14:24:35 +0000 +Subject: [PATCH] gtk3+wayland: enable manual movement of toolbars + +via gtk_window_begin_move_drag so add some BYDRAG/ByDrag hints +to select mechanism to move window by + +Change-Id: Icc58653dff752a6d4ee49446647d7ede2af9dd9b +--- + include/vcl/window.hxx | 3 ++- + vcl/inc/brdwin.hxx | 2 ++ + vcl/inc/salframe.hxx | 1 + + vcl/inc/unx/gtk/gtkframe.hxx | 5 ++++- + vcl/source/window/brdwin.cxx | 7 ++++++- + vcl/source/window/window.cxx | 2 ++ + vcl/unx/gtk3/gtk3gtkframe.cxx | 13 ++++++++++++- + 7 files changed, 29 insertions(+), 4 deletions(-) + +diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx +index ae28940..1f5c0c2 100644 +--- a/include/vcl/window.hxx ++++ b/include/vcl/window.hxx +@@ -161,10 +161,11 @@ enum class PosSizeFlags + PosSize = Pos | Size, + All = PosSize, + Dropdown = 0x0010, ++ ByDrag = 0x0020, + }; + namespace o3tl + { +- template<> struct typed_flags : is_typed_flags {}; ++ template<> struct typed_flags : is_typed_flags {}; + } + + // Flags for Show() +diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx +index d00ca1b..7e89064 100644 +--- a/vcl/inc/brdwin.hxx ++++ b/vcl/inc/brdwin.hxx +@@ -170,6 +170,8 @@ public: + + Rectangle GetMenuRect() const; + ++ void MoveToByDrag(const Point& rNewPos); ++ + virtual Size GetOptimalSize() const SAL_OVERRIDE; + }; + +diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx +index cfd401d..9b3d52e 100644 +--- a/vcl/inc/salframe.hxx ++++ b/vcl/inc/salframe.hxx +@@ -94,6 +94,7 @@ typedef sal_uInt64 SalExtStyle; + #define SAL_FRAME_POSSIZE_Y ((sal_uInt16)0x0002) + #define SAL_FRAME_POSSIZE_WIDTH ((sal_uInt16)0x0004) + #define SAL_FRAME_POSSIZE_HEIGHT ((sal_uInt16)0x0008) ++#define SAL_FRAME_POSSIZE_BYDRAG ((sal_uInt16)0x0010) + + struct SystemParentData; + +diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx +index b779d39..a55ff2c 100644 +--- a/vcl/inc/unx/gtk/gtkframe.hxx ++++ b/vcl/inc/unx/gtk/gtkframe.hxx +@@ -316,7 +316,10 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + void widget_set_size_request(long nWidth, long nHeight); + + void resizeWindow( long nWidth, long nHeight ); +- void moveWindow( long nX, long nY ); ++ void moveWindow(long nX, long nY); ++#if GTK_CHECK_VERSION(3,0,0) ++ void dragWindowTo(long nX, long nY); ++#endif + + Size calcDefaultSize(); + +diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx +index 97dbc5b..f57ab37 100644 +--- a/vcl/source/window/brdwin.cxx ++++ b/vcl/source/window/brdwin.cxx +@@ -1243,7 +1243,7 @@ bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) + aPos.Y() += aMousePos.Y(); + if ( maFrameData.mbDragFull ) + { +- pBorderWindow->SetPosPixel( aPos ); ++ pBorderWindow->MoveToByDrag(aPos); + pBorderWindow->ImplUpdateAll(); + pBorderWindow->ImplGetFrameWindow()->ImplUpdateAll(); + } +@@ -2195,6 +2195,11 @@ Rectangle ImplBorderWindow::GetMenuRect() const + return mpBorderView->GetMenuRect(); + } + ++void ImplBorderWindow::MoveToByDrag(const Point& rNewPos) ++{ ++ setPosSizePixel(rNewPos.X(), rNewPos.Y(), 0, 0, PosSizeFlags::Pos | PosSizeFlags::ByDrag); ++} ++ + Size ImplBorderWindow::GetOptimalSize() const + { + const vcl::Window* pClientWindow = ImplGetClientWindow(); +diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx +index 20377ac..808d683 100644 +--- a/vcl/source/window/window.cxx ++++ b/vcl/source/window/window.cxx +@@ -2886,6 +2886,8 @@ void Window::setPosSizePixel( long nX, long nY, + nSysFlags |= SAL_FRAME_POSSIZE_WIDTH; + if( nFlags & PosSizeFlags::Height ) + nSysFlags |= SAL_FRAME_POSSIZE_HEIGHT; ++ if( nFlags & PosSizeFlags::ByDrag ) ++ nSysFlags |= SAL_FRAME_POSSIZE_BYDRAG; + if( nFlags & PosSizeFlags::X ) + { + nSysFlags |= SAL_FRAME_POSSIZE_X; +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index 7c24d2b..6a69c82 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -878,6 +878,14 @@ void GtkSalFrame::moveWindow( long nX, long nY ) + gtk_window_move( GTK_WINDOW(m_pWindow), nX, nY ); + } + ++void GtkSalFrame::dragWindowTo(long nX, long nY) ++{ ++ if (isChild(false)) ++ moveWindow(nX, nY); ++ else ++ gtk_window_begin_move_drag(GTK_WINDOW(m_pWindow), 1, nX, nY, GDK_CURRENT_TIME); ++} ++ + void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) + { + gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight ); +@@ -1717,7 +1725,10 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u + + m_bDefaultPos = false; + +- moveWindow(nX, nY); ++ if (nFlags & SAL_FRAME_POSSIZE_BYDRAG) ++ dragWindowTo(nX, nY); ++ else ++ moveWindow(nX, nY); + + updateScreenNumber(); + } +-- +2.5.0 + diff --git a/SOURCES/0001-gtk3-wayland-wrong-dialog-sizes.patch b/SOURCES/0001-gtk3-wayland-wrong-dialog-sizes.patch new file mode 100644 index 0000000..3db37e4 --- /dev/null +++ b/SOURCES/0001-gtk3-wayland-wrong-dialog-sizes.patch @@ -0,0 +1,56 @@ +From 88f9c7f53ad1abc49d8ed4cfc46081d767b0c065 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Dec 2015 13:27:21 +0000 +Subject: [PATCH] gtk3+wayland: wrong dialog sizes + +use inner container, not outer toxic toplevel + +Change-Id: I44f2fe1e8e346e51e65158f7864293ef37732345 +--- + vcl/unx/gtk/window/gtksalframe.cxx | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx +index dd03073..99624e0 100644 +--- a/vcl/unx/gtk/window/gtksalframe.cxx ++++ b/vcl/unx/gtk/window/gtksalframe.cxx +@@ -950,22 +950,24 @@ void GtkSalFrame::moveWindow( long nX, long nY ) + + void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) + { ++#if !GTK_CHECK_VERSION(3,0,0) + gint nOrigwidth, nOrigheight; + gtk_window_get_size(GTK_WINDOW(m_pWindow), &nOrigwidth, &nOrigheight); +-#if !GTK_CHECK_VERSION(3,0,0) + if (nWidth > nOrigwidth || nHeight > nOrigheight) + { + m_bPaintsBlocked = true; + } +-#endif + gtk_widget_set_size_request(m_pWindow, nWidth, nHeight ); ++#else ++ gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight ); ++#endif + } + + void GtkSalFrame::window_resize(long nWidth, long nHeight) + { ++#if !GTK_CHECK_VERSION(3,0,0) + gint nOrigwidth, nOrigheight; + gtk_window_get_size(GTK_WINDOW(m_pWindow), &nOrigwidth, &nOrigheight); +-#if !GTK_CHECK_VERSION(3,0,0) + if (nWidth > nOrigwidth || nHeight > nOrigheight) + { + m_bPaintsBlocked = true; +@@ -1087,7 +1089,7 @@ void GtkSalFrame::InitCommon() + m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-release-event", G_CALLBACK(signalButton), this )); + #if GTK_CHECK_VERSION(3,0,0) + g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "size-allocate", G_CALLBACK(sizeAllocated), this ); ++ g_signal_connect( G_OBJECT(m_pFixedContainer), "size-allocate", G_CALLBACK(sizeAllocated), this ); + // g_signal_connect( G_OBJECT(m_pWindow), "state-flags-changed", G_CALLBACK(signalFlagsChanged), this ); + #if GTK_CHECK_VERSION(3,14,0) + GtkGesture *pSwipe = gtk_gesture_swipe_new(pEventWidget); +-- +2.5.0 + diff --git a/SOURCES/0001-have-a-stab-at-improving-impossible-question.patch b/SOURCES/0001-have-a-stab-at-improving-impossible-question.patch deleted file mode 100644 index 495923b..0000000 --- a/SOURCES/0001-have-a-stab-at-improving-impossible-question.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 204dc59286857174306615dad4b4a0bd8d0cfe82 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 11 Nov 2014 14:10:04 +0000 -Subject: [PATCH] have a stab at improving impossible question - -as to whether you want to "adapt" objects or not - -Change-Id: Ic4c00be480d1be632d84dfac71fe911d48eacc51 ---- - sd/source/ui/app/strings.src | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src -index 2b363f6..06b0fcf 100644 ---- a/sd/source/ui/app/strings.src -+++ b/sd/source/ui/app/strings.src -@@ -397,7 +397,7 @@ String STR_READ_DATA_ERROR - }; - String STR_SCALE_OBJECTS - { -- Text [ en-US ] = "The format of the new pages will be adapted.\nDo you want to adapt the objects, too?" ; -+ Text [ en-US ] = "The page size of the target document is different than the source document.\n\nDo you want to scale the copied objects to fit the new page size?" ; - }; - String STR_CREATE_PAGES - { --- -1.9.3 - diff --git a/SOURCES/0001-if-_CALL_ELF-if-defined-_CALL_ELF-_CALL_ELF-2.patch b/SOURCES/0001-if-_CALL_ELF-if-defined-_CALL_ELF-_CALL_ELF-2.patch deleted file mode 100644 index b13277c..0000000 --- a/SOURCES/0001-if-_CALL_ELF-if-defined-_CALL_ELF-_CALL_ELF-2.patch +++ /dev/null @@ -1,103 +0,0 @@ -From af73a28e8538f5b2df6bbfd592d8987511520d4d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 22 Aug 2014 21:08:47 +0100 -Subject: [PATCH] if _CALL_ELF -> if defined(_CALL_ELF) && _CALL_ELF == 2 - -Change-Id: I34e9a98586b795a3fa31ae775aee7898b36e65d4 ---- - bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx | 10 +++++----- - bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx | 8 ++++---- - 2 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx -index 35cc16f..430999f 100644 ---- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx -+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx -@@ -326,7 +326,7 @@ static typelib_TypeClass cpp2uno_call( - } - } - --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - # define PARAMSAVE 32 - #else - # define PARAMSAVE 48 -@@ -545,7 +545,7 @@ extern "C" void privateSnippetExecutor( ... ) - "mr %0, 1\n\t" - : "=r" (sp) : ); - --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - volatile long nRegReturn[2]; - #else - volatile long nRegReturn[1]; -@@ -592,7 +592,7 @@ extern "C" void privateSnippetExecutor( ... ) - default: - __asm__( "ld 3,%0\n\t" - : : "m" (nRegReturn[0]) ); --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - __asm__( "ld 4,%0\n\t" - : : "m" (nRegReturn[1]) ); - #endif -@@ -600,7 +600,7 @@ extern "C" void privateSnippetExecutor( ... ) - } - } - --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - const int codeSnippetSize = 32; - #else - const int codeSnippetSize = 24; -@@ -618,7 +618,7 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sa - - if ( bHasHiddenParam ) - nOffsetAndIndex |= 0x80000000; --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - unsigned int *raw = (unsigned int *)&code[0]; - - raw[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */ -diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -index 391ef219..cfe720d 100644 ---- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -@@ -39,7 +39,7 @@ using namespace ::com::sun::star::uno; - - namespace ppc64 - { --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - bool is_complex_struct(const typelib_TypeDescription * type) - { - const typelib_CompoundTypeDescription * p -@@ -70,7 +70,7 @@ namespace ppc64 - { - if (bridges::cpp_uno::shared::isSimpleType(pTypeRef)) - return false; --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION) - { - typelib_TypeDescription * pTypeDescr = 0; -@@ -115,7 +115,7 @@ void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* - case typelib_TypeClass_DOUBLE: - *reinterpret_cast( pRegisterReturn ) = dret; - break; --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - case typelib_TypeClass_STRUCT: - case typelib_TypeClass_EXCEPTION: - if (!ppc64::return_in_hidden_param(pReturnType)) -@@ -175,7 +175,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, - pMethod += 8 * nVtableIndex; - pMethod = *((sal_uInt64 *)pMethod); - --#if _CALL_ELF == 2 -+#if defined(_CALL_ELF) && _CALL_ELF == 2 - typedef void (* FunctionCall )(...); - #else - typedef void (* FunctionCall )( sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64 ); --- -1.9.3 - diff --git a/SOURCES/0001-if-we-change-the-keys-we-have-to-resort-based-on-the.patch b/SOURCES/0001-if-we-change-the-keys-we-have-to-resort-based-on-the.patch deleted file mode 100644 index 8261ecf..0000000 --- a/SOURCES/0001-if-we-change-the-keys-we-have-to-resort-based-on-the.patch +++ /dev/null @@ -1,86 +0,0 @@ -From dcc2e18191652bdffb7b4a2e4ee536c24635a4fb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 19 Jan 2015 12:09:17 +0000 -Subject: [PATCH] if we change the keys we have to resort based on the new keys - -Change-Id: Ied95c2d1490554d9ba5402c936a9720c8a325771 ---- - sw/source/core/doc/docredln.cxx | 26 ++++++++++++++++++++++---- - 1 file changed, 22 insertions(+), 4 deletions(-) - -diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx -index cb1520a..8d3d704 100644 ---- a/sw/source/core/doc/docredln.cxx -+++ b/sw/source/core/doc/docredln.cxx -@@ -3820,6 +3820,8 @@ void SwRangeRedline::MoveFromSection() - SwDoc* pDoc = GetDoc(); - const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl(); - std::vector aBeforeArr, aBehindArr; -+ typedef std::map IndexAndRange; -+ IndexAndRange aIndexAndRangeMap; - sal_uInt16 nMyPos = rTbl.GetPos( this ); - OSL_ENSURE( this, "this is not in the array?" ); - bool bBreak = false; -@@ -3830,12 +3832,16 @@ void SwRangeRedline::MoveFromSection() - bBreak = true; - if( rTbl[ n ]->GetBound(true) == *GetPoint() ) - { -- aBehindArr.push_back( &rTbl[ n ]->GetBound(true) ); -+ SwRangeRedline* pRedl = rTbl[n]; -+ aBehindArr.push_back(&pRedl->GetBound(true)); -+ aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); - bBreak = false; - } - if( rTbl[ n ]->GetBound(false) == *GetPoint() ) - { -- aBehindArr.push_back( &rTbl[ n ]->GetBound(false) ); -+ SwRangeRedline* pRedl = rTbl[n]; -+ aBehindArr.push_back(&pRedl->GetBound(false)); -+ aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); - bBreak = false; - } - } -@@ -3845,12 +3851,16 @@ void SwRangeRedline::MoveFromSection() - bBreak = true; - if( rTbl[ n ]->GetBound(true) == *GetPoint() ) - { -- aBeforeArr.push_back( &rTbl[ n ]->GetBound(true) ); -+ SwRangeRedline* pRedl = rTbl[n]; -+ aBeforeArr.push_back(&pRedl->GetBound(true)); -+ aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); - bBreak = false; - } - if( rTbl[ n ]->GetBound(false) == *GetPoint() ) - { -- aBeforeArr.push_back( &rTbl[ n ]->GetBound(false) ); -+ SwRangeRedline* pRedl = rTbl[n]; -+ aBeforeArr.push_back(&pRedl->GetBound(false)); -+ aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); - bBreak = false; - } - } -@@ -3904,6 +3914,7 @@ void SwRangeRedline::MoveFromSection() - if( pColl && pCNd ) - pCNd->ChgFmtColl( pColl ); - } -+ - // #i95771# - // Under certain conditions the previous has already - // removed the change tracking section of this instance from -@@ -3924,6 +3935,13 @@ void SwRangeRedline::MoveFromSection() - *aBeforeArr[ n ] = *Start(); - for( n = 0; n < aBehindArr.size(); ++n ) - *aBehindArr[ n ] = *End(); -+ SwRedlineTbl& rResortTbl = const_cast(rTbl); -+ for (auto& a : aIndexAndRangeMap) -+ { -+ // re-insert -+ rResortTbl.Remove(a.first); -+ rResortTbl.Insert(a.second); -+ } - } - else - InvalidateRange(); --- -1.9.3 - diff --git a/SOURCES/0001-implement-dialog-control-over-enhanced-shape-control.patch b/SOURCES/0001-implement-dialog-control-over-enhanced-shape-control.patch new file mode 100644 index 0000000..b71c7b3 --- /dev/null +++ b/SOURCES/0001-implement-dialog-control-over-enhanced-shape-control.patch @@ -0,0 +1,663 @@ +From e9680d99c4403bd07ab4d50939a5d7791bceb98c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 13 Oct 2015 13:16:31 +0100 +Subject: [PATCH] implement dialog control over enhanced shape control points + +use case is a desire to enable viewing and setting rounded rectangle radiuses +to an exact known value + +Change-Id: I7e6a4db0699076950adf5869a61825159766c46a +(cherry picked from commit b859d84e471fdb70b61607d2d919a7907d074bd0) +--- + cui/source/inc/transfrm.hxx | 6 + + cui/source/tabpages/transfrm.cxx | 137 ++++++++++++++- + cui/uiconfig/ui/slantcornertabpage.ui | 310 ++++++++++++++++++++++++++++++---- + include/svx/EnhancedCustomShape2d.hxx | 1 + + 4 files changed, 416 insertions(+), 38 deletions(-) + +diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx +index 2945d28..2fe2524 100644 +--- a/cui/source/inc/transfrm.hxx ++++ b/cui/source/inc/transfrm.hxx +@@ -239,6 +239,12 @@ private: + VclPtr m_pFlAngle; + VclPtr m_pMtrAngle; + ++ VclPtr m_aControlGroups[2]; ++ VclPtr m_aControlGroupX[2]; ++ VclPtr m_aControlX[2]; ++ VclPtr m_aControlGroupY[2]; ++ VclPtr m_aControlY[2]; ++ + const SfxItemSet& rOutAttrs; + + const SdrView* pView; +diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx +index 950a4b2..43375c2 100644 +--- a/cui/source/tabpages/transfrm.cxx ++++ b/cui/source/tabpages/transfrm.cxx +@@ -18,6 +18,8 @@ + */ + + #include ++#include ++#include + #include + #include + #include +@@ -430,6 +432,15 @@ SvxSlantTabPage::SvxSlantTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr + get(m_pFlAngle, "FL_SLANT"); + get(m_pMtrAngle, "MTR_FLD_ANGLE"); + ++ for (int i = 0; i < 2; ++i) ++ { ++ get(m_aControlGroups[i], "controlgroups" + OString::number(i+1)); ++ get(m_aControlGroupX[i], "controlgroupx" + OString::number(i+1)); ++ get(m_aControlX[i], "controlx" + OString::number(i+1)); ++ get(m_aControlGroupY[i], "controlgroupy" + OString::number(i+1)); ++ get(m_aControlY[i], "controly" + OString::number(i+1)); ++ } ++ + // this page needs ExchangeSupport + SetExchangeSupport(); + +@@ -450,6 +461,14 @@ void SvxSlantTabPage::dispose() + m_pMtrRadius.clear(); + m_pFlAngle.clear(); + m_pMtrAngle.clear(); ++ for (int i = 0; i < 2; ++i) ++ { ++ m_aControlGroups[i].clear(); ++ m_aControlGroupX[i].clear(); ++ m_aControlX[i].clear(); ++ m_aControlGroupY[i].clear(); ++ m_aControlY[i].clear(); ++ } + SvxTabPage::dispose(); + } + +@@ -506,10 +525,56 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs) + rAttrs->Put( SfxBoolItem( SID_ATTR_TRANSFORM_SHEAR_VERTICAL, false ) ); + } + +- return bModified; +-} ++ bool bControlPointsChanged = false; ++ for (int i = 0; i < 2; ++i) ++ { ++ bControlPointsChanged |= (m_aControlX[i]->IsValueChangedFromSaved() || ++ m_aControlY[i]->IsValueChangedFromSaved()); ++ } ++ ++ if (!bControlPointsChanged) ++ return bModified; ++ ++ SdrObject* pObj = pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); ++ SdrModel* pModel = pObj->GetModel(); ++ SdrUndoAction* pUndo = pModel->IsUndoEnabled() ? ++ pModel->GetSdrUndoFactory().CreateUndoAttrObject(*pObj) : ++ nullptr; + ++ if (pUndo) ++ pModel->BegUndo(pUndo->GetComment()); ++ ++ EnhancedCustomShape2d aShape(pObj); ++ Rectangle aLogicRect = aShape.GetLogicRect(); ++ ++ for (int i = 0; i < 2; ++i) ++ { ++ if (m_aControlX[i]->IsValueChangedFromSaved() || m_aControlY[i]->IsValueChangedFromSaved()) ++ { ++ Point aNewPosition(GetCoreValue(*m_aControlX[i], ePoolUnit), ++ GetCoreValue(*m_aControlY[i], ePoolUnit)); ++ aNewPosition.Move(aLogicRect.Left(), aLogicRect.Top()); ++ ++ css::awt::Point aPosition; ++ aPosition.X = aNewPosition.X(); ++ aPosition.Y = aNewPosition.Y(); ++ ++ aShape.SetHandleControllerPosition(i, aPosition); ++ } ++ } ++ ++ pObj->SetChanged(); ++ pObj->BroadcastObjectChange(); ++ bModified = true; ++ ++ if (pUndo) ++ { ++ pModel->AddUndo(pUndo); ++ pModel->EndUndo(); ++ } + ++ return bModified; ++} + + void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) + { +@@ -561,17 +626,76 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) + } + + m_pMtrAngle->SaveValue(); +-} +- + ++ const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); ++ if (rMarkList.GetMarkCount() == 1) ++ { ++ SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); ++ SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier(); ++ if (eKind == OBJ_CUSTOMSHAPE) ++ { ++ EnhancedCustomShape2d aShape(pObj); ++ Point aInitialPosition; ++ for (int i = 0; i < 2; ++i) ++ { ++ if (!aShape.GetHandlePosition(i, aInitialPosition)) ++ break; ++ m_aControlGroups[i]->Enable(); ++ css::awt::Point aPosition; ++ ++ aPosition.X = SAL_MAX_INT32; ++ aPosition.Y = SAL_MAX_INT32; ++ aShape.SetHandleControllerPosition(i, aPosition); ++ Point aMaxPosition; ++ aShape.GetHandlePosition(i, aMaxPosition); ++ ++ aPosition.X = SAL_MIN_INT32; ++ aPosition.Y = SAL_MIN_INT32; ++ aShape.SetHandleControllerPosition(i, aPosition); ++ Point aMinPosition; ++ aShape.GetHandlePosition(i, aMinPosition); ++ ++ Rectangle aLogicRect = aShape.GetLogicRect(); ++ aMaxPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); ++ aMinPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); ++ ++ aPosition.X = aInitialPosition.X(); ++ aPosition.Y = aInitialPosition.Y(); ++ aInitialPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); ++ aShape.SetHandleControllerPosition(i, aPosition); ++ ++ SetMetricValue(*m_aControlX[i], aInitialPosition.X(), ePoolUnit); ++ SetMetricValue(*m_aControlY[i], aInitialPosition.Y(), ePoolUnit); ++ ++ if (aMaxPosition.X() == aMinPosition.X()) ++ m_aControlGroupX[i]->Disable(); ++ else ++ { ++ m_aControlX[i]->SetMin(aMinPosition.X(), FUNIT_MM); ++ m_aControlX[i]->SetMax(aMaxPosition.X(), FUNIT_MM); ++ } ++ if (aMaxPosition.Y() == aMinPosition.Y()) ++ m_aControlGroupY[i]->Disable(); ++ else ++ { ++ m_aControlY[i]->SetMin(aMinPosition.Y(), FUNIT_MM); ++ m_aControlY[i]->SetMax(aMaxPosition.Y(), FUNIT_MM); ++ } ++ } ++ } ++ } ++ for (int i = 0; i < 2; ++i) ++ { ++ m_aControlX[i]->SaveValue(); ++ m_aControlY[i]->SaveValue(); ++ } ++} + + VclPtr SvxSlantTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs ) + { + return VclPtr::Create( pWindow, *rOutAttrs ); + } + +- +- + void SvxSlantTabPage::ActivatePage( const SfxItemSet& rSet ) + { + SfxRectangleItem const * pRectItem = NULL; +@@ -620,7 +744,6 @@ SvxPositionSizeTabPage::SvxPositionSizeTabPage(vcl::Window* pParent, const SfxIt + , mfOldWidth(0.0) + , mfOldHeight(0.0) + { +- + get(m_pFlPosition, "FL_POSITION"); + get(m_pMtrPosX, "MTR_FLD_POS_X"); + get(m_pMtrPosY, "MTR_FLD_POS_Y"); +diff --git a/cui/uiconfig/ui/slantcornertabpage.ui b/cui/uiconfig/ui/slantcornertabpage.ui +index 37b7b0e..b3ce646 100644 +--- a/cui/uiconfig/ui/slantcornertabpage.ui ++++ b/cui/uiconfig/ui/slantcornertabpage.ui +@@ -13,12 +13,132 @@ + 1 + 10 +

+- ++ + True + False + 6 +- vertical +- 12 ++ 24 ++ 12 ++ ++ ++ True ++ False ++ False ++ 0 ++ none ++ ++ ++ True ++ False ++ 6 ++ 12 ++ ++ ++ True ++ False ++ 12 ++ 6 ++ ++ ++ True ++ False ++ 12 ++ ++ ++ True ++ False ++ _X: ++ True ++ controlx1:0.00cm ++ 0 ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ True ++ ++ 0.00 ++ 2 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ 0 ++ 0 ++ ++ ++ ++ ++ True ++ False ++ 12 ++ ++ ++ True ++ False ++ _Y: ++ True ++ controly1:0.00cm ++ 0 ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ True ++ ++ 0.00 ++ 2 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ 0 ++ 1 ++ ++ ++ ++ ++ ++ ++ ++ ++ True ++ False ++ Control Point 1 ++ 0 ++ ++ ++ ++ ++ ++ ++ ++ 0 ++ 1 ++ ++ + + + True +@@ -32,37 +152,36 @@ + 6 + 12 + +- ++ + True + False +- 12 ++ 12 + + + True + False +- 0 + _Radius: + True + MTR_FLD_RADIUS:0.00cm ++ 0 + + +- False +- True +- 0 ++ 0 ++ 0 + + + + + True +- False ++ True + ++ 0.00 + adjustmentRADIUS + 2 + + +- False +- True +- 1 ++ 1 ++ 0 + + + +@@ -73,8 +192,8 @@ + + True + False +- 0 + Corner Radius ++ 0 + + + +@@ -82,9 +201,8 @@ + + + +- False +- True +- 0 ++ 0 ++ 0 + + + +@@ -100,37 +218,36 @@ + 6 + 12 + +- ++ + True + False +- 12 ++ 12 + + + True + False +- 0 + _Angle: + True + MTR_FLD_ANGLE:0.00degrees ++ 0 + + +- False +- True +- 0 ++ 0 ++ 0 + + + + + True +- False ++ True + ++ 0.00 + adjustmentSLANT + 2 + + +- False +- True +- 1 ++ 1 ++ 0 + + + +@@ -141,8 +258,128 @@ + + True + False +- 0 + Slant ++ 0 ++ ++ ++ ++ ++ ++ ++ ++ 1 ++ 0 ++ ++ ++ ++ ++ True ++ False ++ False ++ 0 ++ none ++ ++ ++ True ++ False ++ 6 ++ 12 ++ ++ ++ True ++ False ++ 12 ++ 6 ++ ++ ++ True ++ False ++ 12 ++ ++ ++ True ++ False ++ _X: ++ True ++ controlx2:0.00cm ++ 0 ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ True ++ ++ 0.00 ++ 2 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ 0 ++ 0 ++ ++ ++ ++ ++ True ++ False ++ 12 ++ ++ ++ True ++ False ++ _Y: ++ True ++ controly2:0.00cm ++ 0 ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ True ++ ++ 0.00 ++ 2 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ 0 ++ 1 ++ ++ ++ ++ ++ ++ ++ ++ ++ True ++ False ++ Control Point 2 ++ 0 + + + +@@ -150,16 +387,19 @@ + + + +- False +- True +- 1 ++ 1 ++ 1 + + + + + ++ ++ + + ++ ++ + + + +@@ -168,4 +408,12 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ + +diff --git a/include/svx/EnhancedCustomShape2d.hxx b/include/svx/EnhancedCustomShape2d.hxx +index b9ed6f2..b1cc1b7 100644 +--- a/include/svx/EnhancedCustomShape2d.hxx ++++ b/include/svx/EnhancedCustomShape2d.hxx +@@ -191,6 +191,7 @@ class SVX_DLLPUBLIC EnhancedCustomShape2d : public SfxItemSet + SdrObject* CreateObject( bool bLineGeometryNeededOnly ); + void ApplyGluePoints( SdrObject* pObj ); + Rectangle GetTextRect() const; ++ Rectangle GetLogicRect() const { return aLogicRect; } + + sal_uInt32 GetHdlCount() const; + bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const; +-- +2.4.3 + diff --git a/SOURCES/0001-implement-equalize-width-and-height-for-impress-draw.patch b/SOURCES/0001-implement-equalize-width-and-height-for-impress-draw.patch new file mode 100644 index 0000000..ac1c0fc --- /dev/null +++ b/SOURCES/0001-implement-equalize-width-and-height-for-impress-draw.patch @@ -0,0 +1,370 @@ +From bdd33fda337d37431e6bffb99fb90416884981c9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 25 Jun 2015 10:33:06 +0100 +Subject: [PATCH] implement equalize width and height for impress/draw + +Equalize width/height adjusts width/height of selected objects to the +width/height of the last selected object. + +Change-Id: I7c222a6591112cb674322d310ebd87f04a9198bd +--- + include/svx/svdedtv.hxx | 5 +++ + include/svx/svdstr.hrc | 4 +- + include/svx/svxids.hrc | 2 + + .../org/openoffice/Office/UI/GenericCommands.xcu | 10 +++++ + sd/sdi/_drvwsh.sdi | 10 +++++ + sd/source/ui/view/drviews2.cxx | 13 ++++++ + sd/source/ui/view/drviewsj.cxx | 16 ++++++-- + sd/uiconfig/sdraw/menubar/menubar.xml | 3 ++ + svx/inc/globlmn_tmpl.hrc | 20 +++++++++ + svx/sdi/svx.sdi | 47 ++++++++++++++++++++++ + svx/source/svdraw/svdedtv2.cxx | 38 +++++++++++++++++ + svx/source/svdraw/svdstr.src | 8 ++++ + 12 files changed, 171 insertions(+), 5 deletions(-) + +diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx +index cdc2308..b109e0c 100644 +--- a/include/svx/svdedtv.hxx ++++ b/include/svx/svdedtv.hxx +@@ -272,6 +272,11 @@ public: + // for distribution dialog function + void DistributeMarkedObjects(); + ++ // for setting either the width or height of all selected ++ // objects to the width/height of the last selected object ++ // of the selection ++ void EqualizeMarkedObjects(bool bWidth); ++ + // Decompose marked polypolygon objects into polygons. + // Grouped objects are searched and decomposed, if all member objects are PathObjs. + // bMakeLines=TRUE: all polygones are decomposed into single lines resp. bezier segments +diff --git a/include/svx/svdstr.hrc b/include/svx/svdstr.hrc +index 90ef697..36e8719 100644 +--- a/include/svx/svdstr.hrc ++++ b/include/svx/svdstr.hrc +@@ -241,7 +241,9 @@ + #define STR_EditMergeSubstractPoly (STR_EditBegin + 55) + #define STR_EditMergeIntersectPoly (STR_EditBegin + 56) + #define STR_DistributeMarkedObjects (STR_EditBegin + 57) +-#define STR_EditEnd (STR_DistributeMarkedObjects) ++#define STR_EqualizeWidthMarkedObjects (STR_EditBegin + 58) ++#define STR_EqualizeHeightMarkedObjects (STR_EditBegin + 59) ++#define STR_EditEnd (STR_EqualizeHeightMarkedObjects) + + #define STR_ExchangeBegin (STR_EditEnd+1) + #define STR_ExchangePaste (STR_ExchangeBegin +0) +diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc +index 5b8efbc..67ee3da 100644 +--- a/include/svx/svxids.hrc ++++ b/include/svx/svxids.hrc +@@ -113,6 +113,8 @@ + #define SID_POLY_INTERSECT (SID_SFX_START + 681) + #define SID_POLY_FORMEN (SID_SFX_START + 682) + #define SID_DISTRIBUTE_DLG (SID_SFX_START + 683) ++#define SID_EQUALIZEWIDTH (SID_SFX_START + 684) ++#define SID_EQUALIZEHEIGHT (SID_SFX_START + 685) + + // Basic IDE-Id's + +diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +index 1c679bd..d221d56 100644 +--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu ++++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +@@ -3472,6 +3472,16 @@ + ~Subtract + + ++ ++ ++ Equalize ~Width ++ ++ ++ ++ ++ Equalize ~Height ++ ++ + + + Superscript +diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi +index 0b5469bf..6b2f17c 100644 +--- a/sd/sdi/_drvwsh.sdi ++++ b/sd/sdi/_drvwsh.sdi +@@ -507,6 +507,16 @@ interface DrawView + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] ++ SID_EQUALIZEWIDTH // ole : no, status : ? ++ [ ++ ExecMethod = FuTemporary ; ++ StateMethod = GetMenuState ; ++ ] ++ SID_EQUALIZEHEIGHT // ole : no, status : ? ++ [ ++ ExecMethod = FuTemporary ; ++ StateMethod = GetMenuState ; ++ ] + SID_CONNECT // ole : no, status : ? + [ + ExecMethod = FuTemporary ; +diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx +index ffbb503..90c3d59 100644 +--- a/sd/source/ui/view/drviews2.cxx ++++ b/sd/source/ui/view/drviews2.cxx +@@ -2272,6 +2272,19 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) + } + break; + ++ case SID_EQUALIZEWIDTH: ++ case SID_EQUALIZEHEIGHT: ++ { ++ // End text edit to avoid conflicts ++ if(mpDrawView->IsTextEdit()) ++ mpDrawView->SdrEndTextEdit(); ++ ++ mpDrawView->EqualizeMarkedObjects(nSId == SID_EQUALIZEWIDTH); ++ Cancel(); ++ rReq.Done (); ++ } ++ break; ++ + case SID_DISMANTLE: // BASIC + { + if ( mpDrawView->IsDismantlePossible(false) ) +diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx +index 857601f..10a3f5a 100644 +--- a/sd/source/ui/view/drviewsj.cxx ++++ b/sd/source/ui/view/drviewsj.cxx +@@ -284,13 +284,15 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) + rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet)); + } + +- rSet.DisableItem( SID_GROUP ); +- rSet.DisableItem( SID_COMBINE ); ++ rSet.DisableItem(SID_GROUP); ++ rSet.DisableItem(SID_COMBINE); + rSet.DisableItem(SID_DISTRIBUTE_DLG); + rSet.DisableItem(SID_POLY_MERGE); + rSet.DisableItem(SID_POLY_SUBSTRACT); + rSet.DisableItem(SID_POLY_INTERSECT); +- rSet.DisableItem( SID_CONNECT ); ++ rSet.DisableItem(SID_EQUALIZEWIDTH); ++ rSet.DisableItem(SID_EQUALIZEHEIGHT); ++ rSet.DisableItem(SID_CONNECT); + } + // multi-selection + else if( nMarkCount > 1 ) +@@ -377,6 +379,8 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) + rSet.DisableItem(SID_POLY_MERGE); + rSet.DisableItem(SID_POLY_SUBSTRACT); + rSet.DisableItem(SID_POLY_INTERSECT); ++ rSet.DisableItem(SID_EQUALIZEWIDTH); ++ rSet.DisableItem(SID_EQUALIZEHEIGHT); + } + + if (b3dObj || +@@ -438,10 +442,12 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) + } + if ( !mpDrawView->IsCombinePossible(false) ) + { +- rSet.DisableItem( SID_COMBINE ); ++ rSet.DisableItem(SID_COMBINE); + rSet.DisableItem(SID_POLY_MERGE); + rSet.DisableItem(SID_POLY_SUBSTRACT); + rSet.DisableItem(SID_POLY_INTERSECT); ++ rSet.DisableItem(SID_EQUALIZEWIDTH); ++ rSet.DisableItem(SID_EQUALIZEHEIGHT); + } + if ( !mpDrawView->IsCombinePossible(true) ) + { +@@ -501,6 +507,8 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) + rSet.DisableItem(SID_POLY_MERGE); + rSet.DisableItem(SID_POLY_SUBSTRACT); + rSet.DisableItem(SID_POLY_INTERSECT); ++ rSet.DisableItem(SID_EQUALIZEWIDTH); ++ rSet.DisableItem(SID_EQUALIZEHEIGHT); + rSet.DisableItem( SID_CONNECT ); + rSet.DisableItem( SID_ANIMATION_EFFECTS ); + rSet.DisableItem( SID_MODIFY_FIELD ); +diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml +index f12287b..bc8cfee 100644 +--- a/sd/uiconfig/sdraw/menubar/menubar.xml ++++ b/sd/uiconfig/sdraw/menubar/menubar.xml +@@ -346,6 +346,9 @@ + + + ++ ++ ++ + + + +diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc +index 9d511c8..8d82489 100644 +--- a/svx/inc/globlmn_tmpl.hrc ++++ b/svx/inc/globlmn_tmpl.hrc +@@ -306,6 +306,20 @@ + Command = ".uno:Intersect" ; \ + Text [ en-US ] = "I~ntersect" ; \ + }; ++#define ITEM_EQUALIZEWIDTH \ ++ MenuItem\ ++ {\ ++ Identifier = SID_EQUALIZEWIDTH ; \ ++ Command = ".uno:EqualizeWidth" ; \ ++ Text [ en-US ] = "Equalize ~Width" ; \ ++ }; ++#define ITEM_EQUALIZEHEIGHT \ ++ MenuItem\ ++ {\ ++ Identifier = SID_EQUALIZEHEIGHT ; \ ++ Command = ".uno:EqualizeHeight" ; \ ++ Text [ en-US ] = "Equalize ~Height" ; \ ++ }; + + #define MNSUB_FORMEN \ + MenuItem \ +@@ -320,6 +334,12 @@ + ITEM_POLY_MERGE \ + ITEM_POLY_SUBSTRACT \ + ITEM_POLY_INTERSECT \ ++ MenuItem \ ++ { \ ++ Separator = TRUE; \ ++ }; \ ++ ITEM_EQUALIZEWIDTH \ ++ ITEM_EQUALIZEHEIGHT \ + };\ + };\ + }; +diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi +index 941f3e8..b301c58 100644 +--- a/svx/sdi/svx.sdi ++++ b/svx/sdi/svx.sdi +@@ -11100,6 +11100,53 @@ SfxVoidItem Substract SID_POLY_SUBSTRACT + GroupId = GID_MODIFY; + ] + ++SfxVoidItem EqualizeWidth SID_EQUALIZEWIDTH ++() ++[ ++ /* flags: */ ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = FALSE, ++ ReadOnlyDoc = FALSE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ /* config: */ ++ AccelConfig = TRUE, ++ MenuConfig = TRUE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = TRUE, ++ GroupId = GID_MODIFY; ++] ++ ++SfxVoidItem EqualizeHeight SID_EQUALIZEHEIGHT ++() ++[ ++ /* flags: */ ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = FALSE, ++ ReadOnlyDoc = FALSE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ /* config: */ ++ AccelConfig = TRUE, ++ MenuConfig = TRUE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = TRUE, ++ GroupId = GID_MODIFY; ++] + + SfxBoolItem SuperScript SID_SET_SUPER_SCRIPT + +diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx +index 0a60082..ad7dd3f 100644 +--- a/svx/source/svdraw/svdedtv2.cxx ++++ b/svx/source/svdraw/svdedtv2.cxx +@@ -1173,6 +1173,44 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode) + } + } + ++void SdrEditView::EqualizeMarkedObjects(bool bWidth) ++{ ++ const SdrMarkList& rMarkList = GetMarkedObjectList(); ++ size_t nMarked = rMarkList.GetMarkCount(); ++ ++ if (nMarked < 2) ++ return; ++ ++ SdrObject* pLastSelectedObj = rMarkList.GetMark(nMarked-1)->GetMarkedSdrObj(); ++ Size aLastRectSize(pLastSelectedObj->GetLogicRect().GetSize()); ++ ++ const bool bUndo = IsUndoEnabled(); ++ ++ if (bUndo) ++ BegUndo(); ++ ++ for (size_t a = 0; a < nMarked-1; ++a) ++ { ++ SdrMark* pM = rMarkList.GetMark(a); ++ SdrObject* pObj = pM->GetMarkedSdrObj(); ++ Rectangle aLogicRect(pObj->GetLogicRect()); ++ Size aLogicRectSize(aLogicRect.GetSize()); ++ if (bWidth) ++ aLogicRectSize.Width() = aLastRectSize.Width(); ++ else ++ aLogicRectSize.Height() = aLastRectSize.Height(); ++ aLogicRect.SetSize(aLogicRectSize); ++ pObj->SetLogicRect(aLogicRect); ++ } ++ ++ SetUndoComment( ++ ImpGetResStr(bWidth ? STR_EqualizeWidthMarkedObjects : STR_EqualizeHeightMarkedObjects), ++ rMarkList.GetMarkDescription()); ++ ++ if (bUndo) ++ EndUndo(); ++} ++ + void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly) + { + // #105899# Start of Combine-Undo put to front, else ConvertMarkedToPolyObj would +diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src +index 364749a..6dc4420 100644 +--- a/svx/source/svdraw/svdstr.src ++++ b/svx/source/svdraw/svdstr.src +@@ -823,6 +823,14 @@ String STR_DistributeMarkedObjects + { + Text [ en-US ] = "Distribute selected objects"; + }; ++String STR_EqualizeWidthMarkedObjects ++{ ++ Text [ en-US ] = "Equalize Width %1"; ++}; ++String STR_EqualizeHeightMarkedObjects ++{ ++ Text [ en-US ] = "Equalize Height %1"; ++}; + String STR_EditCombine_OnePoly + { + Text [ en-US ] = "Combine %1" ; +-- +2.4.0 + diff --git a/SOURCES/0001-implement-save-slide-background-for-impress.patch b/SOURCES/0001-implement-save-slide-background-for-impress.patch new file mode 100644 index 0000000..d443779 --- /dev/null +++ b/SOURCES/0001-implement-save-slide-background-for-impress.patch @@ -0,0 +1,359 @@ +From 402f64fc8464366015259d44e238a77cb7d9d776 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 30 Sep 2015 13:30:36 +0100 +Subject: [PATCH] implement save slide background for impress + +to go along with the existing "set background", +same sort of thing as the competitor's effort + +(cherry picked from commit ed25a000ab67324075e68d9a7f3ca657b4e6a573) + +Change-Id: I2a1106771ead2cd926f3d631850447499340697c +--- + sd/inc/app.hrc | 3 +- + sd/inc/sdcommands.h | 1 + + sd/sdi/_drvwsh.sdi | 5 +++ + sd/sdi/sdraw.sdi | 24 +++++++++++ + sd/source/ui/app/menuids_tmpl.src | 11 ++++- + sd/source/ui/func/fupage.cxx | 85 +++++++++++++++++++++++--------------- + sd/source/ui/inc/DrawViewShell.hxx | 4 ++ + sd/source/ui/view/drviews2.cxx | 1 + + sd/source/ui/view/drviews7.cxx | 25 ++++++++++- + 9 files changed, 122 insertions(+), 37 deletions(-) + +diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc +index 4f3d82e..956c7d4 100644 +--- a/sd/inc/app.hrc ++++ b/sd/inc/app.hrc +@@ -421,7 +421,8 @@ + #define SID_SLIDE_SORTER_MULTI_PANE_GUI (SID_SD_START+421) + + #define SID_SELECT_BACKGROUND (SID_SD_START+422) +- ++#define SID_SAVE_BACKGROUND (SID_SD_START+423) ++ // FREE + // Slots for the tool pane popup + #define SID_TP_APPLY_TO_ALL_SLIDES (SID_SD_START+425) + #define SID_TP_APPLY_TO_SELECTED_SLIDES (SID_SD_START+426) +diff --git a/sd/inc/sdcommands.h b/sd/inc/sdcommands.h +index 2f4bf56..1d3502f 100644 +--- a/sd/inc/sdcommands.h ++++ b/sd/inc/sdcommands.h +@@ -90,6 +90,7 @@ + #define CMD_SID_DELETE_MASTER_PAGE ".uno:DeleteMasterPage" + #define CMD_SID_RENAME_MASTER_PAGE ".uno:RenameMasterPage" + #define CMD_SID_SELECT_BACKGROUND ".uno:SelectBackground" ++#define CMD_SID_SAVE_BACKGROUND ".uno:SaveBackground" + #define CMD_SID_DISPLAY_MASTER_BACKGROUND ".uno:DisplayMasterBackground" + #define CMD_SID_DISPLAY_MASTER_OBJECTS ".uno:DisplayMasterObjects" + #define CMD_SID_TABLE_DISTRIBUTE_COLUMNS ".uno:DistributeColumns" +diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi +index 263a8ed..28ee22c 100644 +--- a/sd/sdi/_drvwsh.sdi ++++ b/sd/sdi/_drvwsh.sdi +@@ -2662,6 +2662,11 @@ interface DrawView + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] ++ SID_SAVE_BACKGROUND ++ [ ++ ExecMethod = FuTemporary ; ++ StateMethod = GetMenuState ; ++ ] + SID_DISPLAY_MASTER_BACKGROUND + [ + ExecMethod = FuTemporary ; +diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi +index 7297c1f..d2d5d28 100644 +--- a/sd/sdi/sdraw.sdi ++++ b/sd/sdi/sdraw.sdi +@@ -6439,6 +6439,30 @@ SfxVoidItem SelectBackground SID_SELECT_BACKGROUND + GroupId = GID_OPTIONS; + ] + ++SfxVoidItem SaveBackground SID_SAVE_BACKGROUND ++() ++[ ++ /* flags: */ ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = TRUE, ++ ReadOnlyDoc = TRUE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ /* config: */ ++ AccelConfig = FALSE, ++ MenuConfig = FALSE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = FALSE, ++ GroupId = GID_OPTIONS; ++] ++ + SfxBoolItem DisplayMasterBackground SID_DISPLAY_MASTER_BACKGROUND + [ + /* flags: */ +diff --git a/sd/source/ui/app/menuids_tmpl.src b/sd/source/ui/app/menuids_tmpl.src +index bf30830..6917de2 100644 +--- a/sd/source/ui/app/menuids_tmpl.src ++++ b/sd/source/ui/app/menuids_tmpl.src +@@ -138,6 +138,13 @@ + HelpId = CMD_SID_SELECT_BACKGROUND ; \ + Text [ en-US ] = "Set Background Image..." ; \ + }; ++#define MN_SAVE_BACKGROUND \ ++ MenuItem\ ++ {\ ++ Identifier = SID_SAVE_BACKGROUND ; \ ++ HelpId = CMD_SID_SAVE_BACKGROUND ; \ ++ Text [ en-US ] = "Save Background Image..." ; \ ++ }; + #define MN_DISPLAY_MASTER_BACKGROUND \ + MenuItem\ + {\ +@@ -169,6 +176,7 @@ + MN_SELECT_BACKGROUND\ + MN_PAGE_DESIGN\ + MN_RENAME_PAGE\ ++ MN_SAVE_BACKGROUND\ + };\ + };\ + Text [ en-US ] = "Pag~e" ; \ +@@ -200,7 +208,8 @@ + MN_DISPLAY_MASTER_OBJECTS\ + };\ + };\ +- }; ++ }; \ ++ MN_SAVE_BACKGROUND + + // Layer + #define MN_RENAME_LAYER \ +diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx +index 83146e4..d3a053f 100644 +--- a/sd/source/ui/func/fupage.cxx ++++ b/sd/source/ui/func/fupage.cxx +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -164,6 +165,41 @@ void FuPage::Deactivate() + { + } + ++void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool bMasterPage, SfxItemSet& rMergedAttr) ++{ ++ if (bMasterPage) ++ { ++ if (pStyleSheet) ++ mergeItemSetsImpl(rMergedAttr, pStyleSheet->GetItemSet()); ++ } ++ else ++ { ++ // Only this page, get attributes for background fill ++ const SfxItemSet& rBackgroundAttributes = pPage->getSdrPageProperties().GetItemSet(); ++ ++ if(drawing::FillStyle_NONE != static_cast(rBackgroundAttributes.Get(XATTR_FILLSTYLE)).GetValue()) ++ { ++ // page attributes are used, take them ++ rMergedAttr.Put(rBackgroundAttributes); ++ } ++ else ++ { ++ if(pStyleSheet ++ && drawing::FillStyle_NONE != static_cast(pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) ++ { ++ // if the page has no fill style, use the settings from the ++ // background stylesheet (if used) ++ mergeItemSetsImpl(rMergedAttr, pStyleSheet->GetItemSet()); ++ } ++ else ++ { ++ // no fill style from page, start with no fill style ++ rMergedAttr.Put(XFillStyleItem(drawing::FillStyle_NONE)); ++ } ++ } ++ } ++} ++ + const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) + { + if (!mpDrawViewShell) +@@ -247,44 +283,27 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) + // merge page background filling to the dialogs input set + if( mbDisplayBackgroundTabPage ) + { +- if( mbMasterPage ) +- { +- if(pStyleSheet) +- mergeItemSetsImpl( aMergedAttr, pStyleSheet->GetItemSet() ); +- } +- else +- { +- // Only this page, get attributes for background fill +- const SfxItemSet& rBackgroundAttributes = mpPage->getSdrPageProperties().GetItemSet(); +- +- if(drawing::FillStyle_NONE != static_cast(rBackgroundAttributes.Get(XATTR_FILLSTYLE)).GetValue()) +- { +- // page attributes are used, take them +- aMergedAttr.Put(rBackgroundAttributes); +- } +- else +- { +- if(pStyleSheet +- && drawing::FillStyle_NONE != static_cast(pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) +- { +- // if the page has no fill style, use the settings from the +- // background stylesheet (if used) +- mergeItemSetsImpl(aMergedAttr, pStyleSheet->GetItemSet()); +- } +- else +- { +- // no fill style from page, start with no fill style +- aMergedAttr.Put(XFillStyleItem(drawing::FillStyle_NONE)); +- } +- } +- } ++ MergePageBackgroundFilling(mpPage, pStyleSheet, mbMasterPage, aMergedAttr); + } + + boost::scoped_ptr< SfxItemSet > pTempSet; + +- if( GetSlotID() == SID_SELECT_BACKGROUND ) ++ const sal_uInt16 nId = GetSlotID(); ++ if (nId == SID_SAVE_BACKGROUND) ++ { ++ const XFillStyleItem& rStyleItem = ++ static_cast(aMergedAttr.Get(XATTR_FILLSTYLE)); ++ if (drawing::FillStyle_BITMAP == (drawing::FillStyle)rStyleItem.GetValue()) ++ { ++ const XFillBitmapItem& rBitmap = ++ static_cast(aMergedAttr.Get(XATTR_FILLBITMAP)); ++ const GraphicObject& rGraphicObj = rBitmap.GetGraphicObject(); ++ GraphicHelper::ExportGraphic(rGraphicObj.GetGraphic(), ""); ++ } ++ } ++ else if (nId == SID_SELECT_BACKGROUND) + { +- SvxOpenGraphicDialog aDlg(SdResId(STR_SET_BACKGROUND_PICTURE)); ++ SvxOpenGraphicDialog aDlg(SdResId(STR_SET_BACKGROUND_PICTURE)); + + if( aDlg.Execute() == GRFILTER_OK ) + { +diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx +index 405e7af..5ec628c 100644 +--- a/sd/source/ui/inc/DrawViewShell.hxx ++++ b/sd/source/ui/inc/DrawViewShell.hxx +@@ -33,6 +33,7 @@ + + class Outliner; + class SdPage; ++class SdStyleSheet; + class SdrExternalToolEdit; + class DrawDocShell; + class TabBar; +@@ -509,6 +510,9 @@ private: + std::vector> m_ExternalEdits; + }; + ++ /// Merge the background properties together and deposit the result in rMergeAttr ++ void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool bMasterPage, SfxItemSet& rMergedAttr); ++ + } // end of namespace sd + + #endif +diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx +index e9c5f00..5c26c55 100644 +--- a/sd/source/ui/view/drviews2.cxx ++++ b/sd/source/ui/view/drviews2.cxx +@@ -1190,6 +1190,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) + break; + + case SID_SELECT_BACKGROUND: ++ case SID_SAVE_BACKGROUND: + case SID_PAGESETUP: // BASIC ?? + { + SetCurrentFunction( FuPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); +diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx +index 8b6d968..fba8bc1 100644 +--- a/sd/source/ui/view/drviews7.cxx ++++ b/sd/source/ui/view/drviews7.cxx +@@ -83,6 +83,7 @@ + #include "fuediglu.hxx" + #include "fubullet.hxx" + #include "fuformatpaintbrush.hxx" ++#include "stlsheet.hxx" + + #include + +@@ -714,6 +715,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) + { + rSet.DisableItem(SID_PRESENTATION_LAYOUT); + rSet.DisableItem(SID_SELECT_BACKGROUND); ++ rSet.DisableItem(SID_SAVE_BACKGROUND); + } + + if (mePageKind == PK_NOTES) +@@ -730,6 +732,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) + rSet.DisableItem(SID_MODIFYPAGE); + + rSet.DisableItem(SID_SELECT_BACKGROUND); ++ rSet.DisableItem(SID_SAVE_BACKGROUND); + rSet.DisableItem(SID_INSERTLAYER); + rSet.DisableItem(SID_LAYERMODE); + rSet.DisableItem(SID_INSERTFILE); +@@ -750,6 +753,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) + rSet.DisableItem(SID_INSERTFILE); + rSet.DisableItem(SID_PAGEMODE); + rSet.DisableItem(SID_SELECT_BACKGROUND); ++ rSet.DisableItem(SID_SAVE_BACKGROUND); + } + else + { +@@ -1646,8 +1650,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) + || rSet.GetItemState(SID_DISPLAY_MASTER_OBJECTS) == SfxItemState::DEFAULT) + { + SdPage* pPage = GetActualPage(); +- if (pPage != NULL +- && GetDoc() != NULL) ++ if (pPage != NULL && GetDoc() != NULL) + { + SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); + SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin(); +@@ -1668,6 +1671,24 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) + } + #endif + ++ if (rSet.GetItemState(SID_SAVE_BACKGROUND) == SfxItemState::DEFAULT) ++ { ++ bool bDisableSaveBackground = true; ++ SdPage* pPage = GetActualPage(); ++ if (pPage != NULL && GetDoc() != NULL) ++ { ++ SfxItemSet aMergedAttr(GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0); ++ SdStyleSheet* pStyleSheet = pPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND); ++ MergePageBackgroundFilling(pPage, pStyleSheet, meEditMode == EM_MASTERPAGE, aMergedAttr); ++ if (drawing::FillStyle_BITMAP == static_cast(aMergedAttr.Get(XATTR_FILLSTYLE)).GetValue()) ++ { ++ bDisableSaveBackground = false; ++ } ++ } ++ if (bDisableSaveBackground) ++ rSet.DisableItem(SID_SAVE_BACKGROUND); ++ } ++ + GetModeSwitchingMenuState (rSet); + } + +-- +2.4.3 + diff --git a/SOURCES/0001-implement-toggling-off-removeable-master-elements-wi.patch b/SOURCES/0001-implement-toggling-off-removeable-master-elements-wi.patch deleted file mode 100644 index 0a5d8bc..0000000 --- a/SOURCES/0001-implement-toggling-off-removeable-master-elements-wi.patch +++ /dev/null @@ -1,205 +0,0 @@ -From ff0eba6c1cbf4a5816c5b9b48d4e29778f0e0869 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 6 Nov 2014 14:59:49 +0000 -Subject: [PATCH] implement toggling off removeable master elements with direct - delete - -i.e. selecting footers/headers/slidenumber/datetime previes placeholders in -master page view and pressing delete will toggle those master elements off. - -Change-Id: I91f745703e43cbb4fdd037da4eab7c8f6bf9fbf5 -(cherry picked from commit e36dae401fc8963c9a92cb2c11d9b650b943c6d3) ---- - sd/inc/sdpage.hxx | 1 + - sd/source/core/sdpage.cxx | 19 +++++++++ - sd/source/ui/dlg/masterlayoutdlg.cxx | 19 ++------- - sd/source/ui/inc/DrawViewShell.hxx | 1 + - sd/source/ui/view/drviewse.cxx | 74 ++++++++++++++++++++++++++++-------- - 5 files changed, 83 insertions(+), 31 deletions(-) - -diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx -index 4cce906..0d3b138 100644 ---- a/sd/inc/sdpage.hxx -+++ b/sd/inc/sdpage.hxx -@@ -176,6 +176,7 @@ public: - void EnsureMasterPageDefaultBackground(); - SdrObject* CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rectangle& rRect, bool bInsert=false); - SdrObject* CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert); -+ void DestroyDefaultPresObj(PresObjKind eObjKind); - SdrObject* GetPresObj(PresObjKind eObjKind, int nIndex = 1, bool bFuzzySearch = false ); - PresObjKind GetPresObjKind(SdrObject* pObj) const; - OUString GetPresObjText(PresObjKind eObjKind) const; -diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx -index 477ea48..fccd7cf 100644 ---- a/sd/source/core/sdpage.cxx -+++ b/sd/source/core/sdpage.cxx -@@ -1018,6 +1018,25 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert) - } - } - -+void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind) -+{ -+ SdrObject* pObject = GetPresObj( eObjKind ); -+ -+ if( pObject ) -+ { -+ SdDrawDocument *pDoc = static_cast(pModel); -+ -+ const bool bUndo = pDoc->IsUndoEnabled(); -+ if( bUndo ) -+ pDoc->AddUndo(pDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pObject)); -+ SdrObjList* pOL = pObject->GetObjList(); -+ pOL->RemoveObject(pObject->GetOrdNumDirect()); -+ -+ if( !bUndo ) -+ SdrObject::Free(pObject); -+ } -+} -+ - /************************************************************************* - |* - |* return title area -diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx -index 21aa64b..acfd28a 100644 ---- a/sd/source/ui/dlg/masterlayoutdlg.cxx -+++ b/sd/source/ui/dlg/masterlayoutdlg.cxx -@@ -121,27 +121,14 @@ void MasterLayoutDialog::applyChanges() - mpDoc->EndUndo(); - } - --void MasterLayoutDialog::create( PresObjKind eKind ) -+void MasterLayoutDialog::create(PresObjKind eKind) - { -- mpCurrentPage->CreateDefaultPresObj( eKind, true ); -+ mpCurrentPage->CreateDefaultPresObj(eKind, true); - } - - void MasterLayoutDialog::remove( PresObjKind eKind ) - { -- SdrObject* pObject = mpCurrentPage->GetPresObj( eKind ); -- -- if( pObject ) -- { -- const bool bUndo = mpDoc->IsUndoEnabled(); -- if( bUndo ) -- mpDoc->AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pObject)); -- SdrObjList* pOL =pObject->GetObjList(); -- sal_uInt32 nOrdNum=pObject->GetOrdNumDirect(); -- pOL->RemoveObject(nOrdNum); -- -- if( !bUndo ) -- SdrObject::Free(pObject); -- } -+ mpCurrentPage->DestroyDefaultPresObj(eKind); - } - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx -index 96c5c9c..a6f5a13 100644 ---- a/sd/source/ui/inc/DrawViewShell.hxx -+++ b/sd/source/ui/inc/DrawViewShell.hxx -@@ -216,6 +216,7 @@ public: - void FuTemporary(SfxRequest& rReq); - void FuPermanent(SfxRequest& rReq); - void FuSupport(SfxRequest& rReq); -+ void FuDeleteSelectedObjects(); - void FuSupportRotate(SfxRequest& rReq); - void FuTable(SfxRequest& rReq); - -diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx -index cd643b0..6e7cb8d 100644 ---- a/sd/source/ui/view/drviewse.cxx -+++ b/sd/source/ui/view/drviewse.cxx -@@ -625,6 +625,64 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) - } - } - -+void DrawViewShell::FuDeleteSelectedObjects() -+{ -+ bool bConsumed = false; -+ -+ //if any placeholders are selected -+ if (mpDrawView->IsPresObjSelected(false, true, false, false)) -+ { -+ //If there are placeholders in the list which can be toggled -+ //off in edit->master->master elements then do that here, -+ std::vector aPresMarksToRemove; -+ const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); -+ for (size_t i=0; i < rMarkList.GetMarkCount(); ++i) -+ { -+ SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); -+ SdPage* pPage = (SdPage*)pObj->GetPage(); -+ PresObjKind eKind = pPage->GetPresObjKind(pObj); -+ if (eKind == PRESOBJ_FOOTER || eKind == PRESOBJ_HEADER || -+ eKind == PRESOBJ_DATETIME || eKind == PRESOBJ_SLIDENUMBER) -+ { -+ aPresMarksToRemove.push_back(pObj); -+ } -+ } -+ -+ for (std::vector::iterator aI = aPresMarksToRemove.begin(); aI < aPresMarksToRemove.end(); ++aI) -+ { -+ //Unmark object -+ mpDrawView->MarkObj((*aI), mpDrawView->GetSdrPageView(), true); -+ SdPage* pPage = (SdPage*)(*aI)->GetPage(); -+ //remove placeholder from master page -+ pPage->DestroyDefaultPresObj(pPage->GetPresObjKind((*aI))); -+ } -+ -+ bConsumed = true; -+ } -+ -+ // placeholders which cannot be deleted selected -+ if (mpDrawView->IsPresObjSelected(false, true, false, true)) -+ { -+ ::sd::Window* pWindow = GetActiveWindow(); -+ InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute(); -+ bConsumed = true; -+ } -+ -+ if (!bConsumed) -+ { -+ KeyCode aKCode(KEY_DELETE); -+ KeyEvent aKEvt( 0, aKCode); -+ -+ bConsumed = mpDrawView && mpDrawView->getSmartTags().KeyInput( aKEvt ); -+ -+ if( !bConsumed && HasCurrentFunction() ) -+ bConsumed = GetCurrentFunction()->KeyInput(aKEvt); -+ -+ if( !bConsumed && mpDrawView ) -+ mpDrawView->DeleteMarked(); -+ } -+} -+ - void DrawViewShell::FuSupport(SfxRequest& rReq) - { - if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) -@@ -873,23 +931,9 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) - pOLV->PostKeyEvent(aKEvt); - } - } -- else if ( mpDrawView->IsPresObjSelected(false, true, false, true) ) -- { -- ::sd::Window* pWindow = GetActiveWindow(); -- InfoBox(pWindow, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) ).Execute(); -- } - else - { -- KeyCode aKCode(KEY_DELETE); -- KeyEvent aKEvt( 0, aKCode); -- -- bool bConsumed = mpDrawView && mpDrawView->getSmartTags().KeyInput( aKEvt ); -- -- if( !bConsumed && HasCurrentFunction() ) -- bConsumed = GetCurrentFunction()->KeyInput(aKEvt); -- -- if( !bConsumed && mpDrawView ) -- mpDrawView->DeleteMarked(); -+ FuDeleteSelectedObjects(); - } - rReq.Ignore (); - } --- -1.9.3 - diff --git a/SOURCES/0001-implement-undo-for-equalize-marked-objects.patch b/SOURCES/0001-implement-undo-for-equalize-marked-objects.patch new file mode 100644 index 0000000..60d4121 --- /dev/null +++ b/SOURCES/0001-implement-undo-for-equalize-marked-objects.patch @@ -0,0 +1,26 @@ +From 4c8197bc270ec65c147af3388e35403aa77fd02f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 28 Aug 2015 13:08:44 +0100 +Subject: [PATCH] implement undo for equalize-marked-objects + +Change-Id: I245e08674b52c2a5648e9d7762101b8057fd30e9 +--- + svx/source/svdraw/svdedtv2.cxx | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx +index 75c884c..719355d 100644 +--- a/svx/source/svdraw/svdedtv2.cxx ++++ b/svx/source/svdraw/svdedtv2.cxx +@@ -1200,6 +1200,8 @@ void SdrEditView::EqualizeMarkedObjects(bool bWidth) + else + aLogicRectSize.Height() = aLastRectSize.Height(); + aLogicRect.SetSize(aLogicRectSize); ++ if (bUndo) ++ AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj)); + pObj->SetLogicRect(aLogicRect); + } + +-- +2.4.0 + diff --git a/SOURCES/0001-implement-undo-of-delete-impress-cell-contents.patch b/SOURCES/0001-implement-undo-of-delete-impress-cell-contents.patch new file mode 100644 index 0000000..287a0cf --- /dev/null +++ b/SOURCES/0001-implement-undo-of-delete-impress-cell-contents.patch @@ -0,0 +1,79 @@ +From 35a3fb2ca34b30a1bdaf64f0091fcd42af6bfd2c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Sep 2015 16:32:15 +0100 +Subject: [PATCH] implement undo of delete impress cell contents + +Change-Id: I7aa99f3a6668e66b8d02e20b7ea1cf0862e5d760 +(cherry picked from commit d38e4b2ee73ad38881465f9f97eb8d8397ee98ff) +--- + include/svx/svdstr.hrc | 1 + + svx/source/svdraw/svdstr.src | 5 +++++ + svx/source/table/tablecontroller.cxx | 15 +++++++++++++-- + 3 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/include/svx/svdstr.hrc b/include/svx/svdstr.hrc +index 90ef697..f45b55f 100644 +--- a/include/svx/svdstr.hrc ++++ b/include/svx/svdstr.hrc +@@ -711,5 +711,6 @@ + #define STR_TABLE_STYLE (SIP_Begin + 274) + #define STR_TABLE_STYLE_SETTINGS (SIP_Begin + 275) + #define SIP_SA_CROP_MARKERS (SIP_Begin + 276) ++#define STR_TABLE_DELETE_CELL_CONTENTS (SIP_Begin + 277) + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src +index 364749a..c7977c1 100644 +--- a/svx/source/svdraw/svdstr.src ++++ b/svx/source/svdraw/svdstr.src +@@ -2770,6 +2770,11 @@ String STR_TABLE_DISTRIBUTE_COLUMNS + Text [ en-US ] = "Distribute columns" ; + }; + ++String STR_TABLE_DELETE_CELL_CONTENTS ++{ ++ Text [ en-US ] = "Delete cell contents" ; ++}; ++ + String STR_TABLE_STYLE + { + Text [ en-US ] = "Table style" ; +diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx +index 64b40da..6a8bd3f 100644 +--- a/svx/source/table/tablecontroller.cxx ++++ b/svx/source/table/tablecontroller.cxx +@@ -1331,6 +1331,10 @@ bool SvxTableController::DeleteMarked() + { + if( mxTable.is() ) + { ++ const bool bUndo = mpModel && mpModel->IsUndoEnabled(); ++ if (bUndo) ++ mpModel->BegUndo(ImpGetResStr(STR_TABLE_DELETE_CELL_CONTENTS)); ++ + CellPos aStart, aEnd; + getSelectedCells( aStart, aEnd ); + for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ ) +@@ -1338,11 +1342,18 @@ bool SvxTableController::DeleteMarked() + for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ ) + { + CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) ); +- if( xCell.is() ) +- xCell->SetOutlinerParaObject( 0 ); ++ if (xCell.is() && xCell->hasText()) ++ { ++ if (bUndo) ++ xCell->AddUndo(); ++ xCell->SetOutlinerParaObject(0); ++ } + } + } + ++ if (bUndo) ++ mpModel->EndUndo(); ++ + UpdateTableShape(); + return true; + } +-- +2.4.0 + diff --git a/SOURCES/0001-impress-s-AnnotationWindow-is-the-only-user-of-WB_NE.patch b/SOURCES/0001-impress-s-AnnotationWindow-is-the-only-user-of-WB_NE.patch new file mode 100644 index 0000000..735fe71 --- /dev/null +++ b/SOURCES/0001-impress-s-AnnotationWindow-is-the-only-user-of-WB_NE.patch @@ -0,0 +1,49 @@ +From 94341df754fddacefb01638e5c544a5ba66de750 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 16 Dec 2015 21:26:15 +0000 +Subject: [PATCH] impress's AnnotationWindow is the only user of WB_NEEDSFOCUS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Here it is creating a toplevel floating system window which needs special +hackery to function. + +Instead convert it to a non-system window which means that it is in reality +only a vcl construct. The small downside is that it is now unable to leave the +confines of the toplevel system window in which it lives. Upside is that +all the special hackery related to it which generally doesn't work half the time +in various window managers and now in wayland can go away. + +Change-Id: I7ad7c35091086f7671ff4a178c7fa04202c20e09 +Reviewed-on: https://gerrit.libreoffice.org/20745 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sd/source/ui/annotations/annotationwindow.cxx | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx +index bcad03d..c307f1d 100644 +--- a/sd/source/ui/annotations/annotationwindow.cxx ++++ b/sd/source/ui/annotations/annotationwindow.cxx +@@ -273,7 +273,7 @@ Selection AnnotationTextWindow::GetSurroundingTextSelection() const + /************** AnnotationWindow***********************************++*/ + + AnnotationWindow::AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShell* pDocShell, vcl::Window* pParent ) +-: FloatingWindow(pParent, WB_SYSTEMWINDOW|WB_BORDER|WB_NEEDSFOCUS) ++: FloatingWindow(pParent, WB_BORDER) + , mrManager( rManager ) + , mpDocShell( pDocShell ) + , mpView( pDocShell->GetViewShell()->GetView() ) +@@ -287,6 +287,7 @@ AnnotationWindow::AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShel + , mpTextWindow(0) + , mpMeta(0) + { ++ EnableAlwaysOnTop(); + } + + AnnotationWindow::~AnnotationWindow() +-- +2.5.0 + diff --git a/SOURCES/0001-improve-perf.-of-VCL-event-dispatch.patch b/SOURCES/0001-improve-perf.-of-VCL-event-dispatch.patch new file mode 100644 index 0000000..a2eca14 --- /dev/null +++ b/SOURCES/0001-improve-perf.-of-VCL-event-dispatch.patch @@ -0,0 +1,115 @@ +From aae5b1632264a6a97c2bd37da2e5899779e1b108 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Tue, 10 May 2016 09:00:20 +0200 +Subject: [PATCH] improve perf. of VCL event dispatch + +Change-Id: I5052f0c3e2c8739b336da52ef9590e5008255247 +--- + vcl/inc/window.h | 4 +++- + vcl/source/window/event.cxx | 36 +++++++++++++++++++++++++++++++++--- + vcl/source/window/window.cxx | 1 + + 3 files changed, 37 insertions(+), 4 deletions(-) + +diff --git a/vcl/inc/window.h b/vcl/inc/window.h +index 67d5f94..60f7e82 100644 +--- a/vcl/inc/window.h ++++ b/vcl/inc/window.h +@@ -224,7 +224,9 @@ public: + VclPtr mpNextOverlap; + VclPtr mpLastFocusWindow; + VclPtr mpDlgCtrlDownWindow; +- VclEventListeners maEventListeners; ++ std::vector> maEventListeners; ++ int mnEventListenersIteratingCount; ++ std::set> maEventListenersDeleted; + VclEventListeners maChildEventListeners; + + // The canvas interface for this VCL window. Is persistent after the first GetCanvas() call +diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx +index 35c3e38..59fcb61 100644 +--- a/vcl/source/window/event.cxx ++++ b/vcl/source/window/event.cxx +@@ -18,6 +18,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -27,6 +28,8 @@ + #include + #include + ++#include ++ + #include + #include + #include +@@ -212,7 +215,29 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData ) + if ( aDelData.IsDead() ) + return; + +- mpWindowImpl->maEventListeners.Call( &aEvent ); ++ if (!mpWindowImpl->maEventListeners.empty()) ++ { ++ // Copy the list, because this can be destroyed when calling a Link... ++ std::vector> aCopy( mpWindowImpl->maEventListeners ); ++ // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour ++ mpWindowImpl->mnEventListenersIteratingCount++; ++ auto& rWindowImpl = *mpWindowImpl; ++ comphelper::ScopeGuard aGuard( ++ [&rWindowImpl]() ++ { ++ rWindowImpl.mnEventListenersIteratingCount--; ++ if (rWindowImpl.mnEventListenersIteratingCount == 0) ++ rWindowImpl.maEventListenersDeleted.clear(); ++ } ++ ); ++ for ( Link<>& rLink : aCopy ) ++ { ++ if (aDelData.IsDead()) break; ++ // check this hasn't been removed in some re-enterancy scenario fdo#47368 ++ if( rWindowImpl.maEventListenersDeleted.find(rLink) == rWindowImpl.maEventListenersDeleted.end() ) ++ rLink.Call( &aEvent ); ++ } ++ } + + if ( aDelData.IsDead() ) + return; +@@ -245,13 +270,18 @@ void Window::FireVclEvent( VclSimpleEvent* pEvent ) + + void Window::AddEventListener( const Link<>& rEventListener ) + { +- mpWindowImpl->maEventListeners.addListener( rEventListener ); ++ mpWindowImpl->maEventListeners.push_back( rEventListener ); + } + + void Window::RemoveEventListener( const Link<>& rEventListener ) + { + if (mpWindowImpl) +- mpWindowImpl->maEventListeners.removeListener( rEventListener ); ++ { ++ auto& rListeners = mpWindowImpl->maEventListeners; ++ rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() ); ++ if (mpWindowImpl->mnEventListenersIteratingCount) ++ mpWindowImpl->maEventListenersDeleted.insert(rEventListener); ++ } + } + + void Window::AddChildEventListener( const Link<>& rEventListener ) +diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx +index e8d2b96..cbfc4cd 100644 +--- a/vcl/source/window/window.cxx ++++ b/vcl/source/window/window.cxx +@@ -630,6 +630,7 @@ WindowImpl::WindowImpl( WindowType nType ) + mpLastFocusWindow = NULL; // window for focus restore + mpDlgCtrlDownWindow = NULL; // window for dialog control + mpFirstDel = NULL; // Dtor notification list ++ mnEventListenersIteratingCount = 0; + mpUserData = NULL; // user data + mpCursor = NULL; // cursor + mpControlFont = NULL; // font properties +-- +2.7.4 + diff --git a/SOURCES/0001-java-dir-for-powepc64-and-powepc64le-can-differ.patch b/SOURCES/0001-java-dir-for-powepc64-and-powepc64le-can-differ.patch deleted file mode 100644 index 4863441..0000000 --- a/SOURCES/0001-java-dir-for-powepc64-and-powepc64le-can-differ.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 7a66dbe982623be620ad6ac426fe689a434e5f51 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Tue, 12 May 2015 10:37:53 +0200 -Subject: [PATCH] java dir for powepc64 and powepc64le can differ - -E.g., RHEL >= 7.1 uses ppc64le for reasons listed in -https://bugs.openjdk.java.net/browse/JDK-8073139 . - -Change-Id: I982e65cdf99999e8a5ed23cf444ccb2aee764c4c ---- - configure.ac | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 26071dc..55157a9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6997,9 +6997,12 @@ then - powerpc) - my_java_arch=ppc - ;; -- powerpc64*) -+ powerpc64) - my_java_arch=ppc64 - ;; -+ powerpc64le) -+ AS_IF([test -d "$JAVA_HOME/jre/lib/ppc64le"], [my_java_arch=ppc64le], [my_java_arch=ppc64]) -+ ;; - x86_64) - my_java_arch=amd64 - ;; --- -2.4.0 - diff --git a/SOURCES/0001-just-use-ANSI-C-declarations.patch b/SOURCES/0001-just-use-ANSI-C-declarations.patch deleted file mode 100644 index e3acab2..0000000 --- a/SOURCES/0001-just-use-ANSI-C-declarations.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 4d687aec3c5ea0f18ab3f01f827cc544e677bae3 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Thu, 6 Nov 2014 10:20:00 +0100 -Subject: [PATCH] just use ANSI C declarations - -Change-Id: Iec50f3474b97497c50522eabb4435795b3ba3b56 ---- - vcl/source/filter/jpeg/transupp.h | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/vcl/source/filter/jpeg/transupp.h b/vcl/source/filter/jpeg/transupp.h -index 4448c9f..4dbbc2a 100644 ---- a/vcl/source/filter/jpeg/transupp.h -+++ b/vcl/source/filter/jpeg/transupp.h -@@ -164,27 +164,27 @@ typedef struct { - - /* Parse a crop specification (written in X11 geometry style) */ - EXTERN(boolean) jtransform_parse_crop_spec -- JPP((jpeg_transform_info *info, const char *spec)); -+ (jpeg_transform_info *info, const char *spec); - /* Request any required workspace */ - EXTERN(boolean) jtransform_request_workspace -- JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info)); -+ (j_decompress_ptr srcinfo, jpeg_transform_info *info); - /* Adjust output image parameters */ - EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters -- JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, -+ (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - jvirt_barray_ptr *src_coef_arrays, -- jpeg_transform_info *info)); -+ jpeg_transform_info *info); - /* Execute the actual transformation, if any */ - EXTERN(void) jtransform_execute_transform -- JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, -+ (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - jvirt_barray_ptr *src_coef_arrays, -- jpeg_transform_info *info)); -+ jpeg_transform_info *info); - /* Determine whether lossless transformation is perfectly - * possible for a specified image and transformation. - */ - EXTERN(boolean) jtransform_perfect_transform -- JPP((JDIMENSION image_width, JDIMENSION image_height, -+ (JDIMENSION image_width, JDIMENSION image_height, - int MCU_width, int MCU_height, -- JXFORM_CODE transform)); -+ JXFORM_CODE transform); - - /* jtransform_execute_transform used to be called - * jtransform_execute_transformation, but some compilers complain about -@@ -209,8 +209,8 @@ typedef enum { - - /* Setup decompression object to save desired markers in memory */ - EXTERN(void) jcopy_markers_setup -- JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option)); -+ (j_decompress_ptr srcinfo, JCOPY_OPTION option); - /* Copy markers saved in the given source object to the destination object */ - EXTERN(void) jcopy_markers_execute -- JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, -- JCOPY_OPTION option)); -+ (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, -+ JCOPY_OPTION option); --- -2.1.0 - diff --git a/SOURCES/0001-libgcrypt-and-gnutls-are-only-used-by-our-internal-e.patch b/SOURCES/0001-libgcrypt-and-gnutls-are-only-used-by-our-internal-e.patch deleted file mode 100644 index 149e2b8..0000000 --- a/SOURCES/0001-libgcrypt-and-gnutls-are-only-used-by-our-internal-e.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 3cfc0933c38a9f5383042347ef659c3d982090a3 Mon Sep 17 00:00:00 2001 -From: Stephan Bergmann -Date: Wed, 8 Oct 2014 13:22:44 +0200 -Subject: [PATCH] libgcrypt and gnutls are only used by our internal - external/neon - -...so must not be checked for if --without-system-neon - -Change-Id: If598108f98d6f94f32650feba7044224a78a4c12 -(cherry picked from commit c592e7dea2e5ac326041b78b9512600c984ccced) ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 363eb2f..ed3da6c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -9463,7 +9463,7 @@ dnl =================================================================== - dnl Check for building gnutls - dnl =================================================================== - AC_MSG_CHECKING([whether to use gnutls]) --if test "$WITH_WEBDAV" = "neon" && test "$enable_openssl" = "no"; then -+if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then - AC_MSG_RESULT([yes]) - AM_PATH_LIBGCRYPT() - PKG_CHECK_MODULES(GNUTLS, [gnutls],, --- -1.9.3 - diff --git a/SOURCES/0001-misspell-some-words-copy-and-paste-slide-to-gimp.patch b/SOURCES/0001-misspell-some-words-copy-and-paste-slide-to-gimp.patch deleted file mode 100644 index 8705c3e..0000000 --- a/SOURCES/0001-misspell-some-words-copy-and-paste-slide-to-gimp.patch +++ /dev/null @@ -1,49 +0,0 @@ -From e884b98b248e155cda4c53a302cc821a3c2ddaf9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 8 May 2015 15:49:08 +0100 -Subject: [PATCH] misspell some words, copy and paste slide to gimp - -and we don't want to see the mis-spelt underlines - -Change-Id: Ib3ae29297a1697e0f7b0caa816504da7edf721d1 ---- - sd/source/ui/app/sdxfer.cxx | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx -index dda4f74..4ac1fac 100644 ---- a/sd/source/ui/app/sdxfer.cxx -+++ b/sd/source/ui/app/sdxfer.cxx -@@ -518,13 +518,27 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo - } - else if( nFormat == FORMAT_GDIMETAFILE ) - { -- if( mpSdViewIntern ) -+ if (mpSdViewIntern) -+ { -+ const bool bToggleOnlineSpell = mpSdDrawDocumentIntern && mpSdDrawDocumentIntern->GetOnlineSpell(); -+ if (bToggleOnlineSpell) -+ mpSdDrawDocumentIntern->SetOnlineSpell(false); - bOK = SetGDIMetaFile( mpSdViewIntern->GetMarkedObjMetaFile( true ), rFlavor ); -+ if (bToggleOnlineSpell) -+ mpSdDrawDocumentIntern->SetOnlineSpell(true); -+ } - } - else if( FORMAT_BITMAP == nFormat || SOT_FORMATSTR_ID_PNG == nFormat ) - { -- if( mpSdViewIntern ) -+ if (mpSdViewIntern) -+ { -+ const bool bToggleOnlineSpell = mpSdDrawDocumentIntern && mpSdDrawDocumentIntern->GetOnlineSpell(); -+ if (bToggleOnlineSpell) -+ mpSdDrawDocumentIntern->SetOnlineSpell(false); - bOK = SetBitmapEx( mpSdViewIntern->GetMarkedObjBitmapEx(true), rFlavor ); -+ if (bToggleOnlineSpell) -+ mpSdDrawDocumentIntern->SetOnlineSpell(true); -+ } - } - else if( ( nFormat == FORMAT_STRING ) && mpBookmark ) - { --- -2.1.0 - diff --git a/SOURCES/0001-move-things-around-a-little-to-make-backporting-easi.patch b/SOURCES/0001-move-things-around-a-little-to-make-backporting-easi.patch new file mode 100644 index 0000000..19e83e1 --- /dev/null +++ b/SOURCES/0001-move-things-around-a-little-to-make-backporting-easi.patch @@ -0,0 +1,14973 @@ +From a95302af9fabfc9a4e6b5d2983b9f75645f47438 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 9 Dec 2015 15:33:06 +0000 +Subject: [PATCH] move things around a little to make backporting easier + +Change-Id: I0fa86b4b524056f7a9fac228062401ea1ec2ca25 +--- + vcl/Library_vclplug_gtk.mk | 2 +- + vcl/Library_vclplug_gtk3.mk | 2 +- + vcl/inc/unx/gtk/gtkframe.hxx | 1 - + vcl/unx/gtk/gtksalframe.cxx | 4883 ++++++++++++++++++++++++++++++++++ + vcl/unx/gtk/window/gtksalframe.cxx | 4883 ---------------------------------- + vcl/unx/gtk3/app/gtk3gtkinst.cxx | 641 ----- + vcl/unx/gtk3/gtk3gtkframe.cxx | 3803 ++++++++++++++++++++++++++ + vcl/unx/gtk3/gtk3gtkinst.cxx | 641 +++++ + vcl/unx/gtk3/window/gtk3gtkframe.cxx | 12 - + 9 files changed, 9329 insertions(+), 5539 deletions(-) + create mode 100644 vcl/unx/gtk/gtksalframe.cxx + delete mode 100644 vcl/unx/gtk/window/gtksalframe.cxx + delete mode 100644 vcl/unx/gtk3/app/gtk3gtkinst.cxx + create mode 100644 vcl/unx/gtk3/gtk3gtkframe.cxx + create mode 100644 vcl/unx/gtk3/gtk3gtkinst.cxx + delete mode 100644 vcl/unx/gtk3/window/gtk3gtkframe.cxx + +diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk +index ec7f2f8..6d10d5c 100644 +--- a/vcl/Library_vclplug_gtk.mk ++++ b/vcl/Library_vclplug_gtk.mk +@@ -100,7 +100,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk,\ + vcl/unx/gtk/app/gtkinst \ + vcl/unx/gtk/app/gtksys \ + vcl/unx/gtk/gdi/salnativewidgets-gtk \ +- vcl/unx/gtk/window/gtksalframe \ ++ vcl/unx/gtk/gtksalframe \ + vcl/unx/gtk/window/gtkobject \ + vcl/unx/gtk/fpicker/resourceprovider \ + vcl/unx/gtk/fpicker/SalGtkPicker \ +diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk +index 515a81c..222c9d6 100644 +--- a/vcl/Library_vclplug_gtk3.mk ++++ b/vcl/Library_vclplug_gtk3.mk +@@ -99,7 +99,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3,\ + vcl/unx/gtk3/a11y/gtk3atkwindow \ + vcl/unx/gtk3/a11y/gtk3atkwrapper \ + vcl/unx/gtk3/app/gtk3gtkdata \ +- vcl/unx/gtk3/app/gtk3gtkinst \ ++ vcl/unx/gtk3/gtk3gtkinst \ + vcl/unx/gtk3/app/gtk3gtksys \ + vcl/unx/gtk3/app/gtk3fpicker \ + vcl/unx/gtk3/gdi/cairo_gtk3_cairo \ +@@ -107,7 +107,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3,\ + vcl/unx/gtk3/gdi/gtk3gtkprintwrapper \ + vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk \ + vcl/unx/gtk3/gdi/gtk3salprn-gtk \ +- vcl/unx/gtk3/window/gtk3gtkframe \ ++ vcl/unx/gtk3/gtk3gtkframe \ + vcl/unx/gtk3/window/gtk3gtkobject \ + vcl/unx/gtk3/window/gtk3gtksalmenu \ + vcl/unx/gtk3/window/gtk3glomenu \ +diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx +index 4594249..0fb5da7 100644 +--- a/vcl/inc/unx/gtk/gtkframe.hxx ++++ b/vcl/inc/unx/gtk/gtkframe.hxx +@@ -240,7 +240,6 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + static void signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer ); + #if GTK_CHECK_VERSION(3,0,0) + static gboolean signalDraw( GtkWidget*, cairo_t *cr, gpointer ); +- static void signalFlagsChanged( GtkWidget*, GtkStateFlags, gpointer ); + static void sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame); + #if GTK_CHECK_VERSION(3,14,0) + static void gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame); +diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx +new file mode 100644 +index 0000000..9e03f14 +--- /dev/null ++++ b/vcl/unx/gtk/gtksalframe.cxx +@@ -0,0 +1,4883 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ++ * This file is part of the LibreOffice project. ++ * ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ * ++ * This file incorporates work covered by the following license notice: ++ * ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed ++ * with this work for additional information regarding copyright ++ * ownership. The ASF licenses this file to you under the Apache ++ * License, Version 2.0 (the "License"); you may not use this file ++ * except in compliance with the License. You may obtain a copy of ++ * the License at http://www.apache.org/licenses/LICENSE-2.0 . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++# include ++#endif ++#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) ++# include ++#endif ++#if defined ENABLE_GMENU_INTEGRATION // defined in gtksalmenu.hxx above ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++ ++#if OSL_DEBUG_LEVEL > 1 ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if GTK_CHECK_VERSION(3,0,0) ++# include ++#endif ++ ++#ifdef ENABLE_DBUS ++#include ++ ++#define GSM_DBUS_SERVICE "org.gnome.SessionManager" ++#define GSM_DBUS_PATH "/org/gnome/SessionManager" ++#define GSM_DBUS_INTERFACE "org.gnome.SessionManager" ++#endif ++ ++#include ++ ++#if GTK_CHECK_VERSION(3,0,0) ++#define IS_WIDGET_REALIZED gtk_widget_get_realized ++#define IS_WIDGET_MAPPED gtk_widget_get_mapped ++#else ++#define IS_WIDGET_REALIZED GTK_WIDGET_REALIZED ++#define IS_WIDGET_MAPPED GTK_WIDGET_MAPPED ++#endif ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++#define GDK_IS_X11_DISPLAY(foo) (true) ++#endif ++ ++using namespace com::sun::star; ++ ++int GtkSalFrame::m_nFloats = 0; ++ ++#if defined ENABLE_GMENU_INTEGRATION ++static GDBusConnection* pSessionBus = NULL; ++#endif ++ ++static sal_uInt16 GetKeyModCode( guint state ) ++{ ++ sal_uInt16 nCode = 0; ++ if( (state & GDK_SHIFT_MASK) ) ++ nCode |= KEY_SHIFT; ++ if( (state & GDK_CONTROL_MASK) ) ++ nCode |= KEY_MOD1; ++ if( (state & GDK_MOD1_MASK) ) ++ nCode |= KEY_MOD2; ++ ++ // Map Meta/Super keys to MOD3 modifier on all Unix systems ++ // except Mac OS X ++ if ( (state & GDK_META_MASK ) || ( state & GDK_SUPER_MASK ) ) ++ nCode |= KEY_MOD3; ++ return nCode; ++} ++ ++static sal_uInt16 GetMouseModCode( guint state ) ++{ ++ sal_uInt16 nCode = GetKeyModCode( state ); ++ if( (state & GDK_BUTTON1_MASK) ) ++ nCode |= MOUSE_LEFT; ++ if( (state & GDK_BUTTON2_MASK) ) ++ nCode |= MOUSE_MIDDLE; ++ if( (state & GDK_BUTTON3_MASK) ) ++ nCode |= MOUSE_RIGHT; ++ ++ return nCode; ++} ++ ++static sal_uInt16 GetKeyCode( guint keyval ) ++{ ++ sal_uInt16 nCode = 0; ++ if( keyval >= GDK_0 && keyval <= GDK_9 ) ++ nCode = KEY_0 + (keyval-GDK_0); ++ else if( keyval >= GDK_KP_0 && keyval <= GDK_KP_9 ) ++ nCode = KEY_0 + (keyval-GDK_KP_0); ++ else if( keyval >= GDK_A && keyval <= GDK_Z ) ++ nCode = KEY_A + (keyval-GDK_A ); ++ else if( keyval >= GDK_a && keyval <= GDK_z ) ++ nCode = KEY_A + (keyval-GDK_a ); ++ else if( keyval >= GDK_F1 && keyval <= GDK_F26 ) ++ { ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( GetGtkSalData()->GetGtkDisplay()->IsNumLockFromXS() ) ++ { ++ nCode = KEY_F1 + (keyval-GDK_F1); ++ } ++ else ++#endif ++ { ++ switch( keyval ) ++ { ++ // - - - - - Sun keyboard, see vcl/unx/source/app/saldisp.cxx ++ case GDK_L2: ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( GetGtkSalData()->GetGtkDisplay()->GetServerVendor() == vendor_sun ) ++ nCode = KEY_REPEAT; ++ else ++#endif ++ nCode = KEY_F12; ++ break; ++ case GDK_L3: nCode = KEY_PROPERTIES; break; ++ case GDK_L4: nCode = KEY_UNDO; break; ++ case GDK_L6: nCode = KEY_COPY; break; // KEY_F16 ++ case GDK_L8: nCode = KEY_PASTE; break; // KEY_F18 ++ case GDK_L10: nCode = KEY_CUT; break; // KEY_F20 ++ default: ++ nCode = KEY_F1 + (keyval-GDK_F1); break; ++ } ++ } ++ } ++ else ++ { ++ switch( keyval ) ++ { ++ case GDK_KP_Down: ++ case GDK_Down: nCode = KEY_DOWN; break; ++ case GDK_KP_Up: ++ case GDK_Up: nCode = KEY_UP; break; ++ case GDK_KP_Left: ++ case GDK_Left: nCode = KEY_LEFT; break; ++ case GDK_KP_Right: ++ case GDK_Right: nCode = KEY_RIGHT; break; ++ case GDK_KP_Begin: ++ case GDK_KP_Home: ++ case GDK_Begin: ++ case GDK_Home: nCode = KEY_HOME; break; ++ case GDK_KP_End: ++ case GDK_End: nCode = KEY_END; break; ++ case GDK_KP_Page_Up: ++ case GDK_Page_Up: nCode = KEY_PAGEUP; break; ++ case GDK_KP_Page_Down: ++ case GDK_Page_Down: nCode = KEY_PAGEDOWN; break; ++ case GDK_KP_Enter: ++ case GDK_Return: nCode = KEY_RETURN; break; ++ case GDK_Escape: nCode = KEY_ESCAPE; break; ++ case GDK_ISO_Left_Tab: ++ case GDK_KP_Tab: ++ case GDK_Tab: nCode = KEY_TAB; break; ++ case GDK_BackSpace: nCode = KEY_BACKSPACE; break; ++ case GDK_KP_Space: ++ case GDK_space: nCode = KEY_SPACE; break; ++ case GDK_KP_Insert: ++ case GDK_Insert: nCode = KEY_INSERT; break; ++ case GDK_KP_Delete: ++ case GDK_Delete: nCode = KEY_DELETE; break; ++ case GDK_plus: ++ case GDK_KP_Add: nCode = KEY_ADD; break; ++ case GDK_minus: ++ case GDK_KP_Subtract: nCode = KEY_SUBTRACT; break; ++ case GDK_asterisk: ++ case GDK_KP_Multiply: nCode = KEY_MULTIPLY; break; ++ case GDK_slash: ++ case GDK_KP_Divide: nCode = KEY_DIVIDE; break; ++ case GDK_period: nCode = KEY_POINT; break; ++ case GDK_decimalpoint: nCode = KEY_POINT; break; ++ case GDK_comma: nCode = KEY_COMMA; break; ++ case GDK_less: nCode = KEY_LESS; break; ++ case GDK_greater: nCode = KEY_GREATER; break; ++ case GDK_KP_Equal: ++ case GDK_equal: nCode = KEY_EQUAL; break; ++ case GDK_Find: nCode = KEY_FIND; break; ++ case GDK_Menu: nCode = KEY_CONTEXTMENU;break; ++ case GDK_Help: nCode = KEY_HELP; break; ++ case GDK_Undo: nCode = KEY_UNDO; break; ++ case GDK_Redo: nCode = KEY_REPEAT; break; ++ case GDK_KP_Decimal: ++ case GDK_KP_Separator: nCode = KEY_DECIMAL; break; ++ case GDK_asciitilde: nCode = KEY_TILDE; break; ++ case GDK_leftsinglequotemark: ++ case GDK_quoteleft: nCode = KEY_QUOTELEFT; break; ++ case GDK_bracketleft: nCode = KEY_BRACKETLEFT; break; ++ case GDK_bracketright: nCode = KEY_BRACKETRIGHT; break; ++ case GDK_semicolon: nCode = KEY_SEMICOLON; break; ++ case GDK_quoteright: nCode = KEY_QUOTERIGHT; break; ++ // some special cases, also see saldisp.cxx ++ // - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000 ++ case 0x1000FF02: // apXK_Copy ++ nCode = KEY_COPY; ++ break; ++ case 0x1000FF03: // apXK_Cut ++ nCode = KEY_CUT; ++ break; ++ case 0x1000FF04: // apXK_Paste ++ nCode = KEY_PASTE; ++ break; ++ case 0x1000FF14: // apXK_Repeat ++ nCode = KEY_REPEAT; ++ break; ++ // Exit, Save ++ // - - - - - - - - - - - - - - D E C - - - - - - - - - - - - - 0x1000 ++ case 0x1000FF00: ++ nCode = KEY_DELETE; ++ break; ++ // - - - - - - - - - - - - - - H P - - - - - - - - - - - - - 0x1000 ++ case 0x1000FF73: // hpXK_DeleteChar ++ nCode = KEY_DELETE; ++ break; ++ case 0x1000FF74: // hpXK_BackTab ++ case 0x1000FF75: // hpXK_KP_BackTab ++ nCode = KEY_TAB; ++ break; ++ // - - - - - - - - - - - - - - I B M - - - - - - - - - - - - - ++ // - - - - - - - - - - - - - - O S F - - - - - - - - - - - - - 0x1004 ++ case 0x1004FF02: // osfXK_Copy ++ nCode = KEY_COPY; ++ break; ++ case 0x1004FF03: // osfXK_Cut ++ nCode = KEY_CUT; ++ break; ++ case 0x1004FF04: // osfXK_Paste ++ nCode = KEY_PASTE; ++ break; ++ case 0x1004FF07: // osfXK_BackTab ++ nCode = KEY_TAB; ++ break; ++ case 0x1004FF08: // osfXK_BackSpace ++ nCode = KEY_BACKSPACE; ++ break; ++ case 0x1004FF1B: // osfXK_Escape ++ nCode = KEY_ESCAPE; ++ break; ++ // Up, Down, Left, Right, PageUp, PageDown ++ // - - - - - - - - - - - - - - S C O - - - - - - - - - - - - - ++ // - - - - - - - - - - - - - - S G I - - - - - - - - - - - - - 0x1007 ++ // - - - - - - - - - - - - - - S N I - - - - - - - - - - - - - ++ // - - - - - - - - - - - - - - S U N - - - - - - - - - - - - - 0x1005 ++ case 0x1005FF10: // SunXK_F36 ++ nCode = KEY_F11; ++ break; ++ case 0x1005FF11: // SunXK_F37 ++ nCode = KEY_F12; ++ break; ++ case 0x1005FF70: // SunXK_Props ++ nCode = KEY_PROPERTIES; ++ break; ++ case 0x1005FF71: // SunXK_Front ++ nCode = KEY_FRONT; ++ break; ++ case 0x1005FF72: // SunXK_Copy ++ nCode = KEY_COPY; ++ break; ++ case 0x1005FF73: // SunXK_Open ++ nCode = KEY_OPEN; ++ break; ++ case 0x1005FF74: // SunXK_Paste ++ nCode = KEY_PASTE; ++ break; ++ case 0x1005FF75: // SunXK_Cut ++ nCode = KEY_CUT; ++ break; ++ } ++ } ++ ++ return nCode; ++} ++ ++static guint GetKeyValFor(GdkKeymap* pKeyMap, guint16 hardware_keycode, guint8 group) ++{ ++ guint updated_keyval = 0; ++ gdk_keymap_translate_keyboard_state(pKeyMap, hardware_keycode, ++ (GdkModifierType)0, group, &updated_keyval, NULL, NULL, NULL); ++ return updated_keyval; ++} ++ ++// F10 means either KEY_F10 or KEY_MENU, which has to be decided ++// in the independent part. ++struct KeyAlternate ++{ ++ sal_uInt16 nKeyCode; ++ sal_Unicode nCharCode; ++ KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {} ++ KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} ++}; ++ ++inline KeyAlternate ++GetAlternateKeyCode( const sal_uInt16 nKeyCode ) ++{ ++ KeyAlternate aAlternate; ++ ++ switch( nKeyCode ) ++ { ++ case KEY_F10: aAlternate = KeyAlternate( KEY_MENU );break; ++ case KEY_F24: aAlternate = KeyAlternate( KEY_SUBTRACT, '-' );break; ++ } ++ ++ return aAlternate; ++} ++ ++#if GTK_CHECK_VERSION(3,0,0) ++ ++namespace { ++/// Decouple SalFrame lifetime from damagetracker lifetime ++struct DamageTracker : public basebmp::IBitmapDeviceDamageTracker ++{ ++ DamageTracker(GtkSalFrame& rFrame) : m_rFrame(rFrame) ++ {} ++ ++ virtual ~DamageTracker() {} ++ ++ virtual void damaged(const basegfx::B2IBox& rDamageRect) const SAL_OVERRIDE ++ { ++ m_rFrame.damaged(rDamageRect); ++ } ++ ++ GtkSalFrame& m_rFrame; ++}; ++} ++ ++static bool dumpframes = false; ++#endif ++ ++void GtkSalFrame::doKeyCallback( guint state, ++ guint keyval, ++ guint16 hardware_keycode, ++ guint8 group, ++ guint32 time, ++ sal_Unicode aOrigCode, ++ bool bDown, ++ bool bSendRelease ++ ) ++{ ++ SalKeyEvent aEvent; ++ ++ aEvent.mnTime = time; ++ aEvent.mnCharCode = aOrigCode; ++ aEvent.mnRepeat = 0; ++ ++ vcl::DeletionListener aDel( this ); ++ ++#if GTK_CHECK_VERSION(3,0,0) ++#if 0 ++ // shift-zero forces a re-draw and event is swallowed ++ if (keyval == GDK_0) ++ { ++ fprintf( stderr, "force widget_queue_draw\n"); ++ gtk_widget_queue_draw (m_pFixedContainer); ++ return; ++ } ++ else if (keyval == GDK_1) ++ { ++ fprintf( stderr, "force repaint all\n"); ++ TriggerPaintEvent(); ++ return; ++ } ++ else if (keyval == GDK_2) ++ { ++ dumpframes = !dumpframes; ++ fprintf(stderr, "toggle dump frames to %d\n", dumpframes); ++ return; ++ } ++#endif ++#endif ++ ++ /* ++ * #i42122# translate all keys with Ctrl and/or Alt to group 0 else ++ * shortcuts (e.g. Ctrl-o) will not work but be inserted by the ++ * application ++ * ++ * #i52338# do this for all keys that the independent part has no key code ++ * for ++ * ++ * fdo#41169 rather than use group 0, detect if there is a group which can ++ * be used to input Latin text and use that if possible ++ */ ++ aEvent.mnCode = GetKeyCode( keyval ); ++ if( aEvent.mnCode == 0 ) ++ { ++ gint best_group = SAL_MAX_INT32; ++ ++ // Try and find Latin layout ++ GdkKeymap* keymap = gdk_keymap_get_default(); ++ GdkKeymapKey *keys; ++ gint n_keys; ++ if (gdk_keymap_get_entries_for_keyval(keymap, GDK_A, &keys, &n_keys)) ++ { ++ // Find the lowest group that supports Latin layout ++ for (gint i = 0; i < n_keys; ++i) ++ { ++ if (keys[i].level != 0 && keys[i].level != 1) ++ continue; ++ best_group = std::min(best_group, keys[i].group); ++ if (best_group == 0) ++ break; ++ } ++ g_free(keys); ++ } ++ ++ //Unavailable, go with original group then I suppose ++ if (best_group == SAL_MAX_INT32) ++ best_group = group; ++ ++ guint updated_keyval = GetKeyValFor(keymap, hardware_keycode, best_group); ++ aEvent.mnCode = GetKeyCode(updated_keyval); ++ } ++ ++ aEvent.mnCode |= GetKeyModCode( state ); ++ ++ if( bDown ) ++ { ++ bool bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent ); ++ // #i46889# copy AlternatKeyCode handling from generic plugin ++ if( ! bHandled ) ++ { ++ KeyAlternate aAlternate = GetAlternateKeyCode( aEvent.mnCode ); ++ if( aAlternate.nKeyCode ) ++ { ++ aEvent.mnCode = aAlternate.nKeyCode; ++ if( aAlternate.nCharCode ) ++ aEvent.mnCharCode = aAlternate.nCharCode; ++ bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent ); ++ } ++ } ++ if( bSendRelease && ! aDel.isDeleted() ) ++ { ++ CallCallback( SALEVENT_KEYUP, &aEvent ); ++ } ++ } ++ else ++ CallCallback( SALEVENT_KEYUP, &aEvent ); ++} ++ ++GtkSalFrame::GraphicsHolder::~GraphicsHolder() ++{ ++ delete pGraphics; ++} ++ ++GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle ) ++ : m_nXScreen( getDisplay()->GetDefaultXScreen() ) ++{ ++ getDisplay()->registerFrame( this ); ++ m_bDefaultPos = true; ++ m_bDefaultSize = ( (nStyle & SAL_FRAME_STYLE_SIZEABLE) && ! pParent ); ++ m_bWindowIsGtkPlug = false; ++#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) ++ m_pLastSyncedDbusMenu = NULL; ++#endif ++ Init( pParent, nStyle ); ++} ++ ++GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) ++ : m_nXScreen( getDisplay()->GetDefaultXScreen() ) ++{ ++ getDisplay()->registerFrame( this ); ++ // permanently ignore errors from our unruly children ... ++ GetGenericData()->ErrorTrapPush(); ++ m_bDefaultPos = true; ++ m_bDefaultSize = true; ++#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) ++ m_pLastSyncedDbusMenu = NULL; ++#endif ++ Init( pSysData ); ++} ++ ++#ifdef ENABLE_GMENU_INTEGRATION ++ ++static void ++gdk_x11_window_set_utf8_property (GdkWindow *window, ++ const gchar *name, ++ const gchar *value) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ GdkDisplay* display = gdk_window_get_display (window); ++ ++ if (value != NULL) ++ { ++ XChangeProperty (GDK_DISPLAY_XDISPLAY (display), ++ GDK_WINDOW_XID (window), ++ gdk_x11_get_xatom_by_name_for_display (display, name), ++ gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8, ++ PropModeReplace, reinterpret_cast(value), strlen (value)); ++ } ++ else ++ { ++ XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), ++ GDK_WINDOW_XID (window), ++ gdk_x11_get_xatom_by_name_for_display (display, name)); ++ } ++#endif ++} ++ ++// AppMenu watch functions. ++ ++static void ObjectDestroyedNotify( gpointer data ) ++{ ++ if ( data ) { ++ g_object_unref( data ); ++ } ++} ++ ++#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) ++void GtkSalFrame::EnsureDbusMenuSynced() ++{ ++ GtkSalMenu* pSalMenu = static_cast(GetMenu()); ++ if(m_pLastSyncedDbusMenu != pSalMenu) { ++ m_pLastSyncedDbusMenu = pSalMenu; ++ static_cast(pSalMenu)->Activate(); ++ } ++} ++#endif ++ ++static void hud_activated( gboolean hud_active, gpointer user_data ) ++{ ++ if ( hud_active ) ++ { ++ SolarMutexGuard aGuard; ++ GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); ++ GtkSalMenu* pSalMenu = reinterpret_cast< GtkSalMenu* >( pSalFrame->GetMenu() ); ++ ++ if ( pSalMenu ) ++ pSalMenu->UpdateFull(); ++ } ++} ++ ++static void activate_uno(GSimpleAction *action, GVariant*, gpointer) ++{ ++ uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); ++ ++ uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext ); ++ ++ uno::Reference < css::frame::XFrame > xFrame(xDesktop->getActiveFrame()); ++ if (!xFrame.is()) ++ xFrame = uno::Reference < css::frame::XFrame >(xDesktop, uno::UNO_QUERY); ++ ++ if (!xFrame.is()) ++ return; ++ ++ uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, uno::UNO_QUERY); ++ if (!xDispatchProvider.is()) ++ return; ++ ++ gchar *strval = NULL; ++ g_object_get(action, "name", &strval, NULL); ++ if (!strval) ++ return; ++ ++ if (strcmp(strval, "New") == 0) ++ { ++ uno::Reference xModuleManager(frame::ModuleManager::create(xContext)); ++ OUString aModuleId(xModuleManager->identify(xFrame)); ++ if (aModuleId.isEmpty()) ++ return; ++ ++ comphelper::SequenceAsHashMap lModuleDescription(xModuleManager->getByName(aModuleId)); ++ OUString sFactoryService; ++ lModuleDescription[OUString("ooSetupFactoryEmptyDocumentURL")] >>= sFactoryService; ++ if (sFactoryService.isEmpty()) ++ return; ++ ++ uno::Sequence < css::beans::PropertyValue > args(0); ++ xDesktop->loadComponentFromURL(sFactoryService, OUString("_blank"), 0, args); ++ return; ++ } ++ ++ OUString sCommand(".uno:"); ++ sCommand += OUString(strval, strlen(strval), RTL_TEXTENCODING_UTF8); ++ g_free(strval); ++ ++ css::util::URL aCommand; ++ aCommand.Complete = sCommand; ++ uno::Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(xContext); ++ xParser->parseStrict(aCommand); ++ ++ uno::Reference< css::frame::XDispatch > xDisp = xDispatchProvider->queryDispatch(aCommand, OUString(), 0); ++ ++ if (!xDisp.is()) ++ return; ++ ++ xDisp->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >()); ++} ++ ++static const GActionEntry app_entries[] = { ++ { "OptionsTreeDialog", activate_uno, NULL, NULL, NULL, {0} }, ++ { "About", activate_uno, NULL, NULL, NULL, {0} }, ++ { "HelpIndex", activate_uno, NULL, NULL, NULL, {0} }, ++ { "Quit", activate_uno, NULL, NULL, NULL, {0} }, ++ { "New", activate_uno, NULL, NULL, NULL, {0} } ++}; ++ ++gboolean ensure_dbus_setup( gpointer data ) ++{ ++ GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( data ); ++ GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() ); ++ ++ if ( gdkWindow != NULL && g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-menubar" ) == NULL ) ++ { ++ // Get a DBus session connection. ++ if(!pSessionBus) ++ pSessionBus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); ++ if( !pSessionBus ) ++ return FALSE; ++ ++ // Create menu model and action group attached to this frame. ++ GMenuModel* pMenuModel = G_MENU_MODEL( g_lo_menu_new() ); ++ GActionGroup* pActionGroup = reinterpret_cast(g_lo_action_group_new( static_cast< gpointer >( pSalFrame ) )); ++ ++ // Generate menu paths. ++ ::Window windowId = GDK_WINDOW_XID( gdkWindow ); ++ gchar* aDBusWindowPath = g_strdup_printf( "/org/libreoffice/window/%lu", windowId ); ++ gchar* aDBusMenubarPath = g_strdup_printf( "/org/libreoffice/window/%lu/menus/menubar", windowId ); ++ ++ // Set window properties. ++ g_object_set_data_full( G_OBJECT( gdkWindow ), "g-lo-menubar", pMenuModel, ObjectDestroyedNotify ); ++ g_object_set_data_full( G_OBJECT( gdkWindow ), "g-lo-action-group", pActionGroup, ObjectDestroyedNotify ); ++ ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_ID", "org.libreoffice" ); ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_UNIQUE_BUS_NAME", g_dbus_connection_get_unique_name( pSessionBus ) ); ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_OBJECT_PATH", "/org/libreoffice" ); ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_WINDOW_OBJECT_PATH", aDBusWindowPath ); ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_MENUBAR_OBJECT_PATH", aDBusMenubarPath ); ++ ++ // Publish the menu model and the action group. ++ SAL_INFO("vcl.unity", "exporting menu model at " << pMenuModel << " for window " << windowId); ++ pSalFrame->m_nMenuExportId = g_dbus_connection_export_menu_model (pSessionBus, aDBusMenubarPath, pMenuModel, NULL); ++ SAL_INFO("vcl.unity", "exporting action group at " << pActionGroup << " for window " << windowId); ++ pSalFrame->m_nActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, aDBusWindowPath, pActionGroup, NULL); ++ pSalFrame->m_nHudAwarenessId = hud_awareness_register( pSessionBus, aDBusMenubarPath, hud_activated, pSalFrame, NULL, NULL ); ++ ++ // fdo#70885 we don't want app menu under Unity ++ bool bDesktopIsUnity = (SalGetDesktopEnvironment() == "UNITY"); ++ ++ if (!bDesktopIsUnity) ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APP_MENU_OBJECT_PATH", "/org/libreoffice/menus/appmenu" ); ++ ++ //app menu, to-do translations, block normal menus when active, honor use appmenu settings ++ ResMgr* pMgr = ImplGetResMgr(); ++ if( pMgr && !bDesktopIsUnity ) ++ { ++ GMenu *menu = g_menu_new (); ++ GMenuItem* item; ++ ++ GMenu *firstsubmenu = g_menu_new (); ++ ++ OString sNew(OUStringToOString(ResId(SV_BUTTONTEXT_NEW, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sNew.getStr(), "app.New"); ++ g_menu_append_item( firstsubmenu, item ); ++ g_object_unref(item); ++ ++ g_menu_append_section( menu, NULL, G_MENU_MODEL(firstsubmenu)); ++ g_object_unref(firstsubmenu); ++ ++ GMenu *secondsubmenu = g_menu_new (); ++ ++ OString sPreferences(OUStringToOString(ResId(SV_STDTEXT_PREFERENCES, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sPreferences.getStr(), "app.OptionsTreeDialog"); ++ g_menu_append_item( secondsubmenu, item ); ++ g_object_unref(item); ++ ++ g_menu_append_section( menu, NULL, G_MENU_MODEL(secondsubmenu)); ++ g_object_unref(secondsubmenu); ++ ++ GMenu *thirdsubmenu = g_menu_new (); ++ ++ OString sHelp(OUStringToOString(ResId(SV_BUTTONTEXT_HELP, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sHelp.getStr(), "app.HelpIndex"); ++ g_menu_append_item( thirdsubmenu, item ); ++ g_object_unref(item); ++ ++ OString sAbout(OUStringToOString(ResId(SV_STDTEXT_ABOUT, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sAbout.getStr(), "app.About"); ++ g_menu_append_item( thirdsubmenu, item ); ++ g_object_unref(item); ++ ++ OString sQuit(OUStringToOString(ResId(SV_MENU_MAC_QUITAPP, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sQuit.getStr(), "app.Quit"); ++ g_menu_append_item( thirdsubmenu, item ); ++ g_object_unref(item); ++ g_menu_append_section( menu, NULL, G_MENU_MODEL(thirdsubmenu)); ++ g_object_unref(thirdsubmenu); ++ ++ GSimpleActionGroup *group = g_simple_action_group_new (); ++#if GLIB_CHECK_VERSION(2,38,0) // g_simple_action_group_add_entries is deprecated since 2.38 ++ g_action_map_add_action_entries (G_ACTION_MAP (group), app_entries, G_N_ELEMENTS (app_entries), NULL); ++#else ++ g_simple_action_group_add_entries (group, app_entries, G_N_ELEMENTS (app_entries), NULL); ++#endif ++ GActionGroup* pAppActionGroup = G_ACTION_GROUP(group); ++ ++ pSalFrame->m_nAppActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, "/org/libreoffice", pAppActionGroup, NULL); ++ g_object_unref(pAppActionGroup); ++ pSalFrame->m_nAppMenuExportId = g_dbus_connection_export_menu_model (pSessionBus, "/org/libreoffice/menus/appmenu", G_MENU_MODEL (menu), NULL); ++ g_object_unref(menu); ++ } ++ ++ g_free( aDBusMenubarPath ); ++ g_free( aDBusWindowPath ); ++ } ++ ++ return FALSE; ++} ++ ++void on_registrar_available( GDBusConnection * /*connection*/, ++ const gchar * /*name*/, ++ const gchar * /*name_owner*/, ++ gpointer user_data ) ++{ ++ SolarMutexGuard aGuard; ++ ++ GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); ++ ++ SalMenu* pSalMenu = pSalFrame->GetMenu(); ++ ++ if ( pSalMenu != NULL ) ++ { ++ GtkSalMenu* pGtkSalMenu = static_cast(pSalMenu); ++ pGtkSalMenu->Display( true ); ++ pGtkSalMenu->UpdateFull(); ++ } ++} ++ ++// This is called when the registrar becomes unavailable. It shows the menubar. ++void on_registrar_unavailable( GDBusConnection * /*connection*/, ++ const gchar * /*name*/, ++ gpointer user_data ) ++{ ++ SolarMutexGuard aGuard; ++ ++ SAL_INFO("vcl.unity", "on_registrar_unavailable"); ++ ++ //pSessionBus = NULL; ++ GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); ++ ++ SalMenu* pSalMenu = pSalFrame->GetMenu(); ++ ++ if ( pSalMenu ) { ++ GtkSalMenu* pGtkSalMenu = static_cast< GtkSalMenu* >( pSalMenu ); ++ pGtkSalMenu->Display( false ); ++ } ++} ++#endif ++ ++void GtkSalFrame::EnsureAppMenuWatch() ++{ ++#ifdef ENABLE_GMENU_INTEGRATION ++ if ( !m_nWatcherId ) ++ { ++ // Get a DBus session connection. ++ if ( pSessionBus == NULL ) ++ { ++ pSessionBus = g_bus_get_sync( G_BUS_TYPE_SESSION, NULL, NULL ); ++ ++ if ( pSessionBus == NULL ) ++ return; ++ } ++ ++ // Publish the menu only if AppMenu registrar is available. ++ m_nWatcherId = g_bus_watch_name_on_connection( pSessionBus, ++ "com.canonical.AppMenu.Registrar", ++ G_BUS_NAME_WATCHER_FLAGS_NONE, ++ on_registrar_available, ++ on_registrar_unavailable, ++ static_cast(this), ++ NULL ); ++ } ++ ++ //ensure_dbus_setup( this ); ++#else ++ (void) this; // loplugin:staticmethods ++#endif ++} ++ ++void GtkSalFrame::InvalidateGraphics() ++{ ++ for (unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); ++i) ++ { ++ if( !m_aGraphics[i].pGraphics ) ++ continue; ++#if !GTK_CHECK_VERSION(3,0,0) ++ m_aGraphics[i].pGraphics->SetDrawable( None, m_nXScreen ); ++ m_aGraphics[i].pGraphics->SetWindow(NULL); ++#endif ++ m_aGraphics[i].bInUse = false; ++ } ++} ++ ++GtkSalFrame::~GtkSalFrame() ++{ ++ InvalidateGraphics(); ++ ++ if( m_pParent ) ++ m_pParent->m_aChildren.remove( this ); ++ ++ getDisplay()->deregisterFrame( this ); ++ ++ if( m_pRegion ) ++ { ++#if GTK_CHECK_VERSION(3,0,0) ++ cairo_region_destroy( m_pRegion ); ++#else ++ gdk_region_destroy( m_pRegion ); ++#endif ++ } ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( m_hBackgroundPixmap ) ++ { ++ XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), ++ widget_get_xid(m_pWindow), ++ None ); ++ XFreePixmap( getDisplay()->GetDisplay(), m_hBackgroundPixmap ); ++ } ++#endif ++ ++ if( m_pIMHandler ) ++ delete m_pIMHandler; ++ ++ GtkWidget *pEventWidget = getMouseEventWidget(); ++ for (auto handler_id : m_aMouseSignalIds) ++ g_signal_handler_disconnect(G_OBJECT(pEventWidget), handler_id); ++ if( m_pFixedContainer ) ++ gtk_widget_destroy( GTK_WIDGET( m_pFixedContainer ) ); ++ if( m_pEventBox ) ++ gtk_widget_destroy( GTK_WIDGET(m_pEventBox) ); ++ { ++ SolarMutexGuard aGuard; ++#if defined ENABLE_GMENU_INTEGRATION ++ if(m_nWatcherId) ++ g_bus_unwatch_name(m_nWatcherId); ++#endif ++ if( m_pWindow ) ++ { ++ g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", NULL ); ++ ++#if defined ENABLE_GMENU_INTEGRATION ++ if ( pSessionBus ) ++ { ++ if ( m_nHudAwarenessId ) ++ hud_awareness_unregister( pSessionBus, m_nHudAwarenessId ); ++ if ( m_nMenuExportId ) ++ g_dbus_connection_unexport_menu_model( pSessionBus, m_nMenuExportId ); ++ if ( m_nAppMenuExportId ) ++ g_dbus_connection_unexport_menu_model( pSessionBus, m_nAppMenuExportId ); ++ if ( m_nActionGroupExportId ) ++ g_dbus_connection_unexport_action_group( pSessionBus, m_nActionGroupExportId ); ++ if ( m_nAppActionGroupExportId ) ++ g_dbus_connection_unexport_action_group( pSessionBus, m_nAppActionGroupExportId ); ++ } ++#endif ++ gtk_widget_destroy( m_pWindow ); ++ } ++ } ++ if( m_pForeignParent ) ++ g_object_unref( G_OBJECT( m_pForeignParent ) ); ++ if( m_pForeignTopLevel ) ++ g_object_unref( G_OBJECT( m_pForeignTopLevel) ); ++} ++ ++void GtkSalFrame::moveWindow( long nX, long nY ) ++{ ++ if( isChild( false, true ) ) ++ { ++ if( m_pParent ) ++ gtk_fixed_move( m_pParent->getFixedContainer(), ++ m_pWindow, ++ nX - m_pParent->maGeometry.nX, nY - m_pParent->maGeometry.nY ); ++ } ++ else ++ gtk_window_move( GTK_WINDOW(m_pWindow), nX, nY ); ++} ++ ++void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ gint nOrigwidth, nOrigheight; ++ gtk_window_get_size(GTK_WINDOW(m_pWindow), &nOrigwidth, &nOrigheight); ++ if (nWidth > nOrigwidth || nHeight > nOrigheight) ++ { ++ m_bPaintsBlocked = true; ++ } ++ gtk_widget_set_size_request(m_pWindow, nWidth, nHeight ); ++#else ++ gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight ); ++#endif ++} ++ ++void GtkSalFrame::window_resize(long nWidth, long nHeight) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ gint nOrigwidth, nOrigheight; ++ gtk_window_get_size(GTK_WINDOW(m_pWindow), &nOrigwidth, &nOrigheight); ++ if (nWidth > nOrigwidth || nHeight > nOrigheight) ++ { ++ m_bPaintsBlocked = true; ++ } ++#endif ++ gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight); ++} ++ ++void GtkSalFrame::resizeWindow( long nWidth, long nHeight ) ++{ ++ if( isChild( false, true ) ) ++ { ++ widget_set_size_request(nWidth, nHeight); ++ } ++ else if( ! isChild( true, false ) ) ++ window_resize(nWidth, nHeight); ++} ++ ++#if GTK_CHECK_VERSION(3,2,0) ++ ++static void ++ooo_fixed_class_init(GtkFixedClass *klass) ++{ ++ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); ++ widget_class->get_accessible = ooo_fixed_get_accessible; ++} ++ ++#endif ++ ++/* ++ * Always use a sub-class of GtkFixed we can tag for a11y. This allows us to ++ * utilize GAIL for the toplevel window and toolkit implementation incl. ++ * key event listener support .. ++ */ ++ ++GType ++ooo_fixed_get_type() ++{ ++ static GType type = 0; ++ ++ if (!type) { ++ static const GTypeInfo tinfo = ++ { ++ sizeof (GtkFixedClass), ++ nullptr, /* base init */ ++ nullptr, /* base finalize */ ++#if GTK_CHECK_VERSION(3,2,0) ++ reinterpret_cast(ooo_fixed_class_init), /* class init */ ++#else ++ nullptr, /* class init */ ++#endif ++ nullptr, /* class finalize */ ++ NULL, /* class data */ ++ sizeof (GtkFixed), /* instance size */ ++ 0, /* nb preallocs */ ++ (GInstanceInitFunc) NULL, /* instance init */ ++ NULL /* value table */ ++ }; ++ ++ type = g_type_register_static( GTK_TYPE_FIXED, "OOoFixed", ++ &tinfo, (GTypeFlags) 0); ++ } ++ ++ return type; ++} ++ ++void GtkSalFrame::updateScreenNumber() ++{ ++ int nScreen = 0; ++ GdkScreen *pScreen = gtk_widget_get_screen( m_pWindow ); ++ if( pScreen ) ++ nScreen = getDisplay()->getSystem()->getScreenMonitorIdx( pScreen, maGeometry.nX, maGeometry.nY ); ++ maGeometry.nDisplayScreenNumber = nScreen; ++} ++ ++GtkWidget *GtkSalFrame::getMouseEventWidget() const ++{ ++#if GTK_CHECK_VERSION(3,0,0) ++ return GTK_WIDGET(m_pEventBox); ++#else ++ return m_pWindow; ++#endif ++} ++ ++void GtkSalFrame::InitCommon() ++{ ++#if GTK_CHECK_VERSION(3,0,0) ++ m_pEventBox = GTK_EVENT_BOX(gtk_event_box_new()); ++ gtk_widget_add_events( GTK_WIDGET(m_pEventBox), ++ GDK_ALL_EVENTS_MASK ); ++ gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pEventBox) ); ++ ++ // add the fixed container child, ++ // fixed is needed since we have to position plugin windows ++ m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL )); ++ gtk_container_add( GTK_CONTAINER(m_pEventBox), GTK_WIDGET(m_pFixedContainer) ); ++#else ++ m_pEventBox = 0; ++ // add the fixed container child, ++ // fixed is needed since we have to position plugin windows ++ m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL )); ++ gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pFixedContainer) ); ++#endif ++ ++ GtkWidget *pEventWidget = getMouseEventWidget(); ++ ++ gtk_widget_set_app_paintable(GTK_WIDGET(m_pFixedContainer), true); ++ /*non-X11 displays won't show anything at all without double-buffering ++ enabled*/ ++ if (GDK_IS_X11_DISPLAY(getGdkDisplay())) ++ gtk_widget_set_double_buffered(GTK_WIDGET(m_pFixedContainer), false); ++ gtk_widget_set_redraw_on_allocate(GTK_WIDGET(m_pFixedContainer), false); ++ ++ ++ // connect signals ++ g_signal_connect( G_OBJECT(m_pWindow), "style-set", G_CALLBACK(signalStyleSet), this ); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-press-event", G_CALLBACK(signalButton), this )); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "motion-notify-event", G_CALLBACK(signalMotion), this )); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-release-event", G_CALLBACK(signalButton), this )); ++#if GTK_CHECK_VERSION(3,0,0) ++ g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this ); ++ g_signal_connect( G_OBJECT(m_pFixedContainer), "size-allocate", G_CALLBACK(sizeAllocated), this ); ++// g_signal_connect( G_OBJECT(m_pWindow), "state-flags-changed", G_CALLBACK(signalFlagsChanged), this ); ++#if GTK_CHECK_VERSION(3,14,0) ++ GtkGesture *pSwipe = gtk_gesture_swipe_new(pEventWidget); ++ g_signal_connect(pSwipe, "swipe", G_CALLBACK(gestureSwipe), this); ++ gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER (pSwipe), GTK_PHASE_TARGET); ++ g_object_weak_ref(G_OBJECT(pEventWidget), reinterpret_cast(g_object_unref), pSwipe); ++ ++ GtkGesture *pLongPress = gtk_gesture_long_press_new(pEventWidget); ++ g_signal_connect(pLongPress, "pressed", G_CALLBACK(gestureLongPress), this); ++ gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER (pLongPress), GTK_PHASE_TARGET); ++ g_object_weak_ref(G_OBJECT(pEventWidget), reinterpret_cast(g_object_unref), pLongPress); ++ ++#endif ++ ++#else ++ g_signal_connect( G_OBJECT(m_pFixedContainer), "expose-event", G_CALLBACK(signalExpose), this ); ++#endif ++ g_signal_connect( G_OBJECT(m_pWindow), "focus-in-event", G_CALLBACK(signalFocus), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "focus-out-event", G_CALLBACK(signalFocus), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "map-event", G_CALLBACK(signalMap), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "unmap-event", G_CALLBACK(signalUnmap), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "configure-event", G_CALLBACK(signalConfigure), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "key-press-event", G_CALLBACK(signalKey), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "key-release-event", G_CALLBACK(signalKey), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "delete-event", G_CALLBACK(signalDelete), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "window-state-event", G_CALLBACK(signalWindowState), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "scroll-event", G_CALLBACK(signalScroll), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "leave-notify-event", G_CALLBACK(signalCrossing), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "enter-notify-event", G_CALLBACK(signalCrossing), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "visibility-notify-event", G_CALLBACK(signalVisibility), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "destroy", G_CALLBACK(signalDestroy), this ); ++ ++ // init members ++ m_pCurrentCursor = NULL; ++ m_nKeyModifiers = 0; ++ m_bFullscreen = false; ++ m_bSpanMonitorsWhenFullscreen = false; ++ m_nState = GDK_WINDOW_STATE_WITHDRAWN; ++ m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED; ++#if GTK_CHECK_VERSION(3,0,0) ++ m_nLastScrollEventTime = GDK_CURRENT_TIME; ++#endif ++ m_bSendModChangeOnRelease = false; ++ m_pIMHandler = NULL; ++ m_hBackgroundPixmap = None; ++ m_nSavedScreenSaverTimeout = 0; ++ m_nGSMCookie = 0; ++ m_nExtStyle = 0; ++ m_pRegion = NULL; ++ m_ePointerStyle = static_cast(0xffff); ++ m_bSetFocusOnMap = false; ++ m_pSalMenu = NULL; ++ m_nWatcherId = 0; ++ m_nMenuExportId = 0; ++ m_nAppMenuExportId = 0; ++ m_nActionGroupExportId = 0; ++ m_nAppActionGroupExportId = 0; ++ m_nHudAwarenessId = 0; ++ ++ gtk_widget_add_events( m_pWindow, ++ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | ++ GDK_VISIBILITY_NOTIFY_MASK | GDK_SCROLL_MASK ++ ); ++ ++ // show the widgets ++#if GTK_CHECK_VERSION(3,0,0) ++ gtk_widget_show_all( GTK_WIDGET(m_pEventBox) ); ++#else ++ gtk_widget_show_all( GTK_WIDGET(m_pFixedContainer) ); ++#endif ++ ++ // realize the window, we need an XWindow id ++ gtk_widget_realize( m_pWindow ); ++ ++ //system data ++ m_aSystemData.nSize = sizeof( SystemEnvData ); ++#if !GTK_CHECK_VERSION(3,0,0) ++ GtkSalDisplay* pDisp = GetGtkSalData()->GetGtkDisplay(); ++ m_aSystemData.pDisplay = pDisp->GetDisplay(); ++ m_aSystemData.pVisual = pDisp->GetVisual( m_nXScreen ).GetVisual(); ++ m_aSystemData.nDepth = pDisp->GetVisual( m_nXScreen ).GetDepth(); ++ m_aSystemData.aColormap = pDisp->GetColormap( m_nXScreen ).GetXColormap(); ++ m_aSystemData.aWindow = widget_get_xid(m_pWindow); ++ m_aSystemData.aShellWindow = m_aSystemData.aWindow; ++#else ++ static int nWindow = 0; ++ m_aSystemData.aWindow = nWindow; ++ m_aSystemData.aShellWindow = nWindow; ++ ++nWindow; ++#endif ++ m_aSystemData.pSalFrame = this; ++ m_aSystemData.pWidget = m_pWindow; ++ m_aSystemData.nScreen = m_nXScreen.getXScreen(); ++ m_aSystemData.pAppContext = NULL; ++ m_aSystemData.pShellWidget = m_aSystemData.pWidget; ++ ++ // fake an initial geometry, gets updated via configure event or SetPosSize ++ if( m_bDefaultPos || m_bDefaultSize ) ++ { ++ Size aDefSize = calcDefaultSize(); ++ maGeometry.nX = -1; ++ maGeometry.nY = -1; ++ maGeometry.nWidth = aDefSize.Width(); ++ maGeometry.nHeight = aDefSize.Height(); ++ if( m_pParent ) ++ { ++ // approximation ++ maGeometry.nTopDecoration = m_pParent->maGeometry.nTopDecoration; ++ maGeometry.nBottomDecoration = m_pParent->maGeometry.nBottomDecoration; ++ maGeometry.nLeftDecoration = m_pParent->maGeometry.nLeftDecoration; ++ maGeometry.nRightDecoration = m_pParent->maGeometry.nRightDecoration; ++ } ++ else ++ { ++ maGeometry.nTopDecoration = 0; ++ maGeometry.nBottomDecoration = 0; ++ maGeometry.nLeftDecoration = 0; ++ maGeometry.nRightDecoration = 0; ++ } ++ } ++ else ++ { ++ resizeWindow( maGeometry.nWidth, maGeometry.nHeight ); ++ moveWindow( maGeometry.nX, maGeometry.nY ); ++ } ++ updateScreenNumber(); ++ ++ SetIcon(1); ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ m_nWorkArea = pDisp->getWMAdaptor()->getCurrentWorkArea(); ++ /* #i64117# gtk sets a nice background pixmap ++ * but we actually don't really want that, so save ++ * some time on the Xserver as well as prevent ++ * some paint issues ++ */ ++ XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), ++ widget_get_xid(m_pWindow), ++ m_hBackgroundPixmap ); ++#endif ++} ++ ++/* Sadly gtk_window_set_accept_focus exists only since gtk 2.4 ++ * for achieving the same effect we will remove the WM_TAKE_FOCUS ++ * protocol from the window and set the input hint to false. ++ * But gtk_window_set_accept_focus needs to be called before ++ * window realization whereas the removal obviously can only happen ++ * after realization. ++ */ ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++extern "C" { ++ typedef void(*setAcceptFn)( GtkWindow*, gboolean ); ++ static setAcceptFn p_gtk_window_set_accept_focus = NULL; ++ static bool bGetAcceptFocusFn = true; ++ ++ typedef void(*setUserTimeFn)( GdkWindow*, guint32 ); ++ static setUserTimeFn p_gdk_x11_window_set_user_time = NULL; ++ static bool bGetSetUserTimeFn = true; ++} ++#endif ++ ++static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBeforeRealize ) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( bGetAcceptFocusFn ) ++ { ++ bGetAcceptFocusFn = false; ++ p_gtk_window_set_accept_focus = reinterpret_cast(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_window_set_accept_focus" )); ++ } ++ if( p_gtk_window_set_accept_focus && bBeforeRealize ) ++ p_gtk_window_set_accept_focus( pWindow, bAccept ); ++ else if( ! bBeforeRealize ) ++ { ++ Display* pDisplay = GetGtkSalData()->GetGtkDisplay()->GetDisplay(); ++ ::Window aWindow = widget_get_xid(GTK_WIDGET(pWindow)); ++ XWMHints* pHints = XGetWMHints( pDisplay, aWindow ); ++ if( ! pHints ) ++ { ++ pHints = XAllocWMHints(); ++ pHints->flags = 0; ++ } ++ pHints->flags |= InputHint; ++ pHints->input = bAccept ? True : False; ++ XSetWMHints( pDisplay, aWindow, pHints ); ++ XFree( pHints ); ++ ++ if (GetGtkSalData()->GetGtkDisplay()->getWMAdaptor()->getWindowManagerName() == "compiz") ++ return; ++ ++ /* remove WM_TAKE_FOCUS protocol; this would usually be the ++ * right thing, but gtk handles it internally whereas we ++ * want to handle it ourselves (as to sometimes not get ++ * the focus) ++ */ ++ Atom* pProtocols = NULL; ++ int nProtocols = 0; ++ XGetWMProtocols( pDisplay, ++ aWindow, ++ &pProtocols, &nProtocols ); ++ if( pProtocols ) ++ { ++ bool bSet = false; ++ Atom nTakeFocus = XInternAtom( pDisplay, "WM_TAKE_FOCUS", True ); ++ if( nTakeFocus ) ++ { ++ for( int i = 0; i < nProtocols; i++ ) ++ { ++ if( pProtocols[i] == nTakeFocus ) ++ { ++ for( int n = i; n < nProtocols-1; n++ ) ++ pProtocols[n] = pProtocols[n+1]; ++ nProtocols--; ++ i--; ++ bSet = true; ++ } ++ } ++ } ++ if( bSet ) ++ XSetWMProtocols( pDisplay, aWindow, pProtocols, nProtocols ); ++ XFree( pProtocols ); ++ } ++ } ++#else ++ gtk_window_set_accept_focus(pWindow, bAccept); ++ (void)bBeforeRealize; ++#endif ++} ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++static void lcl_set_user_time( GtkWindow* i_pWindow, guint32 i_nTime ) ++{ ++ if( bGetSetUserTimeFn ) ++ { ++ bGetSetUserTimeFn = false; ++ p_gdk_x11_window_set_user_time = reinterpret_cast(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_x11_window_set_user_time" )); ++ } ++ bool bSet = false; ++ if( p_gdk_x11_window_set_user_time ) ++ { ++ GdkWindow* pWin = widget_get_window(GTK_WIDGET(i_pWindow)); ++ if( pWin ) // only if the window is realized. ++ { ++ p_gdk_x11_window_set_user_time( pWin, i_nTime ); ++ bSet = true; ++ } ++ } ++ if( !bSet ) ++ { ++ Display* pDisplay = GetGtkSalData()->GetGtkDisplay()->GetDisplay(); ++ Atom nUserTime = XInternAtom( pDisplay, "_NET_WM_USER_TIME", True ); ++ if( nUserTime ) ++ { ++ XChangeProperty( pDisplay, widget_get_xid(GTK_WIDGET(i_pWindow)), ++ nUserTime, XA_CARDINAL, 32, ++ PropModeReplace, reinterpret_cast(&i_nTime), 1 ); ++ } ++ } ++}; ++#endif ++ ++GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow ) ++{ ++ return static_cast(g_object_get_data( G_OBJECT( pWindow ), "SalFrame" )); ++} ++ ++void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) ++{ ++ if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style ++ { ++ nStyle |= SAL_FRAME_STYLE_MOVEABLE | SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_CLOSEABLE; ++ nStyle &= ~SAL_FRAME_STYLE_FLOAT; ++ } ++ ++ m_pParent = static_cast(pParent); ++ m_pForeignParent = NULL; ++ m_aForeignParentWindow = None; ++ m_pForeignTopLevel = NULL; ++ m_aForeignTopLevelWindow = None; ++ m_nStyle = nStyle; ++ ++ GtkWindowType eWinType = ( (nStyle & SAL_FRAME_STYLE_FLOAT) && ++ ! (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION| ++ SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) ++ ) ++ ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL; ++ ++ if( nStyle & SAL_FRAME_STYLE_SYSTEMCHILD ) ++ { ++ m_pWindow = gtk_event_box_new(); ++ if( m_pParent ) ++ { ++ // insert into container ++ gtk_fixed_put( m_pParent->getFixedContainer(), ++ m_pWindow, 0, 0 ); ++ ++ } ++ } ++ else ++ { ++ m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType, ++ "visible", FALSE, NULL ); ++ } ++ g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this ); ++ g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", (gpointer)LIBO_VERSION_DOTTED); ++ ++ // force wm class hint ++ m_nExtStyle = ~0; ++ if (m_pParent) ++ m_sWMClass = m_pParent->m_sWMClass; ++ SetExtendedFrameStyle( 0 ); ++ ++ if( m_pParent && m_pParent->m_pWindow && ! isChild() ) ++ gtk_window_set_screen( GTK_WINDOW(m_pWindow), gtk_window_get_screen( GTK_WINDOW(m_pParent->m_pWindow) ) ); ++ ++ if (m_pParent) ++ { ++ if (!(m_pParent->m_nStyle & SAL_FRAME_STYLE_PLUG)) ++ gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) ); ++ m_pParent->m_aChildren.push_back( this ); ++ } ++ ++ InitCommon(); ++ ++ // set window type ++ bool bDecoHandling = ++ ! isChild() && ++ ( ! (nStyle & SAL_FRAME_STYLE_FLOAT) || ++ (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) ); ++ ++ if( bDecoHandling ) ++ { ++ GdkWindowTypeHint eType = GDK_WINDOW_TYPE_HINT_NORMAL; ++ if( (nStyle & SAL_FRAME_STYLE_DIALOG) && m_pParent != 0 ) ++ eType = GDK_WINDOW_TYPE_HINT_DIALOG; ++ if( (nStyle & SAL_FRAME_STYLE_INTRO) ) ++ { ++ gtk_window_set_role( GTK_WINDOW(m_pWindow), "splashscreen" ); ++ eType = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN; ++ } ++ else if( (nStyle & SAL_FRAME_STYLE_TOOLWINDOW ) ) ++ { ++ eType = GDK_WINDOW_TYPE_HINT_UTILITY; ++ gtk_window_set_skip_taskbar_hint( GTK_WINDOW(m_pWindow), true ); ++ } ++ else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) ++ { ++ eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; ++ lcl_set_accept_focus( GTK_WINDOW(m_pWindow), false, true ); ++ } ++ else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) ++ { ++ eType = GDK_WINDOW_TYPE_HINT_UTILITY; ++ } ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( (nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ) ++ && getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) ++ { ++ eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; ++ gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), true ); ++ } ++#endif ++ gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType ); ++ gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC ); ++ } ++ else if( (nStyle & SAL_FRAME_STYLE_FLOAT) ) ++ { ++ gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_POPUP_MENU ); ++ } ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( eWinType == GTK_WINDOW_TOPLEVEL ) ++ { ++#ifdef ENABLE_GMENU_INTEGRATION ++ // Enable DBus native menu if available. ++ ensure_dbus_setup( this ); ++#endif ++ ++ guint32 nUserTime = 0; ++ if( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) ++ { ++ nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); ++ } ++ lcl_set_user_time(GTK_WINDOW(m_pWindow), nUserTime); ++ } ++#endif ++ ++ if( bDecoHandling ) ++ { ++ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) != 0 ); ++ if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) ) ++ lcl_set_accept_focus( GTK_WINDOW(m_pWindow), false, false ); ++ } ++} ++ ++GdkNativeWindow GtkSalFrame::findTopLevelSystemWindow( GdkNativeWindow aWindow ) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ ::Window aRoot, aParent; ++ ::Window* pChildren; ++ unsigned int nChildren; ++ bool bBreak = false; ++ do ++ { ++ pChildren = NULL; ++ nChildren = 0; ++ aParent = aRoot = None; ++ XQueryTree( getDisplay()->GetDisplay(), aWindow, ++ &aRoot, &aParent, &pChildren, &nChildren ); ++ XFree( pChildren ); ++ if( aParent != aRoot ) ++ aWindow = aParent; ++ int nCount = 0; ++ Atom* pProps = XListProperties( getDisplay()->GetDisplay(), ++ aWindow, ++ &nCount ); ++ for( int i = 0; i < nCount && ! bBreak; ++i ) ++ bBreak = (pProps[i] == XA_WM_HINTS); ++ if( pProps ) ++ XFree( pProps ); ++ } while( aParent != aRoot && ! bBreak ); ++ ++ return aWindow; ++#else ++ (void)aWindow; ++ //FIXME: no findToplevelSystemWindow ++ return 0; ++#endif ++} ++ ++void GtkSalFrame::Init( SystemParentData* pSysData ) ++{ ++ m_pParent = NULL; ++ m_aForeignParentWindow = (GdkNativeWindow)pSysData->aWindow; ++ m_pForeignParent = NULL; ++ m_aForeignTopLevelWindow = findTopLevelSystemWindow( (GdkNativeWindow)pSysData->aWindow ); ++ m_pForeignTopLevel = gdk_window_foreign_new_for_display( getGdkDisplay(), m_aForeignTopLevelWindow ); ++ gdk_window_set_events( m_pForeignTopLevel, GDK_STRUCTURE_MASK ); ++ ++ if( pSysData->nSize > sizeof(pSysData->nSize)+sizeof(pSysData->aWindow) && pSysData->bXEmbedSupport ) ++ { ++#if GTK_CHECK_VERSION(3,0,0) ++ m_pWindow = gtk_plug_new_for_display( getGdkDisplay(), pSysData->aWindow ); ++#else ++ m_pWindow = gtk_plug_new( pSysData->aWindow ); ++#endif ++ m_bWindowIsGtkPlug = true; ++ widget_set_can_default( m_pWindow, true ); ++ widget_set_can_focus( m_pWindow, true ); ++ gtk_widget_set_sensitive( m_pWindow, true ); ++ } ++ else ++ { ++ m_pWindow = gtk_window_new( GTK_WINDOW_POPUP ); ++ m_bWindowIsGtkPlug = false; ++ } ++ m_nStyle = SAL_FRAME_STYLE_PLUG; ++ InitCommon(); ++ ++ m_pForeignParent = gdk_window_foreign_new_for_display( getGdkDisplay(), m_aForeignParentWindow ); ++ gdk_window_set_events( m_pForeignParent, GDK_STRUCTURE_MASK ); ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ int x_ret, y_ret; ++ unsigned int w, h, bw, d; ++ ::Window aRoot; ++ XGetGeometry( getDisplay()->GetDisplay(), pSysData->aWindow, ++ &aRoot, &x_ret, &y_ret, &w, &h, &bw, &d ); ++ maGeometry.nWidth = w; ++ maGeometry.nHeight = h; ++ window_resize(w, h); ++ gtk_window_move( GTK_WINDOW(m_pWindow), 0, 0 ); ++ if( ! m_bWindowIsGtkPlug ) ++ { ++ XReparentWindow( getDisplay()->GetDisplay(), ++ widget_get_xid(m_pWindow), ++ (::Window)pSysData->aWindow, ++ 0, 0 ); ++ } ++#else ++ //FIXME: Handling embedded windows, is going to be fun ... ++#endif ++} ++ ++void GtkSalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode ) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ XEvent aEvent; ++ ++ memset( &aEvent, 0, sizeof(aEvent) ); ++ aEvent.xclient.window = m_aForeignParentWindow; ++ aEvent.xclient.type = ClientMessage; ++ aEvent.xclient.message_type = getDisplay()->getWMAdaptor()->getAtom( vcl_sal::WMAdaptor::XEMBED ); ++ aEvent.xclient.format = 32; ++ aEvent.xclient.data.l[0] = i_nTimeCode ? i_nTimeCode : CurrentTime; ++ aEvent.xclient.data.l[1] = 3; // XEMBED_REQUEST_FOCUS ++ aEvent.xclient.data.l[2] = 0; ++ aEvent.xclient.data.l[3] = 0; ++ aEvent.xclient.data.l[4] = 0; ++ ++ GetGenericData()->ErrorTrapPush(); ++ XSendEvent( getDisplay()->GetDisplay(), ++ m_aForeignParentWindow, ++ False, NoEventMask, &aEvent ); ++ GetGenericData()->ErrorTrapPop(); ++#else ++ (void) this; // loplugin:staticmethods ++ (void)i_nTimeCode; ++ //FIXME: no askForXEmbedFocus for gtk3 yet ++#endif ++} ++ ++void GtkSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle ) ++{ ++ if( nStyle != m_nExtStyle && ! isChild() ) ++ { ++ m_nExtStyle = nStyle; ++ updateWMClass(); ++ } ++} ++ ++SalGraphics* GtkSalFrame::AcquireGraphics() ++{ ++ if( m_pWindow ) ++ { ++ for( int i = 0; i < nMaxGraphics; i++ ) ++ { ++ if( ! m_aGraphics[i].bInUse ) ++ { ++ m_aGraphics[i].bInUse = true; ++ if( ! m_aGraphics[i].pGraphics ) ++ { ++#if GTK_CHECK_VERSION(3,0,0) ++ m_aGraphics[i].pGraphics = new GtkSalGraphics( this, m_pWindow ); ++ if( !m_aFrame.get() ) ++ { ++ AllocateFrame(); ++ TriggerPaintEvent(); ++ } ++ m_aGraphics[i].pGraphics->setDevice( m_aFrame ); ++#else // common case: ++ m_aGraphics[i].pGraphics = new GtkSalGraphics( this, m_pWindow, m_nXScreen ); ++#endif ++ } ++ return m_aGraphics[i].pGraphics; ++ } ++ } ++ } ++ ++ return NULL; ++} ++ ++void GtkSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) ++{ ++ for( int i = 0; i < nMaxGraphics; i++ ) ++ { ++ if( m_aGraphics[i].pGraphics == pGraphics ) ++ { ++ m_aGraphics[i].bInUse = false; ++ break; ++ } ++ } ++} ++ ++bool GtkSalFrame::PostEvent( void* pData ) ++{ ++ getDisplay()->SendInternalEvent( this, pData ); ++ return true; ++} ++ ++void GtkSalFrame::SetTitle( const OUString& rTitle ) ++{ ++ m_aTitle = rTitle; ++ if( m_pWindow && ! isChild() ) ++ gtk_window_set_title( GTK_WINDOW(m_pWindow), OUStringToOString( rTitle, RTL_TEXTENCODING_UTF8 ).getStr() ); ++} ++ ++static inline sal_uInt8 * ++getRow( BitmapBuffer *pBuffer, sal_uLong nRow ) ++{ ++ if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) ++ return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize; ++ else ++ return pBuffer->mpBits + ( pBuffer->mnHeight - nRow - 1 ) * pBuffer->mnScanlineSize; ++} ++ ++static GdkPixbuf * ++bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha ) ++{ ++ g_return_val_if_fail( pSalBitmap != NULL, NULL ); ++ g_return_val_if_fail( pSalAlpha != NULL, NULL ); ++ ++ BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( BITMAP_READ_ACCESS ); ++ g_return_val_if_fail( pBitmap != NULL, NULL ); ++ g_return_val_if_fail( pBitmap->mnBitCount == 24 || pBitmap->mnBitCount == 32, NULL ); ++ ++ BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( BITMAP_READ_ACCESS ); ++ g_return_val_if_fail( pAlpha != NULL, NULL ); ++ g_return_val_if_fail( pAlpha->mnBitCount == 8, NULL ); ++ ++ Size aSize = pSalBitmap->GetSize(); ++ g_return_val_if_fail( pSalAlpha->GetSize() == aSize, NULL ); ++ ++ int nX, nY; ++ guchar *pPixbufData = static_cast(g_malloc (4 * aSize.Width() * aSize.Height() )); ++ guchar *pDestData = pPixbufData; ++ ++ for( nY = 0; nY < pBitmap->mnHeight; nY++ ) ++ { ++ sal_uInt8 *pData = getRow( pBitmap, nY ); ++ sal_uInt8 *pAlphaData = getRow( pAlpha, nY ); ++ ++ for( nX = 0; nX < pBitmap->mnWidth; nX++ ) ++ { ++ BitmapColor aColor; ++ if (pBitmap->mnFormat == BMP_FORMAT_24BIT_TC_BGR) ++ { ++ aColor = BitmapColor(pData[2], pData[1], pData[0]); ++ pData += 3; ++ } ++ else if (pBitmap->mnFormat == BMP_FORMAT_24BIT_TC_RGB) ++ { ++ aColor = BitmapColor(pData[0], pData[1], pData[2]); ++ pData += 3; ++ } ++ else ++ { ++ pBitmap->maColorMask.GetColorFor32Bit(aColor, pData); ++ pData += 4; ++ } ++ *pDestData++ = aColor.GetRed(); ++ *pDestData++ = aColor.GetGreen(); ++ *pDestData++ = aColor.GetBlue(); ++ *pDestData++ = 255 - *pAlphaData++; ++ } ++ } ++ ++ pSalBitmap->ReleaseBuffer( pBitmap, BITMAP_READ_ACCESS ); ++ pSalAlpha->ReleaseBuffer( pAlpha, BITMAP_READ_ACCESS ); ++ ++ return gdk_pixbuf_new_from_data( pPixbufData, ++ GDK_COLORSPACE_RGB, true, 8, ++ aSize.Width(), aSize.Height(), ++ aSize.Width() * 4, ++ reinterpret_cast(g_free), ++ NULL ); ++} ++ ++void GtkSalFrame::SetIcon( sal_uInt16 nIcon ) ++{ ++ if( (m_nStyle & (SAL_FRAME_STYLE_PLUG|SAL_FRAME_STYLE_SYSTEMCHILD|SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_INTRO|SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ++ || ! m_pWindow ) ++ return; ++ ++ if( !ImplGetResMgr() ) ++ return; ++ ++ GdkPixbuf *pBuf; ++ GList *pIcons = NULL; ++ ++ sal_uInt16 nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START }; ++ sal_uInt16 nIndex; ++ ++ for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(sal_uInt16); nIndex++ ) ++ { ++ // #i44723# workaround gcc temporary problem ++ ResId aResId( nOffsets[nIndex] + nIcon, *ImplGetResMgr() ); ++ BitmapEx aIcon( aResId ); ++ ++ // #i81083# convert to 24bit/8bit alpha bitmap ++ Bitmap aBmp = aIcon.GetBitmap(); ++ if( aBmp.GetBitCount() != 24 || ! aIcon.IsAlpha() ) ++ { ++ if( aBmp.GetBitCount() != 24 ) ++ aBmp.Convert( BMP_CONVERSION_24BIT ); ++ AlphaMask aMask; ++ if( ! aIcon.IsAlpha() ) ++ { ++ switch( aIcon.GetTransparentType() ) ++ { ++ case TRANSPARENT_NONE: ++ { ++ sal_uInt8 nTrans = 0; ++ aMask = AlphaMask( aBmp.GetSizePixel(), &nTrans ); ++ } ++ break; ++ case TRANSPARENT_COLOR: ++ aMask = AlphaMask( aBmp.CreateMask( aIcon.GetTransparentColor() ) ); ++ break; ++ case TRANSPARENT_BITMAP: ++ aMask = AlphaMask( aIcon.GetMask() ); ++ break; ++ default: ++ OSL_FAIL( "unhandled transparent type" ); ++ break; ++ } ++ } ++ else ++ aMask = aIcon.GetAlpha(); ++ aIcon = BitmapEx( aBmp, aMask ); ++ } ++ ++ ImpBitmap *pIconImpBitmap = aIcon.ImplGetBitmapImpBitmap(); ++ ImpBitmap *pIconImpMask = aIcon.ImplGetMaskImpBitmap(); ++ ++ if( pIconImpBitmap && pIconImpMask ) ++ { ++ SalBitmap *pIconBitmap = ++ pIconImpBitmap->ImplGetSalBitmap(); ++ SalBitmap *pIconMask = ++ pIconImpMask->ImplGetSalBitmap(); ++ ++ if( ( pBuf = bitmapToPixbuf( pIconBitmap, pIconMask ) ) ) ++ pIcons = g_list_prepend( pIcons, pBuf ); ++ } ++ } ++ ++ gtk_window_set_icon_list( GTK_WINDOW(m_pWindow), pIcons ); ++ ++ g_list_foreach( pIcons, reinterpret_cast(g_object_unref), NULL ); ++ g_list_free( pIcons ); ++} ++ ++void GtkSalFrame::SetMenu( SalMenu* pSalMenu ) ++{ ++// if(m_pSalMenu) ++// { ++// static_cast(m_pSalMenu)->DisconnectFrame(); ++// } ++ m_pSalMenu = pSalMenu; ++} ++ ++SalMenu* GtkSalFrame::GetMenu() ++{ ++ return m_pSalMenu; ++} ++ ++void GtkSalFrame::DrawMenuBar() ++{ ++} ++ ++void GtkSalFrame::Center() ++{ ++ long nX, nY; ++ ++ if( m_pParent ) ++ { ++ nX = ((long)m_pParent->maGeometry.nWidth - (long)maGeometry.nWidth)/2; ++ nY = ((long)m_pParent->maGeometry.nHeight - (long)maGeometry.nHeight)/2; ++ } ++ else ++ { ++ GdkScreen *pScreen = NULL; ++ gint px, py; ++ GdkModifierType nMask; ++ gdk_display_get_pointer( getGdkDisplay(), &pScreen, &px, &py, &nMask ); ++ if( !pScreen ) ++ pScreen = gtk_widget_get_screen( m_pWindow ); ++ ++ gint nMonitor; ++ nMonitor = gdk_screen_get_monitor_at_point( pScreen, px, py ); ++ ++ GdkRectangle aMonitor; ++ gdk_screen_get_monitor_geometry( pScreen, nMonitor, &aMonitor ); ++ ++ nX = aMonitor.x + (aMonitor.width - (long)maGeometry.nWidth)/2; ++ nY = aMonitor.y + (aMonitor.height - (long)maGeometry.nHeight)/2; ++ } ++ SetPosSize( nX, nY, 0, 0, SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y ); ++} ++ ++Size GtkSalFrame::calcDefaultSize() ++{ ++ return bestmaxFrameSizeForScreenSize(getDisplay()->GetScreenSize(GetDisplayScreen())); ++} ++ ++void GtkSalFrame::SetDefaultSize() ++{ ++ Size aDefSize = calcDefaultSize(); ++ ++ SetPosSize( 0, 0, aDefSize.Width(), aDefSize.Height(), ++ SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); ++ ++ if( (m_nStyle & SAL_FRAME_STYLE_DEFAULT) && m_pWindow ) ++ gtk_window_maximize( GTK_WINDOW(m_pWindow) ); ++} ++ ++static void initClientId() ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ static bool bOnce = false; ++ if (!bOnce) ++ { ++ bOnce = true; ++ const OString& rID = SessionManagerClient::getSessionID(); ++ if (!rID.isEmpty()) ++ gdk_set_sm_client_id(rID.getStr()); ++ } ++#else ++ // No session management support for gtk3+ - this is now legacy. ++#endif ++} ++ ++void GtkSalFrame::Show( bool bVisible, bool bNoActivate ) ++{ ++ if( m_pWindow ) ++ { ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( m_pParent && (m_pParent->m_nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN) ++ && getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) ++ gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), bVisible ); ++#endif ++ if( bVisible ) ++ { ++ initClientId(); ++ getDisplay()->startupNotificationCompleted(); ++ ++ if( m_bDefaultPos ) ++ Center(); ++ if( m_bDefaultSize ) ++ SetDefaultSize(); ++ setMinMaxSize(); ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ // #i45160# switch to desktop where a dialog with parent will appear ++ if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea && IS_WIDGET_MAPPED(m_pParent->m_pWindow) ) ++ getDisplay()->getWMAdaptor()->switchToWorkArea( m_pParent->m_nWorkArea ); ++#endif ++ ++ if( isFloatGrabWindow() && ++ m_pParent && ++ m_nFloats == 0 && ++ ! getDisplay()->GetCaptureFrame() ) ++ { ++ /* #i63086# ++ * outsmart Metacity's "focus:mouse" mode ++ * which insists on taking the focus from the document ++ * to the new float. Grab focus to parent frame BEFORE ++ * showing the float (cannot grab it to the float ++ * before show). ++ */ ++ m_pParent->grabPointer( true, true ); ++ } ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ guint32 nUserTime = 0; ++ if( ! bNoActivate && (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) ++ nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); ++ ++ //For these floating windows we don't want the main window to lose focus, and metacity has... ++ // metacity-2.24.0/src/core/window.c ++ ++ // if ((focus_window != NULL) && XSERVER_TIME_IS_BEFORE (compare, focus_window->net_wm_user_time)) ++ // "compare" window focus prevented by other activity ++ ++ // where "compare" is this window ++ ++ // which leads to... ++ ++ // /* This happens for error dialogs or alerts; these need to remain on ++ // * top, but it would be confusing to have its ancestor remain ++ // * focused. ++ // */ ++ // if (meta_window_is_ancestor_of_transient (focus_window, window)) ++ // "The focus window %s is an ancestor of the newly mapped " ++ // "window %s which isn't being focused. Unfocusing the " ++ // "ancestor.\n", ++ ++ // i.e. having a time < that of the toplevel frame means that the toplevel frame gets unfocused. ++ // awesome. ++ if( nUserTime == 0 ) ++ { ++ nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); ++ } ++ lcl_set_user_time(GTK_WINDOW(m_pWindow), nUserTime ); ++#endif ++ ++ if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) ) ++ m_bSetFocusOnMap = true; ++ ++ gtk_widget_show( m_pWindow ); ++ ++ if( isFloatGrabWindow() ) ++ { ++ m_nFloats++; ++ if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 ) ++ { ++ grabPointer(true, true); ++ GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this; ++ pKeyboardFrame->grabKeyboard(true); ++ } ++ // #i44068# reset parent's IM context ++ if( m_pParent ) ++ m_pParent->EndExtTextInput(0); ++ } ++ if( m_bWindowIsGtkPlug ) ++ askForXEmbedFocus( 0 ); ++ } ++ else ++ { ++ if( isFloatGrabWindow() ) ++ { ++ m_nFloats--; ++ if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0) ++ { ++ GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this; ++ pKeyboardFrame->grabKeyboard(false); ++ grabPointer(false); ++ } ++ } ++ gtk_widget_hide( m_pWindow ); ++ if( m_pIMHandler ) ++ m_pIMHandler->focusChanged( false ); ++ // flush here; there may be a very seldom race between ++ // the display connection used for clipboard and our connection ++ Flush(); ++ } ++ CallCallback( SALEVENT_RESIZE, NULL ); ++ TriggerPaintEvent(); ++ } ++} ++ ++void GtkSalFrame::setMinMaxSize() ++{ ++ /* #i34504# metacity (and possibly others) do not treat ++ * _NET_WM_STATE_FULLSCREEN and max_width/height independently; ++ * whether they should is undefined. So don't set the max size hint ++ * for a full screen window. ++ */ ++ if( m_pWindow && ! isChild() ) ++ { ++ GdkGeometry aGeo; ++ int aHints = 0; ++ if( m_nStyle & SAL_FRAME_STYLE_SIZEABLE ) ++ { ++ if( m_aMinSize.Width() && m_aMinSize.Height() && ! m_bFullscreen ) ++ { ++ aGeo.min_width = m_aMinSize.Width(); ++ aGeo.min_height = m_aMinSize.Height(); ++ aHints |= GDK_HINT_MIN_SIZE; ++ } ++ if( m_aMaxSize.Width() && m_aMaxSize.Height() && ! m_bFullscreen ) ++ { ++ aGeo.max_width = m_aMaxSize.Width(); ++ aGeo.max_height = m_aMaxSize.Height(); ++ aHints |= GDK_HINT_MAX_SIZE; ++ } ++ } ++ else ++ { ++ if( ! m_bFullscreen ) ++ { ++ aGeo.min_width = maGeometry.nWidth; ++ aGeo.min_height = maGeometry.nHeight; ++ aHints |= GDK_HINT_MIN_SIZE; ++ ++ aGeo.max_width = maGeometry.nWidth; ++ aGeo.max_height = maGeometry.nHeight; ++ aHints |= GDK_HINT_MAX_SIZE; ++ } ++ } ++ if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() ) ++ { ++ aGeo.max_width = m_aMaxSize.Width(); ++ aGeo.max_height = m_aMaxSize.Height(); ++ aHints |= GDK_HINT_MAX_SIZE; ++ } ++ if( aHints ) ++ { ++ gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow), ++ NULL, ++ &aGeo, ++ GdkWindowHints( aHints ) ); ++ } ++ } ++} ++ ++void GtkSalFrame::SetMaxClientSize( long nWidth, long nHeight ) ++{ ++ if( ! isChild() ) ++ { ++ m_aMaxSize = Size( nWidth, nHeight ); ++ // Show does a setMinMaxSize ++ if( IS_WIDGET_MAPPED( m_pWindow ) ) ++ setMinMaxSize(); ++ } ++} ++void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight ) ++{ ++ if( ! isChild() ) ++ { ++ m_aMinSize = Size( nWidth, nHeight ); ++ if( m_pWindow ) ++ { ++ widget_set_size_request(nWidth, nHeight ); ++ // Show does a setMinMaxSize ++ if( IS_WIDGET_MAPPED( m_pWindow ) ) ++ setMinMaxSize(); ++ } ++ } ++} ++ ++// FIXME: we should really be an SvpSalFrame sub-class, and ++// share their AllocateFrame ! ++void GtkSalFrame::AllocateFrame() ++{ ++#if GTK_CHECK_VERSION(3,0,0) ++ basegfx::B2IVector aFrameSize( maGeometry.nWidth, maGeometry.nHeight ); ++ if( ! m_aFrame.get() || m_aFrame->getSize() != aFrameSize ) ++ { ++ if( aFrameSize.getX() == 0 ) ++ aFrameSize.setX( 1 ); ++ if( aFrameSize.getY() == 0 ) ++ aFrameSize.setY( 1 ); ++ m_aFrame = basebmp::createBitmapDevice(aFrameSize, true, ++ basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX); ++ m_aFrame->setDamageTracker( ++ basebmp::IBitmapDeviceDamageTrackerSharedPtr(new DamageTracker(*this)) ); ++ SAL_INFO("vcl.gtk3", "allocated m_aFrame size of " << maGeometry.nWidth << " x " << maGeometry.nHeight); ++ ++#if OSL_DEBUG_LEVEL > 0 // set background to orange ++ m_aFrame->clear( basebmp::Color( 255, 127, 0 ) ); ++#endif ++ ++ // update device in existing graphics ++ for( unsigned int i = 0; i < SAL_N_ELEMENTS( m_aGraphics ); ++i ) ++ { ++ if( !m_aGraphics[i].pGraphics ) ++ continue; ++ m_aGraphics[i].pGraphics->setDevice( m_aFrame ); ++ } ++ } ++#endif ++} ++ ++void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) ++{ ++ if( !m_pWindow || isChild( true, false ) ) ++ return; ++ ++ bool bSized = false, bMoved = false; ++ ++ if( (nFlags & ( SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT )) && ++ (nWidth > 0 && nHeight > 0 ) // sometimes stupid things happen ++ ) ++ { ++ m_bDefaultSize = false; ++ ++ if( (unsigned long)nWidth != maGeometry.nWidth || (unsigned long)nHeight != maGeometry.nHeight ) ++ bSized = true; ++ maGeometry.nWidth = nWidth; ++ maGeometry.nHeight = nHeight; ++ ++ if( isChild( false, true ) ) ++ widget_set_size_request(nWidth, nHeight); ++ else if( ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) ) ++ window_resize(nWidth, nHeight); ++ setMinMaxSize(); ++ } ++ else if( m_bDefaultSize ) ++ SetDefaultSize(); ++ ++ m_bDefaultSize = false; ++ ++ if( nFlags & ( SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y ) ) ++ { ++ if( m_pParent ) ++ { ++ if( AllSettings::GetLayoutRTL() ) ++ nX = m_pParent->maGeometry.nWidth-maGeometry.nWidth-1-nX; ++ nX += m_pParent->maGeometry.nX; ++ nY += m_pParent->maGeometry.nY; ++ } ++ ++ if( nX != maGeometry.nX || nY != maGeometry.nY ) ++ bMoved = true; ++ maGeometry.nX = nX; ++ maGeometry.nY = nY; ++ ++ m_bDefaultPos = false; ++ ++ moveWindow( maGeometry.nX, maGeometry.nY ); ++ ++ updateScreenNumber(); ++ } ++ else if( m_bDefaultPos ) ++ Center(); ++ ++ m_bDefaultPos = false; ++ ++ if( bSized ) ++ AllocateFrame(); ++ ++ if( bSized && ! bMoved ) ++ CallCallback( SALEVENT_RESIZE, NULL ); ++ else if( bMoved && ! bSized ) ++ CallCallback( SALEVENT_MOVE, NULL ); ++ else if( bMoved && bSized ) ++ CallCallback( SALEVENT_MOVERESIZE, NULL ); ++ ++ if (bSized) ++ TriggerPaintEvent(); ++} ++ ++void GtkSalFrame::GetClientSize( long& rWidth, long& rHeight ) ++{ ++ if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) ) ++ { ++ rWidth = maGeometry.nWidth; ++ rHeight = maGeometry.nHeight; ++ } ++ else ++ rWidth = rHeight = 0; ++} ++ ++void GtkSalFrame::GetWorkArea( Rectangle& rRect ) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ rRect = GetGtkSalData()->GetGtkDisplay()->getWMAdaptor()->getWorkArea( 0 ); ++#else ++ GdkScreen *pScreen = gtk_window_get_screen(GTK_WINDOW(m_pWindow)); ++ Rectangle aRetRect; ++ int max = gdk_screen_get_n_monitors (pScreen); ++ for (int i = 0; i < max; ++i) ++ { ++ GdkRectangle aRect; ++ gdk_screen_get_monitor_workarea(pScreen, i, &aRect); ++ Rectangle aMonitorRect(aRect.x, aRect.y, aRect.x+aRect.width, aRect.y+aRect.height); ++ aRetRect.Union(aMonitorRect); ++ } ++ rRect = aRetRect; ++#endif ++} ++ ++SalFrame* GtkSalFrame::GetParent() const ++{ ++ return m_pParent; ++} ++ ++void GtkSalFrame::SetWindowState( const SalFrameState* pState ) ++{ ++ if( ! m_pWindow || ! pState || isChild( true, false ) ) ++ return; ++ ++ const sal_uLong nMaxGeometryMask = ++ WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | ++ WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT | ++ WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y | ++ WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; ++ ++ if( (pState->mnMask & WINDOWSTATE_MASK_STATE) && ++ ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) && ++ (pState->mnState & WINDOWSTATE_STATE_MAXIMIZED) && ++ (pState->mnMask & nMaxGeometryMask) == nMaxGeometryMask ) ++ { ++ resizeWindow( pState->mnWidth, pState->mnHeight ); ++ moveWindow( pState->mnX, pState->mnY ); ++ m_bDefaultPos = m_bDefaultSize = false; ++ ++ maGeometry.nX = pState->mnMaximizedX; ++ maGeometry.nY = pState->mnMaximizedY; ++ maGeometry.nWidth = pState->mnMaximizedWidth; ++ maGeometry.nHeight = pState->mnMaximizedHeight; ++ updateScreenNumber(); ++ ++ m_nState = GdkWindowState( m_nState | GDK_WINDOW_STATE_MAXIMIZED ); ++ m_aRestorePosSize = Rectangle( Point( pState->mnX, pState->mnY ), ++ Size( pState->mnWidth, pState->mnHeight ) ); ++ CallCallback( SALEVENT_RESIZE, NULL ); ++ } ++ else if( pState->mnMask & (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | ++ WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ) ) ++ { ++ sal_uInt16 nPosSizeFlags = 0; ++ long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0); ++ long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0); ++ if( pState->mnMask & WINDOWSTATE_MASK_X ) ++ nPosSizeFlags |= SAL_FRAME_POSSIZE_X; ++ else ++ nX = maGeometry.nX - (m_pParent ? m_pParent->maGeometry.nX : 0); ++ if( pState->mnMask & WINDOWSTATE_MASK_Y ) ++ nPosSizeFlags |= SAL_FRAME_POSSIZE_Y; ++ else ++ nY = maGeometry.nY - (m_pParent ? m_pParent->maGeometry.nY : 0); ++ if( pState->mnMask & WINDOWSTATE_MASK_WIDTH ) ++ nPosSizeFlags |= SAL_FRAME_POSSIZE_WIDTH; ++ if( pState->mnMask & WINDOWSTATE_MASK_HEIGHT ) ++ nPosSizeFlags |= SAL_FRAME_POSSIZE_HEIGHT; ++ SetPosSize( nX, nY, pState->mnWidth, pState->mnHeight, nPosSizeFlags ); ++ } ++ if( pState->mnMask & WINDOWSTATE_MASK_STATE && ! isChild() ) ++ { ++ if( pState->mnState & WINDOWSTATE_STATE_MAXIMIZED ) ++ gtk_window_maximize( GTK_WINDOW(m_pWindow) ); ++ else ++ gtk_window_unmaximize( GTK_WINDOW(m_pWindow) ); ++ /* #i42379# there is no rollup state in GDK; and rolled up windows are ++ * (probably depending on the WM) reported as iconified. If we iconify a ++ * window here that was e.g. a dialog, then it will be unmapped but still ++ * not be displayed in the task list, so it's an iconified window that ++ * the user cannot get out of this state. So do not set the iconified state ++ * on windows with a parent (that is transient frames) since these tend ++ * to not be represented in an icon task list. ++ */ ++ if( (pState->mnState & WINDOWSTATE_STATE_MINIMIZED) ++ && ! m_pParent ) ++ gtk_window_iconify( GTK_WINDOW(m_pWindow) ); ++ else ++ gtk_window_deiconify( GTK_WINDOW(m_pWindow) ); ++ } ++ TriggerPaintEvent(); ++} ++ ++bool GtkSalFrame::GetWindowState( SalFrameState* pState ) ++{ ++ pState->mnState = WINDOWSTATE_STATE_NORMAL; ++ pState->mnMask = WINDOWSTATE_MASK_STATE; ++ // rollup ? gtk 2.2 does not seem to support the shaded state ++ if( (m_nState & GDK_WINDOW_STATE_ICONIFIED) ) ++ pState->mnState |= WINDOWSTATE_STATE_MINIMIZED; ++ if( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) ++ { ++ pState->mnState |= WINDOWSTATE_STATE_MAXIMIZED; ++ pState->mnX = m_aRestorePosSize.Left(); ++ pState->mnY = m_aRestorePosSize.Top(); ++ pState->mnWidth = m_aRestorePosSize.GetWidth(); ++ pState->mnHeight = m_aRestorePosSize.GetHeight(); ++ pState->mnMaximizedX = maGeometry.nX; ++ pState->mnMaximizedY = maGeometry.nY; ++ pState->mnMaximizedWidth = maGeometry.nWidth; ++ pState->mnMaximizedHeight = maGeometry.nHeight; ++ pState->mnMask |= WINDOWSTATE_MASK_MAXIMIZED_X | ++ WINDOWSTATE_MASK_MAXIMIZED_Y | ++ WINDOWSTATE_MASK_MAXIMIZED_WIDTH | ++ WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; ++ } ++ else ++ { ++ pState->mnX = maGeometry.nX; ++ pState->mnY = maGeometry.nY; ++ pState->mnWidth = maGeometry.nWidth; ++ pState->mnHeight = maGeometry.nHeight; ++ } ++ pState->mnMask |= WINDOWSTATE_MASK_X | ++ WINDOWSTATE_MASK_Y | ++ WINDOWSTATE_MASK_WIDTH | ++ WINDOWSTATE_MASK_HEIGHT; ++ ++ return true; ++} ++ ++typedef enum { ++ SET_RETAIN_SIZE, ++ SET_FULLSCREEN, ++ SET_UN_FULLSCREEN ++} SetType; ++ ++void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSize ) ++{ ++ if( !m_pWindow ) ++ return; ++ ++ if (maGeometry.nDisplayScreenNumber == nNewScreen && eType == SET_RETAIN_SIZE) ++ return; ++ ++ GdkScreen *pScreen = NULL; ++ GdkRectangle aNewMonitor; ++ ++ bool bSpanAllScreens = nNewScreen == (unsigned int)-1; ++ m_bSpanMonitorsWhenFullscreen = bSpanAllScreens && getDisplay()->getSystem()->GetDisplayScreenCount() > 1; ++ ++ if (m_bSpanMonitorsWhenFullscreen) //span all screens ++ { ++ pScreen = gtk_widget_get_screen( m_pWindow ); ++ aNewMonitor.x = 0; ++ aNewMonitor.y = 0; ++ aNewMonitor.width = gdk_screen_get_width(pScreen); ++ aNewMonitor.height = gdk_screen_get_height(pScreen); ++ } ++ else ++ { ++ gint nMonitor; ++ bool bSameMonitor = false; ++ ++ if (!bSpanAllScreens) ++ { ++ pScreen = getDisplay()->getSystem()->getScreenMonitorFromIdx( nNewScreen, nMonitor ); ++ if (!pScreen) ++ { ++ g_warning ("Attempt to move GtkSalFrame to invalid screen %d => " ++ "fallback to current\n", nNewScreen); ++ } ++ } ++ ++ if (!pScreen) ++ { ++ pScreen = gtk_widget_get_screen( m_pWindow ); ++ bSameMonitor = true; ++ } ++ ++ // Heavy lifting, need to move screen ... ++ if( pScreen != gtk_widget_get_screen( m_pWindow )) ++ gtk_window_set_screen( GTK_WINDOW( m_pWindow ), pScreen ); ++ ++ gint nOldMonitor = gdk_screen_get_monitor_at_window( ++ pScreen, widget_get_window( m_pWindow ) ); ++ if (bSameMonitor) ++ nMonitor = nOldMonitor; ++ ++ #if OSL_DEBUG_LEVEL > 1 ++ if( nMonitor == nOldMonitor ) ++ g_warning( "An apparently pointless SetScreen - should we elide it ?" ); ++ #endif ++ ++ GdkRectangle aOldMonitor; ++ gdk_screen_get_monitor_geometry( pScreen, nOldMonitor, &aOldMonitor ); ++ gdk_screen_get_monitor_geometry( pScreen, nMonitor, &aNewMonitor ); ++ ++ maGeometry.nX = aNewMonitor.x + maGeometry.nX - aOldMonitor.x; ++ maGeometry.nY = aNewMonitor.y + maGeometry.nY - aOldMonitor.y; ++ } ++ ++ bool bResize = false; ++ bool bVisible = IS_WIDGET_MAPPED( m_pWindow ); ++ if( bVisible ) ++ Show( false ); ++ ++ if( eType == SET_FULLSCREEN ) ++ { ++ maGeometry.nX = aNewMonitor.x; ++ maGeometry.nY = aNewMonitor.y; ++ maGeometry.nWidth = aNewMonitor.width; ++ maGeometry.nHeight = aNewMonitor.height; ++ m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; ++ bResize = true; ++ ++ // #i110881# for the benefit of compiz set a max size here ++ // else setting to fullscreen fails for unknown reasons ++ m_aMaxSize.Width() = aNewMonitor.width; ++ m_aMaxSize.Height() = aNewMonitor.height; ++ } ++ ++ if( pSize && eType == SET_UN_FULLSCREEN ) ++ { ++ maGeometry.nX = pSize->Left(); ++ maGeometry.nY = pSize->Top(); ++ maGeometry.nWidth = pSize->GetWidth(); ++ maGeometry.nHeight = pSize->GetHeight(); ++ m_nStyle &= ~SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; ++ bResize = true; ++ } ++ ++ if (bResize) ++ { ++ // temporarily re-sizeable ++ if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) ++ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); ++ window_resize(maGeometry.nWidth, maGeometry.nHeight); ++ //I wonder if we should instead leave maGeometry alone and rely on ++ //configure-event to trigger signalConfigure and set it there ++ AllocateFrame(); ++ TriggerPaintEvent(); ++ } ++ ++ gtk_window_move( GTK_WINDOW( m_pWindow ), maGeometry.nX, maGeometry.nY ); ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ // _NET_WM_STATE_FULLSCREEN (Metacity <-> KWin) ++ if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) ++#endif ++ { ++#if GTK_CHECK_VERSION(3,8,0) ++ gdk_window_set_fullscreen_mode( widget_get_window(m_pWindow), m_bSpanMonitorsWhenFullscreen ++ ? GDK_FULLSCREEN_ON_ALL_MONITORS : GDK_FULLSCREEN_ON_CURRENT_MONITOR ); ++#endif ++ if( eType == SET_FULLSCREEN ) ++ gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) ); ++ else if( eType == SET_UN_FULLSCREEN ) ++ gtk_window_unfullscreen( GTK_WINDOW( m_pWindow ) ); ++ } ++ ++ if( eType == SET_UN_FULLSCREEN && ++ !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) ++ gtk_window_set_resizable( GTK_WINDOW( m_pWindow ), FALSE ); ++ ++ // FIXME: we should really let gtk+ handle our widget hierarchy ... ++ if( m_pParent && gtk_widget_get_screen( m_pParent->m_pWindow ) != pScreen ) ++ SetParent( NULL ); ++ std::list< GtkSalFrame* > aChildren = m_aChildren; ++ for( std::list< GtkSalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) ++ (*it)->SetScreen( nNewScreen, SET_RETAIN_SIZE ); ++ ++ m_bDefaultPos = m_bDefaultSize = false; ++ updateScreenNumber(); ++ CallCallback( SALEVENT_MOVERESIZE, NULL ); ++ ++ if( bVisible ) ++ Show( true ); ++} ++ ++void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen ) ++{ ++ SetScreen( nNewScreen, SET_RETAIN_SIZE ); ++} ++ ++void GtkSalFrame::updateWMClass() ++{ ++ OString aResClass = OUStringToOString(m_sWMClass, RTL_TEXTENCODING_ASCII_US); ++ const char *pResClass = !aResClass.isEmpty() ? aResClass.getStr() : ++ SalGenericSystem::getFrameClassName(); ++ Display *display; ++ ++ if (!getDisplay()->IsX11Display()) ++ return; ++ ++#if GTK_CHECK_VERSION(3,0,0) ++ display = GDK_DISPLAY_XDISPLAY(getGdkDisplay()); ++#else ++ display = getDisplay()->GetDisplay(); ++#endif ++ ++ if( IS_WIDGET_REALIZED( m_pWindow ) ) ++ { ++ XClassHint* pClass = XAllocClassHint(); ++ OString aResName = SalGenericSystem::getFrameResName(); ++ pClass->res_name = const_cast(aResName.getStr()); ++ pClass->res_class = const_cast(pResClass); ++ XSetClassHint( display, ++ widget_get_xid(m_pWindow), ++ pClass ); ++ XFree( pClass ); ++ } ++} ++ ++void GtkSalFrame::SetApplicationID( const OUString &rWMClass ) ++{ ++ if( rWMClass != m_sWMClass && ! isChild() ) ++ { ++ m_sWMClass = rWMClass; ++ updateWMClass(); ++ ++ for( std::list< GtkSalFrame* >::iterator it = m_aChildren.begin(); it != m_aChildren.end(); ++it ) ++ (*it)->SetApplicationID(rWMClass); ++ } ++} ++ ++void GtkSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen ) ++{ ++ m_bFullscreen = bFullScreen; ++ ++ if( !m_pWindow || isChild() ) ++ return; ++ ++ if( bFullScreen ) ++ { ++ m_aRestorePosSize = Rectangle( Point( maGeometry.nX, maGeometry.nY ), ++ Size( maGeometry.nWidth, maGeometry.nHeight ) ); ++ SetScreen( nScreen, SET_FULLSCREEN ); ++ } ++ else ++ { ++ SetScreen( nScreen, SET_UN_FULLSCREEN, ++ !m_aRestorePosSize.IsEmpty() ? &m_aRestorePosSize : NULL ); ++ m_aRestorePosSize = Rectangle(); ++ } ++} ++ ++/* definitions from xautolock.c (pl15) */ ++#define XAUTOLOCK_DISABLE 1 ++#define XAUTOLOCK_ENABLE 2 ++ ++void GtkSalFrame::setAutoLock( bool bLock ) ++{ ++ if( isChild() || !getDisplay()->IsX11Display() ) ++ return; ++ ++ GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(m_pWindow) ); ++ GdkDisplay *pDisplay = gdk_screen_get_display( pScreen ); ++ GdkWindow *pRootWin = gdk_screen_get_root_window( pScreen ); ++ ++ Atom nAtom = XInternAtom( GDK_DISPLAY_XDISPLAY( pDisplay ), ++ "XAUTOLOCK_MESSAGE", False ); ++ ++ int nMessage = bLock ? XAUTOLOCK_ENABLE : XAUTOLOCK_DISABLE; ++ ++ XChangeProperty( GDK_DISPLAY_XDISPLAY( pDisplay ), ++ GDK_WINDOW_XID( pRootWin ), ++ nAtom, XA_INTEGER, ++ 8, PropModeReplace, ++ reinterpret_cast(&nMessage), ++ sizeof( nMessage ) ); ++} ++ ++#ifdef ENABLE_DBUS ++/** cookie is returned as an unsigned integer */ ++static guint ++dbus_inhibit_gsm (const gchar *appname, ++ const gchar *reason, ++ guint xid) ++{ ++ gboolean res; ++ guint cookie; ++ GError *error = NULL; ++ DBusGProxy *proxy = NULL; ++ ++ /* get the DBUS session connection */ ++ DBusGConnection *session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); ++ if (error != NULL) { ++ g_debug ("DBUS cannot connect : %s", error->message); ++ g_error_free (error); ++ return -1; ++ } ++ ++ /* get the proxy with gnome-session-manager */ ++ proxy = dbus_g_proxy_new_for_name (session_connection, ++ GSM_DBUS_SERVICE, ++ GSM_DBUS_PATH, ++ GSM_DBUS_INTERFACE); ++ if (proxy == NULL) { ++ g_debug ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); ++ return -1; ++ } ++ ++ res = dbus_g_proxy_call (proxy, ++ "Inhibit", &error, ++ G_TYPE_STRING, appname, ++ G_TYPE_UINT, xid, ++ G_TYPE_STRING, reason, ++ G_TYPE_UINT, 8, //Inhibit the session being marked as idle ++ G_TYPE_INVALID, ++ G_TYPE_UINT, &cookie, ++ G_TYPE_INVALID); ++ ++ /* check the return value */ ++ if (! res) { ++ cookie = -1; ++ g_debug ("Inhibit method failed"); ++ } ++ ++ /* check the error value */ ++ if (error != NULL) { ++ g_debug ("Inhibit problem : %s", error->message); ++ g_error_free (error); ++ cookie = -1; ++ } ++ ++ g_object_unref (G_OBJECT (proxy)); ++ return cookie; ++} ++ ++static void ++dbus_uninhibit_gsm (guint cookie) ++{ ++ gboolean res; ++ GError *error = NULL; ++ DBusGProxy *proxy = NULL; ++ DBusGConnection *session_connection = NULL; ++ ++ if (cookie == guint(-1)) { ++ g_debug ("Invalid cookie"); ++ return; ++ } ++ ++ /* get the DBUS session connection */ ++ session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); ++ if (error) { ++ g_debug ("DBUS cannot connect : %s", error->message); ++ g_error_free (error); ++ return; ++ } ++ ++ /* get the proxy with gnome-session-manager */ ++ proxy = dbus_g_proxy_new_for_name (session_connection, ++ GSM_DBUS_SERVICE, ++ GSM_DBUS_PATH, ++ GSM_DBUS_INTERFACE); ++ if (proxy == NULL) { ++ g_debug ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); ++ return; ++ } ++ ++ res = dbus_g_proxy_call (proxy, ++ "Uninhibit", ++ &error, ++ G_TYPE_UINT, cookie, ++ G_TYPE_INVALID, ++ G_TYPE_INVALID); ++ ++ /* check the return value */ ++ if (! res) { ++ g_debug ("Uninhibit method failed"); ++ } ++ ++ /* check the error value */ ++ if (error != NULL) { ++ g_debug ("Uninhibit problem : %s", error->message); ++ g_error_free (error); ++ cookie = -1; ++ } ++ g_object_unref (G_OBJECT (proxy)); ++} ++#endif ++ ++void GtkSalFrame::StartPresentation( bool bStart ) ++{ ++ setAutoLock( !bStart ); ++ ++ if( !getDisplay()->IsX11Display() ) ++ return; ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ Display *pDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() ); ++ ++ int nTimeout, nInterval, bPreferBlanking, bAllowExposures; ++ XGetScreenSaver( pDisplay, &nTimeout, &nInterval, ++ &bPreferBlanking, &bAllowExposures ); ++#endif ++ if( bStart ) ++ { ++#if !GTK_CHECK_VERSION(3,0,0) ++ if ( nTimeout ) ++ { ++ m_nSavedScreenSaverTimeout = nTimeout; ++ XResetScreenSaver( pDisplay ); ++ XSetScreenSaver( pDisplay, 0, nInterval, ++ bPreferBlanking, bAllowExposures ); ++ } ++#endif ++#ifdef ENABLE_DBUS ++ m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation", ++ widget_get_xid(m_pWindow)); ++#endif ++ } ++ else ++ { ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( m_nSavedScreenSaverTimeout ) ++ XSetScreenSaver( pDisplay, m_nSavedScreenSaverTimeout, ++ nInterval, bPreferBlanking, ++ bAllowExposures ); ++#endif ++ m_nSavedScreenSaverTimeout = 0; ++#ifdef ENABLE_DBUS ++ dbus_uninhibit_gsm(m_nGSMCookie); ++#endif ++ } ++} ++ ++void GtkSalFrame::SetAlwaysOnTop( bool bOnTop ) ++{ ++ if( m_pWindow ) ++ gtk_window_set_keep_above( GTK_WINDOW( m_pWindow ), bOnTop ); ++} ++ ++void GtkSalFrame::ToTop( sal_uInt16 nFlags ) ++{ ++ if( m_pWindow ) ++ { ++ if( isChild( false, true ) ) ++ gtk_widget_grab_focus( m_pWindow ); ++ else if( IS_WIDGET_MAPPED( m_pWindow ) ) ++ { ++ if( ! (nFlags & SAL_FRAME_TOTOP_GRABFOCUS_ONLY) ) ++ gtk_window_present( GTK_WINDOW(m_pWindow) ); ++ else ++ { ++#if !GTK_CHECK_VERSION(3,0,0) ++ guint32 nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); ++#else ++ guint32 nUserTime = GDK_CURRENT_TIME; ++#endif ++ gdk_window_focus( widget_get_window(m_pWindow), nUserTime ); ++ } ++#if !GTK_CHECK_VERSION(3,0,0) ++ /* need to do an XSetInputFocus here because ++ * gdk_window_focus will ask a EWMH compliant WM to put the focus ++ * to our window - which it of course won't since our input hint ++ * is set to false. ++ */ ++ if( (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) ) ++ { ++ // sad but true: this can cause an XError, we need to catch that ++ // to do this we need to synchronize with the XServer ++ GetGenericData()->ErrorTrapPush(); ++ XSetInputFocus( getDisplay()->GetDisplay(), widget_get_xid(m_pWindow), RevertToParent, CurrentTime ); ++ // fdo#46687 - an XSync should not be necessary - but for some reason it is. ++ XSync( getDisplay()->GetDisplay(), False ); ++ GetGenericData()->ErrorTrapPop(); ++ } ++#endif ++ } ++ else ++ { ++ if( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN ) ++ gtk_window_present( GTK_WINDOW(m_pWindow) ); ++ } ++ } ++} ++ ++void GtkSalFrame::SetPointer( PointerStyle ePointerStyle ) ++{ ++ if( m_pWindow && ePointerStyle != m_ePointerStyle ) ++ { ++ m_ePointerStyle = ePointerStyle; ++ GdkCursor *pCursor = getDisplay()->getCursor( ePointerStyle ); ++ gdk_window_set_cursor( widget_get_window(m_pWindow), pCursor ); ++ m_pCurrentCursor = pCursor; ++ ++ // #i80791# use grabPointer the same way as CaptureMouse, respective float grab ++ if( getDisplay()->MouseCaptured( this ) ) ++ grabPointer( true, false ); ++ else if( m_nFloats > 0 ) ++ grabPointer( true, true ); ++ } ++} ++ ++void GtkSalFrame::grabPointer( bool bGrab, bool bOwnerEvents ) ++{ ++ static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" ); ++ if (pEnv && *pEnv) ++ return; ++ ++ if (!m_pWindow) ++ return; ++ ++ const int nMask = (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); ++ ++#if GTK_CHECK_VERSION(3,0,0) ++ GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay()); ++ GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager); ++ if (bGrab) ++ gdk_device_grab(pPointer, widget_get_window(getMouseEventWidget()), GDK_OWNERSHIP_NONE, bOwnerEvents, (GdkEventMask) nMask, m_pCurrentCursor, GDK_CURRENT_TIME); ++ else ++ gdk_device_ungrab(pPointer, GDK_CURRENT_TIME); ++#else ++ if( bGrab ) ++ { ++ bool bUseGdkGrab = true; ++ const std::list< SalFrame* >& rFrames = getDisplay()->getFrames(); ++ for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it ) ++ { ++ const GtkSalFrame* pFrame = static_cast< const GtkSalFrame* >(*it); ++ if( pFrame->m_bWindowIsGtkPlug ) ++ { ++ bUseGdkGrab = false; ++ break; ++ } ++ } ++ if( bUseGdkGrab ) ++ { ++ gdk_pointer_grab( widget_get_window( m_pWindow ), bOwnerEvents, ++ (GdkEventMask) nMask, NULL, m_pCurrentCursor, ++ GDK_CURRENT_TIME ); ++ } ++ else ++ { ++ // FIXME: for some unknown reason gdk_pointer_grab does not ++ // really produce owner events for GtkPlug windows ++ // the cause is yet unknown ++ ++ // this is of course a bad hack, especially as we cannot ++ // set the right cursor this way ++ XGrabPointer( getDisplay()->GetDisplay(), ++ widget_get_xid( m_pWindow ), ++ bOwnerEvents, ++ PointerMotionMask | ButtonPressMask | ButtonReleaseMask, ++ GrabModeAsync, ++ GrabModeAsync, ++ None, ++ None, ++ CurrentTime ++ ); ++ } ++ } ++ else ++ { ++ // Two GdkDisplays may be open ++ gdk_display_pointer_ungrab( getGdkDisplay(), GDK_CURRENT_TIME); ++ } ++#endif ++} ++ ++void GtkSalFrame::grabKeyboard( bool bGrab ) ++{ ++ if (!m_pWindow) ++ return; ++ ++#if GTK_CHECK_VERSION(3,0,0) ++ GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay()); ++ GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager); ++ GdkDevice* pKeyboard = gdk_device_get_associated_device(pPointer); ++ if (bGrab) ++ { ++ gdk_device_grab(pKeyboard, widget_get_window(m_pWindow), GDK_OWNERSHIP_NONE, ++ true, (GdkEventMask)(GDK_KEY_PRESS | GDK_KEY_RELEASE), NULL, GDK_CURRENT_TIME); ++ } ++ else ++ { ++ gdk_device_ungrab(pKeyboard, GDK_CURRENT_TIME); ++ } ++#else ++ if( bGrab ) ++ { ++ gdk_keyboard_grab(widget_get_window(m_pWindow), true, ++ GDK_CURRENT_TIME); ++ } ++ else ++ { ++ gdk_keyboard_ungrab(GDK_CURRENT_TIME); ++ } ++#endif ++} ++ ++void GtkSalFrame::CaptureMouse( bool bCapture ) ++{ ++ getDisplay()->CaptureMouse( bCapture ? this : NULL ); ++} ++ ++void GtkSalFrame::SetPointerPos( long nX, long nY ) ++{ ++ GtkSalFrame* pFrame = this; ++ while( pFrame && pFrame->isChild( false, true ) ) ++ pFrame = pFrame->m_pParent; ++ if( ! pFrame ) ++ return; ++ ++ GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(pFrame->m_pWindow) ); ++ GdkDisplay *pDisplay = gdk_screen_get_display( pScreen ); ++ ++ /* when the application tries to center the mouse in the dialog the ++ * window isn't mapped already. So use coordinates relative to the root window. ++ */ ++ unsigned int nWindowLeft = maGeometry.nX + nX; ++ unsigned int nWindowTop = maGeometry.nY + nY; ++ ++ XWarpPointer( GDK_DISPLAY_XDISPLAY (pDisplay), None, ++ GDK_WINDOW_XID (gdk_screen_get_root_window( pScreen ) ), ++ 0, 0, 0, 0, nWindowLeft, nWindowTop); ++ // #i38648# ask for the next motion hint ++ gint x, y; ++ GdkModifierType mask; ++ gdk_window_get_pointer( widget_get_window(pFrame->m_pWindow) , &x, &y, &mask ); ++} ++ ++void GtkSalFrame::Flush() ++{ ++#if GTK_CHECK_VERSION(3,0,0) ++ gdk_display_flush( getGdkDisplay() ); ++#else ++ XFlush (GDK_DISPLAY_XDISPLAY (getGdkDisplay())); ++#endif ++} ++ ++void GtkSalFrame::Sync() ++{ ++ gdk_display_sync( getGdkDisplay() ); ++} ++ ++#ifndef GDK_Open ++#define GDK_Open 0x1008ff6b ++#endif ++#ifndef GDK_Paste ++#define GDK_Paste 0x1008ff6d ++#endif ++#ifndef GDK_Copy ++#define GDK_Copy 0x1008ff57 ++#endif ++#ifndef GDK_Cut ++#define GDK_Cut 0x1008ff58 ++#endif ++ ++void GtkSalFrame::KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, ++ guint* pGdkKeyCode, GdkModifierType *pGdkModifiers) ++{ ++ if ( pGdkKeyCode == NULL || pGdkModifiers == NULL ) ++ return; ++ ++ // Get GDK key modifiers ++ GdkModifierType nModifiers = (GdkModifierType) 0; ++ ++ if ( rKeyCode.IsShift() ) ++ nModifiers = (GdkModifierType) ( nModifiers | GDK_SHIFT_MASK ); ++ ++ if ( rKeyCode.IsMod1() ) ++ nModifiers = (GdkModifierType) ( nModifiers | GDK_CONTROL_MASK ); ++ ++ if ( rKeyCode.IsMod2() ) ++ nModifiers = (GdkModifierType) ( nModifiers | GDK_MOD1_MASK ); ++ ++ *pGdkModifiers = nModifiers; ++ ++ // Get GDK keycode. ++ guint nKeyCode = 0; ++ ++ guint nCode = rKeyCode.GetCode(); ++ ++ if ( nCode >= KEY_0 && nCode <= KEY_9 ) ++ nKeyCode = ( nCode - KEY_0 ) + GDK_0; ++ else if ( nCode >= KEY_A && nCode <= KEY_Z ) ++ nKeyCode = ( nCode - KEY_A ) + GDK_A; ++ else if ( nCode >= KEY_F1 && nCode <= KEY_F26 ) ++ nKeyCode = ( nCode - KEY_F1 ) + GDK_F1; ++ else ++ { ++ switch( nCode ) ++ { ++ case KEY_DOWN: nKeyCode = GDK_Down; break; ++ case KEY_UP: nKeyCode = GDK_Up; break; ++ case KEY_LEFT: nKeyCode = GDK_Left; break; ++ case KEY_RIGHT: nKeyCode = GDK_Right; break; ++ case KEY_HOME: nKeyCode = GDK_Home; break; ++ case KEY_END: nKeyCode = GDK_End; break; ++ case KEY_PAGEUP: nKeyCode = GDK_Page_Up; break; ++ case KEY_PAGEDOWN: nKeyCode = GDK_Page_Down; break; ++ case KEY_RETURN: nKeyCode = GDK_Return; break; ++ case KEY_ESCAPE: nKeyCode = GDK_Escape; break; ++ case KEY_TAB: nKeyCode = GDK_Tab; break; ++ case KEY_BACKSPACE: nKeyCode = GDK_BackSpace; break; ++ case KEY_SPACE: nKeyCode = GDK_space; break; ++ case KEY_INSERT: nKeyCode = GDK_Insert; break; ++ case KEY_DELETE: nKeyCode = GDK_Delete; break; ++ case KEY_ADD: nKeyCode = GDK_plus; break; ++ case KEY_SUBTRACT: nKeyCode = GDK_minus; break; ++ case KEY_MULTIPLY: nKeyCode = GDK_asterisk; break; ++ case KEY_DIVIDE: nKeyCode = GDK_slash; break; ++ case KEY_POINT: nKeyCode = GDK_period; break; ++ case KEY_COMMA: nKeyCode = GDK_comma; break; ++ case KEY_LESS: nKeyCode = GDK_less; break; ++ case KEY_GREATER: nKeyCode = GDK_greater; break; ++ case KEY_EQUAL: nKeyCode = GDK_equal; break; ++ case KEY_FIND: nKeyCode = GDK_Find; break; ++ case KEY_CONTEXTMENU: nKeyCode = GDK_Menu; break; ++ case KEY_HELP: nKeyCode = GDK_Help; break; ++ case KEY_UNDO: nKeyCode = GDK_Undo; break; ++ case KEY_REPEAT: nKeyCode = GDK_Redo; break; ++ case KEY_DECIMAL: nKeyCode = GDK_KP_Decimal; break; ++ case KEY_TILDE: nKeyCode = GDK_asciitilde; break; ++ case KEY_QUOTELEFT: nKeyCode = GDK_quoteleft; break; ++ case KEY_BRACKETLEFT: nKeyCode = GDK_bracketleft; break; ++ case KEY_BRACKETRIGHT: nKeyCode = GDK_bracketright; break; ++ case KEY_SEMICOLON: nKeyCode = GDK_semicolon; break; ++ case KEY_QUOTERIGHT: nKeyCode = GDK_quoteright; break; ++ ++ // Special cases ++ case KEY_COPY: nKeyCode = GDK_Copy; break; ++ case KEY_CUT: nKeyCode = GDK_Cut; break; ++ case KEY_PASTE: nKeyCode = GDK_Paste; break; ++ case KEY_OPEN: nKeyCode = GDK_Open; break; ++ } ++ } ++ ++ *pGdkKeyCode = nKeyCode; ++} ++ ++OUString GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode ) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ return getDisplay()->GetKeyName( nKeyCode ); ++#else ++ guint nGtkKeyCode; ++ GdkModifierType nGtkModifiers; ++ KeyCodeToGdkKey(nKeyCode, &nGtkKeyCode, &nGtkModifiers ); ++ ++ gchar* pName = gtk_accelerator_get_label(nGtkKeyCode, nGtkModifiers); ++ OUString aRet(pName, rtl_str_getLength(pName), RTL_TEXTENCODING_UTF8); ++ g_free(pName); ++ return aRet; ++#endif ++} ++ ++GdkDisplay *GtkSalFrame::getGdkDisplay() ++{ ++ return GetGtkSalData()->GetGdkDisplay(); ++} ++ ++GtkSalDisplay *GtkSalFrame::getDisplay() ++{ ++ return GetGtkSalData()->GetGtkDisplay(); ++} ++ ++SalFrame::SalPointerState GtkSalFrame::GetPointerState() ++{ ++ SalPointerState aState; ++ GdkScreen* pScreen; ++ gint x, y; ++ GdkModifierType aMask; ++ gdk_display_get_pointer( getGdkDisplay(), &pScreen, &x, &y, &aMask ); ++ aState.maPos = Point( x - maGeometry.nX, y - maGeometry.nY ); ++ aState.mnState = GetMouseModCode( aMask ); ++ return aState; ++} ++ ++KeyIndicatorState GtkSalFrame::GetIndicatorState() ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ return GetGtkSalData()->GetGtkDisplay()->GetIndicatorState(); ++#else ++ KeyIndicatorState nState = KeyIndicatorState::NONE; ++ ++ GdkKeymap *pKeyMap = gdk_keymap_get_for_display(getGdkDisplay()); ++ ++ if (gdk_keymap_get_caps_lock_state(pKeyMap)) ++ nState |= KeyIndicatorState::CAPSLOCK; ++ if (gdk_keymap_get_num_lock_state(pKeyMap)) ++ nState |= KeyIndicatorState::NUMLOCK; ++#if GTK_CHECK_VERSION(3,18,0) ++ if (gdk_keymap_get_scroll_lock_state(pKeyMap)) ++ nState |= KeyIndicatorState::SCROLLLOCK; ++#endif ++ return nState; ++#endif ++} ++ ++void GtkSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode ) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ GetGtkSalData()->GetGtkDisplay()->SimulateKeyPress(nKeyCode); ++#else ++ g_warning ("missing simulate keypress %d", nKeyCode); ++#endif ++} ++ ++void GtkSalFrame::SetInputContext( SalInputContext* pContext ) ++{ ++ if( ! pContext ) ++ return; ++ ++ if( ! (pContext->mnOptions & InputContextFlags::Text) ) ++ return; ++ ++ // create a new im context ++ if( ! m_pIMHandler ) ++ m_pIMHandler = new IMHandler( this ); ++} ++ ++void GtkSalFrame::EndExtTextInput( sal_uInt16 nFlags ) ++{ ++ if( m_pIMHandler ) ++ m_pIMHandler->endExtTextInput( nFlags ); ++} ++ ++bool GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , vcl::KeyCode& ) ++{ ++ // not supported yet ++ return false; ++} ++ ++LanguageType GtkSalFrame::GetInputLanguage() ++{ ++ return LANGUAGE_DONTKNOW; ++} ++ ++void GtkSalFrame::UpdateSettings( AllSettings& rSettings ) ++{ ++ if( ! m_pWindow ) ++ return; ++ ++ GtkSalGraphics* pGraphics = static_cast(m_aGraphics[0].pGraphics); ++ bool bFreeGraphics = false; ++ if( ! pGraphics ) ++ { ++ pGraphics = static_cast(AcquireGraphics()); ++ if ( !pGraphics ) ++ { ++ SAL_WARN("vcl", "Could not get graphics - unable to update settings"); ++ return; ++ } ++ bFreeGraphics = true; ++ } ++ ++ pGraphics->updateSettings( rSettings ); ++ ++ if( bFreeGraphics ) ++ ReleaseGraphics( pGraphics ); ++} ++ ++void GtkSalFrame::Beep() ++{ ++ gdk_display_beep( getGdkDisplay() ); ++} ++ ++const SystemEnvData* GtkSalFrame::GetSystemData() const ++{ ++ return &m_aSystemData; ++} ++ ++void GtkSalFrame::SetParent( SalFrame* pNewParent ) ++{ ++ if( m_pParent ) ++ m_pParent->m_aChildren.remove( this ); ++ m_pParent = static_cast(pNewParent); ++ if( m_pParent ) ++ m_pParent->m_aChildren.push_back( this ); ++ if( ! isChild() ) ++ gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), ++ (m_pParent && ! m_pParent->isChild(true,false)) ? GTK_WINDOW(m_pParent->m_pWindow) : NULL ++ ); ++} ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ ++void GtkSalFrame::createNewWindow( ::Window aNewParent, bool bXEmbed, SalX11Screen nXScreen ) ++{ ++ bool bWasVisible = m_pWindow && IS_WIDGET_MAPPED(m_pWindow); ++ if( bWasVisible ) ++ Show( false ); ++ ++ if( (int)nXScreen.getXScreen() >= getDisplay()->GetXScreenCount() ) ++ nXScreen = m_nXScreen; ++ ++ SystemParentData aParentData; ++ aParentData.aWindow = aNewParent; ++ aParentData.bXEmbedSupport = bXEmbed; ++ if( aNewParent == None ) ++ { ++ aNewParent = getDisplay()->GetRootWindow(nXScreen); ++ aParentData.aWindow = None; ++ aParentData.bXEmbedSupport = false; ++ } ++ else ++ { ++ // is new parent a root window ? ++ Display* pDisp = getDisplay()->GetDisplay(); ++ int nScreens = getDisplay()->GetXScreenCount(); ++ for( int i = 0; i < nScreens; i++ ) ++ { ++ if( aNewParent == RootWindow( pDisp, i ) ) ++ { ++ nXScreen = SalX11Screen( i ); ++ aParentData.aWindow = None; ++ aParentData.bXEmbedSupport = false; ++ break; ++ } ++ } ++ } ++ ++ // free xrender resources ++ for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ ) ++ if( m_aGraphics[i].bInUse ) ++ m_aGraphics[i].pGraphics->SetDrawable( None, m_nXScreen ); ++ ++ // first deinit frame ++ if( m_pIMHandler ) ++ { ++ delete m_pIMHandler; ++ m_pIMHandler = NULL; ++ } ++ if( m_pRegion ) ++ { ++ gdk_region_destroy( m_pRegion ); ++ } ++ ++ GtkWidget *pEventWidget = getMouseEventWidget(); ++ for (auto handler_id : m_aMouseSignalIds) ++ g_signal_handler_disconnect(G_OBJECT(pEventWidget), handler_id); ++ if( m_pFixedContainer ) ++ gtk_widget_destroy( GTK_WIDGET(m_pFixedContainer) ); ++ if( m_pEventBox ) ++ gtk_widget_destroy( GTK_WIDGET(m_pEventBox) ); ++ if( m_pWindow ) ++ gtk_widget_destroy( m_pWindow ); ++ if( m_pForeignParent ) ++ g_object_unref( G_OBJECT( m_pForeignParent ) ); ++ if( m_pForeignTopLevel ) ++ g_object_unref( G_OBJECT( m_pForeignTopLevel ) ); ++ ++ // init new window ++ m_bDefaultPos = m_bDefaultSize = false; ++ if( aParentData.aWindow != None ) ++ { ++ m_nStyle |= SAL_FRAME_STYLE_PLUG; ++ Init( &aParentData ); ++ } ++ else ++ { ++ m_nStyle &= ~SAL_FRAME_STYLE_PLUG; ++ Init( (m_pParent && m_pParent->m_nXScreen == m_nXScreen) ? m_pParent : NULL, m_nStyle ); ++ } ++ ++ // update graphics ++ for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ ) ++ { ++ if( m_aGraphics[i].bInUse ) ++ { ++ m_aGraphics[i].pGraphics->SetDrawable( widget_get_xid(m_pWindow), m_nXScreen ); ++ m_aGraphics[i].pGraphics->SetWindow( m_pWindow ); ++ } ++ } ++ ++ if( ! m_aTitle.isEmpty() ) ++ SetTitle( m_aTitle ); ++ ++ if( bWasVisible ) ++ Show( true ); ++ ++ std::list< GtkSalFrame* > aChildren = m_aChildren; ++ m_aChildren.clear(); ++ for( std::list< GtkSalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) ++ (*it)->createNewWindow( None, false, m_nXScreen ); ++ ++ // FIXME: SalObjects ++} ++#endif ++ ++bool GtkSalFrame::SetPluginParent( SystemParentData* pSysParent ) ++{ ++#if !GTK_CHECK_VERSION(3,0,0) ++ GetGenericData()->ErrorTrapPush(); // permanantly ignore unruly children's errors ++ createNewWindow( pSysParent->aWindow, (pSysParent->nSize > sizeof(long)) && pSysParent->bXEmbedSupport, m_nXScreen ); ++ return true; ++#else ++ (void)pSysParent; ++ //FIXME: no SetPluginParent impl. for gtk3 ++ return false; ++#endif ++} ++ ++void GtkSalFrame::ResetClipRegion() ++{ ++ if( m_pWindow ) ++ gdk_window_shape_combine_region( widget_get_window( m_pWindow ), NULL, 0, 0 ); ++} ++ ++void GtkSalFrame::BeginSetClipRegion( sal_uLong ) ++{ ++#if GTK_CHECK_VERSION(3,0,0) ++ if( m_pRegion ) ++ cairo_region_destroy( m_pRegion ); ++ m_pRegion = cairo_region_create(); ++#else ++ if( m_pRegion ) ++ gdk_region_destroy( m_pRegion ); ++ m_pRegion = gdk_region_new(); ++#endif ++} ++ ++void GtkSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) ++{ ++ if( m_pRegion ) ++ { ++ GdkRectangle aRect; ++ aRect.x = nX; ++ aRect.y = nY; ++ aRect.width = nWidth; ++ aRect.height = nHeight; ++#if GTK_CHECK_VERSION(3,0,0) ++ cairo_region_union_rectangle( m_pRegion, &aRect ); ++#else ++ gdk_region_union_with_rect( m_pRegion, &aRect ); ++#endif ++ } ++} ++ ++void GtkSalFrame::EndSetClipRegion() ++{ ++ if( m_pWindow && m_pRegion ) ++ gdk_window_shape_combine_region( widget_get_window(m_pWindow), m_pRegion, 0, 0 ); ++} ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++bool GtkSalFrame::Dispatch( const XEvent* pEvent ) ++{ ++ bool bContinueDispatch = true; ++ ++ if( pEvent->type == PropertyNotify ) ++ { ++ vcl_sal::WMAdaptor* pAdaptor = getDisplay()->getWMAdaptor(); ++ Atom nDesktopAtom = pAdaptor->getAtom( vcl_sal::WMAdaptor::NET_WM_DESKTOP ); ++ if( pEvent->xproperty.atom == nDesktopAtom && ++ pEvent->xproperty.state == PropertyNewValue ) ++ { ++ m_nWorkArea = pAdaptor->getWindowWorkArea( widget_get_xid(m_pWindow) ); ++ } ++ } ++ else if( pEvent->type == ConfigureNotify ) ++ { ++ if( m_pForeignParent && pEvent->xconfigure.window == m_aForeignParentWindow ) ++ { ++ bContinueDispatch = false; ++ gtk_window_resize( GTK_WINDOW(m_pWindow), pEvent->xconfigure.width, pEvent->xconfigure.height ); ++ if( ( sal::static_int_cast< int >(maGeometry.nWidth) != ++ pEvent->xconfigure.width ) || ++ ( sal::static_int_cast< int >(maGeometry.nHeight) != ++ pEvent->xconfigure.height ) ) ++ { ++ maGeometry.nWidth = pEvent->xconfigure.width; ++ maGeometry.nHeight = pEvent->xconfigure.height; ++ setMinMaxSize(); ++ getDisplay()->SendInternalEvent( this, NULL, SALEVENT_RESIZE ); ++ } ++ } ++ else if( m_pForeignTopLevel && pEvent->xconfigure.window == m_aForeignTopLevelWindow ) ++ { ++ bContinueDispatch = false; ++ // update position ++ int x = 0, y = 0; ++ ::Window aChild; ++ XTranslateCoordinates( getDisplay()->GetDisplay(), ++ widget_get_xid(m_pWindow), ++ getDisplay()->GetRootWindow( getDisplay()->GetDefaultXScreen() ), ++ 0, 0, ++ &x, &y, ++ &aChild ); ++ if( x != maGeometry.nX || y != maGeometry.nY ) ++ { ++ maGeometry.nX = x; ++ maGeometry.nY = y; ++ getDisplay()->SendInternalEvent( this, NULL, SALEVENT_MOVE ); ++ } ++ } ++ } ++ else if( pEvent->type == ClientMessage && ++ pEvent->xclient.message_type == getDisplay()->getWMAdaptor()->getAtom( vcl_sal::WMAdaptor::XEMBED ) && ++ pEvent->xclient.window == widget_get_xid(m_pWindow) && ++ m_bWindowIsGtkPlug ++ ) ++ { ++ // FIXME: this should not be necessary, GtkPlug should do this ++ // transparently for us ++ if( pEvent->xclient.data.l[1] == 1 || // XEMBED_WINDOW_ACTIVATE ++ pEvent->xclient.data.l[1] == 2 // XEMBED_WINDOW_DEACTIVATE ++ ) ++ { ++ GdkEventFocus aEvent; ++ aEvent.type = GDK_FOCUS_CHANGE; ++ aEvent.window = widget_get_window( m_pWindow ); ++ aEvent.send_event = gint8(TRUE); ++ aEvent.in = gint16(pEvent->xclient.data.l[1] == 1); ++ signalFocus( m_pWindow, &aEvent, this ); ++ } ++ } ++ ++ return bContinueDispatch; ++} ++#endif ++ ++gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ SalMouseEvent aEvent; ++ sal_uInt16 nEventType = 0; ++ switch( pEvent->type ) ++ { ++ case GDK_BUTTON_PRESS: ++ nEventType = SALEVENT_MOUSEBUTTONDOWN; ++ break; ++ case GDK_BUTTON_RELEASE: ++ nEventType = SALEVENT_MOUSEBUTTONUP; ++ break; ++ default: ++ return false; ++ } ++ switch( pEvent->button ) ++ { ++ case 1: aEvent.mnButton = MOUSE_LEFT; break; ++ case 2: aEvent.mnButton = MOUSE_MIDDLE; break; ++ case 3: aEvent.mnButton = MOUSE_RIGHT; break; ++ default: return false; ++ } ++ aEvent.mnTime = pEvent->time; ++ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; ++ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; ++ aEvent.mnCode = GetMouseModCode( pEvent->state ); ++ ++ bool bClosePopups = false; ++ if( pEvent->type == GDK_BUTTON_PRESS && ++ (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) == 0 ++ ) ++ { ++ if( m_nFloats > 0 ) ++ { ++ // close popups if user clicks outside our application ++ gint x, y; ++ bClosePopups = (gdk_display_get_window_at_pointer( GtkSalFrame::getGdkDisplay(), &x, &y ) == NULL); ++ } ++ /* #i30306# release implicit pointer grab if no popups are open; else ++ * Drag cannot grab the pointer and will fail. ++ */ ++ if( m_nFloats < 1 || bClosePopups ) ++ gdk_display_pointer_ungrab( GtkSalFrame::getGdkDisplay(), GDK_CURRENT_TIME ); ++ } ++ ++ if( pThis->m_bWindowIsGtkPlug && ++ pEvent->type == GDK_BUTTON_PRESS && ++ pEvent->button == 1 ) ++ { ++ pThis->askForXEmbedFocus( pEvent->time ); ++ } ++ ++ // --- RTL --- (mirror mouse pos) ++ if( AllSettings::GetLayoutRTL() ) ++ aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; ++ ++ vcl::DeletionListener aDel( pThis ); ++ ++ pThis->CallCallback( nEventType, &aEvent ); ++ ++ if( ! aDel.isDeleted() ) ++ { ++ if( bClosePopups ) ++ { ++ ImplSVData* pSVData = ImplGetSVData(); ++ if ( pSVData->maWinData.mpFirstFloat ) ++ { ++ static const char* pEnv = getenv( "SAL_FLOATWIN_NOAPPFOCUSCLOSE" ); ++ if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) && !(pEnv && *pEnv) ) ++ pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll ); ++ } ++ } ++ ++ if( ! aDel.isDeleted() ) ++ { ++ int frame_x = (int)(pEvent->x_root - pEvent->x); ++ int frame_y = (int)(pEvent->y_root - pEvent->y); ++ if( frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY ) ++ { ++ pThis->maGeometry.nX = frame_x; ++ pThis->maGeometry.nY = frame_y; ++ pThis->CallCallback( SALEVENT_MOVE, NULL ); ++ } ++ } ++ } ++ ++ return true; ++} ++ ++#if GTK_CHECK_VERSION(3,0,0) ++void GtkSalFrame::signalFlagsChanged( GtkWidget* , GtkStateFlags state, gpointer frame ) ++{ ++ //TO-DO: This isn't as helpful as I'd like it to be. The color selector puts the main ++ //windows into the backdrop, disabling everything, and the floating navigator window ++ //is also problematic. ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ bool bOldBackDrop = state & GTK_STATE_FLAG_BACKDROP; ++ bool bNewBackDrop = (gtk_widget_get_state_flags(GTK_WIDGET(pThis->m_pWindow)) & GTK_STATE_FLAG_BACKDROP); ++ if (bNewBackDrop && !bOldBackDrop) ++ { ++ pThis->GetWindow()->Disable(); ++ } ++ else if (bOldBackDrop && !bNewBackDrop) ++ { ++ pThis->GetWindow()->Enable(); ++ } ++} ++#endif ++ ++gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ GdkEventScroll* pSEvent = reinterpret_cast(pEvent); ++ ++#if GTK_CHECK_VERSION(3,0,0) ++ // gnome#726878 check for duplicate legacy scroll event ++ if (pSEvent->direction != GDK_SCROLL_SMOOTH && ++ pThis->m_nLastScrollEventTime == pSEvent->time) ++ { ++ return true; ++ } ++#endif ++ ++ SalWheelMouseEvent aEvent; ++ ++ aEvent.mnTime = pSEvent->time; ++ aEvent.mnX = (sal_uLong)pSEvent->x; ++ aEvent.mnY = (sal_uLong)pSEvent->y; ++ aEvent.mnCode = GetMouseModCode( pSEvent->state ); ++ aEvent.mnScrollLines = 3; ++ ++ switch (pSEvent->direction) ++ { ++#if GTK_CHECK_VERSION(3,0,0) ++ case GDK_SCROLL_SMOOTH: ++ { ++ double delta_x, delta_y; ++ gdk_event_get_scroll_deltas(pEvent, &delta_x, &delta_y); ++ //pick the bigger one I guess ++ aEvent.mbHorz = fabs(delta_x) > fabs(delta_y); ++ if (aEvent.mbHorz) ++ aEvent.mnDelta = -delta_x; ++ else ++ aEvent.mnDelta = -delta_y; ++ aEvent.mnScrollLines = 1; ++ pThis->m_nLastScrollEventTime = pSEvent->time; ++ break; ++ } ++#endif ++ case GDK_SCROLL_UP: ++ aEvent.mnDelta = 120; ++ aEvent.mbHorz = false; ++ break; ++ case GDK_SCROLL_DOWN: ++ aEvent.mnDelta = -120; ++ aEvent.mbHorz = false; ++ break; ++ case GDK_SCROLL_LEFT: ++ aEvent.mbHorz = true; ++ aEvent.mnDelta = 120; ++ break; ++ case GDK_SCROLL_RIGHT: ++ aEvent.mnDelta = -120; ++ aEvent.mbHorz = true; ++ break; ++ }; ++ ++ aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : 1; ++ ++ // --- RTL --- (mirror mouse pos) ++ if( AllSettings::GetLayoutRTL() ) ++ aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; ++ ++ pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent ); ++ ++ return true; ++} ++ ++#if GTK_CHECK_VERSION(3,14,0) ++void GtkSalFrame::gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame) ++{ ++ gdouble x, y; ++ GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture)); ++ //I feel I want the first point of the sequence, not the last point which ++ //the docs say this gives, but for the moment assume we start and end ++ //within the same vcl window ++ if (gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y)) ++ { ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ SalSwipeEvent aEvent; ++ aEvent.mnVelocityX = velocity_x; ++ aEvent.mnVelocityY = velocity_y; ++ aEvent.mnX = x; ++ aEvent.mnY = y; ++ ++ pThis->CallCallback(SALEVENT_SWIPE, &aEvent); ++ } ++} ++ ++void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ if(pThis) ++ { ++ SalLongPressEvent aEvent; ++ ++ gdouble x, y; ++ GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture)); ++ gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y); ++ aEvent.mnX = x; ++ aEvent.mnY = y; ++ ++ pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent); ++ } ++} ++ ++#endif ++ ++gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ SalMouseEvent aEvent; ++ aEvent.mnTime = pEvent->time; ++ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; ++ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; ++ aEvent.mnCode = GetMouseModCode( pEvent->state ); ++ aEvent.mnButton = 0; ++ ++ // --- RTL --- (mirror mouse pos) ++ if( AllSettings::GetLayoutRTL() ) ++ aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; ++ ++ vcl::DeletionListener aDel( pThis ); ++ ++ pThis->CallCallback( SALEVENT_MOUSEMOVE, &aEvent ); ++ ++ if( ! aDel.isDeleted() ) ++ { ++ int frame_x = (int)(pEvent->x_root - pEvent->x); ++ int frame_y = (int)(pEvent->y_root - pEvent->y); ++ if( frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY ) ++ { ++ pThis->maGeometry.nX = frame_x; ++ pThis->maGeometry.nY = frame_y; ++ pThis->CallCallback( SALEVENT_MOVE, NULL ); ++ } ++ ++ if( ! aDel.isDeleted() ) ++ { ++ // ask for the next hint ++ gint x, y; ++ GdkModifierType mask; ++ gdk_window_get_pointer( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &x, &y, &mask ); ++ } ++ } ++ ++ return true; ++} ++ ++gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ SalMouseEvent aEvent; ++ aEvent.mnTime = pEvent->time; ++ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; ++ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; ++ aEvent.mnCode = GetMouseModCode( pEvent->state ); ++ aEvent.mnButton = 0; ++ ++ pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent ); ++ ++ return true; ++} ++ ++#if GTK_CHECK_VERSION(3,0,0) ++ ++cairo_t* GtkSalFrame::getCairoContext() const ++{ ++ cairo_t* cr = SvpSalGraphics::createCairoContext(m_aFrame); ++ assert(cr); ++ return cr; ++} ++ ++void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect) ++{ ++#if OSL_DEBUG_LEVEL > 1 ++ long long area = rDamageRect.getWidth() * rDamageRect.getHeight(); ++ if( area > 32 * 1024 ) ++ { ++ fprintf( stderr, "bitmap damaged %d %d (%dx%d) area %lld widget\n", ++ (int) rDamageRect.getMinX(), ++ (int) rDamageRect.getMinY(), ++ (int) rDamageRect.getWidth(), ++ (int) rDamageRect.getHeight(), ++ area ); ++ } ++#endif ++ ++ if (dumpframes) ++ { ++ static int frame; ++ OString tmp("/tmp/frame" + OString::number(frame++) + ".png"); ++ cairo_t* cr = getCairoContext(); ++ cairo_surface_write_to_png(cairo_get_target(cr), tmp.getStr()); ++ cairo_destroy(cr); ++ } ++ ++ gtk_widget_queue_draw_area(GTK_WIDGET(m_pFixedContainer), ++ rDamageRect.getMinX(), ++ rDamageRect.getMinY(), ++ rDamageRect.getWidth(), ++ rDamageRect.getHeight()); ++} ++ ++// blit our backing basebmp buffer to the target cairo context cr ++gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ cairo_save(cr); ++ ++ cairo_t* source = pThis->getCairoContext(); ++ cairo_surface_t *pSurface = cairo_get_target(source); ++ ++ cairo_set_operator( cr, CAIRO_OPERATOR_OVER ); ++ cairo_set_source_surface(cr, pSurface, 0, 0); ++ cairo_paint(cr); ++ ++ cairo_destroy(source); ++ ++ cairo_restore(cr); ++ ++ cairo_surface_flush(cairo_get_target(cr)); ++ ++ return false; ++} ++ ++void GtkSalFrame::sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ bool bSized = false; ++ ++ if( pThis->m_bFullscreen || (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE ) ++ { ++ if( pAllocation->width != (int)pThis->maGeometry.nWidth || pAllocation->height != (int)pThis->maGeometry.nHeight ) ++ { ++ bSized = true; ++ pThis->maGeometry.nWidth = pAllocation->width; ++ pThis->maGeometry.nHeight = pAllocation->height; ++ } ++ } ++ ++ if( bSized ) ++ { ++ pThis->AllocateFrame(); ++ pThis->CallCallback( SALEVENT_RESIZE, nullptr ); ++ pThis->TriggerPaintEvent(); ++ } ++} ++ ++gboolean GtkSalFrame::signalConfigure(GtkWidget*, GdkEventConfigure* pEvent, gpointer frame) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ pThis->m_bPaintsBlocked = false; ++ ++ bool bMoved = false; ++ int x = pEvent->x, y = pEvent->y; ++ ++ /* HACK: during sizing/moving a toolbar pThis->maGeometry is actually ++ * already exact; even worse: due to the asynchronicity of configure ++ * events the borderwindow which would evaluate this event ++ * would size/move based on wrong data if we would actually evaluate ++ * this event. So let's swallow it. ++ */ ++ if( (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && ++ GtkSalFrame::getDisplay()->GetCaptureFrame() == pThis ) ++ return false; ++ ++ /* #i31785# claims we cannot trust the x,y members of the event; ++ * they are e.g. not set correctly on maximize/demaximize; ++ * yet the gdkdisplay-x11.c code handling configure_events has ++ * done this XTranslateCoordinates work since the day ~zero. ++ */ ++ if( x != pThis->maGeometry.nX || y != pThis->maGeometry.nY ) ++ { ++ bMoved = true; ++ pThis->maGeometry.nX = x; ++ pThis->maGeometry.nY = y; ++ } ++ ++ // update decoration hints ++ if( ! (pThis->m_nStyle & SAL_FRAME_STYLE_PLUG) ) ++ { ++ GdkRectangle aRect; ++ gdk_window_get_frame_extents( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &aRect ); ++ pThis->maGeometry.nTopDecoration = y - aRect.y; ++ pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height; ++ pThis->maGeometry.nLeftDecoration = x - aRect.x; ++ pThis->maGeometry.nRightDecoration = aRect.x + aRect.width - x - pEvent->width; ++ } ++ else ++ { ++ pThis->maGeometry.nTopDecoration = ++ pThis->maGeometry.nBottomDecoration = ++ pThis->maGeometry.nLeftDecoration = ++ pThis->maGeometry.nRightDecoration = 0; ++ } ++ ++ pThis->updateScreenNumber(); ++ ++ if (bMoved) ++ pThis->CallCallback(SALEVENT_MOVE, nullptr); ++ ++ return false; ++} ++#else ++gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ pThis->m_bPaintsBlocked = false; ++ ++ struct SalPaintEvent aEvent( pEvent->area.x, pEvent->area.y, pEvent->area.width, pEvent->area.height ); ++ ++ pThis->CallCallback( SALEVENT_PAINT, &aEvent ); ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ pThis->m_bPaintsBlocked = false; ++ ++ bool bMoved = false, bSized = false; ++ int x = pEvent->x, y = pEvent->y; ++ ++ /* HACK: during sizing/moving a toolbar pThis->maGeometry is actually ++ * already exact; even worse: due to the asynchronicity of configure ++ * events the borderwindow which would evaluate this event ++ * would size/move based on wrong data if we would actually evaluate ++ * this event. So let's swallow it. ++ */ ++ if( (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && ++ GtkSalFrame::getDisplay()->GetCaptureFrame() == pThis ) ++ return false; ++ ++ /* #i31785# claims we cannot trust the x,y members of the event; ++ * they are e.g. not set correctly on maximize/demaximize; ++ * yet the gdkdisplay-x11.c code handling configure_events has ++ * done this XTranslateCoordinates work since the day ~zero. ++ */ ++ if( x != pThis->maGeometry.nX || y != pThis->maGeometry.nY ) ++ { ++ bMoved = true; ++ pThis->maGeometry.nX = x; ++ pThis->maGeometry.nY = y; ++ } ++ /* #i86302# ++ * for non sizeable windows we set the min and max hint for the window manager to ++ * achieve correct sizing. However this is asynchronous and e.g. on Compiz ++ * it sometimes happens that the window gets resized to another size (some default) ++ * if we update the size here, subsequent setMinMaxSize will use this wrong size ++ * - which is not good since the window manager will now size the window back to this ++ * wrong size at some point. ++ */ ++ if( pThis->m_bFullscreen || (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE ) ++ { ++ if( pEvent->width != (int)pThis->maGeometry.nWidth || pEvent->height != (int)pThis->maGeometry.nHeight ) ++ { ++ bSized = true; ++ pThis->maGeometry.nWidth = pEvent->width; ++ pThis->maGeometry.nHeight = pEvent->height; ++ } ++ } ++ ++ // update decoration hints ++ if( ! (pThis->m_nStyle & SAL_FRAME_STYLE_PLUG) ) ++ { ++ GdkRectangle aRect; ++ gdk_window_get_frame_extents( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &aRect ); ++ pThis->maGeometry.nTopDecoration = y - aRect.y; ++ pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height; ++ pThis->maGeometry.nLeftDecoration = x - aRect.x; ++ pThis->maGeometry.nRightDecoration = aRect.x + aRect.width - x - pEvent->width; ++ } ++ else ++ { ++ pThis->maGeometry.nTopDecoration = ++ pThis->maGeometry.nBottomDecoration = ++ pThis->maGeometry.nLeftDecoration = ++ pThis->maGeometry.nRightDecoration = 0; ++ } ++ ++ pThis->updateScreenNumber(); ++ if( bSized ) ++ pThis->AllocateFrame(); ++ ++ if( bMoved && bSized ) ++ pThis->CallCallback( SALEVENT_MOVERESIZE, nullptr ); ++ else if( bMoved ) ++ pThis->CallCallback( SALEVENT_MOVE, nullptr ); ++ else if( bSized ) ++ pThis->CallCallback( SALEVENT_RESIZE, nullptr ); ++ ++ if (bSized) ++ pThis->TriggerPaintEvent(); ++ return false; ++} ++ ++#endif // GTK_CHECK_VERSION(3,0,0) ++ ++void GtkSalFrame::TriggerPaintEvent() ++{ ++ //Under gtk2 we can basically paint directly into the XWindow and on ++ //additional "expose-event" events we can re-render the missing pieces ++ // ++ //Under gtk3 we have to keep our own buffer up to date and flush it into ++ //the given cairo context on "draw". So we emit a paint event on ++ //opportune resize trigger events to initially fill our backbuffer and then ++ //keep it up to date with our direct paints and tell gtk those regions ++ //have changed and then blit them into the provided cairo context when ++ //we get the "draw" ++ // ++ //The other alternative was to always paint everything on "draw", but ++ //that duplicates the amount of drawing and is hideously slow ++#if GTK_CHECK_VERSION(3,0,0) ++ SAL_INFO("vcl.gtk3", "force painting" << 0 << "," << 0 << " " << maGeometry.nWidth << "x" << maGeometry.nHeight); ++ SalPaintEvent aPaintEvt(0, 0, maGeometry.nWidth, maGeometry.nHeight, true); ++ CallCallback(SALEVENT_PAINT, &aPaintEvt); ++ gtk_widget_queue_draw(GTK_WIDGET(m_pFixedContainer)); ++#endif ++} ++ ++gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ SalGenericInstance *pSalInstance = ++ static_cast< SalGenericInstance* >(GetSalData()->m_pInstance); ++ ++ // check if printers have changed (analogous to salframe focus handler) ++ pSalInstance->updatePrinterUpdate(); ++ ++ if( !pEvent->in ) ++ { ++ pThis->m_nKeyModifiers = 0; ++ pThis->m_bSendModChangeOnRelease = false; ++ } ++ ++ if( pThis->m_pIMHandler ) ++ pThis->m_pIMHandler->focusChanged( pEvent->in ); ++ ++ // ask for changed printers like generic implementation ++ if( pEvent->in && pSalInstance->isPrinterInit() ) ++ pSalInstance->updatePrinterUpdate(); ++ ++ // FIXME: find out who the hell steals the focus from our frame ++ // while we have the pointer grabbed, this should not come from ++ // the window manager. Is this an event that was still queued ? ++ // The focus does not seem to get set inside our process ++ ++ // in the meantime do not propagate focus get/lose if floats are open ++ if( m_nFloats == 0 ) ++ pThis->CallCallback( pEvent->in ? SALEVENT_GETFOCUS : SALEVENT_LOSEFOCUS, NULL ); ++ ++ return false; ++} ++ ++#if !GTK_CHECK_VERSION(3,8,0) ++static OString getDisplayString() ++{ ++ int nParams = rtl_getAppCommandArgCount(); ++ OUString aParam; ++ for( int i = 0; i < nParams; i++ ) ++ { ++ rtl_getAppCommandArg( i, &aParam.pData ); ++ if( i < nParams-1 && (aParam == "-display" || aParam == "--display" ) ) ++ { ++ rtl_getAppCommandArg( i+1, &aParam.pData ); ++ return OUStringToOString( aParam, osl_getThreadTextEncoding() ); ++ } ++ } ++ return OString(); ++} ++#endif ++ ++gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++#if !GTK_CHECK_VERSION(3,8,0) ++ //Spawn off a helper program that will attempt to set this fullscreen ++ //window to span all displays. ++ if (pThis->m_bFullscreen && pThis->m_bSpanMonitorsWhenFullscreen) ++ { ++ GdkWindow* gdkwin = widget_get_window(pThis->m_pWindow); ++ if (gdkwin) ++ { ++ OUString sProgramURL( "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/xid-fullscreen-on-all-monitors"); ++ rtl::Bootstrap::expandMacros(sProgramURL); ++ OUString sProgram; ++ if (osl::FileBase::getSystemPathFromFileURL(sProgramURL, sProgram) == osl::File::E_None) ++ { ++ OString sFinalProgram(OUStringToOString(sProgram, osl_getThreadTextEncoding()) ++ + " " + OString::number((int)GDK_WINDOW_XID(gdkwin))); ++ OString sDisplay(getDisplayString()); ++ if (!sDisplay.isEmpty()) ++ { ++ sFinalProgram += "--display " + sDisplay; ++ } ++ int returnValue = system(sFinalProgram.getStr()); ++ (void)returnValue; ++ } ++ } ++ } ++#endif ++ ++ bool bSetFocus = pThis->m_bSetFocusOnMap; ++ pThis->m_bSetFocusOnMap = false; ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ if( bSetFocus ) ++ { ++ GetGenericData()->ErrorTrapPush(); ++ XSetInputFocus( GtkSalFrame::getDisplay()->GetDisplay(), ++ widget_get_xid(pWidget), ++ RevertToParent, CurrentTime ); ++ XSync( GtkSalFrame::getDisplay()->GetDisplay(), False ); ++ GetGenericData()->ErrorTrapPop(); ++ } ++#else ++ (void)pWidget; (void)bSetFocus; ++ //FIXME: no set input focus ... ++#endif ++ ++ pThis->CallCallback( SALEVENT_RESIZE, NULL ); ++ pThis->TriggerPaintEvent(); ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ pThis->CallCallback( SALEVENT_RESIZE, NULL ); ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ vcl::DeletionListener aDel( pThis ); ++ ++ if( pThis->m_pIMHandler ) ++ { ++ if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) ) ++ return true; ++ } ++ ++ // handle modifiers ++ if( pEvent->keyval == GDK_Shift_L || pEvent->keyval == GDK_Shift_R || ++ pEvent->keyval == GDK_Control_L || pEvent->keyval == GDK_Control_R || ++ pEvent->keyval == GDK_Alt_L || pEvent->keyval == GDK_Alt_R || ++ pEvent->keyval == GDK_Meta_L || pEvent->keyval == GDK_Meta_R || ++ pEvent->keyval == GDK_Super_L || pEvent->keyval == GDK_Super_R ) ++ { ++ SalKeyModEvent aModEvt; ++ ++ sal_uInt16 nModCode = GetKeyModCode( pEvent->state ); ++ ++ aModEvt.mnModKeyCode = 0; // emit no MODKEYCHANGE events ++ if( pEvent->type == GDK_KEY_PRESS && !pThis->m_nKeyModifiers ) ++ pThis->m_bSendModChangeOnRelease = true; ++ ++ else if( pEvent->type == GDK_KEY_RELEASE && ++ pThis->m_bSendModChangeOnRelease ) ++ { ++ aModEvt.mnModKeyCode = pThis->m_nKeyModifiers; ++ pThis->m_nKeyModifiers = 0; ++ } ++ ++ sal_uInt16 nExtModMask = 0; ++ sal_uInt16 nModMask = 0; ++ // pressing just the ctrl key leads to a keysym of XK_Control but ++ // the event state does not contain ControlMask. In the release ++ // event its the other way round: it does contain the Control mask. ++ // The modifier mode therefore has to be adapted manually. ++ switch( pEvent->keyval ) ++ { ++ case GDK_Control_L: ++ nExtModMask = MODKEY_LMOD1; ++ nModMask = KEY_MOD1; ++ break; ++ case GDK_Control_R: ++ nExtModMask = MODKEY_RMOD1; ++ nModMask = KEY_MOD1; ++ break; ++ case GDK_Alt_L: ++ nExtModMask = MODKEY_LMOD2; ++ nModMask = KEY_MOD2; ++ break; ++ case GDK_Alt_R: ++ nExtModMask = MODKEY_RMOD2; ++ nModMask = KEY_MOD2; ++ break; ++ case GDK_Shift_L: ++ nExtModMask = MODKEY_LSHIFT; ++ nModMask = KEY_SHIFT; ++ break; ++ case GDK_Shift_R: ++ nExtModMask = MODKEY_RSHIFT; ++ nModMask = KEY_SHIFT; ++ break; ++ // Map Meta/Super to MOD3 modifier on all Unix systems ++ // except Mac OS X ++ case GDK_Meta_L: ++ case GDK_Super_L: ++ nExtModMask = MODKEY_LMOD3; ++ nModMask = KEY_MOD3; ++ break; ++ case GDK_Meta_R: ++ case GDK_Super_R: ++ nExtModMask = MODKEY_RMOD3; ++ nModMask = KEY_MOD3; ++ break; ++ } ++ if( pEvent->type == GDK_KEY_RELEASE ) ++ { ++ nModCode &= ~nModMask; ++ pThis->m_nKeyModifiers &= ~nExtModMask; ++ } ++ else ++ { ++ nModCode |= nModMask; ++ pThis->m_nKeyModifiers |= nExtModMask; ++ } ++ ++ aModEvt.mnCode = nModCode; ++ aModEvt.mnTime = pEvent->time; ++ ++ pThis->CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt ); ++ ++ } ++ else ++ { ++ pThis->doKeyCallback( pEvent->state, ++ pEvent->keyval, ++ pEvent->hardware_keycode, ++ pEvent->group, ++ pEvent->time, ++ sal_Unicode(gdk_keyval_to_unicode( pEvent->keyval )), ++ (pEvent->type == GDK_KEY_PRESS), ++ false ); ++ if( ! aDel.isDeleted() ) ++ pThis->m_bSendModChangeOnRelease = false; ++ } ++ ++ if( !aDel.isDeleted() && pThis->m_pIMHandler ) ++ pThis->m_pIMHandler->updateIMSpotLocation(); ++ ++ return true; ++} ++ ++gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++#if GTK_CHECK_VERSION(3,0,0) ++ //If we went into the backdrop we disabled the toplevel window, if we ++ //receive a delete here, re-enable so we can process it ++ bool bBackDrop = (gtk_widget_get_state_flags(GTK_WIDGET(pThis->m_pWindow)) & GTK_STATE_FLAG_BACKDROP); ++ if (bBackDrop) ++ pThis->GetWindow()->Enable(); ++#endif ++ ++ pThis->CallCallback( SALEVENT_CLOSE, NULL ); ++ ++ return true; ++} ++ ++void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ // every frame gets an initial style set on creation ++ // do not post these as the whole application tends to ++ // redraw itself to adjust to the new style ++ // where there IS no new style resulting in tremendous unnecessary flickering ++ if( pPrevious != NULL ) ++ { ++ // signalStyleSet does NOT usually have the gdk lock ++ // so post user event to safely dispatch the SALEVENT_SETTINGSCHANGED ++ // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings ++ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_SETTINGSCHANGED ); ++ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_FONTCHANGED ); ++ } ++ ++#if !GTK_CHECK_VERSION(3,0,0) ++ /* #i64117# gtk sets a nice background pixmap ++ * but we actually don't really want that, so save ++ * some time on the Xserver as well as prevent ++ * some paint issues ++ */ ++ GdkWindow* pWin = widget_get_window(GTK_WIDGET(pThis->getWindow())); ++ if( pWin ) ++ { ++ ::Window aWin = GDK_WINDOW_XWINDOW(pWin); ++ if( aWin != None ) ++ XSetWindowBackgroundPixmap( GtkSalFrame::getDisplay()->GetDisplay(), ++ aWin, ++ pThis->m_hBackgroundPixmap ); ++ } ++ if( ! pThis->m_pParent ) ++ { ++ // signalize theme changed for NWF caches ++ // FIXME: should be called only once for a style change ++ GtkSalGraphics::bThemeChanged = true; ++ } ++#endif ++} ++ ++gboolean GtkSalFrame::signalWindowState( GtkWidget*, GdkEvent* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ if( (pThis->m_nState & GDK_WINDOW_STATE_ICONIFIED) != (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED ) ) ++ { ++ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_RESIZE ); ++ pThis->TriggerPaintEvent(); ++ } ++ ++ if( (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_MAXIMIZED) && ++ ! (pThis->m_nState & GDK_WINDOW_STATE_MAXIMIZED) ) ++ { ++ pThis->m_aRestorePosSize = ++ Rectangle( Point( pThis->maGeometry.nX, pThis->maGeometry.nY ), ++ Size( pThis->maGeometry.nWidth, pThis->maGeometry.nHeight ) ); ++ } ++ pThis->m_nState = pEvent->window_state.new_window_state; ++ ++ #if OSL_DEBUG_LEVEL > 1 ++ if( (pEvent->window_state.changed_mask & GDK_WINDOW_STATE_FULLSCREEN) ) ++ { ++ fprintf( stderr, "window %p %s full screen state\n", ++ pThis, ++ (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ? "enters" : "leaves"); ++ } ++ #endif ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ pThis->m_nVisibility = pEvent->state; ++ return true; ++} ++ ++void GtkSalFrame::signalDestroy( GtkWidget* pObj, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ if( pObj == pThis->m_pWindow ) ++ { ++ pThis->m_pFixedContainer = NULL; ++ pThis->m_pEventBox = NULL; ++ pThis->m_pWindow = NULL; ++ pThis->InvalidateGraphics(); ++ } ++} ++ ++// GtkSalFrame::IMHandler ++ ++GtkSalFrame::IMHandler::IMHandler( GtkSalFrame* pFrame ) ++: m_pFrame(pFrame), ++ m_nPrevKeyPresses( 0 ), ++ m_pIMContext( NULL ), ++ m_bFocused( true ), ++ m_bPreeditJustChanged( false ) ++{ ++ m_aInputEvent.mpTextAttr = NULL; ++ createIMContext(); ++} ++ ++GtkSalFrame::IMHandler::~IMHandler() ++{ ++ // cancel an eventual event posted to begin preedit again ++ GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); ++ deleteIMContext(); ++} ++ ++void GtkSalFrame::IMHandler::createIMContext() ++{ ++ if( ! m_pIMContext ) ++ { ++ m_pIMContext = gtk_im_multicontext_new (); ++ g_signal_connect( m_pIMContext, "commit", ++ G_CALLBACK (signalIMCommit), this ); ++ g_signal_connect( m_pIMContext, "preedit_changed", ++ G_CALLBACK (signalIMPreeditChanged), this ); ++ g_signal_connect( m_pIMContext, "retrieve_surrounding", ++ G_CALLBACK (signalIMRetrieveSurrounding), this ); ++ g_signal_connect( m_pIMContext, "delete_surrounding", ++ G_CALLBACK (signalIMDeleteSurrounding), this ); ++ g_signal_connect( m_pIMContext, "preedit_start", ++ G_CALLBACK (signalIMPreeditStart), this ); ++ g_signal_connect( m_pIMContext, "preedit_end", ++ G_CALLBACK (signalIMPreeditEnd), this ); ++ ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_set_client_window( m_pIMContext, widget_get_window(GTK_WIDGET(m_pFrame->m_pWindow)) ); ++ gtk_im_context_focus_in( m_pIMContext ); ++ GetGenericData()->ErrorTrapPop(); ++ m_bFocused = true; ++ } ++} ++ ++void GtkSalFrame::IMHandler::deleteIMContext() ++{ ++ if( m_pIMContext ) ++ { ++ // first give IC a chance to deinitialize ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_set_client_window( m_pIMContext, NULL ); ++ GetGenericData()->ErrorTrapPop(); ++ // destroy old IC ++ g_object_unref( m_pIMContext ); ++ m_pIMContext = NULL; ++ } ++} ++ ++void GtkSalFrame::IMHandler::doCallEndExtTextInput() ++{ ++ m_aInputEvent.mpTextAttr = NULL; ++ m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); ++} ++ ++void GtkSalFrame::IMHandler::updateIMSpotLocation() ++{ ++ SalExtTextInputPosEvent aPosEvent; ++ m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvent ); ++ GdkRectangle aArea; ++ aArea.x = aPosEvent.mnX; ++ aArea.y = aPosEvent.mnY; ++ aArea.width = aPosEvent.mnWidth; ++ aArea.height = aPosEvent.mnHeight; ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_set_cursor_location( m_pIMContext, &aArea ); ++ GetGenericData()->ErrorTrapPop(); ++} ++ ++void GtkSalFrame::IMHandler::sendEmptyCommit() ++{ ++ vcl::DeletionListener aDel( m_pFrame ); ++ ++ SalExtTextInputEvent aEmptyEv; ++ aEmptyEv.mnTime = 0; ++ aEmptyEv.mpTextAttr = 0; ++ aEmptyEv.maText.clear(); ++ aEmptyEv.mnCursorPos = 0; ++ aEmptyEv.mnCursorFlags = 0; ++ aEmptyEv.mbOnlyCursor = False; ++ m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEmptyEv ); ++ if( ! aDel.isDeleted() ) ++ m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); ++} ++ ++void GtkSalFrame::IMHandler::endExtTextInput( sal_uInt16 /*nFlags*/ ) ++{ ++ gtk_im_context_reset ( m_pIMContext ); ++ ++ if( m_aInputEvent.mpTextAttr ) ++ { ++ vcl::DeletionListener aDel( m_pFrame ); ++ // delete preedit in sal (commit an empty string) ++ sendEmptyCommit(); ++ if( ! aDel.isDeleted() ) ++ { ++ // mark previous preedit state again (will e.g. be sent at focus gain) ++ m_aInputEvent.mpTextAttr = &m_aInputFlags[0]; ++ if( m_bFocused ) ++ { ++ // begin preedit again ++ GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); ++ } ++ } ++ } ++} ++ ++void GtkSalFrame::IMHandler::focusChanged( bool bFocusIn ) ++{ ++ m_bFocused = bFocusIn; ++ if( bFocusIn ) ++ { ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_focus_in( m_pIMContext ); ++ GetGenericData()->ErrorTrapPop(); ++ if( m_aInputEvent.mpTextAttr ) ++ { ++ sendEmptyCommit(); ++ // begin preedit again ++ GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); ++ } ++ } ++ else ++ { ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_focus_out( m_pIMContext ); ++ GetGenericData()->ErrorTrapPop(); ++ // cancel an eventual event posted to begin preedit again ++ GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); ++ } ++} ++ ++bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent ) ++{ ++ vcl::DeletionListener aDel( m_pFrame ); ++ ++ if( pEvent->type == GDK_KEY_PRESS ) ++ { ++ // Add this key press event to the list of previous key presses ++ // to which we compare key release events. If a later key release ++ // event has a matching key press event in this list, we swallow ++ // the key release because some GTK Input Methods don't swallow it ++ // for us. ++ m_aPrevKeyPresses.push_back( PreviousKeyPress(pEvent) ); ++ m_nPrevKeyPresses++; ++ ++ // Also pop off the earliest key press event if there are more than 10 ++ // already. ++ while (m_nPrevKeyPresses > 10) ++ { ++ m_aPrevKeyPresses.pop_front(); ++ m_nPrevKeyPresses--; ++ } ++ ++ GObject* pRef = G_OBJECT( g_object_ref( G_OBJECT( m_pIMContext ) ) ); ++ ++ // #i51353# update spot location on every key input since we cannot ++ // know which key may activate a preedit choice window ++ updateIMSpotLocation(); ++ if( aDel.isDeleted() ) ++ return true; ++ ++ gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent ); ++ g_object_unref( pRef ); ++ ++ if( aDel.isDeleted() ) ++ return true; ++ ++ m_bPreeditJustChanged = false; ++ ++ if( bResult ) ++ return true; ++ else ++ { ++ DBG_ASSERT( m_nPrevKeyPresses > 0, "key press has vanished !" ); ++ if( ! m_aPrevKeyPresses.empty() ) // sanity check ++ { ++ // event was not swallowed, do not filter a following ++ // key release event ++ // note: this relies on gtk_im_context_filter_keypress ++ // returning without calling a handler (in the "not swallowed" ++ // case ) which might change the previous key press list so ++ // we would pop the wrong event here ++ m_aPrevKeyPresses.pop_back(); ++ m_nPrevKeyPresses--; ++ } ++ } ++ } ++ ++ // Determine if we got an earlier key press event corresponding to this key release ++ if (pEvent->type == GDK_KEY_RELEASE) ++ { ++ GObject* pRef = G_OBJECT( g_object_ref( G_OBJECT( m_pIMContext ) ) ); ++ gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent ); ++ g_object_unref( pRef ); ++ ++ if( aDel.isDeleted() ) ++ return true; ++ ++ m_bPreeditJustChanged = false; ++ ++ std::list::iterator iter = m_aPrevKeyPresses.begin(); ++ std::list::iterator iter_end = m_aPrevKeyPresses.end(); ++ while (iter != iter_end) ++ { ++ // If we found a corresponding previous key press event, swallow the release ++ // and remove the earlier key press from our list ++ if (*iter == pEvent) ++ { ++ m_aPrevKeyPresses.erase(iter); ++ m_nPrevKeyPresses--; ++ return true; ++ } ++ ++iter; ++ } ++ ++ if( bResult ) ++ return true; ++ } ++ ++ return false; ++} ++ ++/* FIXME: ++* #122282# still more hacking: some IMEs never start a preedit but simply commit ++* in this case we cannot commit a single character. Workaround: do not do the ++* single key hack for enter or space if the unicode committed does not match ++*/ ++ ++static bool checkSingleKeyCommitHack( guint keyval, sal_Unicode cCode ) ++{ ++ bool bRet = true; ++ switch( keyval ) ++ { ++ case GDK_KP_Enter: ++ case GDK_Return: ++ if( cCode != '\n' && cCode != '\r' ) ++ bRet = false; ++ break; ++ case GDK_space: ++ case GDK_KP_Space: ++ if( cCode != ' ' ) ++ bRet = false; ++ break; ++ default: ++ break; ++ } ++ return bRet; ++} ++ ++void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* pContext, gchar* pText, gpointer im_handler ) ++{ ++ GtkSalFrame::IMHandler* pThis = static_cast(im_handler); ++ ++ SolarMutexGuard aGuard; ++ vcl::DeletionListener aDel( pThis->m_pFrame ); ++ { ++ const bool bWasPreedit = ++ (pThis->m_aInputEvent.mpTextAttr != 0) || ++ pThis->m_bPreeditJustChanged; ++ ++ pThis->m_aInputEvent.mnTime = 0; ++ pThis->m_aInputEvent.mpTextAttr = 0; ++ pThis->m_aInputEvent.maText = OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ); ++ pThis->m_aInputEvent.mnCursorPos = pThis->m_aInputEvent.maText.getLength(); ++ pThis->m_aInputEvent.mnCursorFlags = 0; ++ pThis->m_aInputEvent.mbOnlyCursor = False; ++ ++ pThis->m_aInputFlags.clear(); ++ ++ /* necessary HACK: all keyboard input comes in here as soon as a IMContext is set ++ * which is logical and consequent. But since even simple input like ++ * comes through the commit signal instead of signalKey ++ * and all kinds of windows only implement KeyInput (e.g. PushButtons, ++ * RadioButtons and a lot of other Controls), will send a single ++ * KeyInput/KeyUp sequence instead of an ExtText event if there ++ * never was a preedit and the text is only one character. ++ * ++ * In this case there the last ExtText event must have been ++ * SALEVENT_ENDEXTTEXTINPUT, either because of a regular commit ++ * or because there never was a preedit. ++ */ ++ bool bSingleCommit = false; ++ if( ! bWasPreedit ++ && pThis->m_aInputEvent.maText.getLength() == 1 ++ && ! pThis->m_aPrevKeyPresses.empty() ++ ) ++ { ++ const PreviousKeyPress& rKP = pThis->m_aPrevKeyPresses.back(); ++ sal_Unicode aOrigCode = pThis->m_aInputEvent.maText[0]; ++ ++ if( checkSingleKeyCommitHack( rKP.keyval, aOrigCode ) ) ++ { ++ pThis->m_pFrame->doKeyCallback( rKP.state, rKP.keyval, rKP.hardware_keycode, rKP.group, rKP.time, aOrigCode, true, true ); ++ bSingleCommit = true; ++ } ++ } ++ if( ! bSingleCommit ) ++ { ++ pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent); ++ if( ! aDel.isDeleted() ) ++ pThis->doCallEndExtTextInput(); ++ } ++ if( ! aDel.isDeleted() ) ++ { ++ // reset input event ++ pThis->m_aInputEvent.maText.clear(); ++ pThis->m_aInputEvent.mnCursorPos = 0; ++ pThis->updateIMSpotLocation(); ++ } ++ } ++#ifdef SOLARIS ++ // #i51356# workaround a solaris IIIMP bug ++ // in case of partial commits the preedit changed signal ++ // and commit signal come in wrong order ++ if( ! aDel.isDeleted() ) ++ signalIMPreeditChanged( pContext, im_handler ); ++#else ++ (void) pContext; ++#endif ++} ++ ++void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_handler ) ++{ ++ GtkSalFrame::IMHandler* pThis = static_cast(im_handler); ++ ++ char* pText = NULL; ++ PangoAttrList* pAttrs = NULL; ++ gint nCursorPos = 0; ++ ++ gtk_im_context_get_preedit_string( pThis->m_pIMContext, ++ &pText, ++ &pAttrs, ++ &nCursorPos ); ++ if( pText && ! *pText ) // empty string ++ { ++ // change from nothing to nothing -> do not start preedit ++ // e.g. this will activate input into a calc cell without ++ // user input ++ if( pThis->m_aInputEvent.maText.getLength() == 0 ) ++ { ++ g_free( pText ); ++ pango_attr_list_unref( pAttrs ); ++ return; ++ } ++ } ++ ++ pThis->m_bPreeditJustChanged = true; ++ ++ bool bEndPreedit = (!pText || !*pText) && pThis->m_aInputEvent.mpTextAttr != NULL; ++ pThis->m_aInputEvent.mnTime = 0; ++ pThis->m_aInputEvent.maText = pText ? OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ) : OUString(); ++ pThis->m_aInputEvent.mnCursorPos = nCursorPos; ++ pThis->m_aInputEvent.mnCursorFlags = 0; ++ pThis->m_aInputEvent.mbOnlyCursor = False; ++ ++ pThis->m_aInputFlags = std::vector( std::max( 1, (int)pThis->m_aInputEvent.maText.getLength() ), 0 ); ++ ++ PangoAttrIterator *iter = pango_attr_list_get_iterator(pAttrs); ++ do ++ { ++ GSList *attr_list = NULL; ++ GSList *tmp_list = NULL; ++ gint start, end; ++ guint sal_attr = 0; ++ ++ pango_attr_iterator_range (iter, &start, &end); ++ if (end == G_MAXINT) ++ end = pText ? strlen (pText) : 0; ++ if (end == start) ++ continue; ++ ++ start = g_utf8_pointer_to_offset (pText, pText + start); ++ end = g_utf8_pointer_to_offset (pText, pText + end); ++ ++ tmp_list = attr_list = pango_attr_iterator_get_attrs (iter); ++ while (tmp_list) ++ { ++ PangoAttribute *pango_attr = static_cast(tmp_list->data); ++ ++ switch (pango_attr->klass->type) ++ { ++ case PANGO_ATTR_BACKGROUND: ++ sal_attr |= (EXTTEXTINPUT_ATTR_HIGHLIGHT | EXTTEXTINPUT_CURSOR_INVISIBLE); ++ break; ++ case PANGO_ATTR_UNDERLINE: ++ sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE; ++ break; ++ case PANGO_ATTR_STRIKETHROUGH: ++ sal_attr |= EXTTEXTINPUT_ATTR_REDTEXT; ++ break; ++ default: ++ break; ++ } ++ pango_attribute_destroy (pango_attr); ++ tmp_list = tmp_list->next; ++ } ++ if (sal_attr == 0) ++ sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE; ++ g_slist_free (attr_list); ++ ++ // Set the sal attributes on our text ++ for (int i = start; i < end; ++i) ++ { ++ SAL_WARN_IF(i >= static_cast(pThis->m_aInputFlags.size()), ++ "vcl.gtk", "pango attrib out of range. Broken range: " ++ << start << "," << end << " Legal range: 0," ++ << pThis->m_aInputFlags.size()); ++ if (i >= static_cast(pThis->m_aInputFlags.size())) ++ continue; ++ pThis->m_aInputFlags[i] |= sal_attr; ++ } ++ } while (pango_attr_iterator_next (iter)); ++ pango_attr_iterator_destroy(iter); ++ ++ pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0]; ++ ++ g_free( pText ); ++ pango_attr_list_unref( pAttrs ); ++ ++ SolarMutexGuard aGuard; ++ vcl::DeletionListener aDel( pThis->m_pFrame ); ++ ++ pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent); ++ if( bEndPreedit && ! aDel.isDeleted() ) ++ pThis->doCallEndExtTextInput(); ++ if( ! aDel.isDeleted() ) ++ pThis->updateIMSpotLocation(); ++} ++ ++void GtkSalFrame::IMHandler::signalIMPreeditStart( GtkIMContext*, gpointer /*im_handler*/ ) ++{ ++} ++ ++void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_handler ) ++{ ++ GtkSalFrame::IMHandler* pThis = static_cast(im_handler); ++ ++ pThis->m_bPreeditJustChanged = true; ++ ++ SolarMutexGuard aGuard; ++ vcl::DeletionListener aDel( pThis->m_pFrame ); ++ pThis->doCallEndExtTextInput(); ++ if( ! aDel.isDeleted() ) ++ pThis->updateIMSpotLocation(); ++} ++ ++uno::Reference ++ FindFocus(uno::Reference< accessibility::XAccessibleContext > xContext) ++{ ++ if (!xContext.is()) ++ uno::Reference< accessibility::XAccessibleEditableText >(); ++ ++ uno::Reference xState = xContext->getAccessibleStateSet(); ++ if (xState.is()) ++ { ++ if (xState->contains(accessibility::AccessibleStateType::FOCUSED)) ++ return uno::Reference(xContext, uno::UNO_QUERY); ++ } ++ ++ for (sal_Int32 i = 0; i < xContext->getAccessibleChildCount(); ++i) ++ { ++ uno::Reference< accessibility::XAccessible > xChild = xContext->getAccessibleChild(i); ++ if (!xChild.is()) ++ continue; ++ uno::Reference< accessibility::XAccessibleContext > xChildContext = xChild->getAccessibleContext(); ++ if (!xChildContext.is()) ++ continue; ++ uno::Reference< accessibility::XAccessibleEditableText > xText = FindFocus(xChildContext); ++ if (xText.is()) ++ return xText; ++ } ++ return uno::Reference< accessibility::XAccessibleEditableText >(); ++} ++ ++static uno::Reference lcl_GetxText(vcl::Window *pFocusWin) ++{ ++ uno::Reference xText; ++ try ++ { ++ uno::Reference< accessibility::XAccessible > xAccessible( pFocusWin->GetAccessible( true ) ); ++ if (xAccessible.is()) ++ xText = FindFocus(xAccessible->getAccessibleContext()); ++ } ++ catch(const uno::Exception& e) ++ { ++ SAL_WARN( "vcl.gtk", "Exception in getting input method surrounding text: " << e.Message); ++ } ++ return xText; ++} ++ ++gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* pContext, gpointer /*im_handler*/ ) ++{ ++ vcl::Window *pFocusWin = Application::GetFocusWindow(); ++ if (!pFocusWin) ++ return true; ++ ++ uno::Reference xText = lcl_GetxText(pFocusWin); ++ if (xText.is()) ++ { ++ sal_Int32 nPosition = xText->getCaretPosition(); ++ OUString sAllText = xText->getText(); ++ OString sUTF = OUStringToOString(sAllText, RTL_TEXTENCODING_UTF8); ++ OUString sCursorText(sAllText.copy(0, nPosition)); ++ gtk_im_context_set_surrounding(pContext, sUTF.getStr(), sUTF.getLength(), ++ OUStringToOString(sCursorText, RTL_TEXTENCODING_UTF8).getLength()); ++ return true; ++ } ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint offset, gint nchars, ++ gpointer /*im_handler*/ ) ++{ ++ vcl::Window *pFocusWin = Application::GetFocusWindow(); ++ if (!pFocusWin) ++ return true; ++ ++ uno::Reference xText = lcl_GetxText(pFocusWin); ++ if (xText.is()) ++ { ++ sal_Int32 nPosition = xText->getCaretPosition(); ++ // #i111768# range checking ++ sal_Int32 nDeletePos = nPosition + offset; ++ sal_Int32 nDeleteEnd = nDeletePos + nchars; ++ if (nDeletePos < 0) ++ nDeletePos = 0; ++ if (nDeleteEnd < 0) ++ nDeleteEnd = 0; ++ if (nDeleteEnd > xText->getCharacterCount()) ++ nDeleteEnd = xText->getCharacterCount(); ++ ++ xText->deleteText(nDeletePos, nDeleteEnd); ++ //tdf91641 adjust cursor if deleted chars shift it forward (normal case) ++ if (nDeletePos < nPosition) ++ { ++ if (nDeleteEnd <= nPosition) ++ nPosition = nPosition - (nDeleteEnd - nDeletePos); ++ else ++ nPosition = nDeletePos; ++ ++ if (xText->getCharacterCount() >= nPosition) ++ xText->setCaretPosition( nPosition ); ++ } ++ return true; ++ } ++ ++ return false; ++} ++ ++Size GtkSalDisplay::GetScreenSize( int nDisplayScreen ) ++{ ++ Rectangle aRect = m_pSys->GetDisplayScreenPosSizePixel( nDisplayScreen ); ++ return Size( aRect.GetWidth(), aRect.GetHeight() ); ++} ++ ++Window GtkSalFrame::GetX11Window() ++{ ++ return widget_get_xid(m_pWindow); ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx +deleted file mode 100644 +index 9e03f14..0000000 +--- a/vcl/unx/gtk/window/gtksalframe.cxx ++++ /dev/null +@@ -1,4883 +0,0 @@ +-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +-/* +- * This file is part of the LibreOffice project. +- * +- * This Source Code Form is subject to the terms of the Mozilla Public +- * License, v. 2.0. If a copy of the MPL was not distributed with this +- * file, You can obtain one at http://mozilla.org/MPL/2.0/. +- * +- * This file incorporates work covered by the following license notice: +- * +- * Licensed to the Apache Software Foundation (ASF) under one or more +- * contributor license agreements. See the NOTICE file distributed +- * with this work for additional information regarding copyright +- * ownership. The ASF licenses this file to you under the Apache +- * License, Version 2.0 (the "License"); you may not use this file +- * except in compliance with the License. You may obtain a copy of +- * the License at http://www.apache.org/licenses/LICENSE-2.0 . +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#if !GTK_CHECK_VERSION(3,0,0) +-# include +-#endif +-#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) +-# include +-#endif +-#if defined ENABLE_GMENU_INTEGRATION // defined in gtksalmenu.hxx above +-# include +-#endif +- +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +-#include +- +-#if OSL_DEBUG_LEVEL > 1 +-# include +-#endif +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#if GTK_CHECK_VERSION(3,0,0) +-# include +-#endif +- +-#ifdef ENABLE_DBUS +-#include +- +-#define GSM_DBUS_SERVICE "org.gnome.SessionManager" +-#define GSM_DBUS_PATH "/org/gnome/SessionManager" +-#define GSM_DBUS_INTERFACE "org.gnome.SessionManager" +-#endif +- +-#include +- +-#if GTK_CHECK_VERSION(3,0,0) +-#define IS_WIDGET_REALIZED gtk_widget_get_realized +-#define IS_WIDGET_MAPPED gtk_widget_get_mapped +-#else +-#define IS_WIDGET_REALIZED GTK_WIDGET_REALIZED +-#define IS_WIDGET_MAPPED GTK_WIDGET_MAPPED +-#endif +- +-#if !GTK_CHECK_VERSION(3,0,0) +-#define GDK_IS_X11_DISPLAY(foo) (true) +-#endif +- +-using namespace com::sun::star; +- +-int GtkSalFrame::m_nFloats = 0; +- +-#if defined ENABLE_GMENU_INTEGRATION +-static GDBusConnection* pSessionBus = NULL; +-#endif +- +-static sal_uInt16 GetKeyModCode( guint state ) +-{ +- sal_uInt16 nCode = 0; +- if( (state & GDK_SHIFT_MASK) ) +- nCode |= KEY_SHIFT; +- if( (state & GDK_CONTROL_MASK) ) +- nCode |= KEY_MOD1; +- if( (state & GDK_MOD1_MASK) ) +- nCode |= KEY_MOD2; +- +- // Map Meta/Super keys to MOD3 modifier on all Unix systems +- // except Mac OS X +- if ( (state & GDK_META_MASK ) || ( state & GDK_SUPER_MASK ) ) +- nCode |= KEY_MOD3; +- return nCode; +-} +- +-static sal_uInt16 GetMouseModCode( guint state ) +-{ +- sal_uInt16 nCode = GetKeyModCode( state ); +- if( (state & GDK_BUTTON1_MASK) ) +- nCode |= MOUSE_LEFT; +- if( (state & GDK_BUTTON2_MASK) ) +- nCode |= MOUSE_MIDDLE; +- if( (state & GDK_BUTTON3_MASK) ) +- nCode |= MOUSE_RIGHT; +- +- return nCode; +-} +- +-static sal_uInt16 GetKeyCode( guint keyval ) +-{ +- sal_uInt16 nCode = 0; +- if( keyval >= GDK_0 && keyval <= GDK_9 ) +- nCode = KEY_0 + (keyval-GDK_0); +- else if( keyval >= GDK_KP_0 && keyval <= GDK_KP_9 ) +- nCode = KEY_0 + (keyval-GDK_KP_0); +- else if( keyval >= GDK_A && keyval <= GDK_Z ) +- nCode = KEY_A + (keyval-GDK_A ); +- else if( keyval >= GDK_a && keyval <= GDK_z ) +- nCode = KEY_A + (keyval-GDK_a ); +- else if( keyval >= GDK_F1 && keyval <= GDK_F26 ) +- { +-#if !GTK_CHECK_VERSION(3,0,0) +- if( GetGtkSalData()->GetGtkDisplay()->IsNumLockFromXS() ) +- { +- nCode = KEY_F1 + (keyval-GDK_F1); +- } +- else +-#endif +- { +- switch( keyval ) +- { +- // - - - - - Sun keyboard, see vcl/unx/source/app/saldisp.cxx +- case GDK_L2: +-#if !GTK_CHECK_VERSION(3,0,0) +- if( GetGtkSalData()->GetGtkDisplay()->GetServerVendor() == vendor_sun ) +- nCode = KEY_REPEAT; +- else +-#endif +- nCode = KEY_F12; +- break; +- case GDK_L3: nCode = KEY_PROPERTIES; break; +- case GDK_L4: nCode = KEY_UNDO; break; +- case GDK_L6: nCode = KEY_COPY; break; // KEY_F16 +- case GDK_L8: nCode = KEY_PASTE; break; // KEY_F18 +- case GDK_L10: nCode = KEY_CUT; break; // KEY_F20 +- default: +- nCode = KEY_F1 + (keyval-GDK_F1); break; +- } +- } +- } +- else +- { +- switch( keyval ) +- { +- case GDK_KP_Down: +- case GDK_Down: nCode = KEY_DOWN; break; +- case GDK_KP_Up: +- case GDK_Up: nCode = KEY_UP; break; +- case GDK_KP_Left: +- case GDK_Left: nCode = KEY_LEFT; break; +- case GDK_KP_Right: +- case GDK_Right: nCode = KEY_RIGHT; break; +- case GDK_KP_Begin: +- case GDK_KP_Home: +- case GDK_Begin: +- case GDK_Home: nCode = KEY_HOME; break; +- case GDK_KP_End: +- case GDK_End: nCode = KEY_END; break; +- case GDK_KP_Page_Up: +- case GDK_Page_Up: nCode = KEY_PAGEUP; break; +- case GDK_KP_Page_Down: +- case GDK_Page_Down: nCode = KEY_PAGEDOWN; break; +- case GDK_KP_Enter: +- case GDK_Return: nCode = KEY_RETURN; break; +- case GDK_Escape: nCode = KEY_ESCAPE; break; +- case GDK_ISO_Left_Tab: +- case GDK_KP_Tab: +- case GDK_Tab: nCode = KEY_TAB; break; +- case GDK_BackSpace: nCode = KEY_BACKSPACE; break; +- case GDK_KP_Space: +- case GDK_space: nCode = KEY_SPACE; break; +- case GDK_KP_Insert: +- case GDK_Insert: nCode = KEY_INSERT; break; +- case GDK_KP_Delete: +- case GDK_Delete: nCode = KEY_DELETE; break; +- case GDK_plus: +- case GDK_KP_Add: nCode = KEY_ADD; break; +- case GDK_minus: +- case GDK_KP_Subtract: nCode = KEY_SUBTRACT; break; +- case GDK_asterisk: +- case GDK_KP_Multiply: nCode = KEY_MULTIPLY; break; +- case GDK_slash: +- case GDK_KP_Divide: nCode = KEY_DIVIDE; break; +- case GDK_period: nCode = KEY_POINT; break; +- case GDK_decimalpoint: nCode = KEY_POINT; break; +- case GDK_comma: nCode = KEY_COMMA; break; +- case GDK_less: nCode = KEY_LESS; break; +- case GDK_greater: nCode = KEY_GREATER; break; +- case GDK_KP_Equal: +- case GDK_equal: nCode = KEY_EQUAL; break; +- case GDK_Find: nCode = KEY_FIND; break; +- case GDK_Menu: nCode = KEY_CONTEXTMENU;break; +- case GDK_Help: nCode = KEY_HELP; break; +- case GDK_Undo: nCode = KEY_UNDO; break; +- case GDK_Redo: nCode = KEY_REPEAT; break; +- case GDK_KP_Decimal: +- case GDK_KP_Separator: nCode = KEY_DECIMAL; break; +- case GDK_asciitilde: nCode = KEY_TILDE; break; +- case GDK_leftsinglequotemark: +- case GDK_quoteleft: nCode = KEY_QUOTELEFT; break; +- case GDK_bracketleft: nCode = KEY_BRACKETLEFT; break; +- case GDK_bracketright: nCode = KEY_BRACKETRIGHT; break; +- case GDK_semicolon: nCode = KEY_SEMICOLON; break; +- case GDK_quoteright: nCode = KEY_QUOTERIGHT; break; +- // some special cases, also see saldisp.cxx +- // - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000 +- case 0x1000FF02: // apXK_Copy +- nCode = KEY_COPY; +- break; +- case 0x1000FF03: // apXK_Cut +- nCode = KEY_CUT; +- break; +- case 0x1000FF04: // apXK_Paste +- nCode = KEY_PASTE; +- break; +- case 0x1000FF14: // apXK_Repeat +- nCode = KEY_REPEAT; +- break; +- // Exit, Save +- // - - - - - - - - - - - - - - D E C - - - - - - - - - - - - - 0x1000 +- case 0x1000FF00: +- nCode = KEY_DELETE; +- break; +- // - - - - - - - - - - - - - - H P - - - - - - - - - - - - - 0x1000 +- case 0x1000FF73: // hpXK_DeleteChar +- nCode = KEY_DELETE; +- break; +- case 0x1000FF74: // hpXK_BackTab +- case 0x1000FF75: // hpXK_KP_BackTab +- nCode = KEY_TAB; +- break; +- // - - - - - - - - - - - - - - I B M - - - - - - - - - - - - - +- // - - - - - - - - - - - - - - O S F - - - - - - - - - - - - - 0x1004 +- case 0x1004FF02: // osfXK_Copy +- nCode = KEY_COPY; +- break; +- case 0x1004FF03: // osfXK_Cut +- nCode = KEY_CUT; +- break; +- case 0x1004FF04: // osfXK_Paste +- nCode = KEY_PASTE; +- break; +- case 0x1004FF07: // osfXK_BackTab +- nCode = KEY_TAB; +- break; +- case 0x1004FF08: // osfXK_BackSpace +- nCode = KEY_BACKSPACE; +- break; +- case 0x1004FF1B: // osfXK_Escape +- nCode = KEY_ESCAPE; +- break; +- // Up, Down, Left, Right, PageUp, PageDown +- // - - - - - - - - - - - - - - S C O - - - - - - - - - - - - - +- // - - - - - - - - - - - - - - S G I - - - - - - - - - - - - - 0x1007 +- // - - - - - - - - - - - - - - S N I - - - - - - - - - - - - - +- // - - - - - - - - - - - - - - S U N - - - - - - - - - - - - - 0x1005 +- case 0x1005FF10: // SunXK_F36 +- nCode = KEY_F11; +- break; +- case 0x1005FF11: // SunXK_F37 +- nCode = KEY_F12; +- break; +- case 0x1005FF70: // SunXK_Props +- nCode = KEY_PROPERTIES; +- break; +- case 0x1005FF71: // SunXK_Front +- nCode = KEY_FRONT; +- break; +- case 0x1005FF72: // SunXK_Copy +- nCode = KEY_COPY; +- break; +- case 0x1005FF73: // SunXK_Open +- nCode = KEY_OPEN; +- break; +- case 0x1005FF74: // SunXK_Paste +- nCode = KEY_PASTE; +- break; +- case 0x1005FF75: // SunXK_Cut +- nCode = KEY_CUT; +- break; +- } +- } +- +- return nCode; +-} +- +-static guint GetKeyValFor(GdkKeymap* pKeyMap, guint16 hardware_keycode, guint8 group) +-{ +- guint updated_keyval = 0; +- gdk_keymap_translate_keyboard_state(pKeyMap, hardware_keycode, +- (GdkModifierType)0, group, &updated_keyval, NULL, NULL, NULL); +- return updated_keyval; +-} +- +-// F10 means either KEY_F10 or KEY_MENU, which has to be decided +-// in the independent part. +-struct KeyAlternate +-{ +- sal_uInt16 nKeyCode; +- sal_Unicode nCharCode; +- KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {} +- KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} +-}; +- +-inline KeyAlternate +-GetAlternateKeyCode( const sal_uInt16 nKeyCode ) +-{ +- KeyAlternate aAlternate; +- +- switch( nKeyCode ) +- { +- case KEY_F10: aAlternate = KeyAlternate( KEY_MENU );break; +- case KEY_F24: aAlternate = KeyAlternate( KEY_SUBTRACT, '-' );break; +- } +- +- return aAlternate; +-} +- +-#if GTK_CHECK_VERSION(3,0,0) +- +-namespace { +-/// Decouple SalFrame lifetime from damagetracker lifetime +-struct DamageTracker : public basebmp::IBitmapDeviceDamageTracker +-{ +- DamageTracker(GtkSalFrame& rFrame) : m_rFrame(rFrame) +- {} +- +- virtual ~DamageTracker() {} +- +- virtual void damaged(const basegfx::B2IBox& rDamageRect) const SAL_OVERRIDE +- { +- m_rFrame.damaged(rDamageRect); +- } +- +- GtkSalFrame& m_rFrame; +-}; +-} +- +-static bool dumpframes = false; +-#endif +- +-void GtkSalFrame::doKeyCallback( guint state, +- guint keyval, +- guint16 hardware_keycode, +- guint8 group, +- guint32 time, +- sal_Unicode aOrigCode, +- bool bDown, +- bool bSendRelease +- ) +-{ +- SalKeyEvent aEvent; +- +- aEvent.mnTime = time; +- aEvent.mnCharCode = aOrigCode; +- aEvent.mnRepeat = 0; +- +- vcl::DeletionListener aDel( this ); +- +-#if GTK_CHECK_VERSION(3,0,0) +-#if 0 +- // shift-zero forces a re-draw and event is swallowed +- if (keyval == GDK_0) +- { +- fprintf( stderr, "force widget_queue_draw\n"); +- gtk_widget_queue_draw (m_pFixedContainer); +- return; +- } +- else if (keyval == GDK_1) +- { +- fprintf( stderr, "force repaint all\n"); +- TriggerPaintEvent(); +- return; +- } +- else if (keyval == GDK_2) +- { +- dumpframes = !dumpframes; +- fprintf(stderr, "toggle dump frames to %d\n", dumpframes); +- return; +- } +-#endif +-#endif +- +- /* +- * #i42122# translate all keys with Ctrl and/or Alt to group 0 else +- * shortcuts (e.g. Ctrl-o) will not work but be inserted by the +- * application +- * +- * #i52338# do this for all keys that the independent part has no key code +- * for +- * +- * fdo#41169 rather than use group 0, detect if there is a group which can +- * be used to input Latin text and use that if possible +- */ +- aEvent.mnCode = GetKeyCode( keyval ); +- if( aEvent.mnCode == 0 ) +- { +- gint best_group = SAL_MAX_INT32; +- +- // Try and find Latin layout +- GdkKeymap* keymap = gdk_keymap_get_default(); +- GdkKeymapKey *keys; +- gint n_keys; +- if (gdk_keymap_get_entries_for_keyval(keymap, GDK_A, &keys, &n_keys)) +- { +- // Find the lowest group that supports Latin layout +- for (gint i = 0; i < n_keys; ++i) +- { +- if (keys[i].level != 0 && keys[i].level != 1) +- continue; +- best_group = std::min(best_group, keys[i].group); +- if (best_group == 0) +- break; +- } +- g_free(keys); +- } +- +- //Unavailable, go with original group then I suppose +- if (best_group == SAL_MAX_INT32) +- best_group = group; +- +- guint updated_keyval = GetKeyValFor(keymap, hardware_keycode, best_group); +- aEvent.mnCode = GetKeyCode(updated_keyval); +- } +- +- aEvent.mnCode |= GetKeyModCode( state ); +- +- if( bDown ) +- { +- bool bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent ); +- // #i46889# copy AlternatKeyCode handling from generic plugin +- if( ! bHandled ) +- { +- KeyAlternate aAlternate = GetAlternateKeyCode( aEvent.mnCode ); +- if( aAlternate.nKeyCode ) +- { +- aEvent.mnCode = aAlternate.nKeyCode; +- if( aAlternate.nCharCode ) +- aEvent.mnCharCode = aAlternate.nCharCode; +- bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent ); +- } +- } +- if( bSendRelease && ! aDel.isDeleted() ) +- { +- CallCallback( SALEVENT_KEYUP, &aEvent ); +- } +- } +- else +- CallCallback( SALEVENT_KEYUP, &aEvent ); +-} +- +-GtkSalFrame::GraphicsHolder::~GraphicsHolder() +-{ +- delete pGraphics; +-} +- +-GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle ) +- : m_nXScreen( getDisplay()->GetDefaultXScreen() ) +-{ +- getDisplay()->registerFrame( this ); +- m_bDefaultPos = true; +- m_bDefaultSize = ( (nStyle & SAL_FRAME_STYLE_SIZEABLE) && ! pParent ); +- m_bWindowIsGtkPlug = false; +-#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) +- m_pLastSyncedDbusMenu = NULL; +-#endif +- Init( pParent, nStyle ); +-} +- +-GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) +- : m_nXScreen( getDisplay()->GetDefaultXScreen() ) +-{ +- getDisplay()->registerFrame( this ); +- // permanently ignore errors from our unruly children ... +- GetGenericData()->ErrorTrapPush(); +- m_bDefaultPos = true; +- m_bDefaultSize = true; +-#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) +- m_pLastSyncedDbusMenu = NULL; +-#endif +- Init( pSysData ); +-} +- +-#ifdef ENABLE_GMENU_INTEGRATION +- +-static void +-gdk_x11_window_set_utf8_property (GdkWindow *window, +- const gchar *name, +- const gchar *value) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- GdkDisplay* display = gdk_window_get_display (window); +- +- if (value != NULL) +- { +- XChangeProperty (GDK_DISPLAY_XDISPLAY (display), +- GDK_WINDOW_XID (window), +- gdk_x11_get_xatom_by_name_for_display (display, name), +- gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8, +- PropModeReplace, reinterpret_cast(value), strlen (value)); +- } +- else +- { +- XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), +- GDK_WINDOW_XID (window), +- gdk_x11_get_xatom_by_name_for_display (display, name)); +- } +-#endif +-} +- +-// AppMenu watch functions. +- +-static void ObjectDestroyedNotify( gpointer data ) +-{ +- if ( data ) { +- g_object_unref( data ); +- } +-} +- +-#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) +-void GtkSalFrame::EnsureDbusMenuSynced() +-{ +- GtkSalMenu* pSalMenu = static_cast(GetMenu()); +- if(m_pLastSyncedDbusMenu != pSalMenu) { +- m_pLastSyncedDbusMenu = pSalMenu; +- static_cast(pSalMenu)->Activate(); +- } +-} +-#endif +- +-static void hud_activated( gboolean hud_active, gpointer user_data ) +-{ +- if ( hud_active ) +- { +- SolarMutexGuard aGuard; +- GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); +- GtkSalMenu* pSalMenu = reinterpret_cast< GtkSalMenu* >( pSalFrame->GetMenu() ); +- +- if ( pSalMenu ) +- pSalMenu->UpdateFull(); +- } +-} +- +-static void activate_uno(GSimpleAction *action, GVariant*, gpointer) +-{ +- uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); +- +- uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext ); +- +- uno::Reference < css::frame::XFrame > xFrame(xDesktop->getActiveFrame()); +- if (!xFrame.is()) +- xFrame = uno::Reference < css::frame::XFrame >(xDesktop, uno::UNO_QUERY); +- +- if (!xFrame.is()) +- return; +- +- uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, uno::UNO_QUERY); +- if (!xDispatchProvider.is()) +- return; +- +- gchar *strval = NULL; +- g_object_get(action, "name", &strval, NULL); +- if (!strval) +- return; +- +- if (strcmp(strval, "New") == 0) +- { +- uno::Reference xModuleManager(frame::ModuleManager::create(xContext)); +- OUString aModuleId(xModuleManager->identify(xFrame)); +- if (aModuleId.isEmpty()) +- return; +- +- comphelper::SequenceAsHashMap lModuleDescription(xModuleManager->getByName(aModuleId)); +- OUString sFactoryService; +- lModuleDescription[OUString("ooSetupFactoryEmptyDocumentURL")] >>= sFactoryService; +- if (sFactoryService.isEmpty()) +- return; +- +- uno::Sequence < css::beans::PropertyValue > args(0); +- xDesktop->loadComponentFromURL(sFactoryService, OUString("_blank"), 0, args); +- return; +- } +- +- OUString sCommand(".uno:"); +- sCommand += OUString(strval, strlen(strval), RTL_TEXTENCODING_UTF8); +- g_free(strval); +- +- css::util::URL aCommand; +- aCommand.Complete = sCommand; +- uno::Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(xContext); +- xParser->parseStrict(aCommand); +- +- uno::Reference< css::frame::XDispatch > xDisp = xDispatchProvider->queryDispatch(aCommand, OUString(), 0); +- +- if (!xDisp.is()) +- return; +- +- xDisp->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >()); +-} +- +-static const GActionEntry app_entries[] = { +- { "OptionsTreeDialog", activate_uno, NULL, NULL, NULL, {0} }, +- { "About", activate_uno, NULL, NULL, NULL, {0} }, +- { "HelpIndex", activate_uno, NULL, NULL, NULL, {0} }, +- { "Quit", activate_uno, NULL, NULL, NULL, {0} }, +- { "New", activate_uno, NULL, NULL, NULL, {0} } +-}; +- +-gboolean ensure_dbus_setup( gpointer data ) +-{ +- GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( data ); +- GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() ); +- +- if ( gdkWindow != NULL && g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-menubar" ) == NULL ) +- { +- // Get a DBus session connection. +- if(!pSessionBus) +- pSessionBus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); +- if( !pSessionBus ) +- return FALSE; +- +- // Create menu model and action group attached to this frame. +- GMenuModel* pMenuModel = G_MENU_MODEL( g_lo_menu_new() ); +- GActionGroup* pActionGroup = reinterpret_cast(g_lo_action_group_new( static_cast< gpointer >( pSalFrame ) )); +- +- // Generate menu paths. +- ::Window windowId = GDK_WINDOW_XID( gdkWindow ); +- gchar* aDBusWindowPath = g_strdup_printf( "/org/libreoffice/window/%lu", windowId ); +- gchar* aDBusMenubarPath = g_strdup_printf( "/org/libreoffice/window/%lu/menus/menubar", windowId ); +- +- // Set window properties. +- g_object_set_data_full( G_OBJECT( gdkWindow ), "g-lo-menubar", pMenuModel, ObjectDestroyedNotify ); +- g_object_set_data_full( G_OBJECT( gdkWindow ), "g-lo-action-group", pActionGroup, ObjectDestroyedNotify ); +- +- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_ID", "org.libreoffice" ); +- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_UNIQUE_BUS_NAME", g_dbus_connection_get_unique_name( pSessionBus ) ); +- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_OBJECT_PATH", "/org/libreoffice" ); +- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_WINDOW_OBJECT_PATH", aDBusWindowPath ); +- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_MENUBAR_OBJECT_PATH", aDBusMenubarPath ); +- +- // Publish the menu model and the action group. +- SAL_INFO("vcl.unity", "exporting menu model at " << pMenuModel << " for window " << windowId); +- pSalFrame->m_nMenuExportId = g_dbus_connection_export_menu_model (pSessionBus, aDBusMenubarPath, pMenuModel, NULL); +- SAL_INFO("vcl.unity", "exporting action group at " << pActionGroup << " for window " << windowId); +- pSalFrame->m_nActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, aDBusWindowPath, pActionGroup, NULL); +- pSalFrame->m_nHudAwarenessId = hud_awareness_register( pSessionBus, aDBusMenubarPath, hud_activated, pSalFrame, NULL, NULL ); +- +- // fdo#70885 we don't want app menu under Unity +- bool bDesktopIsUnity = (SalGetDesktopEnvironment() == "UNITY"); +- +- if (!bDesktopIsUnity) +- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APP_MENU_OBJECT_PATH", "/org/libreoffice/menus/appmenu" ); +- +- //app menu, to-do translations, block normal menus when active, honor use appmenu settings +- ResMgr* pMgr = ImplGetResMgr(); +- if( pMgr && !bDesktopIsUnity ) +- { +- GMenu *menu = g_menu_new (); +- GMenuItem* item; +- +- GMenu *firstsubmenu = g_menu_new (); +- +- OString sNew(OUStringToOString(ResId(SV_BUTTONTEXT_NEW, *pMgr).toString(), +- RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); +- +- item = g_menu_item_new(sNew.getStr(), "app.New"); +- g_menu_append_item( firstsubmenu, item ); +- g_object_unref(item); +- +- g_menu_append_section( menu, NULL, G_MENU_MODEL(firstsubmenu)); +- g_object_unref(firstsubmenu); +- +- GMenu *secondsubmenu = g_menu_new (); +- +- OString sPreferences(OUStringToOString(ResId(SV_STDTEXT_PREFERENCES, *pMgr).toString(), +- RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); +- +- item = g_menu_item_new(sPreferences.getStr(), "app.OptionsTreeDialog"); +- g_menu_append_item( secondsubmenu, item ); +- g_object_unref(item); +- +- g_menu_append_section( menu, NULL, G_MENU_MODEL(secondsubmenu)); +- g_object_unref(secondsubmenu); +- +- GMenu *thirdsubmenu = g_menu_new (); +- +- OString sHelp(OUStringToOString(ResId(SV_BUTTONTEXT_HELP, *pMgr).toString(), +- RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); +- +- item = g_menu_item_new(sHelp.getStr(), "app.HelpIndex"); +- g_menu_append_item( thirdsubmenu, item ); +- g_object_unref(item); +- +- OString sAbout(OUStringToOString(ResId(SV_STDTEXT_ABOUT, *pMgr).toString(), +- RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); +- +- item = g_menu_item_new(sAbout.getStr(), "app.About"); +- g_menu_append_item( thirdsubmenu, item ); +- g_object_unref(item); +- +- OString sQuit(OUStringToOString(ResId(SV_MENU_MAC_QUITAPP, *pMgr).toString(), +- RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); +- +- item = g_menu_item_new(sQuit.getStr(), "app.Quit"); +- g_menu_append_item( thirdsubmenu, item ); +- g_object_unref(item); +- g_menu_append_section( menu, NULL, G_MENU_MODEL(thirdsubmenu)); +- g_object_unref(thirdsubmenu); +- +- GSimpleActionGroup *group = g_simple_action_group_new (); +-#if GLIB_CHECK_VERSION(2,38,0) // g_simple_action_group_add_entries is deprecated since 2.38 +- g_action_map_add_action_entries (G_ACTION_MAP (group), app_entries, G_N_ELEMENTS (app_entries), NULL); +-#else +- g_simple_action_group_add_entries (group, app_entries, G_N_ELEMENTS (app_entries), NULL); +-#endif +- GActionGroup* pAppActionGroup = G_ACTION_GROUP(group); +- +- pSalFrame->m_nAppActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, "/org/libreoffice", pAppActionGroup, NULL); +- g_object_unref(pAppActionGroup); +- pSalFrame->m_nAppMenuExportId = g_dbus_connection_export_menu_model (pSessionBus, "/org/libreoffice/menus/appmenu", G_MENU_MODEL (menu), NULL); +- g_object_unref(menu); +- } +- +- g_free( aDBusMenubarPath ); +- g_free( aDBusWindowPath ); +- } +- +- return FALSE; +-} +- +-void on_registrar_available( GDBusConnection * /*connection*/, +- const gchar * /*name*/, +- const gchar * /*name_owner*/, +- gpointer user_data ) +-{ +- SolarMutexGuard aGuard; +- +- GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); +- +- SalMenu* pSalMenu = pSalFrame->GetMenu(); +- +- if ( pSalMenu != NULL ) +- { +- GtkSalMenu* pGtkSalMenu = static_cast(pSalMenu); +- pGtkSalMenu->Display( true ); +- pGtkSalMenu->UpdateFull(); +- } +-} +- +-// This is called when the registrar becomes unavailable. It shows the menubar. +-void on_registrar_unavailable( GDBusConnection * /*connection*/, +- const gchar * /*name*/, +- gpointer user_data ) +-{ +- SolarMutexGuard aGuard; +- +- SAL_INFO("vcl.unity", "on_registrar_unavailable"); +- +- //pSessionBus = NULL; +- GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); +- +- SalMenu* pSalMenu = pSalFrame->GetMenu(); +- +- if ( pSalMenu ) { +- GtkSalMenu* pGtkSalMenu = static_cast< GtkSalMenu* >( pSalMenu ); +- pGtkSalMenu->Display( false ); +- } +-} +-#endif +- +-void GtkSalFrame::EnsureAppMenuWatch() +-{ +-#ifdef ENABLE_GMENU_INTEGRATION +- if ( !m_nWatcherId ) +- { +- // Get a DBus session connection. +- if ( pSessionBus == NULL ) +- { +- pSessionBus = g_bus_get_sync( G_BUS_TYPE_SESSION, NULL, NULL ); +- +- if ( pSessionBus == NULL ) +- return; +- } +- +- // Publish the menu only if AppMenu registrar is available. +- m_nWatcherId = g_bus_watch_name_on_connection( pSessionBus, +- "com.canonical.AppMenu.Registrar", +- G_BUS_NAME_WATCHER_FLAGS_NONE, +- on_registrar_available, +- on_registrar_unavailable, +- static_cast(this), +- NULL ); +- } +- +- //ensure_dbus_setup( this ); +-#else +- (void) this; // loplugin:staticmethods +-#endif +-} +- +-void GtkSalFrame::InvalidateGraphics() +-{ +- for (unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); ++i) +- { +- if( !m_aGraphics[i].pGraphics ) +- continue; +-#if !GTK_CHECK_VERSION(3,0,0) +- m_aGraphics[i].pGraphics->SetDrawable( None, m_nXScreen ); +- m_aGraphics[i].pGraphics->SetWindow(NULL); +-#endif +- m_aGraphics[i].bInUse = false; +- } +-} +- +-GtkSalFrame::~GtkSalFrame() +-{ +- InvalidateGraphics(); +- +- if( m_pParent ) +- m_pParent->m_aChildren.remove( this ); +- +- getDisplay()->deregisterFrame( this ); +- +- if( m_pRegion ) +- { +-#if GTK_CHECK_VERSION(3,0,0) +- cairo_region_destroy( m_pRegion ); +-#else +- gdk_region_destroy( m_pRegion ); +-#endif +- } +- +-#if !GTK_CHECK_VERSION(3,0,0) +- if( m_hBackgroundPixmap ) +- { +- XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), +- widget_get_xid(m_pWindow), +- None ); +- XFreePixmap( getDisplay()->GetDisplay(), m_hBackgroundPixmap ); +- } +-#endif +- +- if( m_pIMHandler ) +- delete m_pIMHandler; +- +- GtkWidget *pEventWidget = getMouseEventWidget(); +- for (auto handler_id : m_aMouseSignalIds) +- g_signal_handler_disconnect(G_OBJECT(pEventWidget), handler_id); +- if( m_pFixedContainer ) +- gtk_widget_destroy( GTK_WIDGET( m_pFixedContainer ) ); +- if( m_pEventBox ) +- gtk_widget_destroy( GTK_WIDGET(m_pEventBox) ); +- { +- SolarMutexGuard aGuard; +-#if defined ENABLE_GMENU_INTEGRATION +- if(m_nWatcherId) +- g_bus_unwatch_name(m_nWatcherId); +-#endif +- if( m_pWindow ) +- { +- g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", NULL ); +- +-#if defined ENABLE_GMENU_INTEGRATION +- if ( pSessionBus ) +- { +- if ( m_nHudAwarenessId ) +- hud_awareness_unregister( pSessionBus, m_nHudAwarenessId ); +- if ( m_nMenuExportId ) +- g_dbus_connection_unexport_menu_model( pSessionBus, m_nMenuExportId ); +- if ( m_nAppMenuExportId ) +- g_dbus_connection_unexport_menu_model( pSessionBus, m_nAppMenuExportId ); +- if ( m_nActionGroupExportId ) +- g_dbus_connection_unexport_action_group( pSessionBus, m_nActionGroupExportId ); +- if ( m_nAppActionGroupExportId ) +- g_dbus_connection_unexport_action_group( pSessionBus, m_nAppActionGroupExportId ); +- } +-#endif +- gtk_widget_destroy( m_pWindow ); +- } +- } +- if( m_pForeignParent ) +- g_object_unref( G_OBJECT( m_pForeignParent ) ); +- if( m_pForeignTopLevel ) +- g_object_unref( G_OBJECT( m_pForeignTopLevel) ); +-} +- +-void GtkSalFrame::moveWindow( long nX, long nY ) +-{ +- if( isChild( false, true ) ) +- { +- if( m_pParent ) +- gtk_fixed_move( m_pParent->getFixedContainer(), +- m_pWindow, +- nX - m_pParent->maGeometry.nX, nY - m_pParent->maGeometry.nY ); +- } +- else +- gtk_window_move( GTK_WINDOW(m_pWindow), nX, nY ); +-} +- +-void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- gint nOrigwidth, nOrigheight; +- gtk_window_get_size(GTK_WINDOW(m_pWindow), &nOrigwidth, &nOrigheight); +- if (nWidth > nOrigwidth || nHeight > nOrigheight) +- { +- m_bPaintsBlocked = true; +- } +- gtk_widget_set_size_request(m_pWindow, nWidth, nHeight ); +-#else +- gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight ); +-#endif +-} +- +-void GtkSalFrame::window_resize(long nWidth, long nHeight) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- gint nOrigwidth, nOrigheight; +- gtk_window_get_size(GTK_WINDOW(m_pWindow), &nOrigwidth, &nOrigheight); +- if (nWidth > nOrigwidth || nHeight > nOrigheight) +- { +- m_bPaintsBlocked = true; +- } +-#endif +- gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight); +-} +- +-void GtkSalFrame::resizeWindow( long nWidth, long nHeight ) +-{ +- if( isChild( false, true ) ) +- { +- widget_set_size_request(nWidth, nHeight); +- } +- else if( ! isChild( true, false ) ) +- window_resize(nWidth, nHeight); +-} +- +-#if GTK_CHECK_VERSION(3,2,0) +- +-static void +-ooo_fixed_class_init(GtkFixedClass *klass) +-{ +- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); +- widget_class->get_accessible = ooo_fixed_get_accessible; +-} +- +-#endif +- +-/* +- * Always use a sub-class of GtkFixed we can tag for a11y. This allows us to +- * utilize GAIL for the toplevel window and toolkit implementation incl. +- * key event listener support .. +- */ +- +-GType +-ooo_fixed_get_type() +-{ +- static GType type = 0; +- +- if (!type) { +- static const GTypeInfo tinfo = +- { +- sizeof (GtkFixedClass), +- nullptr, /* base init */ +- nullptr, /* base finalize */ +-#if GTK_CHECK_VERSION(3,2,0) +- reinterpret_cast(ooo_fixed_class_init), /* class init */ +-#else +- nullptr, /* class init */ +-#endif +- nullptr, /* class finalize */ +- NULL, /* class data */ +- sizeof (GtkFixed), /* instance size */ +- 0, /* nb preallocs */ +- (GInstanceInitFunc) NULL, /* instance init */ +- NULL /* value table */ +- }; +- +- type = g_type_register_static( GTK_TYPE_FIXED, "OOoFixed", +- &tinfo, (GTypeFlags) 0); +- } +- +- return type; +-} +- +-void GtkSalFrame::updateScreenNumber() +-{ +- int nScreen = 0; +- GdkScreen *pScreen = gtk_widget_get_screen( m_pWindow ); +- if( pScreen ) +- nScreen = getDisplay()->getSystem()->getScreenMonitorIdx( pScreen, maGeometry.nX, maGeometry.nY ); +- maGeometry.nDisplayScreenNumber = nScreen; +-} +- +-GtkWidget *GtkSalFrame::getMouseEventWidget() const +-{ +-#if GTK_CHECK_VERSION(3,0,0) +- return GTK_WIDGET(m_pEventBox); +-#else +- return m_pWindow; +-#endif +-} +- +-void GtkSalFrame::InitCommon() +-{ +-#if GTK_CHECK_VERSION(3,0,0) +- m_pEventBox = GTK_EVENT_BOX(gtk_event_box_new()); +- gtk_widget_add_events( GTK_WIDGET(m_pEventBox), +- GDK_ALL_EVENTS_MASK ); +- gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pEventBox) ); +- +- // add the fixed container child, +- // fixed is needed since we have to position plugin windows +- m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL )); +- gtk_container_add( GTK_CONTAINER(m_pEventBox), GTK_WIDGET(m_pFixedContainer) ); +-#else +- m_pEventBox = 0; +- // add the fixed container child, +- // fixed is needed since we have to position plugin windows +- m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL )); +- gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pFixedContainer) ); +-#endif +- +- GtkWidget *pEventWidget = getMouseEventWidget(); +- +- gtk_widget_set_app_paintable(GTK_WIDGET(m_pFixedContainer), true); +- /*non-X11 displays won't show anything at all without double-buffering +- enabled*/ +- if (GDK_IS_X11_DISPLAY(getGdkDisplay())) +- gtk_widget_set_double_buffered(GTK_WIDGET(m_pFixedContainer), false); +- gtk_widget_set_redraw_on_allocate(GTK_WIDGET(m_pFixedContainer), false); +- +- +- // connect signals +- g_signal_connect( G_OBJECT(m_pWindow), "style-set", G_CALLBACK(signalStyleSet), this ); +- m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-press-event", G_CALLBACK(signalButton), this )); +- m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "motion-notify-event", G_CALLBACK(signalMotion), this )); +- m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-release-event", G_CALLBACK(signalButton), this )); +-#if GTK_CHECK_VERSION(3,0,0) +- g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this ); +- g_signal_connect( G_OBJECT(m_pFixedContainer), "size-allocate", G_CALLBACK(sizeAllocated), this ); +-// g_signal_connect( G_OBJECT(m_pWindow), "state-flags-changed", G_CALLBACK(signalFlagsChanged), this ); +-#if GTK_CHECK_VERSION(3,14,0) +- GtkGesture *pSwipe = gtk_gesture_swipe_new(pEventWidget); +- g_signal_connect(pSwipe, "swipe", G_CALLBACK(gestureSwipe), this); +- gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER (pSwipe), GTK_PHASE_TARGET); +- g_object_weak_ref(G_OBJECT(pEventWidget), reinterpret_cast(g_object_unref), pSwipe); +- +- GtkGesture *pLongPress = gtk_gesture_long_press_new(pEventWidget); +- g_signal_connect(pLongPress, "pressed", G_CALLBACK(gestureLongPress), this); +- gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER (pLongPress), GTK_PHASE_TARGET); +- g_object_weak_ref(G_OBJECT(pEventWidget), reinterpret_cast(g_object_unref), pLongPress); +- +-#endif +- +-#else +- g_signal_connect( G_OBJECT(m_pFixedContainer), "expose-event", G_CALLBACK(signalExpose), this ); +-#endif +- g_signal_connect( G_OBJECT(m_pWindow), "focus-in-event", G_CALLBACK(signalFocus), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "focus-out-event", G_CALLBACK(signalFocus), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "map-event", G_CALLBACK(signalMap), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "unmap-event", G_CALLBACK(signalUnmap), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "configure-event", G_CALLBACK(signalConfigure), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "key-press-event", G_CALLBACK(signalKey), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "key-release-event", G_CALLBACK(signalKey), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "delete-event", G_CALLBACK(signalDelete), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "window-state-event", G_CALLBACK(signalWindowState), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "scroll-event", G_CALLBACK(signalScroll), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "leave-notify-event", G_CALLBACK(signalCrossing), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "enter-notify-event", G_CALLBACK(signalCrossing), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "visibility-notify-event", G_CALLBACK(signalVisibility), this ); +- g_signal_connect( G_OBJECT(m_pWindow), "destroy", G_CALLBACK(signalDestroy), this ); +- +- // init members +- m_pCurrentCursor = NULL; +- m_nKeyModifiers = 0; +- m_bFullscreen = false; +- m_bSpanMonitorsWhenFullscreen = false; +- m_nState = GDK_WINDOW_STATE_WITHDRAWN; +- m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED; +-#if GTK_CHECK_VERSION(3,0,0) +- m_nLastScrollEventTime = GDK_CURRENT_TIME; +-#endif +- m_bSendModChangeOnRelease = false; +- m_pIMHandler = NULL; +- m_hBackgroundPixmap = None; +- m_nSavedScreenSaverTimeout = 0; +- m_nGSMCookie = 0; +- m_nExtStyle = 0; +- m_pRegion = NULL; +- m_ePointerStyle = static_cast(0xffff); +- m_bSetFocusOnMap = false; +- m_pSalMenu = NULL; +- m_nWatcherId = 0; +- m_nMenuExportId = 0; +- m_nAppMenuExportId = 0; +- m_nActionGroupExportId = 0; +- m_nAppActionGroupExportId = 0; +- m_nHudAwarenessId = 0; +- +- gtk_widget_add_events( m_pWindow, +- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | +- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | +- GDK_VISIBILITY_NOTIFY_MASK | GDK_SCROLL_MASK +- ); +- +- // show the widgets +-#if GTK_CHECK_VERSION(3,0,0) +- gtk_widget_show_all( GTK_WIDGET(m_pEventBox) ); +-#else +- gtk_widget_show_all( GTK_WIDGET(m_pFixedContainer) ); +-#endif +- +- // realize the window, we need an XWindow id +- gtk_widget_realize( m_pWindow ); +- +- //system data +- m_aSystemData.nSize = sizeof( SystemEnvData ); +-#if !GTK_CHECK_VERSION(3,0,0) +- GtkSalDisplay* pDisp = GetGtkSalData()->GetGtkDisplay(); +- m_aSystemData.pDisplay = pDisp->GetDisplay(); +- m_aSystemData.pVisual = pDisp->GetVisual( m_nXScreen ).GetVisual(); +- m_aSystemData.nDepth = pDisp->GetVisual( m_nXScreen ).GetDepth(); +- m_aSystemData.aColormap = pDisp->GetColormap( m_nXScreen ).GetXColormap(); +- m_aSystemData.aWindow = widget_get_xid(m_pWindow); +- m_aSystemData.aShellWindow = m_aSystemData.aWindow; +-#else +- static int nWindow = 0; +- m_aSystemData.aWindow = nWindow; +- m_aSystemData.aShellWindow = nWindow; +- ++nWindow; +-#endif +- m_aSystemData.pSalFrame = this; +- m_aSystemData.pWidget = m_pWindow; +- m_aSystemData.nScreen = m_nXScreen.getXScreen(); +- m_aSystemData.pAppContext = NULL; +- m_aSystemData.pShellWidget = m_aSystemData.pWidget; +- +- // fake an initial geometry, gets updated via configure event or SetPosSize +- if( m_bDefaultPos || m_bDefaultSize ) +- { +- Size aDefSize = calcDefaultSize(); +- maGeometry.nX = -1; +- maGeometry.nY = -1; +- maGeometry.nWidth = aDefSize.Width(); +- maGeometry.nHeight = aDefSize.Height(); +- if( m_pParent ) +- { +- // approximation +- maGeometry.nTopDecoration = m_pParent->maGeometry.nTopDecoration; +- maGeometry.nBottomDecoration = m_pParent->maGeometry.nBottomDecoration; +- maGeometry.nLeftDecoration = m_pParent->maGeometry.nLeftDecoration; +- maGeometry.nRightDecoration = m_pParent->maGeometry.nRightDecoration; +- } +- else +- { +- maGeometry.nTopDecoration = 0; +- maGeometry.nBottomDecoration = 0; +- maGeometry.nLeftDecoration = 0; +- maGeometry.nRightDecoration = 0; +- } +- } +- else +- { +- resizeWindow( maGeometry.nWidth, maGeometry.nHeight ); +- moveWindow( maGeometry.nX, maGeometry.nY ); +- } +- updateScreenNumber(); +- +- SetIcon(1); +- +-#if !GTK_CHECK_VERSION(3,0,0) +- m_nWorkArea = pDisp->getWMAdaptor()->getCurrentWorkArea(); +- /* #i64117# gtk sets a nice background pixmap +- * but we actually don't really want that, so save +- * some time on the Xserver as well as prevent +- * some paint issues +- */ +- XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), +- widget_get_xid(m_pWindow), +- m_hBackgroundPixmap ); +-#endif +-} +- +-/* Sadly gtk_window_set_accept_focus exists only since gtk 2.4 +- * for achieving the same effect we will remove the WM_TAKE_FOCUS +- * protocol from the window and set the input hint to false. +- * But gtk_window_set_accept_focus needs to be called before +- * window realization whereas the removal obviously can only happen +- * after realization. +- */ +- +-#if !GTK_CHECK_VERSION(3,0,0) +-extern "C" { +- typedef void(*setAcceptFn)( GtkWindow*, gboolean ); +- static setAcceptFn p_gtk_window_set_accept_focus = NULL; +- static bool bGetAcceptFocusFn = true; +- +- typedef void(*setUserTimeFn)( GdkWindow*, guint32 ); +- static setUserTimeFn p_gdk_x11_window_set_user_time = NULL; +- static bool bGetSetUserTimeFn = true; +-} +-#endif +- +-static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBeforeRealize ) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- if( bGetAcceptFocusFn ) +- { +- bGetAcceptFocusFn = false; +- p_gtk_window_set_accept_focus = reinterpret_cast(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_window_set_accept_focus" )); +- } +- if( p_gtk_window_set_accept_focus && bBeforeRealize ) +- p_gtk_window_set_accept_focus( pWindow, bAccept ); +- else if( ! bBeforeRealize ) +- { +- Display* pDisplay = GetGtkSalData()->GetGtkDisplay()->GetDisplay(); +- ::Window aWindow = widget_get_xid(GTK_WIDGET(pWindow)); +- XWMHints* pHints = XGetWMHints( pDisplay, aWindow ); +- if( ! pHints ) +- { +- pHints = XAllocWMHints(); +- pHints->flags = 0; +- } +- pHints->flags |= InputHint; +- pHints->input = bAccept ? True : False; +- XSetWMHints( pDisplay, aWindow, pHints ); +- XFree( pHints ); +- +- if (GetGtkSalData()->GetGtkDisplay()->getWMAdaptor()->getWindowManagerName() == "compiz") +- return; +- +- /* remove WM_TAKE_FOCUS protocol; this would usually be the +- * right thing, but gtk handles it internally whereas we +- * want to handle it ourselves (as to sometimes not get +- * the focus) +- */ +- Atom* pProtocols = NULL; +- int nProtocols = 0; +- XGetWMProtocols( pDisplay, +- aWindow, +- &pProtocols, &nProtocols ); +- if( pProtocols ) +- { +- bool bSet = false; +- Atom nTakeFocus = XInternAtom( pDisplay, "WM_TAKE_FOCUS", True ); +- if( nTakeFocus ) +- { +- for( int i = 0; i < nProtocols; i++ ) +- { +- if( pProtocols[i] == nTakeFocus ) +- { +- for( int n = i; n < nProtocols-1; n++ ) +- pProtocols[n] = pProtocols[n+1]; +- nProtocols--; +- i--; +- bSet = true; +- } +- } +- } +- if( bSet ) +- XSetWMProtocols( pDisplay, aWindow, pProtocols, nProtocols ); +- XFree( pProtocols ); +- } +- } +-#else +- gtk_window_set_accept_focus(pWindow, bAccept); +- (void)bBeforeRealize; +-#endif +-} +- +-#if !GTK_CHECK_VERSION(3,0,0) +-static void lcl_set_user_time( GtkWindow* i_pWindow, guint32 i_nTime ) +-{ +- if( bGetSetUserTimeFn ) +- { +- bGetSetUserTimeFn = false; +- p_gdk_x11_window_set_user_time = reinterpret_cast(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_x11_window_set_user_time" )); +- } +- bool bSet = false; +- if( p_gdk_x11_window_set_user_time ) +- { +- GdkWindow* pWin = widget_get_window(GTK_WIDGET(i_pWindow)); +- if( pWin ) // only if the window is realized. +- { +- p_gdk_x11_window_set_user_time( pWin, i_nTime ); +- bSet = true; +- } +- } +- if( !bSet ) +- { +- Display* pDisplay = GetGtkSalData()->GetGtkDisplay()->GetDisplay(); +- Atom nUserTime = XInternAtom( pDisplay, "_NET_WM_USER_TIME", True ); +- if( nUserTime ) +- { +- XChangeProperty( pDisplay, widget_get_xid(GTK_WIDGET(i_pWindow)), +- nUserTime, XA_CARDINAL, 32, +- PropModeReplace, reinterpret_cast(&i_nTime), 1 ); +- } +- } +-}; +-#endif +- +-GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow ) +-{ +- return static_cast(g_object_get_data( G_OBJECT( pWindow ), "SalFrame" )); +-} +- +-void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) +-{ +- if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style +- { +- nStyle |= SAL_FRAME_STYLE_MOVEABLE | SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_CLOSEABLE; +- nStyle &= ~SAL_FRAME_STYLE_FLOAT; +- } +- +- m_pParent = static_cast(pParent); +- m_pForeignParent = NULL; +- m_aForeignParentWindow = None; +- m_pForeignTopLevel = NULL; +- m_aForeignTopLevelWindow = None; +- m_nStyle = nStyle; +- +- GtkWindowType eWinType = ( (nStyle & SAL_FRAME_STYLE_FLOAT) && +- ! (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION| +- SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) +- ) +- ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL; +- +- if( nStyle & SAL_FRAME_STYLE_SYSTEMCHILD ) +- { +- m_pWindow = gtk_event_box_new(); +- if( m_pParent ) +- { +- // insert into container +- gtk_fixed_put( m_pParent->getFixedContainer(), +- m_pWindow, 0, 0 ); +- +- } +- } +- else +- { +- m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType, +- "visible", FALSE, NULL ); +- } +- g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this ); +- g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", (gpointer)LIBO_VERSION_DOTTED); +- +- // force wm class hint +- m_nExtStyle = ~0; +- if (m_pParent) +- m_sWMClass = m_pParent->m_sWMClass; +- SetExtendedFrameStyle( 0 ); +- +- if( m_pParent && m_pParent->m_pWindow && ! isChild() ) +- gtk_window_set_screen( GTK_WINDOW(m_pWindow), gtk_window_get_screen( GTK_WINDOW(m_pParent->m_pWindow) ) ); +- +- if (m_pParent) +- { +- if (!(m_pParent->m_nStyle & SAL_FRAME_STYLE_PLUG)) +- gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) ); +- m_pParent->m_aChildren.push_back( this ); +- } +- +- InitCommon(); +- +- // set window type +- bool bDecoHandling = +- ! isChild() && +- ( ! (nStyle & SAL_FRAME_STYLE_FLOAT) || +- (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) ); +- +- if( bDecoHandling ) +- { +- GdkWindowTypeHint eType = GDK_WINDOW_TYPE_HINT_NORMAL; +- if( (nStyle & SAL_FRAME_STYLE_DIALOG) && m_pParent != 0 ) +- eType = GDK_WINDOW_TYPE_HINT_DIALOG; +- if( (nStyle & SAL_FRAME_STYLE_INTRO) ) +- { +- gtk_window_set_role( GTK_WINDOW(m_pWindow), "splashscreen" ); +- eType = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN; +- } +- else if( (nStyle & SAL_FRAME_STYLE_TOOLWINDOW ) ) +- { +- eType = GDK_WINDOW_TYPE_HINT_UTILITY; +- gtk_window_set_skip_taskbar_hint( GTK_WINDOW(m_pWindow), true ); +- } +- else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) +- { +- eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; +- lcl_set_accept_focus( GTK_WINDOW(m_pWindow), false, true ); +- } +- else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) +- { +- eType = GDK_WINDOW_TYPE_HINT_UTILITY; +- } +-#if !GTK_CHECK_VERSION(3,0,0) +- if( (nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ) +- && getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) +- { +- eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; +- gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), true ); +- } +-#endif +- gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType ); +- gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC ); +- } +- else if( (nStyle & SAL_FRAME_STYLE_FLOAT) ) +- { +- gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_POPUP_MENU ); +- } +- +-#if !GTK_CHECK_VERSION(3,0,0) +- if( eWinType == GTK_WINDOW_TOPLEVEL ) +- { +-#ifdef ENABLE_GMENU_INTEGRATION +- // Enable DBus native menu if available. +- ensure_dbus_setup( this ); +-#endif +- +- guint32 nUserTime = 0; +- if( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) +- { +- nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); +- } +- lcl_set_user_time(GTK_WINDOW(m_pWindow), nUserTime); +- } +-#endif +- +- if( bDecoHandling ) +- { +- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) != 0 ); +- if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) ) +- lcl_set_accept_focus( GTK_WINDOW(m_pWindow), false, false ); +- } +-} +- +-GdkNativeWindow GtkSalFrame::findTopLevelSystemWindow( GdkNativeWindow aWindow ) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- ::Window aRoot, aParent; +- ::Window* pChildren; +- unsigned int nChildren; +- bool bBreak = false; +- do +- { +- pChildren = NULL; +- nChildren = 0; +- aParent = aRoot = None; +- XQueryTree( getDisplay()->GetDisplay(), aWindow, +- &aRoot, &aParent, &pChildren, &nChildren ); +- XFree( pChildren ); +- if( aParent != aRoot ) +- aWindow = aParent; +- int nCount = 0; +- Atom* pProps = XListProperties( getDisplay()->GetDisplay(), +- aWindow, +- &nCount ); +- for( int i = 0; i < nCount && ! bBreak; ++i ) +- bBreak = (pProps[i] == XA_WM_HINTS); +- if( pProps ) +- XFree( pProps ); +- } while( aParent != aRoot && ! bBreak ); +- +- return aWindow; +-#else +- (void)aWindow; +- //FIXME: no findToplevelSystemWindow +- return 0; +-#endif +-} +- +-void GtkSalFrame::Init( SystemParentData* pSysData ) +-{ +- m_pParent = NULL; +- m_aForeignParentWindow = (GdkNativeWindow)pSysData->aWindow; +- m_pForeignParent = NULL; +- m_aForeignTopLevelWindow = findTopLevelSystemWindow( (GdkNativeWindow)pSysData->aWindow ); +- m_pForeignTopLevel = gdk_window_foreign_new_for_display( getGdkDisplay(), m_aForeignTopLevelWindow ); +- gdk_window_set_events( m_pForeignTopLevel, GDK_STRUCTURE_MASK ); +- +- if( pSysData->nSize > sizeof(pSysData->nSize)+sizeof(pSysData->aWindow) && pSysData->bXEmbedSupport ) +- { +-#if GTK_CHECK_VERSION(3,0,0) +- m_pWindow = gtk_plug_new_for_display( getGdkDisplay(), pSysData->aWindow ); +-#else +- m_pWindow = gtk_plug_new( pSysData->aWindow ); +-#endif +- m_bWindowIsGtkPlug = true; +- widget_set_can_default( m_pWindow, true ); +- widget_set_can_focus( m_pWindow, true ); +- gtk_widget_set_sensitive( m_pWindow, true ); +- } +- else +- { +- m_pWindow = gtk_window_new( GTK_WINDOW_POPUP ); +- m_bWindowIsGtkPlug = false; +- } +- m_nStyle = SAL_FRAME_STYLE_PLUG; +- InitCommon(); +- +- m_pForeignParent = gdk_window_foreign_new_for_display( getGdkDisplay(), m_aForeignParentWindow ); +- gdk_window_set_events( m_pForeignParent, GDK_STRUCTURE_MASK ); +- +-#if !GTK_CHECK_VERSION(3,0,0) +- int x_ret, y_ret; +- unsigned int w, h, bw, d; +- ::Window aRoot; +- XGetGeometry( getDisplay()->GetDisplay(), pSysData->aWindow, +- &aRoot, &x_ret, &y_ret, &w, &h, &bw, &d ); +- maGeometry.nWidth = w; +- maGeometry.nHeight = h; +- window_resize(w, h); +- gtk_window_move( GTK_WINDOW(m_pWindow), 0, 0 ); +- if( ! m_bWindowIsGtkPlug ) +- { +- XReparentWindow( getDisplay()->GetDisplay(), +- widget_get_xid(m_pWindow), +- (::Window)pSysData->aWindow, +- 0, 0 ); +- } +-#else +- //FIXME: Handling embedded windows, is going to be fun ... +-#endif +-} +- +-void GtkSalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode ) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- XEvent aEvent; +- +- memset( &aEvent, 0, sizeof(aEvent) ); +- aEvent.xclient.window = m_aForeignParentWindow; +- aEvent.xclient.type = ClientMessage; +- aEvent.xclient.message_type = getDisplay()->getWMAdaptor()->getAtom( vcl_sal::WMAdaptor::XEMBED ); +- aEvent.xclient.format = 32; +- aEvent.xclient.data.l[0] = i_nTimeCode ? i_nTimeCode : CurrentTime; +- aEvent.xclient.data.l[1] = 3; // XEMBED_REQUEST_FOCUS +- aEvent.xclient.data.l[2] = 0; +- aEvent.xclient.data.l[3] = 0; +- aEvent.xclient.data.l[4] = 0; +- +- GetGenericData()->ErrorTrapPush(); +- XSendEvent( getDisplay()->GetDisplay(), +- m_aForeignParentWindow, +- False, NoEventMask, &aEvent ); +- GetGenericData()->ErrorTrapPop(); +-#else +- (void) this; // loplugin:staticmethods +- (void)i_nTimeCode; +- //FIXME: no askForXEmbedFocus for gtk3 yet +-#endif +-} +- +-void GtkSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle ) +-{ +- if( nStyle != m_nExtStyle && ! isChild() ) +- { +- m_nExtStyle = nStyle; +- updateWMClass(); +- } +-} +- +-SalGraphics* GtkSalFrame::AcquireGraphics() +-{ +- if( m_pWindow ) +- { +- for( int i = 0; i < nMaxGraphics; i++ ) +- { +- if( ! m_aGraphics[i].bInUse ) +- { +- m_aGraphics[i].bInUse = true; +- if( ! m_aGraphics[i].pGraphics ) +- { +-#if GTK_CHECK_VERSION(3,0,0) +- m_aGraphics[i].pGraphics = new GtkSalGraphics( this, m_pWindow ); +- if( !m_aFrame.get() ) +- { +- AllocateFrame(); +- TriggerPaintEvent(); +- } +- m_aGraphics[i].pGraphics->setDevice( m_aFrame ); +-#else // common case: +- m_aGraphics[i].pGraphics = new GtkSalGraphics( this, m_pWindow, m_nXScreen ); +-#endif +- } +- return m_aGraphics[i].pGraphics; +- } +- } +- } +- +- return NULL; +-} +- +-void GtkSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) +-{ +- for( int i = 0; i < nMaxGraphics; i++ ) +- { +- if( m_aGraphics[i].pGraphics == pGraphics ) +- { +- m_aGraphics[i].bInUse = false; +- break; +- } +- } +-} +- +-bool GtkSalFrame::PostEvent( void* pData ) +-{ +- getDisplay()->SendInternalEvent( this, pData ); +- return true; +-} +- +-void GtkSalFrame::SetTitle( const OUString& rTitle ) +-{ +- m_aTitle = rTitle; +- if( m_pWindow && ! isChild() ) +- gtk_window_set_title( GTK_WINDOW(m_pWindow), OUStringToOString( rTitle, RTL_TEXTENCODING_UTF8 ).getStr() ); +-} +- +-static inline sal_uInt8 * +-getRow( BitmapBuffer *pBuffer, sal_uLong nRow ) +-{ +- if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) +- return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize; +- else +- return pBuffer->mpBits + ( pBuffer->mnHeight - nRow - 1 ) * pBuffer->mnScanlineSize; +-} +- +-static GdkPixbuf * +-bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha ) +-{ +- g_return_val_if_fail( pSalBitmap != NULL, NULL ); +- g_return_val_if_fail( pSalAlpha != NULL, NULL ); +- +- BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( BITMAP_READ_ACCESS ); +- g_return_val_if_fail( pBitmap != NULL, NULL ); +- g_return_val_if_fail( pBitmap->mnBitCount == 24 || pBitmap->mnBitCount == 32, NULL ); +- +- BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( BITMAP_READ_ACCESS ); +- g_return_val_if_fail( pAlpha != NULL, NULL ); +- g_return_val_if_fail( pAlpha->mnBitCount == 8, NULL ); +- +- Size aSize = pSalBitmap->GetSize(); +- g_return_val_if_fail( pSalAlpha->GetSize() == aSize, NULL ); +- +- int nX, nY; +- guchar *pPixbufData = static_cast(g_malloc (4 * aSize.Width() * aSize.Height() )); +- guchar *pDestData = pPixbufData; +- +- for( nY = 0; nY < pBitmap->mnHeight; nY++ ) +- { +- sal_uInt8 *pData = getRow( pBitmap, nY ); +- sal_uInt8 *pAlphaData = getRow( pAlpha, nY ); +- +- for( nX = 0; nX < pBitmap->mnWidth; nX++ ) +- { +- BitmapColor aColor; +- if (pBitmap->mnFormat == BMP_FORMAT_24BIT_TC_BGR) +- { +- aColor = BitmapColor(pData[2], pData[1], pData[0]); +- pData += 3; +- } +- else if (pBitmap->mnFormat == BMP_FORMAT_24BIT_TC_RGB) +- { +- aColor = BitmapColor(pData[0], pData[1], pData[2]); +- pData += 3; +- } +- else +- { +- pBitmap->maColorMask.GetColorFor32Bit(aColor, pData); +- pData += 4; +- } +- *pDestData++ = aColor.GetRed(); +- *pDestData++ = aColor.GetGreen(); +- *pDestData++ = aColor.GetBlue(); +- *pDestData++ = 255 - *pAlphaData++; +- } +- } +- +- pSalBitmap->ReleaseBuffer( pBitmap, BITMAP_READ_ACCESS ); +- pSalAlpha->ReleaseBuffer( pAlpha, BITMAP_READ_ACCESS ); +- +- return gdk_pixbuf_new_from_data( pPixbufData, +- GDK_COLORSPACE_RGB, true, 8, +- aSize.Width(), aSize.Height(), +- aSize.Width() * 4, +- reinterpret_cast(g_free), +- NULL ); +-} +- +-void GtkSalFrame::SetIcon( sal_uInt16 nIcon ) +-{ +- if( (m_nStyle & (SAL_FRAME_STYLE_PLUG|SAL_FRAME_STYLE_SYSTEMCHILD|SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_INTRO|SAL_FRAME_STYLE_OWNERDRAWDECORATION)) +- || ! m_pWindow ) +- return; +- +- if( !ImplGetResMgr() ) +- return; +- +- GdkPixbuf *pBuf; +- GList *pIcons = NULL; +- +- sal_uInt16 nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START }; +- sal_uInt16 nIndex; +- +- for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(sal_uInt16); nIndex++ ) +- { +- // #i44723# workaround gcc temporary problem +- ResId aResId( nOffsets[nIndex] + nIcon, *ImplGetResMgr() ); +- BitmapEx aIcon( aResId ); +- +- // #i81083# convert to 24bit/8bit alpha bitmap +- Bitmap aBmp = aIcon.GetBitmap(); +- if( aBmp.GetBitCount() != 24 || ! aIcon.IsAlpha() ) +- { +- if( aBmp.GetBitCount() != 24 ) +- aBmp.Convert( BMP_CONVERSION_24BIT ); +- AlphaMask aMask; +- if( ! aIcon.IsAlpha() ) +- { +- switch( aIcon.GetTransparentType() ) +- { +- case TRANSPARENT_NONE: +- { +- sal_uInt8 nTrans = 0; +- aMask = AlphaMask( aBmp.GetSizePixel(), &nTrans ); +- } +- break; +- case TRANSPARENT_COLOR: +- aMask = AlphaMask( aBmp.CreateMask( aIcon.GetTransparentColor() ) ); +- break; +- case TRANSPARENT_BITMAP: +- aMask = AlphaMask( aIcon.GetMask() ); +- break; +- default: +- OSL_FAIL( "unhandled transparent type" ); +- break; +- } +- } +- else +- aMask = aIcon.GetAlpha(); +- aIcon = BitmapEx( aBmp, aMask ); +- } +- +- ImpBitmap *pIconImpBitmap = aIcon.ImplGetBitmapImpBitmap(); +- ImpBitmap *pIconImpMask = aIcon.ImplGetMaskImpBitmap(); +- +- if( pIconImpBitmap && pIconImpMask ) +- { +- SalBitmap *pIconBitmap = +- pIconImpBitmap->ImplGetSalBitmap(); +- SalBitmap *pIconMask = +- pIconImpMask->ImplGetSalBitmap(); +- +- if( ( pBuf = bitmapToPixbuf( pIconBitmap, pIconMask ) ) ) +- pIcons = g_list_prepend( pIcons, pBuf ); +- } +- } +- +- gtk_window_set_icon_list( GTK_WINDOW(m_pWindow), pIcons ); +- +- g_list_foreach( pIcons, reinterpret_cast(g_object_unref), NULL ); +- g_list_free( pIcons ); +-} +- +-void GtkSalFrame::SetMenu( SalMenu* pSalMenu ) +-{ +-// if(m_pSalMenu) +-// { +-// static_cast(m_pSalMenu)->DisconnectFrame(); +-// } +- m_pSalMenu = pSalMenu; +-} +- +-SalMenu* GtkSalFrame::GetMenu() +-{ +- return m_pSalMenu; +-} +- +-void GtkSalFrame::DrawMenuBar() +-{ +-} +- +-void GtkSalFrame::Center() +-{ +- long nX, nY; +- +- if( m_pParent ) +- { +- nX = ((long)m_pParent->maGeometry.nWidth - (long)maGeometry.nWidth)/2; +- nY = ((long)m_pParent->maGeometry.nHeight - (long)maGeometry.nHeight)/2; +- } +- else +- { +- GdkScreen *pScreen = NULL; +- gint px, py; +- GdkModifierType nMask; +- gdk_display_get_pointer( getGdkDisplay(), &pScreen, &px, &py, &nMask ); +- if( !pScreen ) +- pScreen = gtk_widget_get_screen( m_pWindow ); +- +- gint nMonitor; +- nMonitor = gdk_screen_get_monitor_at_point( pScreen, px, py ); +- +- GdkRectangle aMonitor; +- gdk_screen_get_monitor_geometry( pScreen, nMonitor, &aMonitor ); +- +- nX = aMonitor.x + (aMonitor.width - (long)maGeometry.nWidth)/2; +- nY = aMonitor.y + (aMonitor.height - (long)maGeometry.nHeight)/2; +- } +- SetPosSize( nX, nY, 0, 0, SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y ); +-} +- +-Size GtkSalFrame::calcDefaultSize() +-{ +- return bestmaxFrameSizeForScreenSize(getDisplay()->GetScreenSize(GetDisplayScreen())); +-} +- +-void GtkSalFrame::SetDefaultSize() +-{ +- Size aDefSize = calcDefaultSize(); +- +- SetPosSize( 0, 0, aDefSize.Width(), aDefSize.Height(), +- SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); +- +- if( (m_nStyle & SAL_FRAME_STYLE_DEFAULT) && m_pWindow ) +- gtk_window_maximize( GTK_WINDOW(m_pWindow) ); +-} +- +-static void initClientId() +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- static bool bOnce = false; +- if (!bOnce) +- { +- bOnce = true; +- const OString& rID = SessionManagerClient::getSessionID(); +- if (!rID.isEmpty()) +- gdk_set_sm_client_id(rID.getStr()); +- } +-#else +- // No session management support for gtk3+ - this is now legacy. +-#endif +-} +- +-void GtkSalFrame::Show( bool bVisible, bool bNoActivate ) +-{ +- if( m_pWindow ) +- { +-#if !GTK_CHECK_VERSION(3,0,0) +- if( m_pParent && (m_pParent->m_nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN) +- && getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) +- gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), bVisible ); +-#endif +- if( bVisible ) +- { +- initClientId(); +- getDisplay()->startupNotificationCompleted(); +- +- if( m_bDefaultPos ) +- Center(); +- if( m_bDefaultSize ) +- SetDefaultSize(); +- setMinMaxSize(); +- +-#if !GTK_CHECK_VERSION(3,0,0) +- // #i45160# switch to desktop where a dialog with parent will appear +- if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea && IS_WIDGET_MAPPED(m_pParent->m_pWindow) ) +- getDisplay()->getWMAdaptor()->switchToWorkArea( m_pParent->m_nWorkArea ); +-#endif +- +- if( isFloatGrabWindow() && +- m_pParent && +- m_nFloats == 0 && +- ! getDisplay()->GetCaptureFrame() ) +- { +- /* #i63086# +- * outsmart Metacity's "focus:mouse" mode +- * which insists on taking the focus from the document +- * to the new float. Grab focus to parent frame BEFORE +- * showing the float (cannot grab it to the float +- * before show). +- */ +- m_pParent->grabPointer( true, true ); +- } +- +-#if !GTK_CHECK_VERSION(3,0,0) +- guint32 nUserTime = 0; +- if( ! bNoActivate && (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) +- nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); +- +- //For these floating windows we don't want the main window to lose focus, and metacity has... +- // metacity-2.24.0/src/core/window.c +- +- // if ((focus_window != NULL) && XSERVER_TIME_IS_BEFORE (compare, focus_window->net_wm_user_time)) +- // "compare" window focus prevented by other activity +- +- // where "compare" is this window +- +- // which leads to... +- +- // /* This happens for error dialogs or alerts; these need to remain on +- // * top, but it would be confusing to have its ancestor remain +- // * focused. +- // */ +- // if (meta_window_is_ancestor_of_transient (focus_window, window)) +- // "The focus window %s is an ancestor of the newly mapped " +- // "window %s which isn't being focused. Unfocusing the " +- // "ancestor.\n", +- +- // i.e. having a time < that of the toplevel frame means that the toplevel frame gets unfocused. +- // awesome. +- if( nUserTime == 0 ) +- { +- nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); +- } +- lcl_set_user_time(GTK_WINDOW(m_pWindow), nUserTime ); +-#endif +- +- if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) ) +- m_bSetFocusOnMap = true; +- +- gtk_widget_show( m_pWindow ); +- +- if( isFloatGrabWindow() ) +- { +- m_nFloats++; +- if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 ) +- { +- grabPointer(true, true); +- GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this; +- pKeyboardFrame->grabKeyboard(true); +- } +- // #i44068# reset parent's IM context +- if( m_pParent ) +- m_pParent->EndExtTextInput(0); +- } +- if( m_bWindowIsGtkPlug ) +- askForXEmbedFocus( 0 ); +- } +- else +- { +- if( isFloatGrabWindow() ) +- { +- m_nFloats--; +- if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0) +- { +- GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this; +- pKeyboardFrame->grabKeyboard(false); +- grabPointer(false); +- } +- } +- gtk_widget_hide( m_pWindow ); +- if( m_pIMHandler ) +- m_pIMHandler->focusChanged( false ); +- // flush here; there may be a very seldom race between +- // the display connection used for clipboard and our connection +- Flush(); +- } +- CallCallback( SALEVENT_RESIZE, NULL ); +- TriggerPaintEvent(); +- } +-} +- +-void GtkSalFrame::setMinMaxSize() +-{ +- /* #i34504# metacity (and possibly others) do not treat +- * _NET_WM_STATE_FULLSCREEN and max_width/height independently; +- * whether they should is undefined. So don't set the max size hint +- * for a full screen window. +- */ +- if( m_pWindow && ! isChild() ) +- { +- GdkGeometry aGeo; +- int aHints = 0; +- if( m_nStyle & SAL_FRAME_STYLE_SIZEABLE ) +- { +- if( m_aMinSize.Width() && m_aMinSize.Height() && ! m_bFullscreen ) +- { +- aGeo.min_width = m_aMinSize.Width(); +- aGeo.min_height = m_aMinSize.Height(); +- aHints |= GDK_HINT_MIN_SIZE; +- } +- if( m_aMaxSize.Width() && m_aMaxSize.Height() && ! m_bFullscreen ) +- { +- aGeo.max_width = m_aMaxSize.Width(); +- aGeo.max_height = m_aMaxSize.Height(); +- aHints |= GDK_HINT_MAX_SIZE; +- } +- } +- else +- { +- if( ! m_bFullscreen ) +- { +- aGeo.min_width = maGeometry.nWidth; +- aGeo.min_height = maGeometry.nHeight; +- aHints |= GDK_HINT_MIN_SIZE; +- +- aGeo.max_width = maGeometry.nWidth; +- aGeo.max_height = maGeometry.nHeight; +- aHints |= GDK_HINT_MAX_SIZE; +- } +- } +- if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() ) +- { +- aGeo.max_width = m_aMaxSize.Width(); +- aGeo.max_height = m_aMaxSize.Height(); +- aHints |= GDK_HINT_MAX_SIZE; +- } +- if( aHints ) +- { +- gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow), +- NULL, +- &aGeo, +- GdkWindowHints( aHints ) ); +- } +- } +-} +- +-void GtkSalFrame::SetMaxClientSize( long nWidth, long nHeight ) +-{ +- if( ! isChild() ) +- { +- m_aMaxSize = Size( nWidth, nHeight ); +- // Show does a setMinMaxSize +- if( IS_WIDGET_MAPPED( m_pWindow ) ) +- setMinMaxSize(); +- } +-} +-void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight ) +-{ +- if( ! isChild() ) +- { +- m_aMinSize = Size( nWidth, nHeight ); +- if( m_pWindow ) +- { +- widget_set_size_request(nWidth, nHeight ); +- // Show does a setMinMaxSize +- if( IS_WIDGET_MAPPED( m_pWindow ) ) +- setMinMaxSize(); +- } +- } +-} +- +-// FIXME: we should really be an SvpSalFrame sub-class, and +-// share their AllocateFrame ! +-void GtkSalFrame::AllocateFrame() +-{ +-#if GTK_CHECK_VERSION(3,0,0) +- basegfx::B2IVector aFrameSize( maGeometry.nWidth, maGeometry.nHeight ); +- if( ! m_aFrame.get() || m_aFrame->getSize() != aFrameSize ) +- { +- if( aFrameSize.getX() == 0 ) +- aFrameSize.setX( 1 ); +- if( aFrameSize.getY() == 0 ) +- aFrameSize.setY( 1 ); +- m_aFrame = basebmp::createBitmapDevice(aFrameSize, true, +- basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX); +- m_aFrame->setDamageTracker( +- basebmp::IBitmapDeviceDamageTrackerSharedPtr(new DamageTracker(*this)) ); +- SAL_INFO("vcl.gtk3", "allocated m_aFrame size of " << maGeometry.nWidth << " x " << maGeometry.nHeight); +- +-#if OSL_DEBUG_LEVEL > 0 // set background to orange +- m_aFrame->clear( basebmp::Color( 255, 127, 0 ) ); +-#endif +- +- // update device in existing graphics +- for( unsigned int i = 0; i < SAL_N_ELEMENTS( m_aGraphics ); ++i ) +- { +- if( !m_aGraphics[i].pGraphics ) +- continue; +- m_aGraphics[i].pGraphics->setDevice( m_aFrame ); +- } +- } +-#endif +-} +- +-void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) +-{ +- if( !m_pWindow || isChild( true, false ) ) +- return; +- +- bool bSized = false, bMoved = false; +- +- if( (nFlags & ( SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT )) && +- (nWidth > 0 && nHeight > 0 ) // sometimes stupid things happen +- ) +- { +- m_bDefaultSize = false; +- +- if( (unsigned long)nWidth != maGeometry.nWidth || (unsigned long)nHeight != maGeometry.nHeight ) +- bSized = true; +- maGeometry.nWidth = nWidth; +- maGeometry.nHeight = nHeight; +- +- if( isChild( false, true ) ) +- widget_set_size_request(nWidth, nHeight); +- else if( ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) ) +- window_resize(nWidth, nHeight); +- setMinMaxSize(); +- } +- else if( m_bDefaultSize ) +- SetDefaultSize(); +- +- m_bDefaultSize = false; +- +- if( nFlags & ( SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y ) ) +- { +- if( m_pParent ) +- { +- if( AllSettings::GetLayoutRTL() ) +- nX = m_pParent->maGeometry.nWidth-maGeometry.nWidth-1-nX; +- nX += m_pParent->maGeometry.nX; +- nY += m_pParent->maGeometry.nY; +- } +- +- if( nX != maGeometry.nX || nY != maGeometry.nY ) +- bMoved = true; +- maGeometry.nX = nX; +- maGeometry.nY = nY; +- +- m_bDefaultPos = false; +- +- moveWindow( maGeometry.nX, maGeometry.nY ); +- +- updateScreenNumber(); +- } +- else if( m_bDefaultPos ) +- Center(); +- +- m_bDefaultPos = false; +- +- if( bSized ) +- AllocateFrame(); +- +- if( bSized && ! bMoved ) +- CallCallback( SALEVENT_RESIZE, NULL ); +- else if( bMoved && ! bSized ) +- CallCallback( SALEVENT_MOVE, NULL ); +- else if( bMoved && bSized ) +- CallCallback( SALEVENT_MOVERESIZE, NULL ); +- +- if (bSized) +- TriggerPaintEvent(); +-} +- +-void GtkSalFrame::GetClientSize( long& rWidth, long& rHeight ) +-{ +- if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) ) +- { +- rWidth = maGeometry.nWidth; +- rHeight = maGeometry.nHeight; +- } +- else +- rWidth = rHeight = 0; +-} +- +-void GtkSalFrame::GetWorkArea( Rectangle& rRect ) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- rRect = GetGtkSalData()->GetGtkDisplay()->getWMAdaptor()->getWorkArea( 0 ); +-#else +- GdkScreen *pScreen = gtk_window_get_screen(GTK_WINDOW(m_pWindow)); +- Rectangle aRetRect; +- int max = gdk_screen_get_n_monitors (pScreen); +- for (int i = 0; i < max; ++i) +- { +- GdkRectangle aRect; +- gdk_screen_get_monitor_workarea(pScreen, i, &aRect); +- Rectangle aMonitorRect(aRect.x, aRect.y, aRect.x+aRect.width, aRect.y+aRect.height); +- aRetRect.Union(aMonitorRect); +- } +- rRect = aRetRect; +-#endif +-} +- +-SalFrame* GtkSalFrame::GetParent() const +-{ +- return m_pParent; +-} +- +-void GtkSalFrame::SetWindowState( const SalFrameState* pState ) +-{ +- if( ! m_pWindow || ! pState || isChild( true, false ) ) +- return; +- +- const sal_uLong nMaxGeometryMask = +- WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | +- WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT | +- WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y | +- WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; +- +- if( (pState->mnMask & WINDOWSTATE_MASK_STATE) && +- ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) && +- (pState->mnState & WINDOWSTATE_STATE_MAXIMIZED) && +- (pState->mnMask & nMaxGeometryMask) == nMaxGeometryMask ) +- { +- resizeWindow( pState->mnWidth, pState->mnHeight ); +- moveWindow( pState->mnX, pState->mnY ); +- m_bDefaultPos = m_bDefaultSize = false; +- +- maGeometry.nX = pState->mnMaximizedX; +- maGeometry.nY = pState->mnMaximizedY; +- maGeometry.nWidth = pState->mnMaximizedWidth; +- maGeometry.nHeight = pState->mnMaximizedHeight; +- updateScreenNumber(); +- +- m_nState = GdkWindowState( m_nState | GDK_WINDOW_STATE_MAXIMIZED ); +- m_aRestorePosSize = Rectangle( Point( pState->mnX, pState->mnY ), +- Size( pState->mnWidth, pState->mnHeight ) ); +- CallCallback( SALEVENT_RESIZE, NULL ); +- } +- else if( pState->mnMask & (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | +- WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ) ) +- { +- sal_uInt16 nPosSizeFlags = 0; +- long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0); +- long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0); +- if( pState->mnMask & WINDOWSTATE_MASK_X ) +- nPosSizeFlags |= SAL_FRAME_POSSIZE_X; +- else +- nX = maGeometry.nX - (m_pParent ? m_pParent->maGeometry.nX : 0); +- if( pState->mnMask & WINDOWSTATE_MASK_Y ) +- nPosSizeFlags |= SAL_FRAME_POSSIZE_Y; +- else +- nY = maGeometry.nY - (m_pParent ? m_pParent->maGeometry.nY : 0); +- if( pState->mnMask & WINDOWSTATE_MASK_WIDTH ) +- nPosSizeFlags |= SAL_FRAME_POSSIZE_WIDTH; +- if( pState->mnMask & WINDOWSTATE_MASK_HEIGHT ) +- nPosSizeFlags |= SAL_FRAME_POSSIZE_HEIGHT; +- SetPosSize( nX, nY, pState->mnWidth, pState->mnHeight, nPosSizeFlags ); +- } +- if( pState->mnMask & WINDOWSTATE_MASK_STATE && ! isChild() ) +- { +- if( pState->mnState & WINDOWSTATE_STATE_MAXIMIZED ) +- gtk_window_maximize( GTK_WINDOW(m_pWindow) ); +- else +- gtk_window_unmaximize( GTK_WINDOW(m_pWindow) ); +- /* #i42379# there is no rollup state in GDK; and rolled up windows are +- * (probably depending on the WM) reported as iconified. If we iconify a +- * window here that was e.g. a dialog, then it will be unmapped but still +- * not be displayed in the task list, so it's an iconified window that +- * the user cannot get out of this state. So do not set the iconified state +- * on windows with a parent (that is transient frames) since these tend +- * to not be represented in an icon task list. +- */ +- if( (pState->mnState & WINDOWSTATE_STATE_MINIMIZED) +- && ! m_pParent ) +- gtk_window_iconify( GTK_WINDOW(m_pWindow) ); +- else +- gtk_window_deiconify( GTK_WINDOW(m_pWindow) ); +- } +- TriggerPaintEvent(); +-} +- +-bool GtkSalFrame::GetWindowState( SalFrameState* pState ) +-{ +- pState->mnState = WINDOWSTATE_STATE_NORMAL; +- pState->mnMask = WINDOWSTATE_MASK_STATE; +- // rollup ? gtk 2.2 does not seem to support the shaded state +- if( (m_nState & GDK_WINDOW_STATE_ICONIFIED) ) +- pState->mnState |= WINDOWSTATE_STATE_MINIMIZED; +- if( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) +- { +- pState->mnState |= WINDOWSTATE_STATE_MAXIMIZED; +- pState->mnX = m_aRestorePosSize.Left(); +- pState->mnY = m_aRestorePosSize.Top(); +- pState->mnWidth = m_aRestorePosSize.GetWidth(); +- pState->mnHeight = m_aRestorePosSize.GetHeight(); +- pState->mnMaximizedX = maGeometry.nX; +- pState->mnMaximizedY = maGeometry.nY; +- pState->mnMaximizedWidth = maGeometry.nWidth; +- pState->mnMaximizedHeight = maGeometry.nHeight; +- pState->mnMask |= WINDOWSTATE_MASK_MAXIMIZED_X | +- WINDOWSTATE_MASK_MAXIMIZED_Y | +- WINDOWSTATE_MASK_MAXIMIZED_WIDTH | +- WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; +- } +- else +- { +- pState->mnX = maGeometry.nX; +- pState->mnY = maGeometry.nY; +- pState->mnWidth = maGeometry.nWidth; +- pState->mnHeight = maGeometry.nHeight; +- } +- pState->mnMask |= WINDOWSTATE_MASK_X | +- WINDOWSTATE_MASK_Y | +- WINDOWSTATE_MASK_WIDTH | +- WINDOWSTATE_MASK_HEIGHT; +- +- return true; +-} +- +-typedef enum { +- SET_RETAIN_SIZE, +- SET_FULLSCREEN, +- SET_UN_FULLSCREEN +-} SetType; +- +-void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSize ) +-{ +- if( !m_pWindow ) +- return; +- +- if (maGeometry.nDisplayScreenNumber == nNewScreen && eType == SET_RETAIN_SIZE) +- return; +- +- GdkScreen *pScreen = NULL; +- GdkRectangle aNewMonitor; +- +- bool bSpanAllScreens = nNewScreen == (unsigned int)-1; +- m_bSpanMonitorsWhenFullscreen = bSpanAllScreens && getDisplay()->getSystem()->GetDisplayScreenCount() > 1; +- +- if (m_bSpanMonitorsWhenFullscreen) //span all screens +- { +- pScreen = gtk_widget_get_screen( m_pWindow ); +- aNewMonitor.x = 0; +- aNewMonitor.y = 0; +- aNewMonitor.width = gdk_screen_get_width(pScreen); +- aNewMonitor.height = gdk_screen_get_height(pScreen); +- } +- else +- { +- gint nMonitor; +- bool bSameMonitor = false; +- +- if (!bSpanAllScreens) +- { +- pScreen = getDisplay()->getSystem()->getScreenMonitorFromIdx( nNewScreen, nMonitor ); +- if (!pScreen) +- { +- g_warning ("Attempt to move GtkSalFrame to invalid screen %d => " +- "fallback to current\n", nNewScreen); +- } +- } +- +- if (!pScreen) +- { +- pScreen = gtk_widget_get_screen( m_pWindow ); +- bSameMonitor = true; +- } +- +- // Heavy lifting, need to move screen ... +- if( pScreen != gtk_widget_get_screen( m_pWindow )) +- gtk_window_set_screen( GTK_WINDOW( m_pWindow ), pScreen ); +- +- gint nOldMonitor = gdk_screen_get_monitor_at_window( +- pScreen, widget_get_window( m_pWindow ) ); +- if (bSameMonitor) +- nMonitor = nOldMonitor; +- +- #if OSL_DEBUG_LEVEL > 1 +- if( nMonitor == nOldMonitor ) +- g_warning( "An apparently pointless SetScreen - should we elide it ?" ); +- #endif +- +- GdkRectangle aOldMonitor; +- gdk_screen_get_monitor_geometry( pScreen, nOldMonitor, &aOldMonitor ); +- gdk_screen_get_monitor_geometry( pScreen, nMonitor, &aNewMonitor ); +- +- maGeometry.nX = aNewMonitor.x + maGeometry.nX - aOldMonitor.x; +- maGeometry.nY = aNewMonitor.y + maGeometry.nY - aOldMonitor.y; +- } +- +- bool bResize = false; +- bool bVisible = IS_WIDGET_MAPPED( m_pWindow ); +- if( bVisible ) +- Show( false ); +- +- if( eType == SET_FULLSCREEN ) +- { +- maGeometry.nX = aNewMonitor.x; +- maGeometry.nY = aNewMonitor.y; +- maGeometry.nWidth = aNewMonitor.width; +- maGeometry.nHeight = aNewMonitor.height; +- m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; +- bResize = true; +- +- // #i110881# for the benefit of compiz set a max size here +- // else setting to fullscreen fails for unknown reasons +- m_aMaxSize.Width() = aNewMonitor.width; +- m_aMaxSize.Height() = aNewMonitor.height; +- } +- +- if( pSize && eType == SET_UN_FULLSCREEN ) +- { +- maGeometry.nX = pSize->Left(); +- maGeometry.nY = pSize->Top(); +- maGeometry.nWidth = pSize->GetWidth(); +- maGeometry.nHeight = pSize->GetHeight(); +- m_nStyle &= ~SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; +- bResize = true; +- } +- +- if (bResize) +- { +- // temporarily re-sizeable +- if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) +- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); +- window_resize(maGeometry.nWidth, maGeometry.nHeight); +- //I wonder if we should instead leave maGeometry alone and rely on +- //configure-event to trigger signalConfigure and set it there +- AllocateFrame(); +- TriggerPaintEvent(); +- } +- +- gtk_window_move( GTK_WINDOW( m_pWindow ), maGeometry.nX, maGeometry.nY ); +- +-#if !GTK_CHECK_VERSION(3,0,0) +- // _NET_WM_STATE_FULLSCREEN (Metacity <-> KWin) +- if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) +-#endif +- { +-#if GTK_CHECK_VERSION(3,8,0) +- gdk_window_set_fullscreen_mode( widget_get_window(m_pWindow), m_bSpanMonitorsWhenFullscreen +- ? GDK_FULLSCREEN_ON_ALL_MONITORS : GDK_FULLSCREEN_ON_CURRENT_MONITOR ); +-#endif +- if( eType == SET_FULLSCREEN ) +- gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) ); +- else if( eType == SET_UN_FULLSCREEN ) +- gtk_window_unfullscreen( GTK_WINDOW( m_pWindow ) ); +- } +- +- if( eType == SET_UN_FULLSCREEN && +- !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) +- gtk_window_set_resizable( GTK_WINDOW( m_pWindow ), FALSE ); +- +- // FIXME: we should really let gtk+ handle our widget hierarchy ... +- if( m_pParent && gtk_widget_get_screen( m_pParent->m_pWindow ) != pScreen ) +- SetParent( NULL ); +- std::list< GtkSalFrame* > aChildren = m_aChildren; +- for( std::list< GtkSalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) +- (*it)->SetScreen( nNewScreen, SET_RETAIN_SIZE ); +- +- m_bDefaultPos = m_bDefaultSize = false; +- updateScreenNumber(); +- CallCallback( SALEVENT_MOVERESIZE, NULL ); +- +- if( bVisible ) +- Show( true ); +-} +- +-void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen ) +-{ +- SetScreen( nNewScreen, SET_RETAIN_SIZE ); +-} +- +-void GtkSalFrame::updateWMClass() +-{ +- OString aResClass = OUStringToOString(m_sWMClass, RTL_TEXTENCODING_ASCII_US); +- const char *pResClass = !aResClass.isEmpty() ? aResClass.getStr() : +- SalGenericSystem::getFrameClassName(); +- Display *display; +- +- if (!getDisplay()->IsX11Display()) +- return; +- +-#if GTK_CHECK_VERSION(3,0,0) +- display = GDK_DISPLAY_XDISPLAY(getGdkDisplay()); +-#else +- display = getDisplay()->GetDisplay(); +-#endif +- +- if( IS_WIDGET_REALIZED( m_pWindow ) ) +- { +- XClassHint* pClass = XAllocClassHint(); +- OString aResName = SalGenericSystem::getFrameResName(); +- pClass->res_name = const_cast(aResName.getStr()); +- pClass->res_class = const_cast(pResClass); +- XSetClassHint( display, +- widget_get_xid(m_pWindow), +- pClass ); +- XFree( pClass ); +- } +-} +- +-void GtkSalFrame::SetApplicationID( const OUString &rWMClass ) +-{ +- if( rWMClass != m_sWMClass && ! isChild() ) +- { +- m_sWMClass = rWMClass; +- updateWMClass(); +- +- for( std::list< GtkSalFrame* >::iterator it = m_aChildren.begin(); it != m_aChildren.end(); ++it ) +- (*it)->SetApplicationID(rWMClass); +- } +-} +- +-void GtkSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen ) +-{ +- m_bFullscreen = bFullScreen; +- +- if( !m_pWindow || isChild() ) +- return; +- +- if( bFullScreen ) +- { +- m_aRestorePosSize = Rectangle( Point( maGeometry.nX, maGeometry.nY ), +- Size( maGeometry.nWidth, maGeometry.nHeight ) ); +- SetScreen( nScreen, SET_FULLSCREEN ); +- } +- else +- { +- SetScreen( nScreen, SET_UN_FULLSCREEN, +- !m_aRestorePosSize.IsEmpty() ? &m_aRestorePosSize : NULL ); +- m_aRestorePosSize = Rectangle(); +- } +-} +- +-/* definitions from xautolock.c (pl15) */ +-#define XAUTOLOCK_DISABLE 1 +-#define XAUTOLOCK_ENABLE 2 +- +-void GtkSalFrame::setAutoLock( bool bLock ) +-{ +- if( isChild() || !getDisplay()->IsX11Display() ) +- return; +- +- GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(m_pWindow) ); +- GdkDisplay *pDisplay = gdk_screen_get_display( pScreen ); +- GdkWindow *pRootWin = gdk_screen_get_root_window( pScreen ); +- +- Atom nAtom = XInternAtom( GDK_DISPLAY_XDISPLAY( pDisplay ), +- "XAUTOLOCK_MESSAGE", False ); +- +- int nMessage = bLock ? XAUTOLOCK_ENABLE : XAUTOLOCK_DISABLE; +- +- XChangeProperty( GDK_DISPLAY_XDISPLAY( pDisplay ), +- GDK_WINDOW_XID( pRootWin ), +- nAtom, XA_INTEGER, +- 8, PropModeReplace, +- reinterpret_cast(&nMessage), +- sizeof( nMessage ) ); +-} +- +-#ifdef ENABLE_DBUS +-/** cookie is returned as an unsigned integer */ +-static guint +-dbus_inhibit_gsm (const gchar *appname, +- const gchar *reason, +- guint xid) +-{ +- gboolean res; +- guint cookie; +- GError *error = NULL; +- DBusGProxy *proxy = NULL; +- +- /* get the DBUS session connection */ +- DBusGConnection *session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); +- if (error != NULL) { +- g_debug ("DBUS cannot connect : %s", error->message); +- g_error_free (error); +- return -1; +- } +- +- /* get the proxy with gnome-session-manager */ +- proxy = dbus_g_proxy_new_for_name (session_connection, +- GSM_DBUS_SERVICE, +- GSM_DBUS_PATH, +- GSM_DBUS_INTERFACE); +- if (proxy == NULL) { +- g_debug ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); +- return -1; +- } +- +- res = dbus_g_proxy_call (proxy, +- "Inhibit", &error, +- G_TYPE_STRING, appname, +- G_TYPE_UINT, xid, +- G_TYPE_STRING, reason, +- G_TYPE_UINT, 8, //Inhibit the session being marked as idle +- G_TYPE_INVALID, +- G_TYPE_UINT, &cookie, +- G_TYPE_INVALID); +- +- /* check the return value */ +- if (! res) { +- cookie = -1; +- g_debug ("Inhibit method failed"); +- } +- +- /* check the error value */ +- if (error != NULL) { +- g_debug ("Inhibit problem : %s", error->message); +- g_error_free (error); +- cookie = -1; +- } +- +- g_object_unref (G_OBJECT (proxy)); +- return cookie; +-} +- +-static void +-dbus_uninhibit_gsm (guint cookie) +-{ +- gboolean res; +- GError *error = NULL; +- DBusGProxy *proxy = NULL; +- DBusGConnection *session_connection = NULL; +- +- if (cookie == guint(-1)) { +- g_debug ("Invalid cookie"); +- return; +- } +- +- /* get the DBUS session connection */ +- session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); +- if (error) { +- g_debug ("DBUS cannot connect : %s", error->message); +- g_error_free (error); +- return; +- } +- +- /* get the proxy with gnome-session-manager */ +- proxy = dbus_g_proxy_new_for_name (session_connection, +- GSM_DBUS_SERVICE, +- GSM_DBUS_PATH, +- GSM_DBUS_INTERFACE); +- if (proxy == NULL) { +- g_debug ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); +- return; +- } +- +- res = dbus_g_proxy_call (proxy, +- "Uninhibit", +- &error, +- G_TYPE_UINT, cookie, +- G_TYPE_INVALID, +- G_TYPE_INVALID); +- +- /* check the return value */ +- if (! res) { +- g_debug ("Uninhibit method failed"); +- } +- +- /* check the error value */ +- if (error != NULL) { +- g_debug ("Uninhibit problem : %s", error->message); +- g_error_free (error); +- cookie = -1; +- } +- g_object_unref (G_OBJECT (proxy)); +-} +-#endif +- +-void GtkSalFrame::StartPresentation( bool bStart ) +-{ +- setAutoLock( !bStart ); +- +- if( !getDisplay()->IsX11Display() ) +- return; +- +-#if !GTK_CHECK_VERSION(3,0,0) +- Display *pDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() ); +- +- int nTimeout, nInterval, bPreferBlanking, bAllowExposures; +- XGetScreenSaver( pDisplay, &nTimeout, &nInterval, +- &bPreferBlanking, &bAllowExposures ); +-#endif +- if( bStart ) +- { +-#if !GTK_CHECK_VERSION(3,0,0) +- if ( nTimeout ) +- { +- m_nSavedScreenSaverTimeout = nTimeout; +- XResetScreenSaver( pDisplay ); +- XSetScreenSaver( pDisplay, 0, nInterval, +- bPreferBlanking, bAllowExposures ); +- } +-#endif +-#ifdef ENABLE_DBUS +- m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation", +- widget_get_xid(m_pWindow)); +-#endif +- } +- else +- { +-#if !GTK_CHECK_VERSION(3,0,0) +- if( m_nSavedScreenSaverTimeout ) +- XSetScreenSaver( pDisplay, m_nSavedScreenSaverTimeout, +- nInterval, bPreferBlanking, +- bAllowExposures ); +-#endif +- m_nSavedScreenSaverTimeout = 0; +-#ifdef ENABLE_DBUS +- dbus_uninhibit_gsm(m_nGSMCookie); +-#endif +- } +-} +- +-void GtkSalFrame::SetAlwaysOnTop( bool bOnTop ) +-{ +- if( m_pWindow ) +- gtk_window_set_keep_above( GTK_WINDOW( m_pWindow ), bOnTop ); +-} +- +-void GtkSalFrame::ToTop( sal_uInt16 nFlags ) +-{ +- if( m_pWindow ) +- { +- if( isChild( false, true ) ) +- gtk_widget_grab_focus( m_pWindow ); +- else if( IS_WIDGET_MAPPED( m_pWindow ) ) +- { +- if( ! (nFlags & SAL_FRAME_TOTOP_GRABFOCUS_ONLY) ) +- gtk_window_present( GTK_WINDOW(m_pWindow) ); +- else +- { +-#if !GTK_CHECK_VERSION(3,0,0) +- guint32 nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); +-#else +- guint32 nUserTime = GDK_CURRENT_TIME; +-#endif +- gdk_window_focus( widget_get_window(m_pWindow), nUserTime ); +- } +-#if !GTK_CHECK_VERSION(3,0,0) +- /* need to do an XSetInputFocus here because +- * gdk_window_focus will ask a EWMH compliant WM to put the focus +- * to our window - which it of course won't since our input hint +- * is set to false. +- */ +- if( (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) ) +- { +- // sad but true: this can cause an XError, we need to catch that +- // to do this we need to synchronize with the XServer +- GetGenericData()->ErrorTrapPush(); +- XSetInputFocus( getDisplay()->GetDisplay(), widget_get_xid(m_pWindow), RevertToParent, CurrentTime ); +- // fdo#46687 - an XSync should not be necessary - but for some reason it is. +- XSync( getDisplay()->GetDisplay(), False ); +- GetGenericData()->ErrorTrapPop(); +- } +-#endif +- } +- else +- { +- if( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN ) +- gtk_window_present( GTK_WINDOW(m_pWindow) ); +- } +- } +-} +- +-void GtkSalFrame::SetPointer( PointerStyle ePointerStyle ) +-{ +- if( m_pWindow && ePointerStyle != m_ePointerStyle ) +- { +- m_ePointerStyle = ePointerStyle; +- GdkCursor *pCursor = getDisplay()->getCursor( ePointerStyle ); +- gdk_window_set_cursor( widget_get_window(m_pWindow), pCursor ); +- m_pCurrentCursor = pCursor; +- +- // #i80791# use grabPointer the same way as CaptureMouse, respective float grab +- if( getDisplay()->MouseCaptured( this ) ) +- grabPointer( true, false ); +- else if( m_nFloats > 0 ) +- grabPointer( true, true ); +- } +-} +- +-void GtkSalFrame::grabPointer( bool bGrab, bool bOwnerEvents ) +-{ +- static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" ); +- if (pEnv && *pEnv) +- return; +- +- if (!m_pWindow) +- return; +- +- const int nMask = (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); +- +-#if GTK_CHECK_VERSION(3,0,0) +- GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay()); +- GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager); +- if (bGrab) +- gdk_device_grab(pPointer, widget_get_window(getMouseEventWidget()), GDK_OWNERSHIP_NONE, bOwnerEvents, (GdkEventMask) nMask, m_pCurrentCursor, GDK_CURRENT_TIME); +- else +- gdk_device_ungrab(pPointer, GDK_CURRENT_TIME); +-#else +- if( bGrab ) +- { +- bool bUseGdkGrab = true; +- const std::list< SalFrame* >& rFrames = getDisplay()->getFrames(); +- for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it ) +- { +- const GtkSalFrame* pFrame = static_cast< const GtkSalFrame* >(*it); +- if( pFrame->m_bWindowIsGtkPlug ) +- { +- bUseGdkGrab = false; +- break; +- } +- } +- if( bUseGdkGrab ) +- { +- gdk_pointer_grab( widget_get_window( m_pWindow ), bOwnerEvents, +- (GdkEventMask) nMask, NULL, m_pCurrentCursor, +- GDK_CURRENT_TIME ); +- } +- else +- { +- // FIXME: for some unknown reason gdk_pointer_grab does not +- // really produce owner events for GtkPlug windows +- // the cause is yet unknown +- +- // this is of course a bad hack, especially as we cannot +- // set the right cursor this way +- XGrabPointer( getDisplay()->GetDisplay(), +- widget_get_xid( m_pWindow ), +- bOwnerEvents, +- PointerMotionMask | ButtonPressMask | ButtonReleaseMask, +- GrabModeAsync, +- GrabModeAsync, +- None, +- None, +- CurrentTime +- ); +- } +- } +- else +- { +- // Two GdkDisplays may be open +- gdk_display_pointer_ungrab( getGdkDisplay(), GDK_CURRENT_TIME); +- } +-#endif +-} +- +-void GtkSalFrame::grabKeyboard( bool bGrab ) +-{ +- if (!m_pWindow) +- return; +- +-#if GTK_CHECK_VERSION(3,0,0) +- GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay()); +- GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager); +- GdkDevice* pKeyboard = gdk_device_get_associated_device(pPointer); +- if (bGrab) +- { +- gdk_device_grab(pKeyboard, widget_get_window(m_pWindow), GDK_OWNERSHIP_NONE, +- true, (GdkEventMask)(GDK_KEY_PRESS | GDK_KEY_RELEASE), NULL, GDK_CURRENT_TIME); +- } +- else +- { +- gdk_device_ungrab(pKeyboard, GDK_CURRENT_TIME); +- } +-#else +- if( bGrab ) +- { +- gdk_keyboard_grab(widget_get_window(m_pWindow), true, +- GDK_CURRENT_TIME); +- } +- else +- { +- gdk_keyboard_ungrab(GDK_CURRENT_TIME); +- } +-#endif +-} +- +-void GtkSalFrame::CaptureMouse( bool bCapture ) +-{ +- getDisplay()->CaptureMouse( bCapture ? this : NULL ); +-} +- +-void GtkSalFrame::SetPointerPos( long nX, long nY ) +-{ +- GtkSalFrame* pFrame = this; +- while( pFrame && pFrame->isChild( false, true ) ) +- pFrame = pFrame->m_pParent; +- if( ! pFrame ) +- return; +- +- GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(pFrame->m_pWindow) ); +- GdkDisplay *pDisplay = gdk_screen_get_display( pScreen ); +- +- /* when the application tries to center the mouse in the dialog the +- * window isn't mapped already. So use coordinates relative to the root window. +- */ +- unsigned int nWindowLeft = maGeometry.nX + nX; +- unsigned int nWindowTop = maGeometry.nY + nY; +- +- XWarpPointer( GDK_DISPLAY_XDISPLAY (pDisplay), None, +- GDK_WINDOW_XID (gdk_screen_get_root_window( pScreen ) ), +- 0, 0, 0, 0, nWindowLeft, nWindowTop); +- // #i38648# ask for the next motion hint +- gint x, y; +- GdkModifierType mask; +- gdk_window_get_pointer( widget_get_window(pFrame->m_pWindow) , &x, &y, &mask ); +-} +- +-void GtkSalFrame::Flush() +-{ +-#if GTK_CHECK_VERSION(3,0,0) +- gdk_display_flush( getGdkDisplay() ); +-#else +- XFlush (GDK_DISPLAY_XDISPLAY (getGdkDisplay())); +-#endif +-} +- +-void GtkSalFrame::Sync() +-{ +- gdk_display_sync( getGdkDisplay() ); +-} +- +-#ifndef GDK_Open +-#define GDK_Open 0x1008ff6b +-#endif +-#ifndef GDK_Paste +-#define GDK_Paste 0x1008ff6d +-#endif +-#ifndef GDK_Copy +-#define GDK_Copy 0x1008ff57 +-#endif +-#ifndef GDK_Cut +-#define GDK_Cut 0x1008ff58 +-#endif +- +-void GtkSalFrame::KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, +- guint* pGdkKeyCode, GdkModifierType *pGdkModifiers) +-{ +- if ( pGdkKeyCode == NULL || pGdkModifiers == NULL ) +- return; +- +- // Get GDK key modifiers +- GdkModifierType nModifiers = (GdkModifierType) 0; +- +- if ( rKeyCode.IsShift() ) +- nModifiers = (GdkModifierType) ( nModifiers | GDK_SHIFT_MASK ); +- +- if ( rKeyCode.IsMod1() ) +- nModifiers = (GdkModifierType) ( nModifiers | GDK_CONTROL_MASK ); +- +- if ( rKeyCode.IsMod2() ) +- nModifiers = (GdkModifierType) ( nModifiers | GDK_MOD1_MASK ); +- +- *pGdkModifiers = nModifiers; +- +- // Get GDK keycode. +- guint nKeyCode = 0; +- +- guint nCode = rKeyCode.GetCode(); +- +- if ( nCode >= KEY_0 && nCode <= KEY_9 ) +- nKeyCode = ( nCode - KEY_0 ) + GDK_0; +- else if ( nCode >= KEY_A && nCode <= KEY_Z ) +- nKeyCode = ( nCode - KEY_A ) + GDK_A; +- else if ( nCode >= KEY_F1 && nCode <= KEY_F26 ) +- nKeyCode = ( nCode - KEY_F1 ) + GDK_F1; +- else +- { +- switch( nCode ) +- { +- case KEY_DOWN: nKeyCode = GDK_Down; break; +- case KEY_UP: nKeyCode = GDK_Up; break; +- case KEY_LEFT: nKeyCode = GDK_Left; break; +- case KEY_RIGHT: nKeyCode = GDK_Right; break; +- case KEY_HOME: nKeyCode = GDK_Home; break; +- case KEY_END: nKeyCode = GDK_End; break; +- case KEY_PAGEUP: nKeyCode = GDK_Page_Up; break; +- case KEY_PAGEDOWN: nKeyCode = GDK_Page_Down; break; +- case KEY_RETURN: nKeyCode = GDK_Return; break; +- case KEY_ESCAPE: nKeyCode = GDK_Escape; break; +- case KEY_TAB: nKeyCode = GDK_Tab; break; +- case KEY_BACKSPACE: nKeyCode = GDK_BackSpace; break; +- case KEY_SPACE: nKeyCode = GDK_space; break; +- case KEY_INSERT: nKeyCode = GDK_Insert; break; +- case KEY_DELETE: nKeyCode = GDK_Delete; break; +- case KEY_ADD: nKeyCode = GDK_plus; break; +- case KEY_SUBTRACT: nKeyCode = GDK_minus; break; +- case KEY_MULTIPLY: nKeyCode = GDK_asterisk; break; +- case KEY_DIVIDE: nKeyCode = GDK_slash; break; +- case KEY_POINT: nKeyCode = GDK_period; break; +- case KEY_COMMA: nKeyCode = GDK_comma; break; +- case KEY_LESS: nKeyCode = GDK_less; break; +- case KEY_GREATER: nKeyCode = GDK_greater; break; +- case KEY_EQUAL: nKeyCode = GDK_equal; break; +- case KEY_FIND: nKeyCode = GDK_Find; break; +- case KEY_CONTEXTMENU: nKeyCode = GDK_Menu; break; +- case KEY_HELP: nKeyCode = GDK_Help; break; +- case KEY_UNDO: nKeyCode = GDK_Undo; break; +- case KEY_REPEAT: nKeyCode = GDK_Redo; break; +- case KEY_DECIMAL: nKeyCode = GDK_KP_Decimal; break; +- case KEY_TILDE: nKeyCode = GDK_asciitilde; break; +- case KEY_QUOTELEFT: nKeyCode = GDK_quoteleft; break; +- case KEY_BRACKETLEFT: nKeyCode = GDK_bracketleft; break; +- case KEY_BRACKETRIGHT: nKeyCode = GDK_bracketright; break; +- case KEY_SEMICOLON: nKeyCode = GDK_semicolon; break; +- case KEY_QUOTERIGHT: nKeyCode = GDK_quoteright; break; +- +- // Special cases +- case KEY_COPY: nKeyCode = GDK_Copy; break; +- case KEY_CUT: nKeyCode = GDK_Cut; break; +- case KEY_PASTE: nKeyCode = GDK_Paste; break; +- case KEY_OPEN: nKeyCode = GDK_Open; break; +- } +- } +- +- *pGdkKeyCode = nKeyCode; +-} +- +-OUString GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode ) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- return getDisplay()->GetKeyName( nKeyCode ); +-#else +- guint nGtkKeyCode; +- GdkModifierType nGtkModifiers; +- KeyCodeToGdkKey(nKeyCode, &nGtkKeyCode, &nGtkModifiers ); +- +- gchar* pName = gtk_accelerator_get_label(nGtkKeyCode, nGtkModifiers); +- OUString aRet(pName, rtl_str_getLength(pName), RTL_TEXTENCODING_UTF8); +- g_free(pName); +- return aRet; +-#endif +-} +- +-GdkDisplay *GtkSalFrame::getGdkDisplay() +-{ +- return GetGtkSalData()->GetGdkDisplay(); +-} +- +-GtkSalDisplay *GtkSalFrame::getDisplay() +-{ +- return GetGtkSalData()->GetGtkDisplay(); +-} +- +-SalFrame::SalPointerState GtkSalFrame::GetPointerState() +-{ +- SalPointerState aState; +- GdkScreen* pScreen; +- gint x, y; +- GdkModifierType aMask; +- gdk_display_get_pointer( getGdkDisplay(), &pScreen, &x, &y, &aMask ); +- aState.maPos = Point( x - maGeometry.nX, y - maGeometry.nY ); +- aState.mnState = GetMouseModCode( aMask ); +- return aState; +-} +- +-KeyIndicatorState GtkSalFrame::GetIndicatorState() +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- return GetGtkSalData()->GetGtkDisplay()->GetIndicatorState(); +-#else +- KeyIndicatorState nState = KeyIndicatorState::NONE; +- +- GdkKeymap *pKeyMap = gdk_keymap_get_for_display(getGdkDisplay()); +- +- if (gdk_keymap_get_caps_lock_state(pKeyMap)) +- nState |= KeyIndicatorState::CAPSLOCK; +- if (gdk_keymap_get_num_lock_state(pKeyMap)) +- nState |= KeyIndicatorState::NUMLOCK; +-#if GTK_CHECK_VERSION(3,18,0) +- if (gdk_keymap_get_scroll_lock_state(pKeyMap)) +- nState |= KeyIndicatorState::SCROLLLOCK; +-#endif +- return nState; +-#endif +-} +- +-void GtkSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode ) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- GetGtkSalData()->GetGtkDisplay()->SimulateKeyPress(nKeyCode); +-#else +- g_warning ("missing simulate keypress %d", nKeyCode); +-#endif +-} +- +-void GtkSalFrame::SetInputContext( SalInputContext* pContext ) +-{ +- if( ! pContext ) +- return; +- +- if( ! (pContext->mnOptions & InputContextFlags::Text) ) +- return; +- +- // create a new im context +- if( ! m_pIMHandler ) +- m_pIMHandler = new IMHandler( this ); +-} +- +-void GtkSalFrame::EndExtTextInput( sal_uInt16 nFlags ) +-{ +- if( m_pIMHandler ) +- m_pIMHandler->endExtTextInput( nFlags ); +-} +- +-bool GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , vcl::KeyCode& ) +-{ +- // not supported yet +- return false; +-} +- +-LanguageType GtkSalFrame::GetInputLanguage() +-{ +- return LANGUAGE_DONTKNOW; +-} +- +-void GtkSalFrame::UpdateSettings( AllSettings& rSettings ) +-{ +- if( ! m_pWindow ) +- return; +- +- GtkSalGraphics* pGraphics = static_cast(m_aGraphics[0].pGraphics); +- bool bFreeGraphics = false; +- if( ! pGraphics ) +- { +- pGraphics = static_cast(AcquireGraphics()); +- if ( !pGraphics ) +- { +- SAL_WARN("vcl", "Could not get graphics - unable to update settings"); +- return; +- } +- bFreeGraphics = true; +- } +- +- pGraphics->updateSettings( rSettings ); +- +- if( bFreeGraphics ) +- ReleaseGraphics( pGraphics ); +-} +- +-void GtkSalFrame::Beep() +-{ +- gdk_display_beep( getGdkDisplay() ); +-} +- +-const SystemEnvData* GtkSalFrame::GetSystemData() const +-{ +- return &m_aSystemData; +-} +- +-void GtkSalFrame::SetParent( SalFrame* pNewParent ) +-{ +- if( m_pParent ) +- m_pParent->m_aChildren.remove( this ); +- m_pParent = static_cast(pNewParent); +- if( m_pParent ) +- m_pParent->m_aChildren.push_back( this ); +- if( ! isChild() ) +- gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), +- (m_pParent && ! m_pParent->isChild(true,false)) ? GTK_WINDOW(m_pParent->m_pWindow) : NULL +- ); +-} +- +-#if !GTK_CHECK_VERSION(3,0,0) +- +-void GtkSalFrame::createNewWindow( ::Window aNewParent, bool bXEmbed, SalX11Screen nXScreen ) +-{ +- bool bWasVisible = m_pWindow && IS_WIDGET_MAPPED(m_pWindow); +- if( bWasVisible ) +- Show( false ); +- +- if( (int)nXScreen.getXScreen() >= getDisplay()->GetXScreenCount() ) +- nXScreen = m_nXScreen; +- +- SystemParentData aParentData; +- aParentData.aWindow = aNewParent; +- aParentData.bXEmbedSupport = bXEmbed; +- if( aNewParent == None ) +- { +- aNewParent = getDisplay()->GetRootWindow(nXScreen); +- aParentData.aWindow = None; +- aParentData.bXEmbedSupport = false; +- } +- else +- { +- // is new parent a root window ? +- Display* pDisp = getDisplay()->GetDisplay(); +- int nScreens = getDisplay()->GetXScreenCount(); +- for( int i = 0; i < nScreens; i++ ) +- { +- if( aNewParent == RootWindow( pDisp, i ) ) +- { +- nXScreen = SalX11Screen( i ); +- aParentData.aWindow = None; +- aParentData.bXEmbedSupport = false; +- break; +- } +- } +- } +- +- // free xrender resources +- for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ ) +- if( m_aGraphics[i].bInUse ) +- m_aGraphics[i].pGraphics->SetDrawable( None, m_nXScreen ); +- +- // first deinit frame +- if( m_pIMHandler ) +- { +- delete m_pIMHandler; +- m_pIMHandler = NULL; +- } +- if( m_pRegion ) +- { +- gdk_region_destroy( m_pRegion ); +- } +- +- GtkWidget *pEventWidget = getMouseEventWidget(); +- for (auto handler_id : m_aMouseSignalIds) +- g_signal_handler_disconnect(G_OBJECT(pEventWidget), handler_id); +- if( m_pFixedContainer ) +- gtk_widget_destroy( GTK_WIDGET(m_pFixedContainer) ); +- if( m_pEventBox ) +- gtk_widget_destroy( GTK_WIDGET(m_pEventBox) ); +- if( m_pWindow ) +- gtk_widget_destroy( m_pWindow ); +- if( m_pForeignParent ) +- g_object_unref( G_OBJECT( m_pForeignParent ) ); +- if( m_pForeignTopLevel ) +- g_object_unref( G_OBJECT( m_pForeignTopLevel ) ); +- +- // init new window +- m_bDefaultPos = m_bDefaultSize = false; +- if( aParentData.aWindow != None ) +- { +- m_nStyle |= SAL_FRAME_STYLE_PLUG; +- Init( &aParentData ); +- } +- else +- { +- m_nStyle &= ~SAL_FRAME_STYLE_PLUG; +- Init( (m_pParent && m_pParent->m_nXScreen == m_nXScreen) ? m_pParent : NULL, m_nStyle ); +- } +- +- // update graphics +- for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ ) +- { +- if( m_aGraphics[i].bInUse ) +- { +- m_aGraphics[i].pGraphics->SetDrawable( widget_get_xid(m_pWindow), m_nXScreen ); +- m_aGraphics[i].pGraphics->SetWindow( m_pWindow ); +- } +- } +- +- if( ! m_aTitle.isEmpty() ) +- SetTitle( m_aTitle ); +- +- if( bWasVisible ) +- Show( true ); +- +- std::list< GtkSalFrame* > aChildren = m_aChildren; +- m_aChildren.clear(); +- for( std::list< GtkSalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) +- (*it)->createNewWindow( None, false, m_nXScreen ); +- +- // FIXME: SalObjects +-} +-#endif +- +-bool GtkSalFrame::SetPluginParent( SystemParentData* pSysParent ) +-{ +-#if !GTK_CHECK_VERSION(3,0,0) +- GetGenericData()->ErrorTrapPush(); // permanantly ignore unruly children's errors +- createNewWindow( pSysParent->aWindow, (pSysParent->nSize > sizeof(long)) && pSysParent->bXEmbedSupport, m_nXScreen ); +- return true; +-#else +- (void)pSysParent; +- //FIXME: no SetPluginParent impl. for gtk3 +- return false; +-#endif +-} +- +-void GtkSalFrame::ResetClipRegion() +-{ +- if( m_pWindow ) +- gdk_window_shape_combine_region( widget_get_window( m_pWindow ), NULL, 0, 0 ); +-} +- +-void GtkSalFrame::BeginSetClipRegion( sal_uLong ) +-{ +-#if GTK_CHECK_VERSION(3,0,0) +- if( m_pRegion ) +- cairo_region_destroy( m_pRegion ); +- m_pRegion = cairo_region_create(); +-#else +- if( m_pRegion ) +- gdk_region_destroy( m_pRegion ); +- m_pRegion = gdk_region_new(); +-#endif +-} +- +-void GtkSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) +-{ +- if( m_pRegion ) +- { +- GdkRectangle aRect; +- aRect.x = nX; +- aRect.y = nY; +- aRect.width = nWidth; +- aRect.height = nHeight; +-#if GTK_CHECK_VERSION(3,0,0) +- cairo_region_union_rectangle( m_pRegion, &aRect ); +-#else +- gdk_region_union_with_rect( m_pRegion, &aRect ); +-#endif +- } +-} +- +-void GtkSalFrame::EndSetClipRegion() +-{ +- if( m_pWindow && m_pRegion ) +- gdk_window_shape_combine_region( widget_get_window(m_pWindow), m_pRegion, 0, 0 ); +-} +- +-#if !GTK_CHECK_VERSION(3,0,0) +-bool GtkSalFrame::Dispatch( const XEvent* pEvent ) +-{ +- bool bContinueDispatch = true; +- +- if( pEvent->type == PropertyNotify ) +- { +- vcl_sal::WMAdaptor* pAdaptor = getDisplay()->getWMAdaptor(); +- Atom nDesktopAtom = pAdaptor->getAtom( vcl_sal::WMAdaptor::NET_WM_DESKTOP ); +- if( pEvent->xproperty.atom == nDesktopAtom && +- pEvent->xproperty.state == PropertyNewValue ) +- { +- m_nWorkArea = pAdaptor->getWindowWorkArea( widget_get_xid(m_pWindow) ); +- } +- } +- else if( pEvent->type == ConfigureNotify ) +- { +- if( m_pForeignParent && pEvent->xconfigure.window == m_aForeignParentWindow ) +- { +- bContinueDispatch = false; +- gtk_window_resize( GTK_WINDOW(m_pWindow), pEvent->xconfigure.width, pEvent->xconfigure.height ); +- if( ( sal::static_int_cast< int >(maGeometry.nWidth) != +- pEvent->xconfigure.width ) || +- ( sal::static_int_cast< int >(maGeometry.nHeight) != +- pEvent->xconfigure.height ) ) +- { +- maGeometry.nWidth = pEvent->xconfigure.width; +- maGeometry.nHeight = pEvent->xconfigure.height; +- setMinMaxSize(); +- getDisplay()->SendInternalEvent( this, NULL, SALEVENT_RESIZE ); +- } +- } +- else if( m_pForeignTopLevel && pEvent->xconfigure.window == m_aForeignTopLevelWindow ) +- { +- bContinueDispatch = false; +- // update position +- int x = 0, y = 0; +- ::Window aChild; +- XTranslateCoordinates( getDisplay()->GetDisplay(), +- widget_get_xid(m_pWindow), +- getDisplay()->GetRootWindow( getDisplay()->GetDefaultXScreen() ), +- 0, 0, +- &x, &y, +- &aChild ); +- if( x != maGeometry.nX || y != maGeometry.nY ) +- { +- maGeometry.nX = x; +- maGeometry.nY = y; +- getDisplay()->SendInternalEvent( this, NULL, SALEVENT_MOVE ); +- } +- } +- } +- else if( pEvent->type == ClientMessage && +- pEvent->xclient.message_type == getDisplay()->getWMAdaptor()->getAtom( vcl_sal::WMAdaptor::XEMBED ) && +- pEvent->xclient.window == widget_get_xid(m_pWindow) && +- m_bWindowIsGtkPlug +- ) +- { +- // FIXME: this should not be necessary, GtkPlug should do this +- // transparently for us +- if( pEvent->xclient.data.l[1] == 1 || // XEMBED_WINDOW_ACTIVATE +- pEvent->xclient.data.l[1] == 2 // XEMBED_WINDOW_DEACTIVATE +- ) +- { +- GdkEventFocus aEvent; +- aEvent.type = GDK_FOCUS_CHANGE; +- aEvent.window = widget_get_window( m_pWindow ); +- aEvent.send_event = gint8(TRUE); +- aEvent.in = gint16(pEvent->xclient.data.l[1] == 1); +- signalFocus( m_pWindow, &aEvent, this ); +- } +- } +- +- return bContinueDispatch; +-} +-#endif +- +-gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- SalMouseEvent aEvent; +- sal_uInt16 nEventType = 0; +- switch( pEvent->type ) +- { +- case GDK_BUTTON_PRESS: +- nEventType = SALEVENT_MOUSEBUTTONDOWN; +- break; +- case GDK_BUTTON_RELEASE: +- nEventType = SALEVENT_MOUSEBUTTONUP; +- break; +- default: +- return false; +- } +- switch( pEvent->button ) +- { +- case 1: aEvent.mnButton = MOUSE_LEFT; break; +- case 2: aEvent.mnButton = MOUSE_MIDDLE; break; +- case 3: aEvent.mnButton = MOUSE_RIGHT; break; +- default: return false; +- } +- aEvent.mnTime = pEvent->time; +- aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; +- aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; +- aEvent.mnCode = GetMouseModCode( pEvent->state ); +- +- bool bClosePopups = false; +- if( pEvent->type == GDK_BUTTON_PRESS && +- (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) == 0 +- ) +- { +- if( m_nFloats > 0 ) +- { +- // close popups if user clicks outside our application +- gint x, y; +- bClosePopups = (gdk_display_get_window_at_pointer( GtkSalFrame::getGdkDisplay(), &x, &y ) == NULL); +- } +- /* #i30306# release implicit pointer grab if no popups are open; else +- * Drag cannot grab the pointer and will fail. +- */ +- if( m_nFloats < 1 || bClosePopups ) +- gdk_display_pointer_ungrab( GtkSalFrame::getGdkDisplay(), GDK_CURRENT_TIME ); +- } +- +- if( pThis->m_bWindowIsGtkPlug && +- pEvent->type == GDK_BUTTON_PRESS && +- pEvent->button == 1 ) +- { +- pThis->askForXEmbedFocus( pEvent->time ); +- } +- +- // --- RTL --- (mirror mouse pos) +- if( AllSettings::GetLayoutRTL() ) +- aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; +- +- vcl::DeletionListener aDel( pThis ); +- +- pThis->CallCallback( nEventType, &aEvent ); +- +- if( ! aDel.isDeleted() ) +- { +- if( bClosePopups ) +- { +- ImplSVData* pSVData = ImplGetSVData(); +- if ( pSVData->maWinData.mpFirstFloat ) +- { +- static const char* pEnv = getenv( "SAL_FLOATWIN_NOAPPFOCUSCLOSE" ); +- if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) && !(pEnv && *pEnv) ) +- pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll ); +- } +- } +- +- if( ! aDel.isDeleted() ) +- { +- int frame_x = (int)(pEvent->x_root - pEvent->x); +- int frame_y = (int)(pEvent->y_root - pEvent->y); +- if( frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY ) +- { +- pThis->maGeometry.nX = frame_x; +- pThis->maGeometry.nY = frame_y; +- pThis->CallCallback( SALEVENT_MOVE, NULL ); +- } +- } +- } +- +- return true; +-} +- +-#if GTK_CHECK_VERSION(3,0,0) +-void GtkSalFrame::signalFlagsChanged( GtkWidget* , GtkStateFlags state, gpointer frame ) +-{ +- //TO-DO: This isn't as helpful as I'd like it to be. The color selector puts the main +- //windows into the backdrop, disabling everything, and the floating navigator window +- //is also problematic. +- GtkSalFrame* pThis = static_cast(frame); +- +- bool bOldBackDrop = state & GTK_STATE_FLAG_BACKDROP; +- bool bNewBackDrop = (gtk_widget_get_state_flags(GTK_WIDGET(pThis->m_pWindow)) & GTK_STATE_FLAG_BACKDROP); +- if (bNewBackDrop && !bOldBackDrop) +- { +- pThis->GetWindow()->Disable(); +- } +- else if (bOldBackDrop && !bNewBackDrop) +- { +- pThis->GetWindow()->Enable(); +- } +-} +-#endif +- +-gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- GdkEventScroll* pSEvent = reinterpret_cast(pEvent); +- +-#if GTK_CHECK_VERSION(3,0,0) +- // gnome#726878 check for duplicate legacy scroll event +- if (pSEvent->direction != GDK_SCROLL_SMOOTH && +- pThis->m_nLastScrollEventTime == pSEvent->time) +- { +- return true; +- } +-#endif +- +- SalWheelMouseEvent aEvent; +- +- aEvent.mnTime = pSEvent->time; +- aEvent.mnX = (sal_uLong)pSEvent->x; +- aEvent.mnY = (sal_uLong)pSEvent->y; +- aEvent.mnCode = GetMouseModCode( pSEvent->state ); +- aEvent.mnScrollLines = 3; +- +- switch (pSEvent->direction) +- { +-#if GTK_CHECK_VERSION(3,0,0) +- case GDK_SCROLL_SMOOTH: +- { +- double delta_x, delta_y; +- gdk_event_get_scroll_deltas(pEvent, &delta_x, &delta_y); +- //pick the bigger one I guess +- aEvent.mbHorz = fabs(delta_x) > fabs(delta_y); +- if (aEvent.mbHorz) +- aEvent.mnDelta = -delta_x; +- else +- aEvent.mnDelta = -delta_y; +- aEvent.mnScrollLines = 1; +- pThis->m_nLastScrollEventTime = pSEvent->time; +- break; +- } +-#endif +- case GDK_SCROLL_UP: +- aEvent.mnDelta = 120; +- aEvent.mbHorz = false; +- break; +- case GDK_SCROLL_DOWN: +- aEvent.mnDelta = -120; +- aEvent.mbHorz = false; +- break; +- case GDK_SCROLL_LEFT: +- aEvent.mbHorz = true; +- aEvent.mnDelta = 120; +- break; +- case GDK_SCROLL_RIGHT: +- aEvent.mnDelta = -120; +- aEvent.mbHorz = true; +- break; +- }; +- +- aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : 1; +- +- // --- RTL --- (mirror mouse pos) +- if( AllSettings::GetLayoutRTL() ) +- aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; +- +- pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent ); +- +- return true; +-} +- +-#if GTK_CHECK_VERSION(3,14,0) +-void GtkSalFrame::gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame) +-{ +- gdouble x, y; +- GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture)); +- //I feel I want the first point of the sequence, not the last point which +- //the docs say this gives, but for the moment assume we start and end +- //within the same vcl window +- if (gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y)) +- { +- GtkSalFrame* pThis = static_cast(frame); +- +- SalSwipeEvent aEvent; +- aEvent.mnVelocityX = velocity_x; +- aEvent.mnVelocityY = velocity_y; +- aEvent.mnX = x; +- aEvent.mnY = y; +- +- pThis->CallCallback(SALEVENT_SWIPE, &aEvent); +- } +-} +- +-void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- if(pThis) +- { +- SalLongPressEvent aEvent; +- +- gdouble x, y; +- GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture)); +- gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y); +- aEvent.mnX = x; +- aEvent.mnY = y; +- +- pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent); +- } +-} +- +-#endif +- +-gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- SalMouseEvent aEvent; +- aEvent.mnTime = pEvent->time; +- aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; +- aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; +- aEvent.mnCode = GetMouseModCode( pEvent->state ); +- aEvent.mnButton = 0; +- +- // --- RTL --- (mirror mouse pos) +- if( AllSettings::GetLayoutRTL() ) +- aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; +- +- vcl::DeletionListener aDel( pThis ); +- +- pThis->CallCallback( SALEVENT_MOUSEMOVE, &aEvent ); +- +- if( ! aDel.isDeleted() ) +- { +- int frame_x = (int)(pEvent->x_root - pEvent->x); +- int frame_y = (int)(pEvent->y_root - pEvent->y); +- if( frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY ) +- { +- pThis->maGeometry.nX = frame_x; +- pThis->maGeometry.nY = frame_y; +- pThis->CallCallback( SALEVENT_MOVE, NULL ); +- } +- +- if( ! aDel.isDeleted() ) +- { +- // ask for the next hint +- gint x, y; +- GdkModifierType mask; +- gdk_window_get_pointer( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &x, &y, &mask ); +- } +- } +- +- return true; +-} +- +-gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- SalMouseEvent aEvent; +- aEvent.mnTime = pEvent->time; +- aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; +- aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; +- aEvent.mnCode = GetMouseModCode( pEvent->state ); +- aEvent.mnButton = 0; +- +- pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent ); +- +- return true; +-} +- +-#if GTK_CHECK_VERSION(3,0,0) +- +-cairo_t* GtkSalFrame::getCairoContext() const +-{ +- cairo_t* cr = SvpSalGraphics::createCairoContext(m_aFrame); +- assert(cr); +- return cr; +-} +- +-void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect) +-{ +-#if OSL_DEBUG_LEVEL > 1 +- long long area = rDamageRect.getWidth() * rDamageRect.getHeight(); +- if( area > 32 * 1024 ) +- { +- fprintf( stderr, "bitmap damaged %d %d (%dx%d) area %lld widget\n", +- (int) rDamageRect.getMinX(), +- (int) rDamageRect.getMinY(), +- (int) rDamageRect.getWidth(), +- (int) rDamageRect.getHeight(), +- area ); +- } +-#endif +- +- if (dumpframes) +- { +- static int frame; +- OString tmp("/tmp/frame" + OString::number(frame++) + ".png"); +- cairo_t* cr = getCairoContext(); +- cairo_surface_write_to_png(cairo_get_target(cr), tmp.getStr()); +- cairo_destroy(cr); +- } +- +- gtk_widget_queue_draw_area(GTK_WIDGET(m_pFixedContainer), +- rDamageRect.getMinX(), +- rDamageRect.getMinY(), +- rDamageRect.getWidth(), +- rDamageRect.getHeight()); +-} +- +-// blit our backing basebmp buffer to the target cairo context cr +-gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- cairo_save(cr); +- +- cairo_t* source = pThis->getCairoContext(); +- cairo_surface_t *pSurface = cairo_get_target(source); +- +- cairo_set_operator( cr, CAIRO_OPERATOR_OVER ); +- cairo_set_source_surface(cr, pSurface, 0, 0); +- cairo_paint(cr); +- +- cairo_destroy(source); +- +- cairo_restore(cr); +- +- cairo_surface_flush(cairo_get_target(cr)); +- +- return false; +-} +- +-void GtkSalFrame::sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- bool bSized = false; +- +- if( pThis->m_bFullscreen || (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE ) +- { +- if( pAllocation->width != (int)pThis->maGeometry.nWidth || pAllocation->height != (int)pThis->maGeometry.nHeight ) +- { +- bSized = true; +- pThis->maGeometry.nWidth = pAllocation->width; +- pThis->maGeometry.nHeight = pAllocation->height; +- } +- } +- +- if( bSized ) +- { +- pThis->AllocateFrame(); +- pThis->CallCallback( SALEVENT_RESIZE, nullptr ); +- pThis->TriggerPaintEvent(); +- } +-} +- +-gboolean GtkSalFrame::signalConfigure(GtkWidget*, GdkEventConfigure* pEvent, gpointer frame) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- pThis->m_bPaintsBlocked = false; +- +- bool bMoved = false; +- int x = pEvent->x, y = pEvent->y; +- +- /* HACK: during sizing/moving a toolbar pThis->maGeometry is actually +- * already exact; even worse: due to the asynchronicity of configure +- * events the borderwindow which would evaluate this event +- * would size/move based on wrong data if we would actually evaluate +- * this event. So let's swallow it. +- */ +- if( (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && +- GtkSalFrame::getDisplay()->GetCaptureFrame() == pThis ) +- return false; +- +- /* #i31785# claims we cannot trust the x,y members of the event; +- * they are e.g. not set correctly on maximize/demaximize; +- * yet the gdkdisplay-x11.c code handling configure_events has +- * done this XTranslateCoordinates work since the day ~zero. +- */ +- if( x != pThis->maGeometry.nX || y != pThis->maGeometry.nY ) +- { +- bMoved = true; +- pThis->maGeometry.nX = x; +- pThis->maGeometry.nY = y; +- } +- +- // update decoration hints +- if( ! (pThis->m_nStyle & SAL_FRAME_STYLE_PLUG) ) +- { +- GdkRectangle aRect; +- gdk_window_get_frame_extents( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &aRect ); +- pThis->maGeometry.nTopDecoration = y - aRect.y; +- pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height; +- pThis->maGeometry.nLeftDecoration = x - aRect.x; +- pThis->maGeometry.nRightDecoration = aRect.x + aRect.width - x - pEvent->width; +- } +- else +- { +- pThis->maGeometry.nTopDecoration = +- pThis->maGeometry.nBottomDecoration = +- pThis->maGeometry.nLeftDecoration = +- pThis->maGeometry.nRightDecoration = 0; +- } +- +- pThis->updateScreenNumber(); +- +- if (bMoved) +- pThis->CallCallback(SALEVENT_MOVE, nullptr); +- +- return false; +-} +-#else +-gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- pThis->m_bPaintsBlocked = false; +- +- struct SalPaintEvent aEvent( pEvent->area.x, pEvent->area.y, pEvent->area.width, pEvent->area.height ); +- +- pThis->CallCallback( SALEVENT_PAINT, &aEvent ); +- +- return false; +-} +- +-gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- pThis->m_bPaintsBlocked = false; +- +- bool bMoved = false, bSized = false; +- int x = pEvent->x, y = pEvent->y; +- +- /* HACK: during sizing/moving a toolbar pThis->maGeometry is actually +- * already exact; even worse: due to the asynchronicity of configure +- * events the borderwindow which would evaluate this event +- * would size/move based on wrong data if we would actually evaluate +- * this event. So let's swallow it. +- */ +- if( (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && +- GtkSalFrame::getDisplay()->GetCaptureFrame() == pThis ) +- return false; +- +- /* #i31785# claims we cannot trust the x,y members of the event; +- * they are e.g. not set correctly on maximize/demaximize; +- * yet the gdkdisplay-x11.c code handling configure_events has +- * done this XTranslateCoordinates work since the day ~zero. +- */ +- if( x != pThis->maGeometry.nX || y != pThis->maGeometry.nY ) +- { +- bMoved = true; +- pThis->maGeometry.nX = x; +- pThis->maGeometry.nY = y; +- } +- /* #i86302# +- * for non sizeable windows we set the min and max hint for the window manager to +- * achieve correct sizing. However this is asynchronous and e.g. on Compiz +- * it sometimes happens that the window gets resized to another size (some default) +- * if we update the size here, subsequent setMinMaxSize will use this wrong size +- * - which is not good since the window manager will now size the window back to this +- * wrong size at some point. +- */ +- if( pThis->m_bFullscreen || (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE ) +- { +- if( pEvent->width != (int)pThis->maGeometry.nWidth || pEvent->height != (int)pThis->maGeometry.nHeight ) +- { +- bSized = true; +- pThis->maGeometry.nWidth = pEvent->width; +- pThis->maGeometry.nHeight = pEvent->height; +- } +- } +- +- // update decoration hints +- if( ! (pThis->m_nStyle & SAL_FRAME_STYLE_PLUG) ) +- { +- GdkRectangle aRect; +- gdk_window_get_frame_extents( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &aRect ); +- pThis->maGeometry.nTopDecoration = y - aRect.y; +- pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height; +- pThis->maGeometry.nLeftDecoration = x - aRect.x; +- pThis->maGeometry.nRightDecoration = aRect.x + aRect.width - x - pEvent->width; +- } +- else +- { +- pThis->maGeometry.nTopDecoration = +- pThis->maGeometry.nBottomDecoration = +- pThis->maGeometry.nLeftDecoration = +- pThis->maGeometry.nRightDecoration = 0; +- } +- +- pThis->updateScreenNumber(); +- if( bSized ) +- pThis->AllocateFrame(); +- +- if( bMoved && bSized ) +- pThis->CallCallback( SALEVENT_MOVERESIZE, nullptr ); +- else if( bMoved ) +- pThis->CallCallback( SALEVENT_MOVE, nullptr ); +- else if( bSized ) +- pThis->CallCallback( SALEVENT_RESIZE, nullptr ); +- +- if (bSized) +- pThis->TriggerPaintEvent(); +- return false; +-} +- +-#endif // GTK_CHECK_VERSION(3,0,0) +- +-void GtkSalFrame::TriggerPaintEvent() +-{ +- //Under gtk2 we can basically paint directly into the XWindow and on +- //additional "expose-event" events we can re-render the missing pieces +- // +- //Under gtk3 we have to keep our own buffer up to date and flush it into +- //the given cairo context on "draw". So we emit a paint event on +- //opportune resize trigger events to initially fill our backbuffer and then +- //keep it up to date with our direct paints and tell gtk those regions +- //have changed and then blit them into the provided cairo context when +- //we get the "draw" +- // +- //The other alternative was to always paint everything on "draw", but +- //that duplicates the amount of drawing and is hideously slow +-#if GTK_CHECK_VERSION(3,0,0) +- SAL_INFO("vcl.gtk3", "force painting" << 0 << "," << 0 << " " << maGeometry.nWidth << "x" << maGeometry.nHeight); +- SalPaintEvent aPaintEvt(0, 0, maGeometry.nWidth, maGeometry.nHeight, true); +- CallCallback(SALEVENT_PAINT, &aPaintEvt); +- gtk_widget_queue_draw(GTK_WIDGET(m_pFixedContainer)); +-#endif +-} +- +-gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- SalGenericInstance *pSalInstance = +- static_cast< SalGenericInstance* >(GetSalData()->m_pInstance); +- +- // check if printers have changed (analogous to salframe focus handler) +- pSalInstance->updatePrinterUpdate(); +- +- if( !pEvent->in ) +- { +- pThis->m_nKeyModifiers = 0; +- pThis->m_bSendModChangeOnRelease = false; +- } +- +- if( pThis->m_pIMHandler ) +- pThis->m_pIMHandler->focusChanged( pEvent->in ); +- +- // ask for changed printers like generic implementation +- if( pEvent->in && pSalInstance->isPrinterInit() ) +- pSalInstance->updatePrinterUpdate(); +- +- // FIXME: find out who the hell steals the focus from our frame +- // while we have the pointer grabbed, this should not come from +- // the window manager. Is this an event that was still queued ? +- // The focus does not seem to get set inside our process +- +- // in the meantime do not propagate focus get/lose if floats are open +- if( m_nFloats == 0 ) +- pThis->CallCallback( pEvent->in ? SALEVENT_GETFOCUS : SALEVENT_LOSEFOCUS, NULL ); +- +- return false; +-} +- +-#if !GTK_CHECK_VERSION(3,8,0) +-static OString getDisplayString() +-{ +- int nParams = rtl_getAppCommandArgCount(); +- OUString aParam; +- for( int i = 0; i < nParams; i++ ) +- { +- rtl_getAppCommandArg( i, &aParam.pData ); +- if( i < nParams-1 && (aParam == "-display" || aParam == "--display" ) ) +- { +- rtl_getAppCommandArg( i+1, &aParam.pData ); +- return OUStringToOString( aParam, osl_getThreadTextEncoding() ); +- } +- } +- return OString(); +-} +-#endif +- +-gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +-#if !GTK_CHECK_VERSION(3,8,0) +- //Spawn off a helper program that will attempt to set this fullscreen +- //window to span all displays. +- if (pThis->m_bFullscreen && pThis->m_bSpanMonitorsWhenFullscreen) +- { +- GdkWindow* gdkwin = widget_get_window(pThis->m_pWindow); +- if (gdkwin) +- { +- OUString sProgramURL( "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/xid-fullscreen-on-all-monitors"); +- rtl::Bootstrap::expandMacros(sProgramURL); +- OUString sProgram; +- if (osl::FileBase::getSystemPathFromFileURL(sProgramURL, sProgram) == osl::File::E_None) +- { +- OString sFinalProgram(OUStringToOString(sProgram, osl_getThreadTextEncoding()) +- + " " + OString::number((int)GDK_WINDOW_XID(gdkwin))); +- OString sDisplay(getDisplayString()); +- if (!sDisplay.isEmpty()) +- { +- sFinalProgram += "--display " + sDisplay; +- } +- int returnValue = system(sFinalProgram.getStr()); +- (void)returnValue; +- } +- } +- } +-#endif +- +- bool bSetFocus = pThis->m_bSetFocusOnMap; +- pThis->m_bSetFocusOnMap = false; +- +-#if !GTK_CHECK_VERSION(3,0,0) +- if( bSetFocus ) +- { +- GetGenericData()->ErrorTrapPush(); +- XSetInputFocus( GtkSalFrame::getDisplay()->GetDisplay(), +- widget_get_xid(pWidget), +- RevertToParent, CurrentTime ); +- XSync( GtkSalFrame::getDisplay()->GetDisplay(), False ); +- GetGenericData()->ErrorTrapPop(); +- } +-#else +- (void)pWidget; (void)bSetFocus; +- //FIXME: no set input focus ... +-#endif +- +- pThis->CallCallback( SALEVENT_RESIZE, NULL ); +- pThis->TriggerPaintEvent(); +- +- return false; +-} +- +-gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- pThis->CallCallback( SALEVENT_RESIZE, NULL ); +- +- return false; +-} +- +-gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- vcl::DeletionListener aDel( pThis ); +- +- if( pThis->m_pIMHandler ) +- { +- if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) ) +- return true; +- } +- +- // handle modifiers +- if( pEvent->keyval == GDK_Shift_L || pEvent->keyval == GDK_Shift_R || +- pEvent->keyval == GDK_Control_L || pEvent->keyval == GDK_Control_R || +- pEvent->keyval == GDK_Alt_L || pEvent->keyval == GDK_Alt_R || +- pEvent->keyval == GDK_Meta_L || pEvent->keyval == GDK_Meta_R || +- pEvent->keyval == GDK_Super_L || pEvent->keyval == GDK_Super_R ) +- { +- SalKeyModEvent aModEvt; +- +- sal_uInt16 nModCode = GetKeyModCode( pEvent->state ); +- +- aModEvt.mnModKeyCode = 0; // emit no MODKEYCHANGE events +- if( pEvent->type == GDK_KEY_PRESS && !pThis->m_nKeyModifiers ) +- pThis->m_bSendModChangeOnRelease = true; +- +- else if( pEvent->type == GDK_KEY_RELEASE && +- pThis->m_bSendModChangeOnRelease ) +- { +- aModEvt.mnModKeyCode = pThis->m_nKeyModifiers; +- pThis->m_nKeyModifiers = 0; +- } +- +- sal_uInt16 nExtModMask = 0; +- sal_uInt16 nModMask = 0; +- // pressing just the ctrl key leads to a keysym of XK_Control but +- // the event state does not contain ControlMask. In the release +- // event its the other way round: it does contain the Control mask. +- // The modifier mode therefore has to be adapted manually. +- switch( pEvent->keyval ) +- { +- case GDK_Control_L: +- nExtModMask = MODKEY_LMOD1; +- nModMask = KEY_MOD1; +- break; +- case GDK_Control_R: +- nExtModMask = MODKEY_RMOD1; +- nModMask = KEY_MOD1; +- break; +- case GDK_Alt_L: +- nExtModMask = MODKEY_LMOD2; +- nModMask = KEY_MOD2; +- break; +- case GDK_Alt_R: +- nExtModMask = MODKEY_RMOD2; +- nModMask = KEY_MOD2; +- break; +- case GDK_Shift_L: +- nExtModMask = MODKEY_LSHIFT; +- nModMask = KEY_SHIFT; +- break; +- case GDK_Shift_R: +- nExtModMask = MODKEY_RSHIFT; +- nModMask = KEY_SHIFT; +- break; +- // Map Meta/Super to MOD3 modifier on all Unix systems +- // except Mac OS X +- case GDK_Meta_L: +- case GDK_Super_L: +- nExtModMask = MODKEY_LMOD3; +- nModMask = KEY_MOD3; +- break; +- case GDK_Meta_R: +- case GDK_Super_R: +- nExtModMask = MODKEY_RMOD3; +- nModMask = KEY_MOD3; +- break; +- } +- if( pEvent->type == GDK_KEY_RELEASE ) +- { +- nModCode &= ~nModMask; +- pThis->m_nKeyModifiers &= ~nExtModMask; +- } +- else +- { +- nModCode |= nModMask; +- pThis->m_nKeyModifiers |= nExtModMask; +- } +- +- aModEvt.mnCode = nModCode; +- aModEvt.mnTime = pEvent->time; +- +- pThis->CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt ); +- +- } +- else +- { +- pThis->doKeyCallback( pEvent->state, +- pEvent->keyval, +- pEvent->hardware_keycode, +- pEvent->group, +- pEvent->time, +- sal_Unicode(gdk_keyval_to_unicode( pEvent->keyval )), +- (pEvent->type == GDK_KEY_PRESS), +- false ); +- if( ! aDel.isDeleted() ) +- pThis->m_bSendModChangeOnRelease = false; +- } +- +- if( !aDel.isDeleted() && pThis->m_pIMHandler ) +- pThis->m_pIMHandler->updateIMSpotLocation(); +- +- return true; +-} +- +-gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +-#if GTK_CHECK_VERSION(3,0,0) +- //If we went into the backdrop we disabled the toplevel window, if we +- //receive a delete here, re-enable so we can process it +- bool bBackDrop = (gtk_widget_get_state_flags(GTK_WIDGET(pThis->m_pWindow)) & GTK_STATE_FLAG_BACKDROP); +- if (bBackDrop) +- pThis->GetWindow()->Enable(); +-#endif +- +- pThis->CallCallback( SALEVENT_CLOSE, NULL ); +- +- return true; +-} +- +-void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- +- // every frame gets an initial style set on creation +- // do not post these as the whole application tends to +- // redraw itself to adjust to the new style +- // where there IS no new style resulting in tremendous unnecessary flickering +- if( pPrevious != NULL ) +- { +- // signalStyleSet does NOT usually have the gdk lock +- // so post user event to safely dispatch the SALEVENT_SETTINGSCHANGED +- // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings +- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_SETTINGSCHANGED ); +- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_FONTCHANGED ); +- } +- +-#if !GTK_CHECK_VERSION(3,0,0) +- /* #i64117# gtk sets a nice background pixmap +- * but we actually don't really want that, so save +- * some time on the Xserver as well as prevent +- * some paint issues +- */ +- GdkWindow* pWin = widget_get_window(GTK_WIDGET(pThis->getWindow())); +- if( pWin ) +- { +- ::Window aWin = GDK_WINDOW_XWINDOW(pWin); +- if( aWin != None ) +- XSetWindowBackgroundPixmap( GtkSalFrame::getDisplay()->GetDisplay(), +- aWin, +- pThis->m_hBackgroundPixmap ); +- } +- if( ! pThis->m_pParent ) +- { +- // signalize theme changed for NWF caches +- // FIXME: should be called only once for a style change +- GtkSalGraphics::bThemeChanged = true; +- } +-#endif +-} +- +-gboolean GtkSalFrame::signalWindowState( GtkWidget*, GdkEvent* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- if( (pThis->m_nState & GDK_WINDOW_STATE_ICONIFIED) != (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED ) ) +- { +- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_RESIZE ); +- pThis->TriggerPaintEvent(); +- } +- +- if( (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_MAXIMIZED) && +- ! (pThis->m_nState & GDK_WINDOW_STATE_MAXIMIZED) ) +- { +- pThis->m_aRestorePosSize = +- Rectangle( Point( pThis->maGeometry.nX, pThis->maGeometry.nY ), +- Size( pThis->maGeometry.nWidth, pThis->maGeometry.nHeight ) ); +- } +- pThis->m_nState = pEvent->window_state.new_window_state; +- +- #if OSL_DEBUG_LEVEL > 1 +- if( (pEvent->window_state.changed_mask & GDK_WINDOW_STATE_FULLSCREEN) ) +- { +- fprintf( stderr, "window %p %s full screen state\n", +- pThis, +- (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ? "enters" : "leaves"); +- } +- #endif +- +- return false; +-} +- +-gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- pThis->m_nVisibility = pEvent->state; +- return true; +-} +- +-void GtkSalFrame::signalDestroy( GtkWidget* pObj, gpointer frame ) +-{ +- GtkSalFrame* pThis = static_cast(frame); +- if( pObj == pThis->m_pWindow ) +- { +- pThis->m_pFixedContainer = NULL; +- pThis->m_pEventBox = NULL; +- pThis->m_pWindow = NULL; +- pThis->InvalidateGraphics(); +- } +-} +- +-// GtkSalFrame::IMHandler +- +-GtkSalFrame::IMHandler::IMHandler( GtkSalFrame* pFrame ) +-: m_pFrame(pFrame), +- m_nPrevKeyPresses( 0 ), +- m_pIMContext( NULL ), +- m_bFocused( true ), +- m_bPreeditJustChanged( false ) +-{ +- m_aInputEvent.mpTextAttr = NULL; +- createIMContext(); +-} +- +-GtkSalFrame::IMHandler::~IMHandler() +-{ +- // cancel an eventual event posted to begin preedit again +- GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); +- deleteIMContext(); +-} +- +-void GtkSalFrame::IMHandler::createIMContext() +-{ +- if( ! m_pIMContext ) +- { +- m_pIMContext = gtk_im_multicontext_new (); +- g_signal_connect( m_pIMContext, "commit", +- G_CALLBACK (signalIMCommit), this ); +- g_signal_connect( m_pIMContext, "preedit_changed", +- G_CALLBACK (signalIMPreeditChanged), this ); +- g_signal_connect( m_pIMContext, "retrieve_surrounding", +- G_CALLBACK (signalIMRetrieveSurrounding), this ); +- g_signal_connect( m_pIMContext, "delete_surrounding", +- G_CALLBACK (signalIMDeleteSurrounding), this ); +- g_signal_connect( m_pIMContext, "preedit_start", +- G_CALLBACK (signalIMPreeditStart), this ); +- g_signal_connect( m_pIMContext, "preedit_end", +- G_CALLBACK (signalIMPreeditEnd), this ); +- +- GetGenericData()->ErrorTrapPush(); +- gtk_im_context_set_client_window( m_pIMContext, widget_get_window(GTK_WIDGET(m_pFrame->m_pWindow)) ); +- gtk_im_context_focus_in( m_pIMContext ); +- GetGenericData()->ErrorTrapPop(); +- m_bFocused = true; +- } +-} +- +-void GtkSalFrame::IMHandler::deleteIMContext() +-{ +- if( m_pIMContext ) +- { +- // first give IC a chance to deinitialize +- GetGenericData()->ErrorTrapPush(); +- gtk_im_context_set_client_window( m_pIMContext, NULL ); +- GetGenericData()->ErrorTrapPop(); +- // destroy old IC +- g_object_unref( m_pIMContext ); +- m_pIMContext = NULL; +- } +-} +- +-void GtkSalFrame::IMHandler::doCallEndExtTextInput() +-{ +- m_aInputEvent.mpTextAttr = NULL; +- m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); +-} +- +-void GtkSalFrame::IMHandler::updateIMSpotLocation() +-{ +- SalExtTextInputPosEvent aPosEvent; +- m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvent ); +- GdkRectangle aArea; +- aArea.x = aPosEvent.mnX; +- aArea.y = aPosEvent.mnY; +- aArea.width = aPosEvent.mnWidth; +- aArea.height = aPosEvent.mnHeight; +- GetGenericData()->ErrorTrapPush(); +- gtk_im_context_set_cursor_location( m_pIMContext, &aArea ); +- GetGenericData()->ErrorTrapPop(); +-} +- +-void GtkSalFrame::IMHandler::sendEmptyCommit() +-{ +- vcl::DeletionListener aDel( m_pFrame ); +- +- SalExtTextInputEvent aEmptyEv; +- aEmptyEv.mnTime = 0; +- aEmptyEv.mpTextAttr = 0; +- aEmptyEv.maText.clear(); +- aEmptyEv.mnCursorPos = 0; +- aEmptyEv.mnCursorFlags = 0; +- aEmptyEv.mbOnlyCursor = False; +- m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEmptyEv ); +- if( ! aDel.isDeleted() ) +- m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); +-} +- +-void GtkSalFrame::IMHandler::endExtTextInput( sal_uInt16 /*nFlags*/ ) +-{ +- gtk_im_context_reset ( m_pIMContext ); +- +- if( m_aInputEvent.mpTextAttr ) +- { +- vcl::DeletionListener aDel( m_pFrame ); +- // delete preedit in sal (commit an empty string) +- sendEmptyCommit(); +- if( ! aDel.isDeleted() ) +- { +- // mark previous preedit state again (will e.g. be sent at focus gain) +- m_aInputEvent.mpTextAttr = &m_aInputFlags[0]; +- if( m_bFocused ) +- { +- // begin preedit again +- GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); +- } +- } +- } +-} +- +-void GtkSalFrame::IMHandler::focusChanged( bool bFocusIn ) +-{ +- m_bFocused = bFocusIn; +- if( bFocusIn ) +- { +- GetGenericData()->ErrorTrapPush(); +- gtk_im_context_focus_in( m_pIMContext ); +- GetGenericData()->ErrorTrapPop(); +- if( m_aInputEvent.mpTextAttr ) +- { +- sendEmptyCommit(); +- // begin preedit again +- GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); +- } +- } +- else +- { +- GetGenericData()->ErrorTrapPush(); +- gtk_im_context_focus_out( m_pIMContext ); +- GetGenericData()->ErrorTrapPop(); +- // cancel an eventual event posted to begin preedit again +- GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); +- } +-} +- +-bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent ) +-{ +- vcl::DeletionListener aDel( m_pFrame ); +- +- if( pEvent->type == GDK_KEY_PRESS ) +- { +- // Add this key press event to the list of previous key presses +- // to which we compare key release events. If a later key release +- // event has a matching key press event in this list, we swallow +- // the key release because some GTK Input Methods don't swallow it +- // for us. +- m_aPrevKeyPresses.push_back( PreviousKeyPress(pEvent) ); +- m_nPrevKeyPresses++; +- +- // Also pop off the earliest key press event if there are more than 10 +- // already. +- while (m_nPrevKeyPresses > 10) +- { +- m_aPrevKeyPresses.pop_front(); +- m_nPrevKeyPresses--; +- } +- +- GObject* pRef = G_OBJECT( g_object_ref( G_OBJECT( m_pIMContext ) ) ); +- +- // #i51353# update spot location on every key input since we cannot +- // know which key may activate a preedit choice window +- updateIMSpotLocation(); +- if( aDel.isDeleted() ) +- return true; +- +- gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent ); +- g_object_unref( pRef ); +- +- if( aDel.isDeleted() ) +- return true; +- +- m_bPreeditJustChanged = false; +- +- if( bResult ) +- return true; +- else +- { +- DBG_ASSERT( m_nPrevKeyPresses > 0, "key press has vanished !" ); +- if( ! m_aPrevKeyPresses.empty() ) // sanity check +- { +- // event was not swallowed, do not filter a following +- // key release event +- // note: this relies on gtk_im_context_filter_keypress +- // returning without calling a handler (in the "not swallowed" +- // case ) which might change the previous key press list so +- // we would pop the wrong event here +- m_aPrevKeyPresses.pop_back(); +- m_nPrevKeyPresses--; +- } +- } +- } +- +- // Determine if we got an earlier key press event corresponding to this key release +- if (pEvent->type == GDK_KEY_RELEASE) +- { +- GObject* pRef = G_OBJECT( g_object_ref( G_OBJECT( m_pIMContext ) ) ); +- gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent ); +- g_object_unref( pRef ); +- +- if( aDel.isDeleted() ) +- return true; +- +- m_bPreeditJustChanged = false; +- +- std::list::iterator iter = m_aPrevKeyPresses.begin(); +- std::list::iterator iter_end = m_aPrevKeyPresses.end(); +- while (iter != iter_end) +- { +- // If we found a corresponding previous key press event, swallow the release +- // and remove the earlier key press from our list +- if (*iter == pEvent) +- { +- m_aPrevKeyPresses.erase(iter); +- m_nPrevKeyPresses--; +- return true; +- } +- ++iter; +- } +- +- if( bResult ) +- return true; +- } +- +- return false; +-} +- +-/* FIXME: +-* #122282# still more hacking: some IMEs never start a preedit but simply commit +-* in this case we cannot commit a single character. Workaround: do not do the +-* single key hack for enter or space if the unicode committed does not match +-*/ +- +-static bool checkSingleKeyCommitHack( guint keyval, sal_Unicode cCode ) +-{ +- bool bRet = true; +- switch( keyval ) +- { +- case GDK_KP_Enter: +- case GDK_Return: +- if( cCode != '\n' && cCode != '\r' ) +- bRet = false; +- break; +- case GDK_space: +- case GDK_KP_Space: +- if( cCode != ' ' ) +- bRet = false; +- break; +- default: +- break; +- } +- return bRet; +-} +- +-void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* pContext, gchar* pText, gpointer im_handler ) +-{ +- GtkSalFrame::IMHandler* pThis = static_cast(im_handler); +- +- SolarMutexGuard aGuard; +- vcl::DeletionListener aDel( pThis->m_pFrame ); +- { +- const bool bWasPreedit = +- (pThis->m_aInputEvent.mpTextAttr != 0) || +- pThis->m_bPreeditJustChanged; +- +- pThis->m_aInputEvent.mnTime = 0; +- pThis->m_aInputEvent.mpTextAttr = 0; +- pThis->m_aInputEvent.maText = OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ); +- pThis->m_aInputEvent.mnCursorPos = pThis->m_aInputEvent.maText.getLength(); +- pThis->m_aInputEvent.mnCursorFlags = 0; +- pThis->m_aInputEvent.mbOnlyCursor = False; +- +- pThis->m_aInputFlags.clear(); +- +- /* necessary HACK: all keyboard input comes in here as soon as a IMContext is set +- * which is logical and consequent. But since even simple input like +- * comes through the commit signal instead of signalKey +- * and all kinds of windows only implement KeyInput (e.g. PushButtons, +- * RadioButtons and a lot of other Controls), will send a single +- * KeyInput/KeyUp sequence instead of an ExtText event if there +- * never was a preedit and the text is only one character. +- * +- * In this case there the last ExtText event must have been +- * SALEVENT_ENDEXTTEXTINPUT, either because of a regular commit +- * or because there never was a preedit. +- */ +- bool bSingleCommit = false; +- if( ! bWasPreedit +- && pThis->m_aInputEvent.maText.getLength() == 1 +- && ! pThis->m_aPrevKeyPresses.empty() +- ) +- { +- const PreviousKeyPress& rKP = pThis->m_aPrevKeyPresses.back(); +- sal_Unicode aOrigCode = pThis->m_aInputEvent.maText[0]; +- +- if( checkSingleKeyCommitHack( rKP.keyval, aOrigCode ) ) +- { +- pThis->m_pFrame->doKeyCallback( rKP.state, rKP.keyval, rKP.hardware_keycode, rKP.group, rKP.time, aOrigCode, true, true ); +- bSingleCommit = true; +- } +- } +- if( ! bSingleCommit ) +- { +- pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent); +- if( ! aDel.isDeleted() ) +- pThis->doCallEndExtTextInput(); +- } +- if( ! aDel.isDeleted() ) +- { +- // reset input event +- pThis->m_aInputEvent.maText.clear(); +- pThis->m_aInputEvent.mnCursorPos = 0; +- pThis->updateIMSpotLocation(); +- } +- } +-#ifdef SOLARIS +- // #i51356# workaround a solaris IIIMP bug +- // in case of partial commits the preedit changed signal +- // and commit signal come in wrong order +- if( ! aDel.isDeleted() ) +- signalIMPreeditChanged( pContext, im_handler ); +-#else +- (void) pContext; +-#endif +-} +- +-void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_handler ) +-{ +- GtkSalFrame::IMHandler* pThis = static_cast(im_handler); +- +- char* pText = NULL; +- PangoAttrList* pAttrs = NULL; +- gint nCursorPos = 0; +- +- gtk_im_context_get_preedit_string( pThis->m_pIMContext, +- &pText, +- &pAttrs, +- &nCursorPos ); +- if( pText && ! *pText ) // empty string +- { +- // change from nothing to nothing -> do not start preedit +- // e.g. this will activate input into a calc cell without +- // user input +- if( pThis->m_aInputEvent.maText.getLength() == 0 ) +- { +- g_free( pText ); +- pango_attr_list_unref( pAttrs ); +- return; +- } +- } +- +- pThis->m_bPreeditJustChanged = true; +- +- bool bEndPreedit = (!pText || !*pText) && pThis->m_aInputEvent.mpTextAttr != NULL; +- pThis->m_aInputEvent.mnTime = 0; +- pThis->m_aInputEvent.maText = pText ? OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ) : OUString(); +- pThis->m_aInputEvent.mnCursorPos = nCursorPos; +- pThis->m_aInputEvent.mnCursorFlags = 0; +- pThis->m_aInputEvent.mbOnlyCursor = False; +- +- pThis->m_aInputFlags = std::vector( std::max( 1, (int)pThis->m_aInputEvent.maText.getLength() ), 0 ); +- +- PangoAttrIterator *iter = pango_attr_list_get_iterator(pAttrs); +- do +- { +- GSList *attr_list = NULL; +- GSList *tmp_list = NULL; +- gint start, end; +- guint sal_attr = 0; +- +- pango_attr_iterator_range (iter, &start, &end); +- if (end == G_MAXINT) +- end = pText ? strlen (pText) : 0; +- if (end == start) +- continue; +- +- start = g_utf8_pointer_to_offset (pText, pText + start); +- end = g_utf8_pointer_to_offset (pText, pText + end); +- +- tmp_list = attr_list = pango_attr_iterator_get_attrs (iter); +- while (tmp_list) +- { +- PangoAttribute *pango_attr = static_cast(tmp_list->data); +- +- switch (pango_attr->klass->type) +- { +- case PANGO_ATTR_BACKGROUND: +- sal_attr |= (EXTTEXTINPUT_ATTR_HIGHLIGHT | EXTTEXTINPUT_CURSOR_INVISIBLE); +- break; +- case PANGO_ATTR_UNDERLINE: +- sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE; +- break; +- case PANGO_ATTR_STRIKETHROUGH: +- sal_attr |= EXTTEXTINPUT_ATTR_REDTEXT; +- break; +- default: +- break; +- } +- pango_attribute_destroy (pango_attr); +- tmp_list = tmp_list->next; +- } +- if (sal_attr == 0) +- sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE; +- g_slist_free (attr_list); +- +- // Set the sal attributes on our text +- for (int i = start; i < end; ++i) +- { +- SAL_WARN_IF(i >= static_cast(pThis->m_aInputFlags.size()), +- "vcl.gtk", "pango attrib out of range. Broken range: " +- << start << "," << end << " Legal range: 0," +- << pThis->m_aInputFlags.size()); +- if (i >= static_cast(pThis->m_aInputFlags.size())) +- continue; +- pThis->m_aInputFlags[i] |= sal_attr; +- } +- } while (pango_attr_iterator_next (iter)); +- pango_attr_iterator_destroy(iter); +- +- pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0]; +- +- g_free( pText ); +- pango_attr_list_unref( pAttrs ); +- +- SolarMutexGuard aGuard; +- vcl::DeletionListener aDel( pThis->m_pFrame ); +- +- pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent); +- if( bEndPreedit && ! aDel.isDeleted() ) +- pThis->doCallEndExtTextInput(); +- if( ! aDel.isDeleted() ) +- pThis->updateIMSpotLocation(); +-} +- +-void GtkSalFrame::IMHandler::signalIMPreeditStart( GtkIMContext*, gpointer /*im_handler*/ ) +-{ +-} +- +-void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_handler ) +-{ +- GtkSalFrame::IMHandler* pThis = static_cast(im_handler); +- +- pThis->m_bPreeditJustChanged = true; +- +- SolarMutexGuard aGuard; +- vcl::DeletionListener aDel( pThis->m_pFrame ); +- pThis->doCallEndExtTextInput(); +- if( ! aDel.isDeleted() ) +- pThis->updateIMSpotLocation(); +-} +- +-uno::Reference +- FindFocus(uno::Reference< accessibility::XAccessibleContext > xContext) +-{ +- if (!xContext.is()) +- uno::Reference< accessibility::XAccessibleEditableText >(); +- +- uno::Reference xState = xContext->getAccessibleStateSet(); +- if (xState.is()) +- { +- if (xState->contains(accessibility::AccessibleStateType::FOCUSED)) +- return uno::Reference(xContext, uno::UNO_QUERY); +- } +- +- for (sal_Int32 i = 0; i < xContext->getAccessibleChildCount(); ++i) +- { +- uno::Reference< accessibility::XAccessible > xChild = xContext->getAccessibleChild(i); +- if (!xChild.is()) +- continue; +- uno::Reference< accessibility::XAccessibleContext > xChildContext = xChild->getAccessibleContext(); +- if (!xChildContext.is()) +- continue; +- uno::Reference< accessibility::XAccessibleEditableText > xText = FindFocus(xChildContext); +- if (xText.is()) +- return xText; +- } +- return uno::Reference< accessibility::XAccessibleEditableText >(); +-} +- +-static uno::Reference lcl_GetxText(vcl::Window *pFocusWin) +-{ +- uno::Reference xText; +- try +- { +- uno::Reference< accessibility::XAccessible > xAccessible( pFocusWin->GetAccessible( true ) ); +- if (xAccessible.is()) +- xText = FindFocus(xAccessible->getAccessibleContext()); +- } +- catch(const uno::Exception& e) +- { +- SAL_WARN( "vcl.gtk", "Exception in getting input method surrounding text: " << e.Message); +- } +- return xText; +-} +- +-gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* pContext, gpointer /*im_handler*/ ) +-{ +- vcl::Window *pFocusWin = Application::GetFocusWindow(); +- if (!pFocusWin) +- return true; +- +- uno::Reference xText = lcl_GetxText(pFocusWin); +- if (xText.is()) +- { +- sal_Int32 nPosition = xText->getCaretPosition(); +- OUString sAllText = xText->getText(); +- OString sUTF = OUStringToOString(sAllText, RTL_TEXTENCODING_UTF8); +- OUString sCursorText(sAllText.copy(0, nPosition)); +- gtk_im_context_set_surrounding(pContext, sUTF.getStr(), sUTF.getLength(), +- OUStringToOString(sCursorText, RTL_TEXTENCODING_UTF8).getLength()); +- return true; +- } +- +- return false; +-} +- +-gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint offset, gint nchars, +- gpointer /*im_handler*/ ) +-{ +- vcl::Window *pFocusWin = Application::GetFocusWindow(); +- if (!pFocusWin) +- return true; +- +- uno::Reference xText = lcl_GetxText(pFocusWin); +- if (xText.is()) +- { +- sal_Int32 nPosition = xText->getCaretPosition(); +- // #i111768# range checking +- sal_Int32 nDeletePos = nPosition + offset; +- sal_Int32 nDeleteEnd = nDeletePos + nchars; +- if (nDeletePos < 0) +- nDeletePos = 0; +- if (nDeleteEnd < 0) +- nDeleteEnd = 0; +- if (nDeleteEnd > xText->getCharacterCount()) +- nDeleteEnd = xText->getCharacterCount(); +- +- xText->deleteText(nDeletePos, nDeleteEnd); +- //tdf91641 adjust cursor if deleted chars shift it forward (normal case) +- if (nDeletePos < nPosition) +- { +- if (nDeleteEnd <= nPosition) +- nPosition = nPosition - (nDeleteEnd - nDeletePos); +- else +- nPosition = nDeletePos; +- +- if (xText->getCharacterCount() >= nPosition) +- xText->setCaretPosition( nPosition ); +- } +- return true; +- } +- +- return false; +-} +- +-Size GtkSalDisplay::GetScreenSize( int nDisplayScreen ) +-{ +- Rectangle aRect = m_pSys->GetDisplayScreenPosSizePixel( nDisplayScreen ); +- return Size( aRect.GetWidth(), aRect.GetHeight() ); +-} +- +-Window GtkSalFrame::GetX11Window() +-{ +- return widget_get_xid(m_pWindow); +-} +- +-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/unx/gtk3/app/gtk3gtkinst.cxx b/vcl/unx/gtk3/app/gtk3gtkinst.cxx +deleted file mode 100644 +index 5716058..0000000 +--- a/vcl/unx/gtk3/app/gtk3gtkinst.cxx ++++ /dev/null +@@ -1,641 +0,0 @@ +-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +-/* +- * This file is part of the LibreOffice project. +- * +- * This Source Code Form is subject to the terms of the Mozilla Public +- * License, v. 2.0. If a copy of the MPL was not distributed with this +- * file, You can obtain one at http://mozilla.org/MPL/2.0/. +- */ +- +-#include "../../gtk/app/gtkinst.cxx" +- +-#include +-#include "com/sun/star/lang/XServiceInfo.hpp" +-#include "com/sun/star/lang/XSingleServiceFactory.hpp" +-#include "com/sun/star/lang/XInitialization.hpp" +-#include "com/sun/star/lang/DisposedException.hpp" +-#include "com/sun/star/datatransfer/XTransferable.hpp" +-#include "com/sun/star/datatransfer/clipboard/XClipboard.hpp" +-#include "com/sun/star/datatransfer/clipboard/XClipboardEx.hpp" +-#include "com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp" +-#include "com/sun/star/datatransfer/clipboard/XClipboardListener.hpp" +-#include "com/sun/star/datatransfer/clipboard/XSystemClipboard.hpp" +-#include "com/sun/star/datatransfer/dnd/XDragSource.hpp" +-#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp" +-#include "com/sun/star/datatransfer/dnd/DNDConstants.hpp" +-#include +-#include +-#include "cppuhelper/compbase.hxx" +-#include "cppuhelper/implbase1.hxx" +-#include +- +-using namespace com::sun::star; +-using namespace com::sun::star::uno; +-using namespace com::sun::star::lang; +- +-namespace +-{ +- struct TypeEntry +- { +- const char* pNativeType; // string corresponding to nAtom for the case of nAtom being uninitialized +- const char* pType; // Mime encoding on our side +- }; +- +- static TypeEntry aConversionTab[] = +- { +- { "ISO10646-1", "text/plain;charset=utf-16" }, +- { "UTF8_STRING", "text/plain;charset=utf-8" }, +- { "UTF-8", "text/plain;charset=utf-8" }, +- { "text/plain;charset=UTF-8", "text/plain;charset=utf-8" }, +- // ISO encodings +- { "ISO8859-2", "text/plain;charset=iso8859-2" }, +- { "ISO8859-3", "text/plain;charset=iso8859-3" }, +- { "ISO8859-4", "text/plain;charset=iso8859-4" }, +- { "ISO8859-5", "text/plain;charset=iso8859-5" }, +- { "ISO8859-6", "text/plain;charset=iso8859-6" }, +- { "ISO8859-7", "text/plain;charset=iso8859-7" }, +- { "ISO8859-8", "text/plain;charset=iso8859-8" }, +- { "ISO8859-9", "text/plain;charset=iso8859-9" }, +- { "ISO8859-10", "text/plain;charset=iso8859-10" }, +- { "ISO8859-13", "text/plain;charset=iso8859-13" }, +- { "ISO8859-14", "text/plain;charset=iso8859-14" }, +- { "ISO8859-15", "text/plain;charset=iso8859-15" }, +- // asian encodings +- { "JISX0201.1976-0", "text/plain;charset=jisx0201.1976-0" }, +- { "JISX0208.1983-0", "text/plain;charset=jisx0208.1983-0" }, +- { "JISX0208.1990-0", "text/plain;charset=jisx0208.1990-0" }, +- { "JISX0212.1990-0", "text/plain;charset=jisx0212.1990-0" }, +- { "GB2312.1980-0", "text/plain;charset=gb2312.1980-0" }, +- { "KSC5601.1992-0", "text/plain;charset=ksc5601.1992-0" }, +- // eastern european encodings +- { "KOI8-R", "text/plain;charset=koi8-r" }, +- { "KOI8-U", "text/plain;charset=koi8-u" }, +- // String (== iso8859-1) +- { "STRING", "text/plain;charset=iso8859-1" }, +- // special for compound text +- { "COMPOUND_TEXT", "text/plain;charset=compound_text" }, +- +- // PIXMAP +- { "PIXMAP", "image/bmp" } +- }; +- +- class DataFlavorEq : public std::unary_function +- { +- private: +- const css::datatransfer::DataFlavor& m_rData; +- public: +- explicit DataFlavorEq(const css::datatransfer::DataFlavor& rData) : m_rData(rData) {} +- bool operator() (const css::datatransfer::DataFlavor& rData) const +- { +- return rData.MimeType == m_rData.MimeType && +- rData.DataType == m_rData.DataType; +- } +- }; +-} +- +-class GtkTransferable : public ::cppu::WeakImplHelper1 < +- css::datatransfer::XTransferable > +-{ +-private: +- GdkAtom m_nSelection; +- std::map m_aMimeTypeToAtom; +-public: +- +- GtkTransferable(GdkAtom nSelection) +- : m_nSelection(nSelection) +- { +- } +- +- /* +- * XTransferable +- */ +- +- virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor& rFlavor) +- throw(css::datatransfer::UnsupportedFlavorException, +- css::io::IOException, +- css::uno::RuntimeException, std::exception +- ) SAL_OVERRIDE +- { +- GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); +- if (rFlavor.MimeType == "text/plain;charset=utf-16") +- { +- OUString aStr; +- gchar *pText = gtk_clipboard_wait_for_text(clipboard); +- if (pText) +- aStr = OUString(pText, rtl_str_getLength(pText), RTL_TEXTENCODING_UTF8); +- g_free(pText); +- css::uno::Any aRet; +- aRet <<= aStr.replaceAll("\r\n", "\n"); +- return aRet; +- } +- +- auto it = m_aMimeTypeToAtom.find(rFlavor.MimeType); +- if (it == m_aMimeTypeToAtom.end()) +- return css::uno::Any(); +- +- css::uno::Any aRet; +- GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard, +- it->second); +- gint length; +- const guchar *rawdata = gtk_selection_data_get_data_with_length(data, +- &length); +- Sequence aSeq(reinterpret_cast(rawdata), length); +- gtk_selection_data_free(data); +- aRet <<= aSeq; +- return aRet; +- } +- +- std::vector getTransferDataFlavorsAsVector() +- { +- std::vector aVector; +- +- GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); +- +- GdkAtom *targets; +- gint n_targets; +- if (gtk_clipboard_wait_for_targets(clipboard, &targets, &n_targets)) +- { +- bool bHaveText = false, bHaveUTF16 = false; +- +- for (gint i = 0; i < n_targets; ++i) +- { +- gchar* pName = gdk_atom_name(targets[i]); +- const char* pFinalName = pName; +- css::datatransfer::DataFlavor aFlavor; +- +- for (size_t j = 0; j < SAL_N_ELEMENTS(aConversionTab); ++j) +- { +- if (rtl_str_compare(pName, aConversionTab[j].pNativeType) == 0) +- { +- pFinalName = aConversionTab[j].pType; +- break; +- } +- } +- +- aFlavor.MimeType = OUString(pFinalName, +- rtl_str_getLength(pFinalName), +- RTL_TEXTENCODING_UTF8); +- +- m_aMimeTypeToAtom[aFlavor.MimeType] = targets[i]; +- +- aFlavor.DataType = cppu::UnoType>::get(); +- +- sal_Int32 nIndex(0); +- if (aFlavor.MimeType.getToken(0, ';', nIndex) == "text/plain") +- { +- bHaveText = true; +- OUString aToken(aFlavor.MimeType.getToken(0, ';', nIndex)); +- if (aToken == "charset=utf-16") +- { +- bHaveUTF16 = true; +- aFlavor.DataType = cppu::UnoType::get(); +- } +- } +- aVector.push_back(aFlavor); +- g_free(pName); +- } +- +- g_free(targets); +- +- //If we have text, but no UTF-16 format which is basically the only +- //text-format LibreOffice supports for cnp then claim we do and we +- //will convert on demand +- if (bHaveText && !bHaveUTF16) +- { +- css::datatransfer::DataFlavor aFlavor; +- aFlavor.MimeType = "text/plain;charset=utf-16"; +- aFlavor.DataType = cppu::UnoType::get(); +- aVector.push_back(aFlavor); +- } +- } +- +- return aVector; +- } +- +- virtual css::uno::Sequence SAL_CALL getTransferDataFlavors() +- throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE +- { +- return comphelper::containerToSequence(getTransferDataFlavorsAsVector()); +- } +- +- virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor& rFlavor) +- throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE +- { +- const std::vector aAll = +- getTransferDataFlavorsAsVector(); +- +- return std::find_if(aAll.begin(), aAll.end(), DataFlavorEq(rFlavor)) != aAll.end(); +- } +-}; +- +-//We want to use gtk_clipboard_get_owner own owner-change to distinguish between +-//us gaining the clipboard ownership vs losing it. To do that we need to use +-//gtk_clipboard_set_with_owner and to do that we need a GObject, so define +-//one here for that purpose and just give it a VclGtkClipboard* member +-class VclGtkClipboard; +- +-typedef struct _ClipboardOwner ClipboardOwner; +-typedef struct _ClipboardOwnerClass ClipboardOwnerClass; +- +-struct _ClipboardOwner +-{ +- GObject parent_instance; +- +- /* instance members */ +- VclGtkClipboard* m_pThis; +-}; +- +-struct _ClipboardOwnerClass +-{ +- GObjectClass parent_class; +- +- /* class members */ +-}; +- +-#define CLIPBOARD_OWNER_OBJECT (clipboard_owner_get_type ()) +-#define CLIPBOARD_OWNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLIPBOARD_OWNER_OBJECT, ClipboardOwner)) +- +-#ifdef __GNUC__ +-#pragma GCC diagnostic push +-#pragma GCC diagnostic ignored "-Wunused-function" +-#endif +-G_DEFINE_TYPE(ClipboardOwner, clipboard_owner, G_TYPE_OBJECT); +-#ifdef __GNUC__ +-#pragma GCC diagnostic pop +-#endif +- +-static void clipboard_owner_class_init (ClipboardOwnerClass *) +-{ +-} +- +-static void clipboard_owner_init(ClipboardOwner *) +-{ +-} +- +-class VclGtkClipboard : +- public cppu::WeakComponentImplHelper< +- datatransfer::clipboard::XSystemClipboard, +- XServiceInfo> +-{ +- GdkAtom m_nSelection; +- osl::Mutex m_aMutex; +- ClipboardOwner* m_pOwner; +- gulong m_nOwnerChangedSignalId; +- Reference m_aContents; +- Reference m_aOwner; +- std::list< Reference > m_aListeners; +- std::vector m_aGtkTargets; +- std::vector m_aInfoToFlavor; +- +-public: +- +- VclGtkClipboard(GdkAtom nSelection); +- virtual ~VclGtkClipboard(); +- +- /* +- * XServiceInfo +- */ +- +- virtual OUString SAL_CALL getImplementationName() throw( RuntimeException, std::exception ) SAL_OVERRIDE; +- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( RuntimeException, std::exception ) SAL_OVERRIDE; +- virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( RuntimeException, std::exception ) SAL_OVERRIDE; +- +- static OUString getImplementationName_static(); +- static Sequence< OUString > getSupportedServiceNames_static(); +- +- /* +- * XClipboard +- */ +- +- virtual Reference< css::datatransfer::XTransferable > SAL_CALL getContents() +- throw(RuntimeException, std::exception) SAL_OVERRIDE; +- +- virtual void SAL_CALL setContents( +- const Reference< css::datatransfer::XTransferable >& xTrans, +- const Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ) +- throw(RuntimeException, std::exception) SAL_OVERRIDE; +- +- virtual OUString SAL_CALL getName() +- throw(RuntimeException, std::exception) SAL_OVERRIDE; +- +- /* +- * XClipboardEx +- */ +- +- virtual sal_Int8 SAL_CALL getRenderingCapabilities() +- throw(RuntimeException, std::exception) SAL_OVERRIDE; +- +- /* +- * XClipboardNotifier +- */ +- virtual void SAL_CALL addClipboardListener( +- const Reference< css::datatransfer::clipboard::XClipboardListener >& listener ) +- throw(RuntimeException, std::exception) SAL_OVERRIDE; +- +- virtual void SAL_CALL removeClipboardListener( +- const Reference< css::datatransfer::clipboard::XClipboardListener >& listener ) +- throw(RuntimeException, std::exception) SAL_OVERRIDE; +- +- void ClipboardGet(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info); +- void ClipboardClear(GtkClipboard *clipboard); +- void OwnerChanged(GtkClipboard *clipboard, GdkEvent *event); +-private: +- GtkTargetEntry makeGtkTargetEntry(const css::datatransfer::DataFlavor& rFlavor); +-}; +- +-OUString VclGtkClipboard::getImplementationName_static() +-{ +- return OUString( "com.sun.star.datatransfer.VclGtkClipboard" ); +-} +- +-Sequence< OUString > VclGtkClipboard::getSupportedServiceNames_static() +-{ +- Sequence< OUString > aRet(1); +- aRet[0] = "com.sun.star.datatransfer.clipboard.SystemClipboard"; +- return aRet; +-} +- +-OUString VclGtkClipboard::getImplementationName() throw( RuntimeException, std::exception ) +-{ +- return getImplementationName_static(); +-} +- +-Sequence< OUString > VclGtkClipboard::getSupportedServiceNames() throw( RuntimeException, std::exception ) +-{ +- return getSupportedServiceNames_static(); +-} +- +-sal_Bool VclGtkClipboard::supportsService( const OUString& ServiceName ) throw( RuntimeException, std::exception ) +-{ +- return cppu::supportsService(this, ServiceName); +-} +- +-Reference< css::datatransfer::XTransferable > VclGtkClipboard::getContents() throw( RuntimeException, std::exception ) +-{ +- if (G_OBJECT(m_pOwner) != gtk_clipboard_get_owner(gtk_clipboard_get(m_nSelection)) && +- !m_aContents.is()) +- { +- //tdf#93887 This is the system clipboard/selection. We fetch it when we are not +- //the owner of the clipboard and have not already fetched it. +- m_aContents = new GtkTransferable(m_nSelection); +- } +- return m_aContents; +-} +- +-void VclGtkClipboard::ClipboardGet(GtkClipboard* /*clipboard*/, GtkSelectionData *selection_data, +- guint info) +-{ +- if (!m_aContents.is()) +- return; +- +- GdkAtom type(gdk_atom_intern(OUStringToOString(m_aInfoToFlavor[info].MimeType, +- RTL_TEXTENCODING_UTF8).getStr(), +- false)); +- +- css::datatransfer::DataFlavor aFlavor(m_aInfoToFlavor[info]); +- if (aFlavor.MimeType == "UTF8_STRING" || aFlavor.MimeType == "STRING") +- aFlavor.MimeType = "text/plain;charset=utf-8"; +- +- Sequence aData; +- Any aValue; +- +- try +- { +- aValue = m_aContents->getTransferData(aFlavor); +- } +- catch(...) +- { +- } +- +- if (aValue.getValueTypeClass() == TypeClass_STRING) +- { +- OUString aString; +- aValue >>= aString; +- aData = Sequence< sal_Int8 >( reinterpret_cast(aString.getStr()), aString.getLength() * sizeof( sal_Unicode ) ); +- } +- else if (aValue.getValueType() == cppu::UnoType>::get()) +- { +- aValue >>= aData; +- } +- else if (aFlavor.MimeType == "text/plain;charset=utf-8") +- { +- //didn't have utf-8, try utf-16 and convert +- aFlavor.MimeType = "text/plain;charset=utf-16"; +- aFlavor.DataType = cppu::UnoType::get(); +- try +- { +- aValue = m_aContents->getTransferData(aFlavor); +- } +- catch(...) +- { +- } +- OUString aString; +- aValue >>= aString; +- OString aUTF8String(OUStringToOString(aString, RTL_TEXTENCODING_UTF8)); +- gtk_selection_data_set(selection_data, type, 8, +- reinterpret_cast(aUTF8String.getStr()), +- aUTF8String.getLength()); +- return; +- } +- +- gtk_selection_data_set(selection_data, type, 8, +- reinterpret_cast(aData.getArray()), +- aData.getLength()); +-} +- +-void VclGtkClipboard::OwnerChanged(GtkClipboard* clipboard, GdkEvent* /*event*/) +-{ +- if (G_OBJECT(m_pOwner) != gtk_clipboard_get_owner(clipboard)) +- { +- //null out m_aContents to return control to the system-one which +- //will be retrieved if getContents is called again +- setContents(Reference(), +- Reference()); +- } +-} +- +-void VclGtkClipboard::ClipboardClear(GtkClipboard * /*clipboard*/) +-{ +- for (auto &a : m_aGtkTargets) +- free(a.target); +- m_aGtkTargets.clear(); +-} +- +-GtkTargetEntry VclGtkClipboard::makeGtkTargetEntry(const css::datatransfer::DataFlavor& rFlavor) +-{ +- GtkTargetEntry aEntry; +- aEntry.target = +- g_strdup(OUStringToOString(rFlavor.MimeType, RTL_TEXTENCODING_UTF8).getStr()); +- aEntry.flags = 0; +- auto it = std::find_if(m_aInfoToFlavor.begin(), m_aInfoToFlavor.end(), +- DataFlavorEq(rFlavor)); +- if (it != m_aInfoToFlavor.end()) +- aEntry.info = std::distance(m_aInfoToFlavor.begin(), it); +- else +- { +- aEntry.info = m_aInfoToFlavor.size(); +- m_aInfoToFlavor.push_back(rFlavor); +- } +- return aEntry; +-} +- +-namespace +-{ +- void ClipboardGetFunc(GtkClipboard *clipboard, GtkSelectionData *selection_data, +- guint info, +- gpointer user_data_or_owner) +- { +- VclGtkClipboard* pThis = CLIPBOARD_OWNER(user_data_or_owner)->m_pThis; +- pThis->ClipboardGet(clipboard, selection_data, info); +- } +- +- void ClipboardClearFunc(GtkClipboard *clipboard, gpointer user_data_or_owner) +- { +- VclGtkClipboard* pThis = CLIPBOARD_OWNER(user_data_or_owner)->m_pThis; +- pThis->ClipboardClear(clipboard); +- } +- +- void handle_owner_change(GtkClipboard *clipboard, GdkEvent *event, gpointer user_data) +- { +- VclGtkClipboard* pThis = static_cast(user_data); +- pThis->OwnerChanged(clipboard, event); +- } +-} +- +-VclGtkClipboard::VclGtkClipboard(GdkAtom nSelection) +- : cppu::WeakComponentImplHelper +- (m_aMutex) +- , m_nSelection(nSelection) +-{ +- GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); +- m_nOwnerChangedSignalId = g_signal_connect(clipboard, "owner-change", +- G_CALLBACK(handle_owner_change), this); +- m_pOwner = CLIPBOARD_OWNER(g_object_new(CLIPBOARD_OWNER_OBJECT, NULL)); +- m_pOwner->m_pThis = this; +-} +- +-VclGtkClipboard::~VclGtkClipboard() +-{ +- GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); +- g_signal_handler_disconnect(clipboard, m_nOwnerChangedSignalId); +- g_object_unref(m_pOwner); +-} +- +-void VclGtkClipboard::setContents( +- const Reference< css::datatransfer::XTransferable >& xTrans, +- const Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ) +- throw( RuntimeException, std::exception ) +-{ +- osl::ClearableMutexGuard aGuard( m_aMutex ); +- Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner ); +- Reference< datatransfer::XTransferable > xOldContents( m_aContents ); +- m_aContents = xTrans; +- m_aOwner = xClipboardOwner; +- +- std::list< Reference< datatransfer::clipboard::XClipboardListener > > xListeners( m_aListeners ); +- datatransfer::clipboard::ClipboardEvent aEv; +- +- if (m_aContents.is()) +- { +- css::uno::Sequence aFormats = xTrans->getTransferDataFlavors(); +- std::vector aGtkTargets; +- bool bHaveText(false), bHaveUTF8(false); +- for (int i = 0; i < aFormats.getLength(); ++i) +- { +- const css::datatransfer::DataFlavor& rFlavor = aFormats[i]; +- +- sal_Int32 nIndex(0); +- if (rFlavor.MimeType.getToken(0, ';', nIndex) == "text/plain") +- { +- bHaveText = true; +- OUString aToken(rFlavor.MimeType.getToken(0, ';', nIndex)); +- if (aToken == "charset=utf-8") +- { +- bHaveUTF8 = true; +- } +- } +- GtkTargetEntry aEntry(makeGtkTargetEntry(rFlavor)); +- aGtkTargets.push_back(aEntry); +- } +- +- if (bHaveText) +- { +- css::datatransfer::DataFlavor aFlavor; +- aFlavor.DataType = cppu::UnoType>::get(); +- if (!bHaveUTF8) +- { +- aFlavor.MimeType = "text/plain;charset=utf-8"; +- aGtkTargets.push_back(makeGtkTargetEntry(aFlavor)); +- } +- aFlavor.MimeType = "UTF8_STRING"; +- aGtkTargets.push_back(makeGtkTargetEntry(aFlavor)); +- aFlavor.MimeType = "STRING"; +- aGtkTargets.push_back(makeGtkTargetEntry(aFlavor)); +- } +- +- //if there was a previous gtk_clipboard_set_with_data call then +- //ClipboardClearFunc will be called now +- GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); +- //use with_owner with m_pOwner so we can distinguish in handle_owner_change +- //if we have gained or lost ownership of the clipboard +- gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(), +- ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner)); +- m_aGtkTargets = aGtkTargets; +- } +- +- aEv.Contents = getContents(); +- +- aGuard.clear(); +- +- if( xOldOwner.is() && xOldOwner != xClipboardOwner ) +- xOldOwner->lostOwnership( this, xOldContents ); +- for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it = +- xListeners.begin(); it != xListeners.end() ; ++it ) +- { +- (*it)->changedContents( aEv ); +- } +-} +- +-OUString VclGtkClipboard::getName() throw( RuntimeException, std::exception ) +-{ +- return OUString( "CLIPBOARD" ); +-} +- +-sal_Int8 VclGtkClipboard::getRenderingCapabilities() throw( RuntimeException, std::exception ) +-{ +- return 0; +-} +- +-void VclGtkClipboard::addClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener ) +- throw( RuntimeException, std::exception ) +-{ +- osl::ClearableMutexGuard aGuard( m_aMutex ); +- +- m_aListeners.push_back( listener ); +-} +- +-void VclGtkClipboard::removeClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener ) +- throw( RuntimeException, std::exception ) +-{ +- osl::ClearableMutexGuard aGuard( m_aMutex ); +- +- m_aListeners.remove( listener ); +-} +- +-Reference< XInterface > GtkInstance::CreateClipboard(const Sequence< Any >& arguments) +-{ +- OUString sel; +- if (arguments.getLength() == 0) { +- sel = "CLIPBOARD"; +- } else if (arguments.getLength() != 1 || !(arguments[0] >>= sel)) { +- throw css::lang::IllegalArgumentException( +- "bad GtkInstance::CreateClipboard arguments", +- css::uno::Reference(), -1); +- } +- +- GdkAtom nSelection = (sel == "CLIPBOARD") ? GDK_SELECTION_CLIPBOARD : GDK_SELECTION_PRIMARY; +- +- return Reference< XInterface >( static_cast(new VclGtkClipboard(nSelection)) ); +-} +- +-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +new file mode 100644 +index 0000000..dcfebbf +--- /dev/null ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -0,0 +1,3803 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ++ * This file is part of the LibreOffice project. ++ * ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ * ++ * This file incorporates work covered by the following license notice: ++ * ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed ++ * with this work for additional information regarding copyright ++ * ownership. The ASF licenses this file to you under the Apache ++ * License, Version 2.0 (the "License"); you may not use this file ++ * except in compliance with the License. You may obtain a copy of ++ * the License at http://www.apache.org/licenses/LICENSE-2.0 . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) ++# include ++#endif ++#if defined ENABLE_GMENU_INTEGRATION // defined in gtksalmenu.hxx above ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++ ++#if OSL_DEBUG_LEVEL > 1 ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#ifdef ENABLE_DBUS ++#include ++ ++#define GSM_DBUS_SERVICE "org.gnome.SessionManager" ++#define GSM_DBUS_PATH "/org/gnome/SessionManager" ++#define GSM_DBUS_INTERFACE "org.gnome.SessionManager" ++#endif ++ ++#include ++ ++#define IS_WIDGET_REALIZED gtk_widget_get_realized ++#define IS_WIDGET_MAPPED gtk_widget_get_mapped ++ ++using namespace com::sun::star; ++ ++int GtkSalFrame::m_nFloats = 0; ++ ++#if defined ENABLE_GMENU_INTEGRATION ++static GDBusConnection* pSessionBus = NULL; ++#endif ++ ++static sal_uInt16 GetKeyModCode( guint state ) ++{ ++ sal_uInt16 nCode = 0; ++ if( (state & GDK_SHIFT_MASK) ) ++ nCode |= KEY_SHIFT; ++ if( (state & GDK_CONTROL_MASK) ) ++ nCode |= KEY_MOD1; ++ if( (state & GDK_MOD1_MASK) ) ++ nCode |= KEY_MOD2; ++ ++ // Map Meta/Super keys to MOD3 modifier on all Unix systems ++ // except Mac OS X ++ if ( (state & GDK_META_MASK ) || ( state & GDK_SUPER_MASK ) ) ++ nCode |= KEY_MOD3; ++ return nCode; ++} ++ ++static sal_uInt16 GetMouseModCode( guint state ) ++{ ++ sal_uInt16 nCode = GetKeyModCode( state ); ++ if( (state & GDK_BUTTON1_MASK) ) ++ nCode |= MOUSE_LEFT; ++ if( (state & GDK_BUTTON2_MASK) ) ++ nCode |= MOUSE_MIDDLE; ++ if( (state & GDK_BUTTON3_MASK) ) ++ nCode |= MOUSE_RIGHT; ++ ++ return nCode; ++} ++ ++static sal_uInt16 GetKeyCode( guint keyval ) ++{ ++ sal_uInt16 nCode = 0; ++ if( keyval >= GDK_0 && keyval <= GDK_9 ) ++ nCode = KEY_0 + (keyval-GDK_0); ++ else if( keyval >= GDK_KP_0 && keyval <= GDK_KP_9 ) ++ nCode = KEY_0 + (keyval-GDK_KP_0); ++ else if( keyval >= GDK_A && keyval <= GDK_Z ) ++ nCode = KEY_A + (keyval-GDK_A ); ++ else if( keyval >= GDK_a && keyval <= GDK_z ) ++ nCode = KEY_A + (keyval-GDK_a ); ++ else if( keyval >= GDK_F1 && keyval <= GDK_F26 ) ++ { ++ switch( keyval ) ++ { ++ // - - - - - Sun keyboard, see vcl/unx/source/app/saldisp.cxx ++ case GDK_L2: ++ nCode = KEY_F12; ++ break; ++ case GDK_L3: nCode = KEY_PROPERTIES; break; ++ case GDK_L4: nCode = KEY_UNDO; break; ++ case GDK_L6: nCode = KEY_COPY; break; // KEY_F16 ++ case GDK_L8: nCode = KEY_PASTE; break; // KEY_F18 ++ case GDK_L10: nCode = KEY_CUT; break; // KEY_F20 ++ default: ++ nCode = KEY_F1 + (keyval-GDK_F1); break; ++ } ++ } ++ else ++ { ++ switch( keyval ) ++ { ++ case GDK_KP_Down: ++ case GDK_Down: nCode = KEY_DOWN; break; ++ case GDK_KP_Up: ++ case GDK_Up: nCode = KEY_UP; break; ++ case GDK_KP_Left: ++ case GDK_Left: nCode = KEY_LEFT; break; ++ case GDK_KP_Right: ++ case GDK_Right: nCode = KEY_RIGHT; break; ++ case GDK_KP_Begin: ++ case GDK_KP_Home: ++ case GDK_Begin: ++ case GDK_Home: nCode = KEY_HOME; break; ++ case GDK_KP_End: ++ case GDK_End: nCode = KEY_END; break; ++ case GDK_KP_Page_Up: ++ case GDK_Page_Up: nCode = KEY_PAGEUP; break; ++ case GDK_KP_Page_Down: ++ case GDK_Page_Down: nCode = KEY_PAGEDOWN; break; ++ case GDK_KP_Enter: ++ case GDK_Return: nCode = KEY_RETURN; break; ++ case GDK_Escape: nCode = KEY_ESCAPE; break; ++ case GDK_ISO_Left_Tab: ++ case GDK_KP_Tab: ++ case GDK_Tab: nCode = KEY_TAB; break; ++ case GDK_BackSpace: nCode = KEY_BACKSPACE; break; ++ case GDK_KP_Space: ++ case GDK_space: nCode = KEY_SPACE; break; ++ case GDK_KP_Insert: ++ case GDK_Insert: nCode = KEY_INSERT; break; ++ case GDK_KP_Delete: ++ case GDK_Delete: nCode = KEY_DELETE; break; ++ case GDK_plus: ++ case GDK_KP_Add: nCode = KEY_ADD; break; ++ case GDK_minus: ++ case GDK_KP_Subtract: nCode = KEY_SUBTRACT; break; ++ case GDK_asterisk: ++ case GDK_KP_Multiply: nCode = KEY_MULTIPLY; break; ++ case GDK_slash: ++ case GDK_KP_Divide: nCode = KEY_DIVIDE; break; ++ case GDK_period: nCode = KEY_POINT; break; ++ case GDK_decimalpoint: nCode = KEY_POINT; break; ++ case GDK_comma: nCode = KEY_COMMA; break; ++ case GDK_less: nCode = KEY_LESS; break; ++ case GDK_greater: nCode = KEY_GREATER; break; ++ case GDK_KP_Equal: ++ case GDK_equal: nCode = KEY_EQUAL; break; ++ case GDK_Find: nCode = KEY_FIND; break; ++ case GDK_Menu: nCode = KEY_CONTEXTMENU;break; ++ case GDK_Help: nCode = KEY_HELP; break; ++ case GDK_Undo: nCode = KEY_UNDO; break; ++ case GDK_Redo: nCode = KEY_REPEAT; break; ++ case GDK_KP_Decimal: ++ case GDK_KP_Separator: nCode = KEY_DECIMAL; break; ++ case GDK_asciitilde: nCode = KEY_TILDE; break; ++ case GDK_leftsinglequotemark: ++ case GDK_quoteleft: nCode = KEY_QUOTELEFT; break; ++ case GDK_bracketleft: nCode = KEY_BRACKETLEFT; break; ++ case GDK_bracketright: nCode = KEY_BRACKETRIGHT; break; ++ case GDK_semicolon: nCode = KEY_SEMICOLON; break; ++ case GDK_quoteright: nCode = KEY_QUOTERIGHT; break; ++ // some special cases, also see saldisp.cxx ++ // - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000 ++ case 0x1000FF02: // apXK_Copy ++ nCode = KEY_COPY; ++ break; ++ case 0x1000FF03: // apXK_Cut ++ nCode = KEY_CUT; ++ break; ++ case 0x1000FF04: // apXK_Paste ++ nCode = KEY_PASTE; ++ break; ++ case 0x1000FF14: // apXK_Repeat ++ nCode = KEY_REPEAT; ++ break; ++ // Exit, Save ++ // - - - - - - - - - - - - - - D E C - - - - - - - - - - - - - 0x1000 ++ case 0x1000FF00: ++ nCode = KEY_DELETE; ++ break; ++ // - - - - - - - - - - - - - - H P - - - - - - - - - - - - - 0x1000 ++ case 0x1000FF73: // hpXK_DeleteChar ++ nCode = KEY_DELETE; ++ break; ++ case 0x1000FF74: // hpXK_BackTab ++ case 0x1000FF75: // hpXK_KP_BackTab ++ nCode = KEY_TAB; ++ break; ++ // - - - - - - - - - - - - - - I B M - - - - - - - - - - - - - ++ // - - - - - - - - - - - - - - O S F - - - - - - - - - - - - - 0x1004 ++ case 0x1004FF02: // osfXK_Copy ++ nCode = KEY_COPY; ++ break; ++ case 0x1004FF03: // osfXK_Cut ++ nCode = KEY_CUT; ++ break; ++ case 0x1004FF04: // osfXK_Paste ++ nCode = KEY_PASTE; ++ break; ++ case 0x1004FF07: // osfXK_BackTab ++ nCode = KEY_TAB; ++ break; ++ case 0x1004FF08: // osfXK_BackSpace ++ nCode = KEY_BACKSPACE; ++ break; ++ case 0x1004FF1B: // osfXK_Escape ++ nCode = KEY_ESCAPE; ++ break; ++ // Up, Down, Left, Right, PageUp, PageDown ++ // - - - - - - - - - - - - - - S C O - - - - - - - - - - - - - ++ // - - - - - - - - - - - - - - S G I - - - - - - - - - - - - - 0x1007 ++ // - - - - - - - - - - - - - - S N I - - - - - - - - - - - - - ++ // - - - - - - - - - - - - - - S U N - - - - - - - - - - - - - 0x1005 ++ case 0x1005FF10: // SunXK_F36 ++ nCode = KEY_F11; ++ break; ++ case 0x1005FF11: // SunXK_F37 ++ nCode = KEY_F12; ++ break; ++ case 0x1005FF70: // SunXK_Props ++ nCode = KEY_PROPERTIES; ++ break; ++ case 0x1005FF71: // SunXK_Front ++ nCode = KEY_FRONT; ++ break; ++ case 0x1005FF72: // SunXK_Copy ++ nCode = KEY_COPY; ++ break; ++ case 0x1005FF73: // SunXK_Open ++ nCode = KEY_OPEN; ++ break; ++ case 0x1005FF74: // SunXK_Paste ++ nCode = KEY_PASTE; ++ break; ++ case 0x1005FF75: // SunXK_Cut ++ nCode = KEY_CUT; ++ break; ++ } ++ } ++ ++ return nCode; ++} ++ ++static guint GetKeyValFor(GdkKeymap* pKeyMap, guint16 hardware_keycode, guint8 group) ++{ ++ guint updated_keyval = 0; ++ gdk_keymap_translate_keyboard_state(pKeyMap, hardware_keycode, ++ (GdkModifierType)0, group, &updated_keyval, NULL, NULL, NULL); ++ return updated_keyval; ++} ++ ++// F10 means either KEY_F10 or KEY_MENU, which has to be decided ++// in the independent part. ++struct KeyAlternate ++{ ++ sal_uInt16 nKeyCode; ++ sal_Unicode nCharCode; ++ KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {} ++ KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} ++}; ++ ++inline KeyAlternate ++GetAlternateKeyCode( const sal_uInt16 nKeyCode ) ++{ ++ KeyAlternate aAlternate; ++ ++ switch( nKeyCode ) ++ { ++ case KEY_F10: aAlternate = KeyAlternate( KEY_MENU );break; ++ case KEY_F24: aAlternate = KeyAlternate( KEY_SUBTRACT, '-' );break; ++ } ++ ++ return aAlternate; ++} ++ ++namespace { ++/// Decouple SalFrame lifetime from damagetracker lifetime ++struct DamageTracker : public basebmp::IBitmapDeviceDamageTracker ++{ ++ DamageTracker(GtkSalFrame& rFrame) : m_rFrame(rFrame) ++ {} ++ ++ virtual ~DamageTracker() {} ++ ++ virtual void damaged(const basegfx::B2IBox& rDamageRect) const SAL_OVERRIDE ++ { ++ m_rFrame.damaged(rDamageRect); ++ } ++ ++ GtkSalFrame& m_rFrame; ++}; ++} ++ ++static bool dumpframes = false; ++ ++void GtkSalFrame::doKeyCallback( guint state, ++ guint keyval, ++ guint16 hardware_keycode, ++ guint8 group, ++ guint32 time, ++ sal_Unicode aOrigCode, ++ bool bDown, ++ bool bSendRelease ++ ) ++{ ++ SalKeyEvent aEvent; ++ ++ aEvent.mnTime = time; ++ aEvent.mnCharCode = aOrigCode; ++ aEvent.mnRepeat = 0; ++ ++ vcl::DeletionListener aDel( this ); ++ ++#if 0 ++ // shift-zero forces a re-draw and event is swallowed ++ if (keyval == GDK_0) ++ { ++ fprintf( stderr, "force widget_queue_draw\n"); ++ gtk_widget_queue_draw (m_pFixedContainer); ++ return; ++ } ++ else if (keyval == GDK_1) ++ { ++ fprintf( stderr, "force repaint all\n"); ++ TriggerPaintEvent(); ++ return; ++ } ++ else if (keyval == GDK_2) ++ { ++ dumpframes = !dumpframes; ++ fprintf(stderr, "toggle dump frames to %d\n", dumpframes); ++ return; ++ } ++#endif ++ ++ /* ++ * #i42122# translate all keys with Ctrl and/or Alt to group 0 else ++ * shortcuts (e.g. Ctrl-o) will not work but be inserted by the ++ * application ++ * ++ * #i52338# do this for all keys that the independent part has no key code ++ * for ++ * ++ * fdo#41169 rather than use group 0, detect if there is a group which can ++ * be used to input Latin text and use that if possible ++ */ ++ aEvent.mnCode = GetKeyCode( keyval ); ++ if( aEvent.mnCode == 0 ) ++ { ++ gint best_group = SAL_MAX_INT32; ++ ++ // Try and find Latin layout ++ GdkKeymap* keymap = gdk_keymap_get_default(); ++ GdkKeymapKey *keys; ++ gint n_keys; ++ if (gdk_keymap_get_entries_for_keyval(keymap, GDK_A, &keys, &n_keys)) ++ { ++ // Find the lowest group that supports Latin layout ++ for (gint i = 0; i < n_keys; ++i) ++ { ++ if (keys[i].level != 0 && keys[i].level != 1) ++ continue; ++ best_group = std::min(best_group, keys[i].group); ++ if (best_group == 0) ++ break; ++ } ++ g_free(keys); ++ } ++ ++ //Unavailable, go with original group then I suppose ++ if (best_group == SAL_MAX_INT32) ++ best_group = group; ++ ++ guint updated_keyval = GetKeyValFor(keymap, hardware_keycode, best_group); ++ aEvent.mnCode = GetKeyCode(updated_keyval); ++ } ++ ++ aEvent.mnCode |= GetKeyModCode( state ); ++ ++ if( bDown ) ++ { ++ bool bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent ); ++ // #i46889# copy AlternatKeyCode handling from generic plugin ++ if( ! bHandled ) ++ { ++ KeyAlternate aAlternate = GetAlternateKeyCode( aEvent.mnCode ); ++ if( aAlternate.nKeyCode ) ++ { ++ aEvent.mnCode = aAlternate.nKeyCode; ++ if( aAlternate.nCharCode ) ++ aEvent.mnCharCode = aAlternate.nCharCode; ++ bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent ); ++ } ++ } ++ if( bSendRelease && ! aDel.isDeleted() ) ++ { ++ CallCallback( SALEVENT_KEYUP, &aEvent ); ++ } ++ } ++ else ++ CallCallback( SALEVENT_KEYUP, &aEvent ); ++} ++ ++GtkSalFrame::GraphicsHolder::~GraphicsHolder() ++{ ++ delete pGraphics; ++} ++ ++GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle ) ++ : m_nXScreen( getDisplay()->GetDefaultXScreen() ) ++{ ++ getDisplay()->registerFrame( this ); ++ m_bDefaultPos = true; ++ m_bDefaultSize = ( (nStyle & SAL_FRAME_STYLE_SIZEABLE) && ! pParent ); ++ m_bWindowIsGtkPlug = false; ++#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) ++ m_pLastSyncedDbusMenu = NULL; ++#endif ++ Init( pParent, nStyle ); ++} ++ ++GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) ++ : m_nXScreen( getDisplay()->GetDefaultXScreen() ) ++{ ++ getDisplay()->registerFrame( this ); ++ // permanently ignore errors from our unruly children ... ++ GetGenericData()->ErrorTrapPush(); ++ m_bDefaultPos = true; ++ m_bDefaultSize = true; ++#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) ++ m_pLastSyncedDbusMenu = NULL; ++#endif ++ Init( pSysData ); ++} ++ ++#ifdef ENABLE_GMENU_INTEGRATION ++ ++static void ++gdk_x11_window_set_utf8_property (GdkWindow *window, ++ const gchar *name, ++ const gchar *value) ++{ ++} ++ ++// AppMenu watch functions. ++ ++static void ObjectDestroyedNotify( gpointer data ) ++{ ++ if ( data ) { ++ g_object_unref( data ); ++ } ++} ++ ++#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) ++void GtkSalFrame::EnsureDbusMenuSynced() ++{ ++ GtkSalMenu* pSalMenu = static_cast(GetMenu()); ++ if(m_pLastSyncedDbusMenu != pSalMenu) { ++ m_pLastSyncedDbusMenu = pSalMenu; ++ static_cast(pSalMenu)->Activate(); ++ } ++} ++#endif ++ ++static void hud_activated( gboolean hud_active, gpointer user_data ) ++{ ++ if ( hud_active ) ++ { ++ SolarMutexGuard aGuard; ++ GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); ++ GtkSalMenu* pSalMenu = reinterpret_cast< GtkSalMenu* >( pSalFrame->GetMenu() ); ++ ++ if ( pSalMenu ) ++ pSalMenu->UpdateFull(); ++ } ++} ++ ++static void activate_uno(GSimpleAction *action, GVariant*, gpointer) ++{ ++ uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); ++ ++ uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext ); ++ ++ uno::Reference < css::frame::XFrame > xFrame(xDesktop->getActiveFrame()); ++ if (!xFrame.is()) ++ xFrame = uno::Reference < css::frame::XFrame >(xDesktop, uno::UNO_QUERY); ++ ++ if (!xFrame.is()) ++ return; ++ ++ uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, uno::UNO_QUERY); ++ if (!xDispatchProvider.is()) ++ return; ++ ++ gchar *strval = NULL; ++ g_object_get(action, "name", &strval, NULL); ++ if (!strval) ++ return; ++ ++ if (strcmp(strval, "New") == 0) ++ { ++ uno::Reference xModuleManager(frame::ModuleManager::create(xContext)); ++ OUString aModuleId(xModuleManager->identify(xFrame)); ++ if (aModuleId.isEmpty()) ++ return; ++ ++ comphelper::SequenceAsHashMap lModuleDescription(xModuleManager->getByName(aModuleId)); ++ OUString sFactoryService; ++ lModuleDescription[OUString("ooSetupFactoryEmptyDocumentURL")] >>= sFactoryService; ++ if (sFactoryService.isEmpty()) ++ return; ++ ++ uno::Sequence < css::beans::PropertyValue > args(0); ++ xDesktop->loadComponentFromURL(sFactoryService, OUString("_blank"), 0, args); ++ return; ++ } ++ ++ OUString sCommand(".uno:"); ++ sCommand += OUString(strval, strlen(strval), RTL_TEXTENCODING_UTF8); ++ g_free(strval); ++ ++ css::util::URL aCommand; ++ aCommand.Complete = sCommand; ++ uno::Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(xContext); ++ xParser->parseStrict(aCommand); ++ ++ uno::Reference< css::frame::XDispatch > xDisp = xDispatchProvider->queryDispatch(aCommand, OUString(), 0); ++ ++ if (!xDisp.is()) ++ return; ++ ++ xDisp->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >()); ++} ++ ++static const GActionEntry app_entries[] = { ++ { "OptionsTreeDialog", activate_uno, NULL, NULL, NULL, {0} }, ++ { "About", activate_uno, NULL, NULL, NULL, {0} }, ++ { "HelpIndex", activate_uno, NULL, NULL, NULL, {0} }, ++ { "Quit", activate_uno, NULL, NULL, NULL, {0} }, ++ { "New", activate_uno, NULL, NULL, NULL, {0} } ++}; ++ ++gboolean ensure_dbus_setup( gpointer data ) ++{ ++ GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( data ); ++ GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() ); ++ ++ if ( gdkWindow != NULL && g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-menubar" ) == NULL ) ++ { ++ // Get a DBus session connection. ++ if(!pSessionBus) ++ pSessionBus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); ++ if( !pSessionBus ) ++ return FALSE; ++ ++ // Create menu model and action group attached to this frame. ++ GMenuModel* pMenuModel = G_MENU_MODEL( g_lo_menu_new() ); ++ GActionGroup* pActionGroup = reinterpret_cast(g_lo_action_group_new( static_cast< gpointer >( pSalFrame ) )); ++ ++ // Generate menu paths. ++ ::Window windowId = GDK_WINDOW_XID( gdkWindow ); ++ gchar* aDBusWindowPath = g_strdup_printf( "/org/libreoffice/window/%lu", windowId ); ++ gchar* aDBusMenubarPath = g_strdup_printf( "/org/libreoffice/window/%lu/menus/menubar", windowId ); ++ ++ // Set window properties. ++ g_object_set_data_full( G_OBJECT( gdkWindow ), "g-lo-menubar", pMenuModel, ObjectDestroyedNotify ); ++ g_object_set_data_full( G_OBJECT( gdkWindow ), "g-lo-action-group", pActionGroup, ObjectDestroyedNotify ); ++ ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_ID", "org.libreoffice" ); ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_UNIQUE_BUS_NAME", g_dbus_connection_get_unique_name( pSessionBus ) ); ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_OBJECT_PATH", "/org/libreoffice" ); ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_WINDOW_OBJECT_PATH", aDBusWindowPath ); ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_MENUBAR_OBJECT_PATH", aDBusMenubarPath ); ++ ++ // Publish the menu model and the action group. ++ SAL_INFO("vcl.unity", "exporting menu model at " << pMenuModel << " for window " << windowId); ++ pSalFrame->m_nMenuExportId = g_dbus_connection_export_menu_model (pSessionBus, aDBusMenubarPath, pMenuModel, NULL); ++ SAL_INFO("vcl.unity", "exporting action group at " << pActionGroup << " for window " << windowId); ++ pSalFrame->m_nActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, aDBusWindowPath, pActionGroup, NULL); ++ pSalFrame->m_nHudAwarenessId = hud_awareness_register( pSessionBus, aDBusMenubarPath, hud_activated, pSalFrame, NULL, NULL ); ++ ++ // fdo#70885 we don't want app menu under Unity ++ bool bDesktopIsUnity = (SalGetDesktopEnvironment() == "UNITY"); ++ ++ if (!bDesktopIsUnity) ++ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APP_MENU_OBJECT_PATH", "/org/libreoffice/menus/appmenu" ); ++ ++ //app menu, to-do translations, block normal menus when active, honor use appmenu settings ++ ResMgr* pMgr = ImplGetResMgr(); ++ if( pMgr && !bDesktopIsUnity ) ++ { ++ GMenu *menu = g_menu_new (); ++ GMenuItem* item; ++ ++ GMenu *firstsubmenu = g_menu_new (); ++ ++ OString sNew(OUStringToOString(ResId(SV_BUTTONTEXT_NEW, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sNew.getStr(), "app.New"); ++ g_menu_append_item( firstsubmenu, item ); ++ g_object_unref(item); ++ ++ g_menu_append_section( menu, NULL, G_MENU_MODEL(firstsubmenu)); ++ g_object_unref(firstsubmenu); ++ ++ GMenu *secondsubmenu = g_menu_new (); ++ ++ OString sPreferences(OUStringToOString(ResId(SV_STDTEXT_PREFERENCES, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sPreferences.getStr(), "app.OptionsTreeDialog"); ++ g_menu_append_item( secondsubmenu, item ); ++ g_object_unref(item); ++ ++ g_menu_append_section( menu, NULL, G_MENU_MODEL(secondsubmenu)); ++ g_object_unref(secondsubmenu); ++ ++ GMenu *thirdsubmenu = g_menu_new (); ++ ++ OString sHelp(OUStringToOString(ResId(SV_BUTTONTEXT_HELP, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sHelp.getStr(), "app.HelpIndex"); ++ g_menu_append_item( thirdsubmenu, item ); ++ g_object_unref(item); ++ ++ OString sAbout(OUStringToOString(ResId(SV_STDTEXT_ABOUT, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sAbout.getStr(), "app.About"); ++ g_menu_append_item( thirdsubmenu, item ); ++ g_object_unref(item); ++ ++ OString sQuit(OUStringToOString(ResId(SV_MENU_MAC_QUITAPP, *pMgr).toString(), ++ RTL_TEXTENCODING_UTF8).replaceFirst("~", "_")); ++ ++ item = g_menu_item_new(sQuit.getStr(), "app.Quit"); ++ g_menu_append_item( thirdsubmenu, item ); ++ g_object_unref(item); ++ g_menu_append_section( menu, NULL, G_MENU_MODEL(thirdsubmenu)); ++ g_object_unref(thirdsubmenu); ++ ++ GSimpleActionGroup *group = g_simple_action_group_new (); ++#if GLIB_CHECK_VERSION(2,38,0) // g_simple_action_group_add_entries is deprecated since 2.38 ++ g_action_map_add_action_entries (G_ACTION_MAP (group), app_entries, G_N_ELEMENTS (app_entries), NULL); ++#else ++ g_simple_action_group_add_entries (group, app_entries, G_N_ELEMENTS (app_entries), NULL); ++#endif ++ GActionGroup* pAppActionGroup = G_ACTION_GROUP(group); ++ ++ pSalFrame->m_nAppActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, "/org/libreoffice", pAppActionGroup, NULL); ++ g_object_unref(pAppActionGroup); ++ pSalFrame->m_nAppMenuExportId = g_dbus_connection_export_menu_model (pSessionBus, "/org/libreoffice/menus/appmenu", G_MENU_MODEL (menu), NULL); ++ g_object_unref(menu); ++ } ++ ++ g_free( aDBusMenubarPath ); ++ g_free( aDBusWindowPath ); ++ } ++ ++ return FALSE; ++} ++ ++void on_registrar_available( GDBusConnection * /*connection*/, ++ const gchar * /*name*/, ++ const gchar * /*name_owner*/, ++ gpointer user_data ) ++{ ++ SolarMutexGuard aGuard; ++ ++ GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); ++ ++ SalMenu* pSalMenu = pSalFrame->GetMenu(); ++ ++ if ( pSalMenu != NULL ) ++ { ++ GtkSalMenu* pGtkSalMenu = static_cast(pSalMenu); ++ pGtkSalMenu->Display( true ); ++ pGtkSalMenu->UpdateFull(); ++ } ++} ++ ++// This is called when the registrar becomes unavailable. It shows the menubar. ++void on_registrar_unavailable( GDBusConnection * /*connection*/, ++ const gchar * /*name*/, ++ gpointer user_data ) ++{ ++ SolarMutexGuard aGuard; ++ ++ SAL_INFO("vcl.unity", "on_registrar_unavailable"); ++ ++ //pSessionBus = NULL; ++ GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( user_data ); ++ ++ SalMenu* pSalMenu = pSalFrame->GetMenu(); ++ ++ if ( pSalMenu ) { ++ GtkSalMenu* pGtkSalMenu = static_cast< GtkSalMenu* >( pSalMenu ); ++ pGtkSalMenu->Display( false ); ++ } ++} ++#endif ++ ++void GtkSalFrame::EnsureAppMenuWatch() ++{ ++#ifdef ENABLE_GMENU_INTEGRATION ++ if ( !m_nWatcherId ) ++ { ++ // Get a DBus session connection. ++ if ( pSessionBus == NULL ) ++ { ++ pSessionBus = g_bus_get_sync( G_BUS_TYPE_SESSION, NULL, NULL ); ++ ++ if ( pSessionBus == NULL ) ++ return; ++ } ++ ++ // Publish the menu only if AppMenu registrar is available. ++ m_nWatcherId = g_bus_watch_name_on_connection( pSessionBus, ++ "com.canonical.AppMenu.Registrar", ++ G_BUS_NAME_WATCHER_FLAGS_NONE, ++ on_registrar_available, ++ on_registrar_unavailable, ++ static_cast(this), ++ NULL ); ++ } ++ ++ //ensure_dbus_setup( this ); ++#else ++ (void) this; // loplugin:staticmethods ++#endif ++} ++ ++void GtkSalFrame::InvalidateGraphics() ++{ ++ for (unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); ++i) ++ { ++ if( !m_aGraphics[i].pGraphics ) ++ continue; ++ m_aGraphics[i].bInUse = false; ++ } ++} ++ ++GtkSalFrame::~GtkSalFrame() ++{ ++ InvalidateGraphics(); ++ ++ if( m_pParent ) ++ m_pParent->m_aChildren.remove( this ); ++ ++ getDisplay()->deregisterFrame( this ); ++ ++ if( m_pRegion ) ++ { ++ cairo_region_destroy( m_pRegion ); ++ } ++ ++ delete m_pIMHandler; ++ ++ GtkWidget *pEventWidget = getMouseEventWidget(); ++ for (auto handler_id : m_aMouseSignalIds) ++ g_signal_handler_disconnect(G_OBJECT(pEventWidget), handler_id); ++ if( m_pFixedContainer ) ++ gtk_widget_destroy( GTK_WIDGET( m_pFixedContainer ) ); ++ if( m_pEventBox ) ++ gtk_widget_destroy( GTK_WIDGET(m_pEventBox) ); ++ { ++ SolarMutexGuard aGuard; ++#if defined ENABLE_GMENU_INTEGRATION ++ if(m_nWatcherId) ++ g_bus_unwatch_name(m_nWatcherId); ++#endif ++ if( m_pWindow ) ++ { ++ g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", NULL ); ++ ++#if defined ENABLE_GMENU_INTEGRATION ++ if ( pSessionBus ) ++ { ++ if ( m_nHudAwarenessId ) ++ hud_awareness_unregister( pSessionBus, m_nHudAwarenessId ); ++ if ( m_nMenuExportId ) ++ g_dbus_connection_unexport_menu_model( pSessionBus, m_nMenuExportId ); ++ if ( m_nAppMenuExportId ) ++ g_dbus_connection_unexport_menu_model( pSessionBus, m_nAppMenuExportId ); ++ if ( m_nActionGroupExportId ) ++ g_dbus_connection_unexport_action_group( pSessionBus, m_nActionGroupExportId ); ++ if ( m_nAppActionGroupExportId ) ++ g_dbus_connection_unexport_action_group( pSessionBus, m_nAppActionGroupExportId ); ++ } ++#endif ++ gtk_widget_destroy( m_pWindow ); ++ } ++ } ++ if( m_pForeignParent ) ++ g_object_unref( G_OBJECT( m_pForeignParent ) ); ++ if( m_pForeignTopLevel ) ++ g_object_unref( G_OBJECT( m_pForeignTopLevel) ); ++} ++ ++void GtkSalFrame::moveWindow( long nX, long nY ) ++{ ++ if( isChild( false, true ) ) ++ { ++ if( m_pParent ) ++ gtk_fixed_move( m_pParent->getFixedContainer(), ++ m_pWindow, ++ nX - m_pParent->maGeometry.nX, nY - m_pParent->maGeometry.nY ); ++ } ++ else ++ gtk_window_move( GTK_WINDOW(m_pWindow), nX, nY ); ++} ++ ++void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) ++{ ++ gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight ); ++} ++ ++void GtkSalFrame::window_resize(long nWidth, long nHeight) ++{ ++ gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight); ++} ++ ++void GtkSalFrame::resizeWindow( long nWidth, long nHeight ) ++{ ++ if( isChild( false, true ) ) ++ { ++ widget_set_size_request(nWidth, nHeight); ++ } ++ else if( ! isChild( true, false ) ) ++ window_resize(nWidth, nHeight); ++} ++ ++static void ++ooo_fixed_class_init(GtkFixedClass *klass) ++{ ++ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); ++ widget_class->get_accessible = ooo_fixed_get_accessible; ++} ++ ++/* ++ * Always use a sub-class of GtkFixed we can tag for a11y. This allows us to ++ * utilize GAIL for the toplevel window and toolkit implementation incl. ++ * key event listener support .. ++ */ ++ ++GType ++ooo_fixed_get_type() ++{ ++ static GType type = 0; ++ ++ if (!type) { ++ static const GTypeInfo tinfo = ++ { ++ sizeof (GtkFixedClass), ++ nullptr, /* base init */ ++ nullptr, /* base finalize */ ++ reinterpret_cast(ooo_fixed_class_init), /* class init */ ++ nullptr, /* class finalize */ ++ NULL, /* class data */ ++ sizeof (GtkFixed), /* instance size */ ++ 0, /* nb preallocs */ ++ (GInstanceInitFunc) NULL, /* instance init */ ++ NULL /* value table */ ++ }; ++ ++ type = g_type_register_static( GTK_TYPE_FIXED, "OOoFixed", ++ &tinfo, (GTypeFlags) 0); ++ } ++ ++ return type; ++} ++ ++void GtkSalFrame::updateScreenNumber() ++{ ++ int nScreen = 0; ++ GdkScreen *pScreen = gtk_widget_get_screen( m_pWindow ); ++ if( pScreen ) ++ nScreen = getDisplay()->getSystem()->getScreenMonitorIdx( pScreen, maGeometry.nX, maGeometry.nY ); ++ maGeometry.nDisplayScreenNumber = nScreen; ++} ++ ++GtkWidget *GtkSalFrame::getMouseEventWidget() const ++{ ++ return GTK_WIDGET(m_pEventBox); ++} ++ ++void GtkSalFrame::InitCommon() ++{ ++ m_pEventBox = GTK_EVENT_BOX(gtk_event_box_new()); ++ gtk_widget_add_events( GTK_WIDGET(m_pEventBox), ++ GDK_ALL_EVENTS_MASK ); ++ gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pEventBox) ); ++ ++ // add the fixed container child, ++ // fixed is needed since we have to position plugin windows ++ m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL )); ++ gtk_container_add( GTK_CONTAINER(m_pEventBox), GTK_WIDGET(m_pFixedContainer) ); ++ ++ GtkWidget *pEventWidget = getMouseEventWidget(); ++ ++ gtk_widget_set_app_paintable(GTK_WIDGET(m_pFixedContainer), true); ++ /*non-X11 displays won't show anything at all without double-buffering ++ enabled*/ ++ if (GDK_IS_X11_DISPLAY(getGdkDisplay())) ++ gtk_widget_set_double_buffered(GTK_WIDGET(m_pFixedContainer), false); ++ gtk_widget_set_redraw_on_allocate(GTK_WIDGET(m_pFixedContainer), false); ++ ++ ++ // connect signals ++ g_signal_connect( G_OBJECT(m_pWindow), "style-set", G_CALLBACK(signalStyleSet), this ); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-press-event", G_CALLBACK(signalButton), this )); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "motion-notify-event", G_CALLBACK(signalMotion), this )); ++ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-release-event", G_CALLBACK(signalButton), this )); ++ g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this ); ++ g_signal_connect( G_OBJECT(m_pFixedContainer), "size-allocate", G_CALLBACK(sizeAllocated), this ); ++ GtkGesture *pSwipe = gtk_gesture_swipe_new(pEventWidget); ++ g_signal_connect(pSwipe, "swipe", G_CALLBACK(gestureSwipe), this); ++ gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER (pSwipe), GTK_PHASE_TARGET); ++ g_object_weak_ref(G_OBJECT(pEventWidget), reinterpret_cast(g_object_unref), pSwipe); ++ ++ GtkGesture *pLongPress = gtk_gesture_long_press_new(pEventWidget); ++ g_signal_connect(pLongPress, "pressed", G_CALLBACK(gestureLongPress), this); ++ gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER (pLongPress), GTK_PHASE_TARGET); ++ g_object_weak_ref(G_OBJECT(pEventWidget), reinterpret_cast(g_object_unref), pLongPress); ++ ++ g_signal_connect( G_OBJECT(m_pWindow), "focus-in-event", G_CALLBACK(signalFocus), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "focus-out-event", G_CALLBACK(signalFocus), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "map-event", G_CALLBACK(signalMap), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "unmap-event", G_CALLBACK(signalUnmap), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "configure-event", G_CALLBACK(signalConfigure), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "key-press-event", G_CALLBACK(signalKey), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "key-release-event", G_CALLBACK(signalKey), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "delete-event", G_CALLBACK(signalDelete), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "window-state-event", G_CALLBACK(signalWindowState), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "scroll-event", G_CALLBACK(signalScroll), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "leave-notify-event", G_CALLBACK(signalCrossing), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "enter-notify-event", G_CALLBACK(signalCrossing), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "visibility-notify-event", G_CALLBACK(signalVisibility), this ); ++ g_signal_connect( G_OBJECT(m_pWindow), "destroy", G_CALLBACK(signalDestroy), this ); ++ ++ // init members ++ m_pCurrentCursor = NULL; ++ m_nKeyModifiers = 0; ++ m_bFullscreen = false; ++ m_bSpanMonitorsWhenFullscreen = false; ++ m_nState = GDK_WINDOW_STATE_WITHDRAWN; ++ m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED; ++ m_nLastScrollEventTime = GDK_CURRENT_TIME; ++ m_bSendModChangeOnRelease = false; ++ m_pIMHandler = NULL; ++ m_hBackgroundPixmap = None; ++ m_nSavedScreenSaverTimeout = 0; ++ m_nGSMCookie = 0; ++ m_nExtStyle = 0; ++ m_pRegion = NULL; ++ m_ePointerStyle = static_cast(0xffff); ++ m_bSetFocusOnMap = false; ++ m_pSalMenu = NULL; ++ m_nWatcherId = 0; ++ m_nMenuExportId = 0; ++ m_nAppMenuExportId = 0; ++ m_nActionGroupExportId = 0; ++ m_nAppActionGroupExportId = 0; ++ m_nHudAwarenessId = 0; ++ ++ gtk_widget_add_events( m_pWindow, ++ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | ++ GDK_VISIBILITY_NOTIFY_MASK | GDK_SCROLL_MASK ++ ); ++ ++ // show the widgets ++ gtk_widget_show_all( GTK_WIDGET(m_pEventBox) ); ++ ++ // realize the window, we need an XWindow id ++ gtk_widget_realize( m_pWindow ); ++ ++ //system data ++ m_aSystemData.nSize = sizeof( SystemEnvData ); ++ static int nWindow = 0; ++ m_aSystemData.aWindow = nWindow; ++ m_aSystemData.aShellWindow = nWindow; ++ ++nWindow; ++ m_aSystemData.pSalFrame = this; ++ m_aSystemData.pWidget = m_pWindow; ++ m_aSystemData.nScreen = m_nXScreen.getXScreen(); ++ m_aSystemData.pAppContext = NULL; ++ m_aSystemData.pShellWidget = m_aSystemData.pWidget; ++ ++ // fake an initial geometry, gets updated via configure event or SetPosSize ++ if( m_bDefaultPos || m_bDefaultSize ) ++ { ++ Size aDefSize = calcDefaultSize(); ++ maGeometry.nX = -1; ++ maGeometry.nY = -1; ++ maGeometry.nWidth = aDefSize.Width(); ++ maGeometry.nHeight = aDefSize.Height(); ++ if( m_pParent ) ++ { ++ // approximation ++ maGeometry.nTopDecoration = m_pParent->maGeometry.nTopDecoration; ++ maGeometry.nBottomDecoration = m_pParent->maGeometry.nBottomDecoration; ++ maGeometry.nLeftDecoration = m_pParent->maGeometry.nLeftDecoration; ++ maGeometry.nRightDecoration = m_pParent->maGeometry.nRightDecoration; ++ } ++ else ++ { ++ maGeometry.nTopDecoration = 0; ++ maGeometry.nBottomDecoration = 0; ++ maGeometry.nLeftDecoration = 0; ++ maGeometry.nRightDecoration = 0; ++ } ++ } ++ updateScreenNumber(); ++ ++ SetIcon(1); ++ ++} ++ ++GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow ) ++{ ++ return static_cast(g_object_get_data( G_OBJECT( pWindow ), "SalFrame" )); ++} ++ ++void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) ++{ ++ if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style ++ { ++ nStyle |= SAL_FRAME_STYLE_MOVEABLE | SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_CLOSEABLE; ++ nStyle &= ~SAL_FRAME_STYLE_FLOAT; ++ } ++ ++ m_pParent = static_cast(pParent); ++ m_pForeignParent = NULL; ++ m_aForeignParentWindow = None; ++ m_pForeignTopLevel = NULL; ++ m_aForeignTopLevelWindow = None; ++ m_nStyle = nStyle; ++ ++ GtkWindowType eWinType = ( (nStyle & SAL_FRAME_STYLE_FLOAT) && ++ ! (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION| ++ SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) ++ ) ++ ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL; ++ ++ if( nStyle & SAL_FRAME_STYLE_SYSTEMCHILD ) ++ { ++ m_pWindow = gtk_event_box_new(); ++ if( m_pParent ) ++ { ++ // insert into container ++ gtk_fixed_put( m_pParent->getFixedContainer(), ++ m_pWindow, 0, 0 ); ++ ++ } ++ } ++ else ++ { ++ m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType, ++ "visible", FALSE, NULL ); ++ } ++ g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this ); ++ g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", (gpointer)LIBO_VERSION_DOTTED); ++ ++ // force wm class hint ++ m_nExtStyle = ~0; ++ if (m_pParent) ++ m_sWMClass = m_pParent->m_sWMClass; ++ SetExtendedFrameStyle( 0 ); ++ ++ if( m_pParent && m_pParent->m_pWindow && ! isChild() ) ++ gtk_window_set_screen( GTK_WINDOW(m_pWindow), gtk_window_get_screen( GTK_WINDOW(m_pParent->m_pWindow) ) ); ++ ++ if (m_pParent) ++ { ++ if (!(m_pParent->m_nStyle & SAL_FRAME_STYLE_PLUG)) ++ gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) ); ++ m_pParent->m_aChildren.push_back( this ); ++ } ++ ++ InitCommon(); ++ ++ // set window type ++ bool bDecoHandling = ++ ! isChild() && ++ ( ! (nStyle & SAL_FRAME_STYLE_FLOAT) || ++ (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) ); ++ ++ if( bDecoHandling ) ++ { ++ GdkWindowTypeHint eType = GDK_WINDOW_TYPE_HINT_NORMAL; ++ if( (nStyle & SAL_FRAME_STYLE_DIALOG) && m_pParent != 0 ) ++ eType = GDK_WINDOW_TYPE_HINT_DIALOG; ++ if( (nStyle & SAL_FRAME_STYLE_INTRO) ) ++ { ++ gtk_window_set_role( GTK_WINDOW(m_pWindow), "splashscreen" ); ++ eType = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN; ++ } ++ else if( (nStyle & SAL_FRAME_STYLE_TOOLWINDOW ) ) ++ { ++ eType = GDK_WINDOW_TYPE_HINT_UTILITY; ++ gtk_window_set_skip_taskbar_hint( GTK_WINDOW(m_pWindow), true ); ++ } ++ else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) ++ { ++ eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; ++ gtk_window_set_accept_focus(GTK_WINDOW(m_pWindow), false); ++ } ++ else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) ++ { ++ eType = GDK_WINDOW_TYPE_HINT_UTILITY; ++ } ++ gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType ); ++ gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC ); ++ } ++ else if( (nStyle & SAL_FRAME_STYLE_FLOAT) ) ++ { ++ gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_POPUP_MENU ); ++ } ++ ++ if( bDecoHandling ) ++ { ++ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) != 0 ); ++ if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) ) ++ gtk_window_set_accept_focus(GTK_WINDOW(m_pWindow), false); ++ } ++} ++ ++GdkNativeWindow GtkSalFrame::findTopLevelSystemWindow( GdkNativeWindow aWindow ) ++{ ++ (void)aWindow; ++ //FIXME: no findToplevelSystemWindow ++ return 0; ++} ++ ++void GtkSalFrame::Init( SystemParentData* pSysData ) ++{ ++ m_pParent = NULL; ++ m_aForeignParentWindow = (GdkNativeWindow)pSysData->aWindow; ++ m_pForeignParent = NULL; ++ m_aForeignTopLevelWindow = findTopLevelSystemWindow( (GdkNativeWindow)pSysData->aWindow ); ++ m_pForeignTopLevel = gdk_window_foreign_new_for_display( getGdkDisplay(), m_aForeignTopLevelWindow ); ++ gdk_window_set_events( m_pForeignTopLevel, GDK_STRUCTURE_MASK ); ++ ++ if( pSysData->nSize > sizeof(pSysData->nSize)+sizeof(pSysData->aWindow) && pSysData->bXEmbedSupport ) ++ { ++ m_pWindow = gtk_plug_new_for_display( getGdkDisplay(), pSysData->aWindow ); ++ m_bWindowIsGtkPlug = true; ++ widget_set_can_default( m_pWindow, true ); ++ widget_set_can_focus( m_pWindow, true ); ++ gtk_widget_set_sensitive( m_pWindow, true ); ++ } ++ else ++ { ++ m_pWindow = gtk_window_new( GTK_WINDOW_POPUP ); ++ m_bWindowIsGtkPlug = false; ++ } ++ m_nStyle = SAL_FRAME_STYLE_PLUG; ++ InitCommon(); ++ ++ m_pForeignParent = gdk_window_foreign_new_for_display( getGdkDisplay(), m_aForeignParentWindow ); ++ gdk_window_set_events( m_pForeignParent, GDK_STRUCTURE_MASK ); ++ ++ //FIXME: Handling embedded windows, is going to be fun ... ++} ++ ++void GtkSalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode ) ++{ ++ (void) this; // loplugin:staticmethods ++ (void)i_nTimeCode; ++ //FIXME: no askForXEmbedFocus for gtk3 yet ++} ++ ++void GtkSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle ) ++{ ++ if( nStyle != m_nExtStyle && ! isChild() ) ++ { ++ m_nExtStyle = nStyle; ++ updateWMClass(); ++ } ++} ++ ++SalGraphics* GtkSalFrame::AcquireGraphics() ++{ ++ if( m_pWindow ) ++ { ++ for( int i = 0; i < nMaxGraphics; i++ ) ++ { ++ if( ! m_aGraphics[i].bInUse ) ++ { ++ m_aGraphics[i].bInUse = true; ++ if( ! m_aGraphics[i].pGraphics ) ++ { ++ m_aGraphics[i].pGraphics = new GtkSalGraphics( this, m_pWindow ); ++ if( !m_aFrame.get() ) ++ { ++ AllocateFrame(); ++ TriggerPaintEvent(); ++ } ++ m_aGraphics[i].pGraphics->setDevice( m_aFrame ); ++ } ++ return m_aGraphics[i].pGraphics; ++ } ++ } ++ } ++ ++ return NULL; ++} ++ ++void GtkSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) ++{ ++ for( int i = 0; i < nMaxGraphics; i++ ) ++ { ++ if( m_aGraphics[i].pGraphics == pGraphics ) ++ { ++ m_aGraphics[i].bInUse = false; ++ break; ++ } ++ } ++} ++ ++bool GtkSalFrame::PostEvent( void* pData ) ++{ ++ getDisplay()->SendInternalEvent( this, pData ); ++ return true; ++} ++ ++void GtkSalFrame::SetTitle( const OUString& rTitle ) ++{ ++ m_aTitle = rTitle; ++ if( m_pWindow && ! isChild() ) ++ gtk_window_set_title( GTK_WINDOW(m_pWindow), OUStringToOString( rTitle, RTL_TEXTENCODING_UTF8 ).getStr() ); ++} ++ ++static inline sal_uInt8 * ++getRow( BitmapBuffer *pBuffer, sal_uLong nRow ) ++{ ++ if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) ++ return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize; ++ else ++ return pBuffer->mpBits + ( pBuffer->mnHeight - nRow - 1 ) * pBuffer->mnScanlineSize; ++} ++ ++static GdkPixbuf * ++bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha ) ++{ ++ g_return_val_if_fail( pSalBitmap != NULL, NULL ); ++ g_return_val_if_fail( pSalAlpha != NULL, NULL ); ++ ++ BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( BITMAP_READ_ACCESS ); ++ g_return_val_if_fail( pBitmap != NULL, NULL ); ++ g_return_val_if_fail( pBitmap->mnBitCount == 24 || pBitmap->mnBitCount == 32, NULL ); ++ ++ BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( BITMAP_READ_ACCESS ); ++ g_return_val_if_fail( pAlpha != NULL, NULL ); ++ g_return_val_if_fail( pAlpha->mnBitCount == 8, NULL ); ++ ++ Size aSize = pSalBitmap->GetSize(); ++ g_return_val_if_fail( pSalAlpha->GetSize() == aSize, NULL ); ++ ++ int nX, nY; ++ guchar *pPixbufData = static_cast(g_malloc (4 * aSize.Width() * aSize.Height() )); ++ guchar *pDestData = pPixbufData; ++ ++ for( nY = 0; nY < pBitmap->mnHeight; nY++ ) ++ { ++ sal_uInt8 *pData = getRow( pBitmap, nY ); ++ sal_uInt8 *pAlphaData = getRow( pAlpha, nY ); ++ ++ for( nX = 0; nX < pBitmap->mnWidth; nX++ ) ++ { ++ BitmapColor aColor; ++ if (pBitmap->mnFormat == BMP_FORMAT_24BIT_TC_BGR) ++ { ++ aColor = BitmapColor(pData[2], pData[1], pData[0]); ++ pData += 3; ++ } ++ else if (pBitmap->mnFormat == BMP_FORMAT_24BIT_TC_RGB) ++ { ++ aColor = BitmapColor(pData[0], pData[1], pData[2]); ++ pData += 3; ++ } ++ else ++ { ++ pBitmap->maColorMask.GetColorFor32Bit(aColor, pData); ++ pData += 4; ++ } ++ *pDestData++ = aColor.GetRed(); ++ *pDestData++ = aColor.GetGreen(); ++ *pDestData++ = aColor.GetBlue(); ++ *pDestData++ = 255 - *pAlphaData++; ++ } ++ } ++ ++ pSalBitmap->ReleaseBuffer( pBitmap, BITMAP_READ_ACCESS ); ++ pSalAlpha->ReleaseBuffer( pAlpha, BITMAP_READ_ACCESS ); ++ ++ return gdk_pixbuf_new_from_data( pPixbufData, ++ GDK_COLORSPACE_RGB, true, 8, ++ aSize.Width(), aSize.Height(), ++ aSize.Width() * 4, ++ reinterpret_cast(g_free), ++ NULL ); ++} ++ ++void GtkSalFrame::SetIcon( sal_uInt16 nIcon ) ++{ ++ if( (m_nStyle & (SAL_FRAME_STYLE_PLUG|SAL_FRAME_STYLE_SYSTEMCHILD|SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_INTRO|SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ++ || ! m_pWindow ) ++ return; ++ ++ if( !ImplGetResMgr() ) ++ return; ++ ++ GdkPixbuf *pBuf; ++ GList *pIcons = NULL; ++ ++ sal_uInt16 nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START }; ++ sal_uInt16 nIndex; ++ ++ for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(sal_uInt16); nIndex++ ) ++ { ++ // #i44723# workaround gcc temporary problem ++ ResId aResId( nOffsets[nIndex] + nIcon, *ImplGetResMgr() ); ++ BitmapEx aIcon( aResId ); ++ ++ // #i81083# convert to 24bit/8bit alpha bitmap ++ Bitmap aBmp = aIcon.GetBitmap(); ++ if( aBmp.GetBitCount() != 24 || ! aIcon.IsAlpha() ) ++ { ++ if( aBmp.GetBitCount() != 24 ) ++ aBmp.Convert( BMP_CONVERSION_24BIT ); ++ AlphaMask aMask; ++ if( ! aIcon.IsAlpha() ) ++ { ++ switch( aIcon.GetTransparentType() ) ++ { ++ case TRANSPARENT_NONE: ++ { ++ sal_uInt8 nTrans = 0; ++ aMask = AlphaMask( aBmp.GetSizePixel(), &nTrans ); ++ } ++ break; ++ case TRANSPARENT_COLOR: ++ aMask = AlphaMask( aBmp.CreateMask( aIcon.GetTransparentColor() ) ); ++ break; ++ case TRANSPARENT_BITMAP: ++ aMask = AlphaMask( aIcon.GetMask() ); ++ break; ++ default: ++ OSL_FAIL( "unhandled transparent type" ); ++ break; ++ } ++ } ++ else ++ aMask = aIcon.GetAlpha(); ++ aIcon = BitmapEx( aBmp, aMask ); ++ } ++ ++ ImpBitmap *pIconImpBitmap = aIcon.ImplGetBitmapImpBitmap(); ++ ImpBitmap *pIconImpMask = aIcon.ImplGetMaskImpBitmap(); ++ ++ if( pIconImpBitmap && pIconImpMask ) ++ { ++ SalBitmap *pIconBitmap = ++ pIconImpBitmap->ImplGetSalBitmap(); ++ SalBitmap *pIconMask = ++ pIconImpMask->ImplGetSalBitmap(); ++ ++ if( ( pBuf = bitmapToPixbuf( pIconBitmap, pIconMask ) ) ) ++ pIcons = g_list_prepend( pIcons, pBuf ); ++ } ++ } ++ ++ gtk_window_set_icon_list( GTK_WINDOW(m_pWindow), pIcons ); ++ ++ g_list_foreach( pIcons, reinterpret_cast(g_object_unref), NULL ); ++ g_list_free( pIcons ); ++} ++ ++void GtkSalFrame::SetMenu( SalMenu* pSalMenu ) ++{ ++// if(m_pSalMenu) ++// { ++// static_cast(m_pSalMenu)->DisconnectFrame(); ++// } ++ m_pSalMenu = pSalMenu; ++} ++ ++SalMenu* GtkSalFrame::GetMenu() ++{ ++ return m_pSalMenu; ++} ++ ++void GtkSalFrame::DrawMenuBar() ++{ ++} ++ ++void GtkSalFrame::Center() ++{ ++ if (m_pParent) ++ gtk_window_set_position(GTK_WINDOW(m_pWindow), GTK_WIN_POS_CENTER_ON_PARENT); ++ else ++ gtk_window_set_position(GTK_WINDOW(m_pWindow), GTK_WIN_POS_CENTER); ++} ++ ++Size GtkSalFrame::calcDefaultSize() ++{ ++ return bestmaxFrameSizeForScreenSize(getDisplay()->GetScreenSize(GetDisplayScreen())); ++} ++ ++void GtkSalFrame::SetDefaultSize() ++{ ++ Size aDefSize = calcDefaultSize(); ++ ++ SetPosSize( 0, 0, aDefSize.Width(), aDefSize.Height(), ++ SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); ++ ++ if( (m_nStyle & SAL_FRAME_STYLE_DEFAULT) && m_pWindow ) ++ gtk_window_maximize( GTK_WINDOW(m_pWindow) ); ++} ++ ++static void initClientId() ++{ ++ // No session management support for gtk3+ - this is now legacy. ++} ++ ++void GtkSalFrame::Show( bool bVisible, bool bNoActivate ) ++{ ++ if( m_pWindow ) ++ { ++ if( bVisible ) ++ { ++ initClientId(); ++ getDisplay()->startupNotificationCompleted(); ++ ++ if( m_bDefaultPos ) ++ Center(); ++ if( m_bDefaultSize ) ++ SetDefaultSize(); ++ setMinMaxSize(); ++ ++ if( isFloatGrabWindow() && ++ m_pParent && ++ m_nFloats == 0 && ++ ! getDisplay()->GetCaptureFrame() ) ++ { ++ /* #i63086# ++ * outsmart Metacity's "focus:mouse" mode ++ * which insists on taking the focus from the document ++ * to the new float. Grab focus to parent frame BEFORE ++ * showing the float (cannot grab it to the float ++ * before show). ++ */ ++ m_pParent->grabPointer( true, true ); ++ } ++ ++ if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) ) ++ m_bSetFocusOnMap = true; ++ ++ gtk_widget_show( m_pWindow ); ++ ++ if( isFloatGrabWindow() ) ++ { ++ m_nFloats++; ++ if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 ) ++ { ++ grabPointer(true, true); ++ GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this; ++ pKeyboardFrame->grabKeyboard(true); ++ } ++ // #i44068# reset parent's IM context ++ if( m_pParent ) ++ m_pParent->EndExtTextInput(0); ++ } ++ if( m_bWindowIsGtkPlug ) ++ askForXEmbedFocus( 0 ); ++ } ++ else ++ { ++ if( isFloatGrabWindow() ) ++ { ++ m_nFloats--; ++ if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0) ++ { ++ GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this; ++ pKeyboardFrame->grabKeyboard(false); ++ grabPointer(false); ++ } ++ } ++ gtk_widget_hide( m_pWindow ); ++ if( m_pIMHandler ) ++ m_pIMHandler->focusChanged( false ); ++ // flush here; there may be a very seldom race between ++ // the display connection used for clipboard and our connection ++ Flush(); ++ } ++ } ++} ++ ++void GtkSalFrame::setMinMaxSize() ++{ ++ /* #i34504# metacity (and possibly others) do not treat ++ * _NET_WM_STATE_FULLSCREEN and max_width/height independently; ++ * whether they should is undefined. So don't set the max size hint ++ * for a full screen window. ++ */ ++ if( m_pWindow && ! isChild() ) ++ { ++ GdkGeometry aGeo; ++ int aHints = 0; ++ if( m_nStyle & SAL_FRAME_STYLE_SIZEABLE ) ++ { ++ if( m_aMinSize.Width() && m_aMinSize.Height() && ! m_bFullscreen ) ++ { ++ aGeo.min_width = m_aMinSize.Width(); ++ aGeo.min_height = m_aMinSize.Height(); ++ aHints |= GDK_HINT_MIN_SIZE; ++ } ++ if( m_aMaxSize.Width() && m_aMaxSize.Height() && ! m_bFullscreen ) ++ { ++ aGeo.max_width = m_aMaxSize.Width(); ++ aGeo.max_height = m_aMaxSize.Height(); ++ aHints |= GDK_HINT_MAX_SIZE; ++ } ++ } ++ if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() ) ++ { ++ aGeo.max_width = m_aMaxSize.Width(); ++ aGeo.max_height = m_aMaxSize.Height(); ++ aHints |= GDK_HINT_MAX_SIZE; ++ } ++ if( aHints ) ++ { ++ gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow), ++ NULL, ++ &aGeo, ++ GdkWindowHints( aHints ) ); ++ } ++ } ++} ++ ++void GtkSalFrame::SetMaxClientSize( long nWidth, long nHeight ) ++{ ++ if( ! isChild() ) ++ { ++ m_aMaxSize = Size( nWidth, nHeight ); ++ setMinMaxSize(); ++ } ++} ++void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight ) ++{ ++ if( ! isChild() ) ++ { ++ m_aMinSize = Size( nWidth, nHeight ); ++ if( m_pWindow ) ++ { ++ widget_set_size_request(nWidth, nHeight ); ++ setMinMaxSize(); ++ } ++ } ++} ++ ++// FIXME: we should really be an SvpSalFrame sub-class, and ++// share their AllocateFrame ! ++void GtkSalFrame::AllocateFrame() ++{ ++ basegfx::B2IVector aFrameSize( maGeometry.nWidth, maGeometry.nHeight ); ++ if( ! m_aFrame.get() || m_aFrame->getSize() != aFrameSize ) ++ { ++ if( aFrameSize.getX() == 0 ) ++ aFrameSize.setX( 1 ); ++ if( aFrameSize.getY() == 0 ) ++ aFrameSize.setY( 1 ); ++ m_aFrame = basebmp::createBitmapDevice(aFrameSize, true, ++ basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX); ++ m_aFrame->setDamageTracker( ++ basebmp::IBitmapDeviceDamageTrackerSharedPtr(new DamageTracker(*this)) ); ++ SAL_INFO("vcl.gtk3", "allocated m_aFrame size of " << maGeometry.nWidth << " x " << maGeometry.nHeight); ++ ++#if OSL_DEBUG_LEVEL > 0 // set background to orange ++ m_aFrame->clear( basebmp::Color( 255, 127, 0 ) ); ++#endif ++ ++ // update device in existing graphics ++ for( unsigned int i = 0; i < SAL_N_ELEMENTS( m_aGraphics ); ++i ) ++ { ++ if( !m_aGraphics[i].pGraphics ) ++ continue; ++ m_aGraphics[i].pGraphics->setDevice( m_aFrame ); ++ } ++ } ++} ++ ++void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) ++{ ++ if( !m_pWindow || isChild( true, false ) ) ++ return; ++ ++ if( (nFlags & ( SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT )) && ++ (nWidth > 0 && nHeight > 0 ) // sometimes stupid things happen ++ ) ++ { ++ m_bDefaultSize = false; ++ ++ if( isChild( false, true ) ) ++ widget_set_size_request(nWidth, nHeight); ++ else if( ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) ) ++ window_resize(nWidth, nHeight); ++ ++ setMinMaxSize(); ++ } ++ else if( m_bDefaultSize ) ++ SetDefaultSize(); ++ ++ m_bDefaultSize = false; ++ ++ if( nFlags & ( SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y ) ) ++ { ++ if( m_pParent ) ++ { ++ if( AllSettings::GetLayoutRTL() ) ++ nX = m_pParent->maGeometry.nWidth-maGeometry.nWidth-1-nX; ++ nX += m_pParent->maGeometry.nX; ++ nY += m_pParent->maGeometry.nY; ++ } ++ ++ m_bDefaultPos = false; ++ ++ moveWindow(nX, nY); ++ ++ updateScreenNumber(); ++ } ++ else if( m_bDefaultPos ) ++ Center(); ++ ++ m_bDefaultPos = false; ++} ++ ++void GtkSalFrame::GetClientSize( long& rWidth, long& rHeight ) ++{ ++ if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) ) ++ { ++ rWidth = maGeometry.nWidth; ++ rHeight = maGeometry.nHeight; ++ } ++ else ++ rWidth = rHeight = 0; ++} ++ ++void GtkSalFrame::GetWorkArea( Rectangle& rRect ) ++{ ++ GdkScreen *pScreen = gtk_window_get_screen(GTK_WINDOW(m_pWindow)); ++ Rectangle aRetRect; ++ int max = gdk_screen_get_n_monitors (pScreen); ++ for (int i = 0; i < max; ++i) ++ { ++ GdkRectangle aRect; ++ gdk_screen_get_monitor_workarea(pScreen, i, &aRect); ++ Rectangle aMonitorRect(aRect.x, aRect.y, aRect.x+aRect.width, aRect.y+aRect.height); ++ aRetRect.Union(aMonitorRect); ++ } ++ rRect = aRetRect; ++} ++ ++SalFrame* GtkSalFrame::GetParent() const ++{ ++ return m_pParent; ++} ++ ++void GtkSalFrame::SetWindowState( const SalFrameState* pState ) ++{ ++ if( ! m_pWindow || ! pState || isChild( true, false ) ) ++ return; ++ ++ const sal_uLong nMaxGeometryMask = ++ WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | ++ WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT | ++ WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y | ++ WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; ++ ++ if( (pState->mnMask & WINDOWSTATE_MASK_STATE) && ++ ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) && ++ (pState->mnState & WINDOWSTATE_STATE_MAXIMIZED) && ++ (pState->mnMask & nMaxGeometryMask) == nMaxGeometryMask ) ++ { ++ resizeWindow( pState->mnWidth, pState->mnHeight ); ++ moveWindow( pState->mnX, pState->mnY ); ++ m_bDefaultPos = m_bDefaultSize = false; ++ ++ updateScreenNumber(); ++ ++ m_nState = GdkWindowState( m_nState | GDK_WINDOW_STATE_MAXIMIZED ); ++ m_aRestorePosSize = Rectangle( Point( pState->mnX, pState->mnY ), ++ Size( pState->mnWidth, pState->mnHeight ) ); ++ } ++ else if( pState->mnMask & (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | ++ WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ) ) ++ { ++ sal_uInt16 nPosSizeFlags = 0; ++ long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0); ++ long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0); ++ if( pState->mnMask & WINDOWSTATE_MASK_X ) ++ nPosSizeFlags |= SAL_FRAME_POSSIZE_X; ++ else ++ nX = maGeometry.nX - (m_pParent ? m_pParent->maGeometry.nX : 0); ++ if( pState->mnMask & WINDOWSTATE_MASK_Y ) ++ nPosSizeFlags |= SAL_FRAME_POSSIZE_Y; ++ else ++ nY = maGeometry.nY - (m_pParent ? m_pParent->maGeometry.nY : 0); ++ if( pState->mnMask & WINDOWSTATE_MASK_WIDTH ) ++ nPosSizeFlags |= SAL_FRAME_POSSIZE_WIDTH; ++ if( pState->mnMask & WINDOWSTATE_MASK_HEIGHT ) ++ nPosSizeFlags |= SAL_FRAME_POSSIZE_HEIGHT; ++ SetPosSize( nX, nY, pState->mnWidth, pState->mnHeight, nPosSizeFlags ); ++ } ++ if( pState->mnMask & WINDOWSTATE_MASK_STATE && ! isChild() ) ++ { ++ if( pState->mnState & WINDOWSTATE_STATE_MAXIMIZED ) ++ gtk_window_maximize( GTK_WINDOW(m_pWindow) ); ++ else ++ gtk_window_unmaximize( GTK_WINDOW(m_pWindow) ); ++ /* #i42379# there is no rollup state in GDK; and rolled up windows are ++ * (probably depending on the WM) reported as iconified. If we iconify a ++ * window here that was e.g. a dialog, then it will be unmapped but still ++ * not be displayed in the task list, so it's an iconified window that ++ * the user cannot get out of this state. So do not set the iconified state ++ * on windows with a parent (that is transient frames) since these tend ++ * to not be represented in an icon task list. ++ */ ++ if( (pState->mnState & WINDOWSTATE_STATE_MINIMIZED) ++ && ! m_pParent ) ++ gtk_window_iconify( GTK_WINDOW(m_pWindow) ); ++ else ++ gtk_window_deiconify( GTK_WINDOW(m_pWindow) ); ++ } ++ TriggerPaintEvent(); ++} ++ ++bool GtkSalFrame::GetWindowState( SalFrameState* pState ) ++{ ++ pState->mnState = WINDOWSTATE_STATE_NORMAL; ++ pState->mnMask = WINDOWSTATE_MASK_STATE; ++ // rollup ? gtk 2.2 does not seem to support the shaded state ++ if( (m_nState & GDK_WINDOW_STATE_ICONIFIED) ) ++ pState->mnState |= WINDOWSTATE_STATE_MINIMIZED; ++ if( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) ++ { ++ pState->mnState |= WINDOWSTATE_STATE_MAXIMIZED; ++ pState->mnX = m_aRestorePosSize.Left(); ++ pState->mnY = m_aRestorePosSize.Top(); ++ pState->mnWidth = m_aRestorePosSize.GetWidth(); ++ pState->mnHeight = m_aRestorePosSize.GetHeight(); ++ pState->mnMaximizedX = maGeometry.nX; ++ pState->mnMaximizedY = maGeometry.nY; ++ pState->mnMaximizedWidth = maGeometry.nWidth; ++ pState->mnMaximizedHeight = maGeometry.nHeight; ++ pState->mnMask |= WINDOWSTATE_MASK_MAXIMIZED_X | ++ WINDOWSTATE_MASK_MAXIMIZED_Y | ++ WINDOWSTATE_MASK_MAXIMIZED_WIDTH | ++ WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; ++ } ++ else ++ { ++ pState->mnX = maGeometry.nX; ++ pState->mnY = maGeometry.nY; ++ pState->mnWidth = maGeometry.nWidth; ++ pState->mnHeight = maGeometry.nHeight; ++ } ++ pState->mnMask |= WINDOWSTATE_MASK_X | ++ WINDOWSTATE_MASK_Y | ++ WINDOWSTATE_MASK_WIDTH | ++ WINDOWSTATE_MASK_HEIGHT; ++ ++ return true; ++} ++ ++typedef enum { ++ SET_RETAIN_SIZE, ++ SET_FULLSCREEN, ++ SET_UN_FULLSCREEN ++} SetType; ++ ++void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSize ) ++{ ++ if( !m_pWindow ) ++ return; ++ ++ if (maGeometry.nDisplayScreenNumber == nNewScreen && eType == SET_RETAIN_SIZE) ++ return; ++ ++ int nX = maGeometry.nX, nY = maGeometry.nY, ++ nWidth = maGeometry.nWidth, nHeight = maGeometry.nHeight; ++ GdkScreen *pScreen = NULL; ++ GdkRectangle aNewMonitor; ++ ++ bool bSpanAllScreens = nNewScreen == (unsigned int)-1; ++ m_bSpanMonitorsWhenFullscreen = bSpanAllScreens && getDisplay()->getSystem()->GetDisplayScreenCount() > 1; ++ ++ if (m_bSpanMonitorsWhenFullscreen) //span all screens ++ { ++ pScreen = gtk_widget_get_screen( m_pWindow ); ++ aNewMonitor.x = 0; ++ aNewMonitor.y = 0; ++ aNewMonitor.width = gdk_screen_get_width(pScreen); ++ aNewMonitor.height = gdk_screen_get_height(pScreen); ++ } ++ else ++ { ++ gint nMonitor; ++ bool bSameMonitor = false; ++ ++ if (!bSpanAllScreens) ++ { ++ pScreen = getDisplay()->getSystem()->getScreenMonitorFromIdx( nNewScreen, nMonitor ); ++ if (!pScreen) ++ { ++ g_warning ("Attempt to move GtkSalFrame to invalid screen %d => " ++ "fallback to current\n", nNewScreen); ++ } ++ } ++ ++ if (!pScreen) ++ { ++ pScreen = gtk_widget_get_screen( m_pWindow ); ++ bSameMonitor = true; ++ } ++ ++ // Heavy lifting, need to move screen ... ++ if( pScreen != gtk_widget_get_screen( m_pWindow )) ++ gtk_window_set_screen( GTK_WINDOW( m_pWindow ), pScreen ); ++ ++ gint nOldMonitor = gdk_screen_get_monitor_at_window( ++ pScreen, widget_get_window( m_pWindow ) ); ++ if (bSameMonitor) ++ nMonitor = nOldMonitor; ++ ++ #if OSL_DEBUG_LEVEL > 1 ++ if( nMonitor == nOldMonitor ) ++ g_warning( "An apparently pointless SetScreen - should we elide it ?" ); ++ #endif ++ ++ GdkRectangle aOldMonitor; ++ gdk_screen_get_monitor_geometry( pScreen, nOldMonitor, &aOldMonitor ); ++ gdk_screen_get_monitor_geometry( pScreen, nMonitor, &aNewMonitor ); ++ ++ nX = aNewMonitor.x + maGeometry.nX - aOldMonitor.x; ++ nY = aNewMonitor.y + maGeometry.nY - aOldMonitor.y; ++ } ++ ++ bool bResize = false; ++ bool bVisible = IS_WIDGET_MAPPED( m_pWindow ); ++ if( bVisible ) ++ Show( false ); ++ ++ if( eType == SET_FULLSCREEN ) ++ { ++ nX = aNewMonitor.x; ++ nY = aNewMonitor.y; ++ nWidth = aNewMonitor.width; ++ nHeight = aNewMonitor.height; ++ m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; ++ bResize = true; ++ ++ // #i110881# for the benefit of compiz set a max size here ++ // else setting to fullscreen fails for unknown reasons ++ m_aMaxSize.Width() = aNewMonitor.width; ++ m_aMaxSize.Height() = aNewMonitor.height; ++ } ++ ++ if( pSize && eType == SET_UN_FULLSCREEN ) ++ { ++ nX = pSize->Left(); ++ nY = pSize->Top(); ++ nWidth = pSize->GetWidth(); ++ nHeight = pSize->GetHeight(); ++ m_nStyle &= ~SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; ++ bResize = true; ++ } ++ ++ if (bResize) ++ { ++ // temporarily re-sizeable ++ if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) ++ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); ++ window_resize(nWidth, nHeight); ++ } ++ ++ gtk_window_move(GTK_WINDOW(m_pWindow), nX, nY); ++ ++ { ++ gdk_window_set_fullscreen_mode( widget_get_window(m_pWindow), m_bSpanMonitorsWhenFullscreen ++ ? GDK_FULLSCREEN_ON_ALL_MONITORS : GDK_FULLSCREEN_ON_CURRENT_MONITOR ); ++ if( eType == SET_FULLSCREEN ) ++ gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) ); ++ else if( eType == SET_UN_FULLSCREEN ) ++ gtk_window_unfullscreen( GTK_WINDOW( m_pWindow ) ); ++ } ++ ++ if( eType == SET_UN_FULLSCREEN && ++ !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) ++ gtk_window_set_resizable( GTK_WINDOW( m_pWindow ), FALSE ); ++ ++ // FIXME: we should really let gtk+ handle our widget hierarchy ... ++ if( m_pParent && gtk_widget_get_screen( m_pParent->m_pWindow ) != pScreen ) ++ SetParent( NULL ); ++ std::list< GtkSalFrame* > aChildren = m_aChildren; ++ for( std::list< GtkSalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) ++ (*it)->SetScreen( nNewScreen, SET_RETAIN_SIZE ); ++ ++ m_bDefaultPos = m_bDefaultSize = false; ++ updateScreenNumber(); ++ ++ if( bVisible ) ++ Show( true ); ++} ++ ++void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen ) ++{ ++ SetScreen( nNewScreen, SET_RETAIN_SIZE ); ++} ++ ++void GtkSalFrame::updateWMClass() ++{ ++ OString aResClass = OUStringToOString(m_sWMClass, RTL_TEXTENCODING_ASCII_US); ++ const char *pResClass = !aResClass.isEmpty() ? aResClass.getStr() : ++ SalGenericSystem::getFrameClassName(); ++ Display *display; ++ ++ if (!getDisplay()->IsX11Display()) ++ return; ++ ++ display = GDK_DISPLAY_XDISPLAY(getGdkDisplay()); ++ ++ if( IS_WIDGET_REALIZED( m_pWindow ) ) ++ { ++ XClassHint* pClass = XAllocClassHint(); ++ OString aResName = SalGenericSystem::getFrameResName(); ++ pClass->res_name = const_cast(aResName.getStr()); ++ pClass->res_class = const_cast(pResClass); ++ XSetClassHint( display, ++ widget_get_xid(m_pWindow), ++ pClass ); ++ XFree( pClass ); ++ } ++} ++ ++void GtkSalFrame::SetApplicationID( const OUString &rWMClass ) ++{ ++ if( rWMClass != m_sWMClass && ! isChild() ) ++ { ++ m_sWMClass = rWMClass; ++ updateWMClass(); ++ ++ for( std::list< GtkSalFrame* >::iterator it = m_aChildren.begin(); it != m_aChildren.end(); ++it ) ++ (*it)->SetApplicationID(rWMClass); ++ } ++} ++ ++void GtkSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen ) ++{ ++ m_bFullscreen = bFullScreen; ++ ++ if( !m_pWindow || isChild() ) ++ return; ++ ++ if( bFullScreen ) ++ { ++ m_aRestorePosSize = Rectangle( Point( maGeometry.nX, maGeometry.nY ), ++ Size( maGeometry.nWidth, maGeometry.nHeight ) ); ++ SetScreen( nScreen, SET_FULLSCREEN ); ++ } ++ else ++ { ++ SetScreen( nScreen, SET_UN_FULLSCREEN, ++ !m_aRestorePosSize.IsEmpty() ? &m_aRestorePosSize : NULL ); ++ m_aRestorePosSize = Rectangle(); ++ } ++} ++ ++/* definitions from xautolock.c (pl15) */ ++#define XAUTOLOCK_DISABLE 1 ++#define XAUTOLOCK_ENABLE 2 ++ ++void GtkSalFrame::setAutoLock( bool bLock ) ++{ ++ if( isChild() || !getDisplay()->IsX11Display() ) ++ return; ++ ++ GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(m_pWindow) ); ++ GdkDisplay *pDisplay = gdk_screen_get_display( pScreen ); ++ GdkWindow *pRootWin = gdk_screen_get_root_window( pScreen ); ++ ++ Atom nAtom = XInternAtom( GDK_DISPLAY_XDISPLAY( pDisplay ), ++ "XAUTOLOCK_MESSAGE", False ); ++ ++ int nMessage = bLock ? XAUTOLOCK_ENABLE : XAUTOLOCK_DISABLE; ++ ++ XChangeProperty( GDK_DISPLAY_XDISPLAY( pDisplay ), ++ GDK_WINDOW_XID( pRootWin ), ++ nAtom, XA_INTEGER, ++ 8, PropModeReplace, ++ reinterpret_cast(&nMessage), ++ sizeof( nMessage ) ); ++} ++ ++#ifdef ENABLE_DBUS ++/** cookie is returned as an unsigned integer */ ++static guint ++dbus_inhibit_gsm (const gchar *appname, ++ const gchar *reason, ++ guint xid) ++{ ++ gboolean res; ++ guint cookie; ++ GError *error = NULL; ++ DBusGProxy *proxy = NULL; ++ ++ /* get the DBUS session connection */ ++ DBusGConnection *session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); ++ if (error != NULL) { ++ g_debug ("DBUS cannot connect : %s", error->message); ++ g_error_free (error); ++ return -1; ++ } ++ ++ /* get the proxy with gnome-session-manager */ ++ proxy = dbus_g_proxy_new_for_name (session_connection, ++ GSM_DBUS_SERVICE, ++ GSM_DBUS_PATH, ++ GSM_DBUS_INTERFACE); ++ if (proxy == NULL) { ++ g_debug ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); ++ return -1; ++ } ++ ++ res = dbus_g_proxy_call (proxy, ++ "Inhibit", &error, ++ G_TYPE_STRING, appname, ++ G_TYPE_UINT, xid, ++ G_TYPE_STRING, reason, ++ G_TYPE_UINT, 8, //Inhibit the session being marked as idle ++ G_TYPE_INVALID, ++ G_TYPE_UINT, &cookie, ++ G_TYPE_INVALID); ++ ++ /* check the return value */ ++ if (! res) { ++ cookie = -1; ++ g_debug ("Inhibit method failed"); ++ } ++ ++ /* check the error value */ ++ if (error != NULL) { ++ g_debug ("Inhibit problem : %s", error->message); ++ g_error_free (error); ++ cookie = -1; ++ } ++ ++ g_object_unref (G_OBJECT (proxy)); ++ return cookie; ++} ++ ++static void ++dbus_uninhibit_gsm (guint cookie) ++{ ++ gboolean res; ++ GError *error = NULL; ++ DBusGProxy *proxy = NULL; ++ DBusGConnection *session_connection = NULL; ++ ++ if (cookie == guint(-1)) { ++ g_debug ("Invalid cookie"); ++ return; ++ } ++ ++ /* get the DBUS session connection */ ++ session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); ++ if (error) { ++ g_debug ("DBUS cannot connect : %s", error->message); ++ g_error_free (error); ++ return; ++ } ++ ++ /* get the proxy with gnome-session-manager */ ++ proxy = dbus_g_proxy_new_for_name (session_connection, ++ GSM_DBUS_SERVICE, ++ GSM_DBUS_PATH, ++ GSM_DBUS_INTERFACE); ++ if (proxy == NULL) { ++ g_debug ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); ++ return; ++ } ++ ++ res = dbus_g_proxy_call (proxy, ++ "Uninhibit", ++ &error, ++ G_TYPE_UINT, cookie, ++ G_TYPE_INVALID, ++ G_TYPE_INVALID); ++ ++ /* check the return value */ ++ if (! res) { ++ g_debug ("Uninhibit method failed"); ++ } ++ ++ /* check the error value */ ++ if (error != NULL) { ++ g_debug ("Uninhibit problem : %s", error->message); ++ g_error_free (error); ++ cookie = -1; ++ } ++ g_object_unref (G_OBJECT (proxy)); ++} ++#endif ++ ++void GtkSalFrame::StartPresentation( bool bStart ) ++{ ++ setAutoLock( !bStart ); ++ ++ if( !getDisplay()->IsX11Display() ) ++ return; ++ ++ if( bStart ) ++ { ++#ifdef ENABLE_DBUS ++ m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation", ++ widget_get_xid(m_pWindow)); ++#endif ++ } ++ else ++ { ++ m_nSavedScreenSaverTimeout = 0; ++#ifdef ENABLE_DBUS ++ dbus_uninhibit_gsm(m_nGSMCookie); ++#endif ++ } ++} ++ ++void GtkSalFrame::SetAlwaysOnTop( bool bOnTop ) ++{ ++ if( m_pWindow ) ++ gtk_window_set_keep_above( GTK_WINDOW( m_pWindow ), bOnTop ); ++} ++ ++void GtkSalFrame::ToTop( sal_uInt16 nFlags ) ++{ ++ if( m_pWindow ) ++ { ++ if( isChild( false, true ) ) ++ gtk_widget_grab_focus( m_pWindow ); ++ else if( IS_WIDGET_MAPPED( m_pWindow ) ) ++ { ++ if( ! (nFlags & SAL_FRAME_TOTOP_GRABFOCUS_ONLY) ) ++ gtk_window_present( GTK_WINDOW(m_pWindow) ); ++ else ++ { ++ guint32 nUserTime = GDK_CURRENT_TIME; ++ gdk_window_focus( widget_get_window(m_pWindow), nUserTime ); ++ } ++ } ++ else ++ { ++ if( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN ) ++ gtk_window_present( GTK_WINDOW(m_pWindow) ); ++ } ++ } ++} ++ ++void GtkSalFrame::SetPointer( PointerStyle ePointerStyle ) ++{ ++ if( m_pWindow && ePointerStyle != m_ePointerStyle ) ++ { ++ m_ePointerStyle = ePointerStyle; ++ GdkCursor *pCursor = getDisplay()->getCursor( ePointerStyle ); ++ gdk_window_set_cursor( widget_get_window(m_pWindow), pCursor ); ++ m_pCurrentCursor = pCursor; ++ ++ // #i80791# use grabPointer the same way as CaptureMouse, respective float grab ++ if( getDisplay()->MouseCaptured( this ) ) ++ grabPointer( true, false ); ++ else if( m_nFloats > 0 ) ++ grabPointer( true, true ); ++ } ++} ++ ++void GtkSalFrame::grabPointer( bool bGrab, bool bOwnerEvents ) ++{ ++ static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" ); ++ if (pEnv && *pEnv) ++ return; ++ ++ if (!m_pWindow) ++ return; ++ ++ const int nMask = (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); ++ ++ GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay()); ++ GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager); ++ if (bGrab) ++ gdk_device_grab(pPointer, widget_get_window(getMouseEventWidget()), GDK_OWNERSHIP_NONE, bOwnerEvents, (GdkEventMask) nMask, m_pCurrentCursor, GDK_CURRENT_TIME); ++ else ++ gdk_device_ungrab(pPointer, GDK_CURRENT_TIME); ++} ++ ++void GtkSalFrame::grabKeyboard( bool bGrab ) ++{ ++ if (!m_pWindow) ++ return; ++ ++ GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay()); ++ GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager); ++ GdkDevice* pKeyboard = gdk_device_get_associated_device(pPointer); ++ if (bGrab) ++ { ++ gdk_device_grab(pKeyboard, widget_get_window(m_pWindow), GDK_OWNERSHIP_NONE, ++ true, (GdkEventMask)(GDK_KEY_PRESS | GDK_KEY_RELEASE), NULL, GDK_CURRENT_TIME); ++ } ++ else ++ { ++ gdk_device_ungrab(pKeyboard, GDK_CURRENT_TIME); ++ } ++} ++ ++void GtkSalFrame::CaptureMouse( bool bCapture ) ++{ ++ getDisplay()->CaptureMouse( bCapture ? this : NULL ); ++} ++ ++void GtkSalFrame::SetPointerPos( long nX, long nY ) ++{ ++ GtkSalFrame* pFrame = this; ++ while( pFrame && pFrame->isChild( false, true ) ) ++ pFrame = pFrame->m_pParent; ++ if( ! pFrame ) ++ return; ++ ++ GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(pFrame->m_pWindow) ); ++ GdkDisplay *pDisplay = gdk_screen_get_display( pScreen ); ++ ++ /* when the application tries to center the mouse in the dialog the ++ * window isn't mapped already. So use coordinates relative to the root window. ++ */ ++ unsigned int nWindowLeft = maGeometry.nX + nX; ++ unsigned int nWindowTop = maGeometry.nY + nY; ++ ++ XWarpPointer( GDK_DISPLAY_XDISPLAY (pDisplay), None, ++ GDK_WINDOW_XID (gdk_screen_get_root_window( pScreen ) ), ++ 0, 0, 0, 0, nWindowLeft, nWindowTop); ++ // #i38648# ask for the next motion hint ++ gint x, y; ++ GdkModifierType mask; ++ gdk_window_get_pointer( widget_get_window(pFrame->m_pWindow) , &x, &y, &mask ); ++} ++ ++void GtkSalFrame::Flush() ++{ ++ gdk_display_flush( getGdkDisplay() ); ++} ++ ++void GtkSalFrame::Sync() ++{ ++ gdk_display_sync( getGdkDisplay() ); ++} ++ ++#ifndef GDK_Open ++#define GDK_Open 0x1008ff6b ++#endif ++#ifndef GDK_Paste ++#define GDK_Paste 0x1008ff6d ++#endif ++#ifndef GDK_Copy ++#define GDK_Copy 0x1008ff57 ++#endif ++#ifndef GDK_Cut ++#define GDK_Cut 0x1008ff58 ++#endif ++ ++void GtkSalFrame::KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, ++ guint* pGdkKeyCode, GdkModifierType *pGdkModifiers) ++{ ++ if ( pGdkKeyCode == NULL || pGdkModifiers == NULL ) ++ return; ++ ++ // Get GDK key modifiers ++ GdkModifierType nModifiers = (GdkModifierType) 0; ++ ++ if ( rKeyCode.IsShift() ) ++ nModifiers = (GdkModifierType) ( nModifiers | GDK_SHIFT_MASK ); ++ ++ if ( rKeyCode.IsMod1() ) ++ nModifiers = (GdkModifierType) ( nModifiers | GDK_CONTROL_MASK ); ++ ++ if ( rKeyCode.IsMod2() ) ++ nModifiers = (GdkModifierType) ( nModifiers | GDK_MOD1_MASK ); ++ ++ *pGdkModifiers = nModifiers; ++ ++ // Get GDK keycode. ++ guint nKeyCode = 0; ++ ++ guint nCode = rKeyCode.GetCode(); ++ ++ if ( nCode >= KEY_0 && nCode <= KEY_9 ) ++ nKeyCode = ( nCode - KEY_0 ) + GDK_0; ++ else if ( nCode >= KEY_A && nCode <= KEY_Z ) ++ nKeyCode = ( nCode - KEY_A ) + GDK_A; ++ else if ( nCode >= KEY_F1 && nCode <= KEY_F26 ) ++ nKeyCode = ( nCode - KEY_F1 ) + GDK_F1; ++ else ++ { ++ switch( nCode ) ++ { ++ case KEY_DOWN: nKeyCode = GDK_Down; break; ++ case KEY_UP: nKeyCode = GDK_Up; break; ++ case KEY_LEFT: nKeyCode = GDK_Left; break; ++ case KEY_RIGHT: nKeyCode = GDK_Right; break; ++ case KEY_HOME: nKeyCode = GDK_Home; break; ++ case KEY_END: nKeyCode = GDK_End; break; ++ case KEY_PAGEUP: nKeyCode = GDK_Page_Up; break; ++ case KEY_PAGEDOWN: nKeyCode = GDK_Page_Down; break; ++ case KEY_RETURN: nKeyCode = GDK_Return; break; ++ case KEY_ESCAPE: nKeyCode = GDK_Escape; break; ++ case KEY_TAB: nKeyCode = GDK_Tab; break; ++ case KEY_BACKSPACE: nKeyCode = GDK_BackSpace; break; ++ case KEY_SPACE: nKeyCode = GDK_space; break; ++ case KEY_INSERT: nKeyCode = GDK_Insert; break; ++ case KEY_DELETE: nKeyCode = GDK_Delete; break; ++ case KEY_ADD: nKeyCode = GDK_plus; break; ++ case KEY_SUBTRACT: nKeyCode = GDK_minus; break; ++ case KEY_MULTIPLY: nKeyCode = GDK_asterisk; break; ++ case KEY_DIVIDE: nKeyCode = GDK_slash; break; ++ case KEY_POINT: nKeyCode = GDK_period; break; ++ case KEY_COMMA: nKeyCode = GDK_comma; break; ++ case KEY_LESS: nKeyCode = GDK_less; break; ++ case KEY_GREATER: nKeyCode = GDK_greater; break; ++ case KEY_EQUAL: nKeyCode = GDK_equal; break; ++ case KEY_FIND: nKeyCode = GDK_Find; break; ++ case KEY_CONTEXTMENU: nKeyCode = GDK_Menu; break; ++ case KEY_HELP: nKeyCode = GDK_Help; break; ++ case KEY_UNDO: nKeyCode = GDK_Undo; break; ++ case KEY_REPEAT: nKeyCode = GDK_Redo; break; ++ case KEY_DECIMAL: nKeyCode = GDK_KP_Decimal; break; ++ case KEY_TILDE: nKeyCode = GDK_asciitilde; break; ++ case KEY_QUOTELEFT: nKeyCode = GDK_quoteleft; break; ++ case KEY_BRACKETLEFT: nKeyCode = GDK_bracketleft; break; ++ case KEY_BRACKETRIGHT: nKeyCode = GDK_bracketright; break; ++ case KEY_SEMICOLON: nKeyCode = GDK_semicolon; break; ++ case KEY_QUOTERIGHT: nKeyCode = GDK_quoteright; break; ++ ++ // Special cases ++ case KEY_COPY: nKeyCode = GDK_Copy; break; ++ case KEY_CUT: nKeyCode = GDK_Cut; break; ++ case KEY_PASTE: nKeyCode = GDK_Paste; break; ++ case KEY_OPEN: nKeyCode = GDK_Open; break; ++ } ++ } ++ ++ *pGdkKeyCode = nKeyCode; ++} ++ ++OUString GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode ) ++{ ++ guint nGtkKeyCode; ++ GdkModifierType nGtkModifiers; ++ KeyCodeToGdkKey(nKeyCode, &nGtkKeyCode, &nGtkModifiers ); ++ ++ gchar* pName = gtk_accelerator_get_label(nGtkKeyCode, nGtkModifiers); ++ OUString aRet(pName, rtl_str_getLength(pName), RTL_TEXTENCODING_UTF8); ++ g_free(pName); ++ return aRet; ++} ++ ++GdkDisplay *GtkSalFrame::getGdkDisplay() ++{ ++ return GetGtkSalData()->GetGdkDisplay(); ++} ++ ++GtkSalDisplay *GtkSalFrame::getDisplay() ++{ ++ return GetGtkSalData()->GetGtkDisplay(); ++} ++ ++SalFrame::SalPointerState GtkSalFrame::GetPointerState() ++{ ++ SalPointerState aState; ++ GdkScreen* pScreen; ++ gint x, y; ++ GdkModifierType aMask; ++ gdk_display_get_pointer( getGdkDisplay(), &pScreen, &x, &y, &aMask ); ++ aState.maPos = Point( x - maGeometry.nX, y - maGeometry.nY ); ++ aState.mnState = GetMouseModCode( aMask ); ++ return aState; ++} ++ ++KeyIndicatorState GtkSalFrame::GetIndicatorState() ++{ ++ KeyIndicatorState nState = KeyIndicatorState::NONE; ++ ++ GdkKeymap *pKeyMap = gdk_keymap_get_for_display(getGdkDisplay()); ++ ++ if (gdk_keymap_get_caps_lock_state(pKeyMap)) ++ nState |= KeyIndicatorState::CAPSLOCK; ++ if (gdk_keymap_get_num_lock_state(pKeyMap)) ++ nState |= KeyIndicatorState::NUMLOCK; ++ if (gdk_keymap_get_scroll_lock_state(pKeyMap)) ++ nState |= KeyIndicatorState::SCROLLLOCK; ++ return nState; ++} ++ ++void GtkSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode ) ++{ ++ g_warning ("missing simulate keypress %d", nKeyCode); ++} ++ ++void GtkSalFrame::SetInputContext( SalInputContext* pContext ) ++{ ++ if( ! pContext ) ++ return; ++ ++ if( ! (pContext->mnOptions & InputContextFlags::Text) ) ++ return; ++ ++ // create a new im context ++ if( ! m_pIMHandler ) ++ m_pIMHandler = new IMHandler( this ); ++} ++ ++void GtkSalFrame::EndExtTextInput( sal_uInt16 nFlags ) ++{ ++ if( m_pIMHandler ) ++ m_pIMHandler->endExtTextInput( nFlags ); ++} ++ ++bool GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , vcl::KeyCode& ) ++{ ++ // not supported yet ++ return false; ++} ++ ++LanguageType GtkSalFrame::GetInputLanguage() ++{ ++ return LANGUAGE_DONTKNOW; ++} ++ ++void GtkSalFrame::UpdateSettings( AllSettings& rSettings ) ++{ ++ if( ! m_pWindow ) ++ return; ++ ++ GtkSalGraphics* pGraphics = static_cast(m_aGraphics[0].pGraphics); ++ bool bFreeGraphics = false; ++ if( ! pGraphics ) ++ { ++ pGraphics = static_cast(AcquireGraphics()); ++ if ( !pGraphics ) ++ { ++ SAL_WARN("vcl", "Could not get graphics - unable to update settings"); ++ return; ++ } ++ bFreeGraphics = true; ++ } ++ ++ pGraphics->updateSettings( rSettings ); ++ ++ if( bFreeGraphics ) ++ ReleaseGraphics( pGraphics ); ++} ++ ++void GtkSalFrame::Beep() ++{ ++ gdk_display_beep( getGdkDisplay() ); ++} ++ ++const SystemEnvData* GtkSalFrame::GetSystemData() const ++{ ++ return &m_aSystemData; ++} ++ ++void GtkSalFrame::SetParent( SalFrame* pNewParent ) ++{ ++ if( m_pParent ) ++ m_pParent->m_aChildren.remove( this ); ++ m_pParent = static_cast(pNewParent); ++ if( m_pParent ) ++ m_pParent->m_aChildren.push_back( this ); ++ if( ! isChild() ) ++ gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), ++ (m_pParent && ! m_pParent->isChild(true,false)) ? GTK_WINDOW(m_pParent->m_pWindow) : NULL ++ ); ++} ++ ++bool GtkSalFrame::SetPluginParent( SystemParentData* pSysParent ) ++{ ++ (void)pSysParent; ++ //FIXME: no SetPluginParent impl. for gtk3 ++ return false; ++} ++ ++void GtkSalFrame::ResetClipRegion() ++{ ++ if( m_pWindow ) ++ gdk_window_shape_combine_region( widget_get_window( m_pWindow ), NULL, 0, 0 ); ++} ++ ++void GtkSalFrame::BeginSetClipRegion( sal_uLong ) ++{ ++ if( m_pRegion ) ++ cairo_region_destroy( m_pRegion ); ++ m_pRegion = cairo_region_create(); ++} ++ ++void GtkSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) ++{ ++ if( m_pRegion ) ++ { ++ GdkRectangle aRect; ++ aRect.x = nX; ++ aRect.y = nY; ++ aRect.width = nWidth; ++ aRect.height = nHeight; ++ cairo_region_union_rectangle( m_pRegion, &aRect ); ++ } ++} ++ ++void GtkSalFrame::EndSetClipRegion() ++{ ++ if( m_pWindow && m_pRegion ) ++ gdk_window_shape_combine_region( widget_get_window(m_pWindow), m_pRegion, 0, 0 ); ++} ++ ++gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ SalMouseEvent aEvent; ++ sal_uInt16 nEventType = 0; ++ switch( pEvent->type ) ++ { ++ case GDK_BUTTON_PRESS: ++ nEventType = SALEVENT_MOUSEBUTTONDOWN; ++ break; ++ case GDK_BUTTON_RELEASE: ++ nEventType = SALEVENT_MOUSEBUTTONUP; ++ break; ++ default: ++ return false; ++ } ++ switch( pEvent->button ) ++ { ++ case 1: aEvent.mnButton = MOUSE_LEFT; break; ++ case 2: aEvent.mnButton = MOUSE_MIDDLE; break; ++ case 3: aEvent.mnButton = MOUSE_RIGHT; break; ++ default: return false; ++ } ++ aEvent.mnTime = pEvent->time; ++ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; ++ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; ++ aEvent.mnCode = GetMouseModCode( pEvent->state ); ++ ++ bool bClosePopups = false; ++ if( pEvent->type == GDK_BUTTON_PRESS && ++ (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) == 0 ++ ) ++ { ++ if( m_nFloats > 0 ) ++ { ++ // close popups if user clicks outside our application ++ gint x, y; ++ bClosePopups = (gdk_display_get_window_at_pointer( GtkSalFrame::getGdkDisplay(), &x, &y ) == NULL); ++ } ++ /* #i30306# release implicit pointer grab if no popups are open; else ++ * Drag cannot grab the pointer and will fail. ++ */ ++ if( m_nFloats < 1 || bClosePopups ) ++ gdk_display_pointer_ungrab( GtkSalFrame::getGdkDisplay(), GDK_CURRENT_TIME ); ++ } ++ ++ if( pThis->m_bWindowIsGtkPlug && ++ pEvent->type == GDK_BUTTON_PRESS && ++ pEvent->button == 1 ) ++ { ++ pThis->askForXEmbedFocus( pEvent->time ); ++ } ++ ++ // --- RTL --- (mirror mouse pos) ++ if( AllSettings::GetLayoutRTL() ) ++ aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; ++ ++ vcl::DeletionListener aDel( pThis ); ++ ++ pThis->CallCallback( nEventType, &aEvent ); ++ ++ if( ! aDel.isDeleted() ) ++ { ++ if( bClosePopups ) ++ { ++ ImplSVData* pSVData = ImplGetSVData(); ++ if ( pSVData->maWinData.mpFirstFloat ) ++ { ++ static const char* pEnv = getenv( "SAL_FLOATWIN_NOAPPFOCUSCLOSE" ); ++ if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) && !(pEnv && *pEnv) ) ++ pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll ); ++ } ++ } ++ ++ if( ! aDel.isDeleted() ) ++ { ++ int frame_x = (int)(pEvent->x_root - pEvent->x); ++ int frame_y = (int)(pEvent->y_root - pEvent->y); ++ if( frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY ) ++ { ++ pThis->maGeometry.nX = frame_x; ++ pThis->maGeometry.nY = frame_y; ++ pThis->CallCallback( SALEVENT_MOVE, NULL ); ++ } ++ } ++ } ++ ++ return true; ++} ++ ++gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ GdkEventScroll* pSEvent = reinterpret_cast(pEvent); ++ ++ // gnome#726878 check for duplicate legacy scroll event ++ if (pSEvent->direction != GDK_SCROLL_SMOOTH && ++ pThis->m_nLastScrollEventTime == pSEvent->time) ++ { ++ return true; ++ } ++ ++ SalWheelMouseEvent aEvent; ++ ++ aEvent.mnTime = pSEvent->time; ++ aEvent.mnX = (sal_uLong)pSEvent->x; ++ aEvent.mnY = (sal_uLong)pSEvent->y; ++ aEvent.mnCode = GetMouseModCode( pSEvent->state ); ++ aEvent.mnScrollLines = 3; ++ ++ switch (pSEvent->direction) ++ { ++ case GDK_SCROLL_SMOOTH: ++ { ++ double delta_x, delta_y; ++ gdk_event_get_scroll_deltas(pEvent, &delta_x, &delta_y); ++ //pick the bigger one I guess ++ aEvent.mbHorz = fabs(delta_x) > fabs(delta_y); ++ if (aEvent.mbHorz) ++ aEvent.mnDelta = -delta_x; ++ else ++ aEvent.mnDelta = -delta_y; ++ aEvent.mnScrollLines = 1; ++ pThis->m_nLastScrollEventTime = pSEvent->time; ++ break; ++ } ++ case GDK_SCROLL_UP: ++ aEvent.mnDelta = 120; ++ aEvent.mbHorz = false; ++ break; ++ case GDK_SCROLL_DOWN: ++ aEvent.mnDelta = -120; ++ aEvent.mbHorz = false; ++ break; ++ case GDK_SCROLL_LEFT: ++ aEvent.mbHorz = true; ++ aEvent.mnDelta = 120; ++ break; ++ case GDK_SCROLL_RIGHT: ++ aEvent.mnDelta = -120; ++ aEvent.mbHorz = true; ++ break; ++ }; ++ ++ aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : 1; ++ ++ // --- RTL --- (mirror mouse pos) ++ if( AllSettings::GetLayoutRTL() ) ++ aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; ++ ++ pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent ); ++ ++ return true; ++} ++ ++void GtkSalFrame::gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame) ++{ ++ gdouble x, y; ++ GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture)); ++ //I feel I want the first point of the sequence, not the last point which ++ //the docs say this gives, but for the moment assume we start and end ++ //within the same vcl window ++ if (gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y)) ++ { ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ SalSwipeEvent aEvent; ++ aEvent.mnVelocityX = velocity_x; ++ aEvent.mnVelocityY = velocity_y; ++ aEvent.mnX = x; ++ aEvent.mnY = y; ++ ++ pThis->CallCallback(SALEVENT_SWIPE, &aEvent); ++ } ++} ++ ++void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ if(pThis) ++ { ++ SalLongPressEvent aEvent; ++ ++ gdouble x, y; ++ GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture)); ++ gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y); ++ aEvent.mnX = x; ++ aEvent.mnY = y; ++ ++ pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent); ++ } ++} ++ ++gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ SalMouseEvent aEvent; ++ aEvent.mnTime = pEvent->time; ++ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; ++ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; ++ aEvent.mnCode = GetMouseModCode( pEvent->state ); ++ aEvent.mnButton = 0; ++ ++ // --- RTL --- (mirror mouse pos) ++ if( AllSettings::GetLayoutRTL() ) ++ aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX; ++ ++ vcl::DeletionListener aDel( pThis ); ++ ++ pThis->CallCallback( SALEVENT_MOUSEMOVE, &aEvent ); ++ ++ if( ! aDel.isDeleted() ) ++ { ++ int frame_x = (int)(pEvent->x_root - pEvent->x); ++ int frame_y = (int)(pEvent->y_root - pEvent->y); ++ if( frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY ) ++ { ++ pThis->maGeometry.nX = frame_x; ++ pThis->maGeometry.nY = frame_y; ++ pThis->CallCallback( SALEVENT_MOVE, NULL ); ++ } ++ ++ if( ! aDel.isDeleted() ) ++ { ++ // ask for the next hint ++ gint x, y; ++ GdkModifierType mask; ++ gdk_window_get_pointer( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &x, &y, &mask ); ++ } ++ } ++ ++ return true; ++} ++ ++gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ SalMouseEvent aEvent; ++ aEvent.mnTime = pEvent->time; ++ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX; ++ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY; ++ aEvent.mnCode = GetMouseModCode( pEvent->state ); ++ aEvent.mnButton = 0; ++ ++ pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent ); ++ ++ return true; ++} ++ ++cairo_t* GtkSalFrame::getCairoContext() const ++{ ++ cairo_t* cr = SvpSalGraphics::createCairoContext(m_aFrame); ++ assert(cr); ++ return cr; ++} ++ ++void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect) ++{ ++#if OSL_DEBUG_LEVEL > 1 ++ long long area = rDamageRect.getWidth() * rDamageRect.getHeight(); ++ if( area > 32 * 1024 ) ++ { ++ fprintf( stderr, "bitmap damaged %d %d (%dx%d) area %lld widget\n", ++ (int) rDamageRect.getMinX(), ++ (int) rDamageRect.getMinY(), ++ (int) rDamageRect.getWidth(), ++ (int) rDamageRect.getHeight(), ++ area ); ++ } ++#endif ++ ++ if (dumpframes) ++ { ++ static int frame; ++ OString tmp("/tmp/frame" + OString::number(frame++) + ".png"); ++ cairo_t* cr = getCairoContext(); ++ cairo_surface_write_to_png(cairo_get_target(cr), tmp.getStr()); ++ cairo_destroy(cr); ++ } ++ ++ gtk_widget_queue_draw_area(GTK_WIDGET(m_pFixedContainer), ++ rDamageRect.getMinX(), ++ rDamageRect.getMinY(), ++ rDamageRect.getWidth(), ++ rDamageRect.getHeight()); ++} ++ ++// blit our backing basebmp buffer to the target cairo context cr ++gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ cairo_save(cr); ++ ++ cairo_t* source = pThis->getCairoContext(); ++ cairo_surface_t *pSurface = cairo_get_target(source); ++ ++ cairo_set_operator( cr, CAIRO_OPERATOR_OVER ); ++ cairo_set_source_surface(cr, pSurface, 0, 0); ++ cairo_paint(cr); ++ ++ cairo_destroy(source); ++ ++ cairo_restore(cr); ++ ++ cairo_surface_flush(cairo_get_target(cr)); ++ ++ return false; ++} ++ ++void GtkSalFrame::sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ pThis->maGeometry.nWidth = pAllocation->width; ++ pThis->maGeometry.nHeight = pAllocation->height; ++ pThis->AllocateFrame(); ++ pThis->CallCallback( SALEVENT_RESIZE, nullptr ); ++ pThis->TriggerPaintEvent(); ++} ++ ++gboolean GtkSalFrame::signalConfigure(GtkWidget*, GdkEventConfigure* pEvent, gpointer frame) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ bool bMoved = false; ++ int x = pEvent->x, y = pEvent->y; ++ ++ /* #i31785# claims we cannot trust the x,y members of the event; ++ * they are e.g. not set correctly on maximize/demaximize; ++ * yet the gdkdisplay-x11.c code handling configure_events has ++ * done this XTranslateCoordinates work since the day ~zero. ++ */ ++ if( x != pThis->maGeometry.nX || y != pThis->maGeometry.nY ) ++ { ++ bMoved = true; ++ pThis->maGeometry.nX = x; ++ pThis->maGeometry.nY = y; ++ } ++ ++ // update decoration hints ++ GdkRectangle aRect; ++ gdk_window_get_frame_extents( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &aRect ); ++ pThis->maGeometry.nTopDecoration = y - aRect.y; ++ pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height; ++ pThis->maGeometry.nLeftDecoration = x - aRect.x; ++ pThis->maGeometry.nRightDecoration = aRect.x + aRect.width - x - pEvent->width; ++ ++ pThis->updateScreenNumber(); ++ ++ if (bMoved) ++ pThis->CallCallback(SALEVENT_MOVE, nullptr); ++ ++ return false; ++} ++ ++void GtkSalFrame::TriggerPaintEvent() ++{ ++ //Under gtk2 we can basically paint directly into the XWindow and on ++ //additional "expose-event" events we can re-render the missing pieces ++ // ++ //Under gtk3 we have to keep our own buffer up to date and flush it into ++ //the given cairo context on "draw". So we emit a paint event on ++ //opportune resize trigger events to initially fill our backbuffer and then ++ //keep it up to date with our direct paints and tell gtk those regions ++ //have changed and then blit them into the provided cairo context when ++ //we get the "draw" ++ // ++ //The other alternative was to always paint everything on "draw", but ++ //that duplicates the amount of drawing and is hideously slow ++ SAL_INFO("vcl.gtk3", "force painting" << 0 << "," << 0 << " " << maGeometry.nWidth << "x" << maGeometry.nHeight); ++ SalPaintEvent aPaintEvt(0, 0, maGeometry.nWidth, maGeometry.nHeight, true); ++ CallCallback(SALEVENT_PAINT, &aPaintEvt); ++ gtk_widget_queue_draw(GTK_WIDGET(m_pFixedContainer)); ++} ++ ++gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ SalGenericInstance *pSalInstance = ++ static_cast< SalGenericInstance* >(GetSalData()->m_pInstance); ++ ++ // check if printers have changed (analogous to salframe focus handler) ++ pSalInstance->updatePrinterUpdate(); ++ ++ if( !pEvent->in ) ++ { ++ pThis->m_nKeyModifiers = 0; ++ pThis->m_bSendModChangeOnRelease = false; ++ } ++ ++ if( pThis->m_pIMHandler ) ++ pThis->m_pIMHandler->focusChanged( pEvent->in ); ++ ++ // ask for changed printers like generic implementation ++ if( pEvent->in && pSalInstance->isPrinterInit() ) ++ pSalInstance->updatePrinterUpdate(); ++ ++ // FIXME: find out who the hell steals the focus from our frame ++ // while we have the pointer grabbed, this should not come from ++ // the window manager. Is this an event that was still queued ? ++ // The focus does not seem to get set inside our process ++ ++ // in the meantime do not propagate focus get/lose if floats are open ++ if( m_nFloats == 0 ) ++ pThis->CallCallback( pEvent->in ? SALEVENT_GETFOCUS : SALEVENT_LOSEFOCUS, NULL ); ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ bool bSetFocus = pThis->m_bSetFocusOnMap; ++ pThis->m_bSetFocusOnMap = false; ++ ++ (void)pWidget; (void)bSetFocus; ++ //FIXME: no set input focus ... ++ ++ pThis->CallCallback( SALEVENT_RESIZE, NULL ); ++ pThis->TriggerPaintEvent(); ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ pThis->CallCallback( SALEVENT_RESIZE, NULL ); ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ vcl::DeletionListener aDel( pThis ); ++ ++ if( pThis->m_pIMHandler ) ++ { ++ if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) ) ++ return true; ++ } ++ ++ // handle modifiers ++ if( pEvent->keyval == GDK_Shift_L || pEvent->keyval == GDK_Shift_R || ++ pEvent->keyval == GDK_Control_L || pEvent->keyval == GDK_Control_R || ++ pEvent->keyval == GDK_Alt_L || pEvent->keyval == GDK_Alt_R || ++ pEvent->keyval == GDK_Meta_L || pEvent->keyval == GDK_Meta_R || ++ pEvent->keyval == GDK_Super_L || pEvent->keyval == GDK_Super_R ) ++ { ++ SalKeyModEvent aModEvt; ++ ++ sal_uInt16 nModCode = GetKeyModCode( pEvent->state ); ++ ++ aModEvt.mnModKeyCode = 0; // emit no MODKEYCHANGE events ++ if( pEvent->type == GDK_KEY_PRESS && !pThis->m_nKeyModifiers ) ++ pThis->m_bSendModChangeOnRelease = true; ++ ++ else if( pEvent->type == GDK_KEY_RELEASE && ++ pThis->m_bSendModChangeOnRelease ) ++ { ++ aModEvt.mnModKeyCode = pThis->m_nKeyModifiers; ++ pThis->m_nKeyModifiers = 0; ++ } ++ ++ sal_uInt16 nExtModMask = 0; ++ sal_uInt16 nModMask = 0; ++ // pressing just the ctrl key leads to a keysym of XK_Control but ++ // the event state does not contain ControlMask. In the release ++ // event its the other way round: it does contain the Control mask. ++ // The modifier mode therefore has to be adapted manually. ++ switch( pEvent->keyval ) ++ { ++ case GDK_Control_L: ++ nExtModMask = MODKEY_LMOD1; ++ nModMask = KEY_MOD1; ++ break; ++ case GDK_Control_R: ++ nExtModMask = MODKEY_RMOD1; ++ nModMask = KEY_MOD1; ++ break; ++ case GDK_Alt_L: ++ nExtModMask = MODKEY_LMOD2; ++ nModMask = KEY_MOD2; ++ break; ++ case GDK_Alt_R: ++ nExtModMask = MODKEY_RMOD2; ++ nModMask = KEY_MOD2; ++ break; ++ case GDK_Shift_L: ++ nExtModMask = MODKEY_LSHIFT; ++ nModMask = KEY_SHIFT; ++ break; ++ case GDK_Shift_R: ++ nExtModMask = MODKEY_RSHIFT; ++ nModMask = KEY_SHIFT; ++ break; ++ // Map Meta/Super to MOD3 modifier on all Unix systems ++ // except Mac OS X ++ case GDK_Meta_L: ++ case GDK_Super_L: ++ nExtModMask = MODKEY_LMOD3; ++ nModMask = KEY_MOD3; ++ break; ++ case GDK_Meta_R: ++ case GDK_Super_R: ++ nExtModMask = MODKEY_RMOD3; ++ nModMask = KEY_MOD3; ++ break; ++ } ++ if( pEvent->type == GDK_KEY_RELEASE ) ++ { ++ nModCode &= ~nModMask; ++ pThis->m_nKeyModifiers &= ~nExtModMask; ++ } ++ else ++ { ++ nModCode |= nModMask; ++ pThis->m_nKeyModifiers |= nExtModMask; ++ } ++ ++ aModEvt.mnCode = nModCode; ++ aModEvt.mnTime = pEvent->time; ++ ++ pThis->CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt ); ++ ++ } ++ else ++ { ++ pThis->doKeyCallback( pEvent->state, ++ pEvent->keyval, ++ pEvent->hardware_keycode, ++ pEvent->group, ++ pEvent->time, ++ sal_Unicode(gdk_keyval_to_unicode( pEvent->keyval )), ++ (pEvent->type == GDK_KEY_PRESS), ++ false ); ++ if( ! aDel.isDeleted() ) ++ pThis->m_bSendModChangeOnRelease = false; ++ } ++ ++ if( !aDel.isDeleted() && pThis->m_pIMHandler ) ++ pThis->m_pIMHandler->updateIMSpotLocation(); ++ ++ return true; ++} ++ ++gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ pThis->CallCallback( SALEVENT_CLOSE, NULL ); ++ ++ return true; ++} ++ ++void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ ++ // every frame gets an initial style set on creation ++ // do not post these as the whole application tends to ++ // redraw itself to adjust to the new style ++ // where there IS no new style resulting in tremendous unnecessary flickering ++ if( pPrevious != NULL ) ++ { ++ // signalStyleSet does NOT usually have the gdk lock ++ // so post user event to safely dispatch the SALEVENT_SETTINGSCHANGED ++ // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings ++ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_SETTINGSCHANGED ); ++ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_FONTCHANGED ); ++ } ++} ++ ++gboolean GtkSalFrame::signalWindowState( GtkWidget*, GdkEvent* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ if( (pThis->m_nState & GDK_WINDOW_STATE_ICONIFIED) != (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED ) ) ++ { ++ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_RESIZE ); ++ pThis->TriggerPaintEvent(); ++ } ++ ++ if( (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_MAXIMIZED) && ++ ! (pThis->m_nState & GDK_WINDOW_STATE_MAXIMIZED) ) ++ { ++ pThis->m_aRestorePosSize = ++ Rectangle( Point( pThis->maGeometry.nX, pThis->maGeometry.nY ), ++ Size( pThis->maGeometry.nWidth, pThis->maGeometry.nHeight ) ); ++ } ++ pThis->m_nState = pEvent->window_state.new_window_state; ++ ++ #if OSL_DEBUG_LEVEL > 1 ++ if( (pEvent->window_state.changed_mask & GDK_WINDOW_STATE_FULLSCREEN) ) ++ { ++ fprintf( stderr, "window %p %s full screen state\n", ++ pThis, ++ (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ? "enters" : "leaves"); ++ } ++ #endif ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ pThis->m_nVisibility = pEvent->state; ++ return true; ++} ++ ++void GtkSalFrame::signalDestroy( GtkWidget* pObj, gpointer frame ) ++{ ++ GtkSalFrame* pThis = static_cast(frame); ++ if( pObj == pThis->m_pWindow ) ++ { ++ pThis->m_pFixedContainer = NULL; ++ pThis->m_pEventBox = NULL; ++ pThis->m_pWindow = NULL; ++ pThis->InvalidateGraphics(); ++ } ++} ++ ++// GtkSalFrame::IMHandler ++ ++GtkSalFrame::IMHandler::IMHandler( GtkSalFrame* pFrame ) ++: m_pFrame(pFrame), ++ m_nPrevKeyPresses( 0 ), ++ m_pIMContext( NULL ), ++ m_bFocused( true ), ++ m_bPreeditJustChanged( false ) ++{ ++ m_aInputEvent.mpTextAttr = NULL; ++ createIMContext(); ++} ++ ++GtkSalFrame::IMHandler::~IMHandler() ++{ ++ // cancel an eventual event posted to begin preedit again ++ GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); ++ deleteIMContext(); ++} ++ ++void GtkSalFrame::IMHandler::createIMContext() ++{ ++ if( ! m_pIMContext ) ++ { ++ m_pIMContext = gtk_im_multicontext_new (); ++ g_signal_connect( m_pIMContext, "commit", ++ G_CALLBACK (signalIMCommit), this ); ++ g_signal_connect( m_pIMContext, "preedit_changed", ++ G_CALLBACK (signalIMPreeditChanged), this ); ++ g_signal_connect( m_pIMContext, "retrieve_surrounding", ++ G_CALLBACK (signalIMRetrieveSurrounding), this ); ++ g_signal_connect( m_pIMContext, "delete_surrounding", ++ G_CALLBACK (signalIMDeleteSurrounding), this ); ++ g_signal_connect( m_pIMContext, "preedit_start", ++ G_CALLBACK (signalIMPreeditStart), this ); ++ g_signal_connect( m_pIMContext, "preedit_end", ++ G_CALLBACK (signalIMPreeditEnd), this ); ++ ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_set_client_window( m_pIMContext, widget_get_window(GTK_WIDGET(m_pFrame->m_pWindow)) ); ++ gtk_im_context_focus_in( m_pIMContext ); ++ GetGenericData()->ErrorTrapPop(); ++ m_bFocused = true; ++ } ++} ++ ++void GtkSalFrame::IMHandler::deleteIMContext() ++{ ++ if( m_pIMContext ) ++ { ++ // first give IC a chance to deinitialize ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_set_client_window( m_pIMContext, NULL ); ++ GetGenericData()->ErrorTrapPop(); ++ // destroy old IC ++ g_object_unref( m_pIMContext ); ++ m_pIMContext = NULL; ++ } ++} ++ ++void GtkSalFrame::IMHandler::doCallEndExtTextInput() ++{ ++ m_aInputEvent.mpTextAttr = NULL; ++ m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); ++} ++ ++void GtkSalFrame::IMHandler::updateIMSpotLocation() ++{ ++ SalExtTextInputPosEvent aPosEvent; ++ m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvent ); ++ GdkRectangle aArea; ++ aArea.x = aPosEvent.mnX; ++ aArea.y = aPosEvent.mnY; ++ aArea.width = aPosEvent.mnWidth; ++ aArea.height = aPosEvent.mnHeight; ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_set_cursor_location( m_pIMContext, &aArea ); ++ GetGenericData()->ErrorTrapPop(); ++} ++ ++void GtkSalFrame::IMHandler::sendEmptyCommit() ++{ ++ vcl::DeletionListener aDel( m_pFrame ); ++ ++ SalExtTextInputEvent aEmptyEv; ++ aEmptyEv.mnTime = 0; ++ aEmptyEv.mpTextAttr = 0; ++ aEmptyEv.maText.clear(); ++ aEmptyEv.mnCursorPos = 0; ++ aEmptyEv.mnCursorFlags = 0; ++ aEmptyEv.mbOnlyCursor = False; ++ m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEmptyEv ); ++ if( ! aDel.isDeleted() ) ++ m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL ); ++} ++ ++void GtkSalFrame::IMHandler::endExtTextInput( sal_uInt16 /*nFlags*/ ) ++{ ++ gtk_im_context_reset ( m_pIMContext ); ++ ++ if( m_aInputEvent.mpTextAttr ) ++ { ++ vcl::DeletionListener aDel( m_pFrame ); ++ // delete preedit in sal (commit an empty string) ++ sendEmptyCommit(); ++ if( ! aDel.isDeleted() ) ++ { ++ // mark previous preedit state again (will e.g. be sent at focus gain) ++ m_aInputEvent.mpTextAttr = &m_aInputFlags[0]; ++ if( m_bFocused ) ++ { ++ // begin preedit again ++ GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); ++ } ++ } ++ } ++} ++ ++void GtkSalFrame::IMHandler::focusChanged( bool bFocusIn ) ++{ ++ m_bFocused = bFocusIn; ++ if( bFocusIn ) ++ { ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_focus_in( m_pIMContext ); ++ GetGenericData()->ErrorTrapPop(); ++ if( m_aInputEvent.mpTextAttr ) ++ { ++ sendEmptyCommit(); ++ // begin preedit again ++ GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); ++ } ++ } ++ else ++ { ++ GetGenericData()->ErrorTrapPush(); ++ gtk_im_context_focus_out( m_pIMContext ); ++ GetGenericData()->ErrorTrapPop(); ++ // cancel an eventual event posted to begin preedit again ++ GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT ); ++ } ++} ++ ++bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent ) ++{ ++ vcl::DeletionListener aDel( m_pFrame ); ++ ++ if( pEvent->type == GDK_KEY_PRESS ) ++ { ++ // Add this key press event to the list of previous key presses ++ // to which we compare key release events. If a later key release ++ // event has a matching key press event in this list, we swallow ++ // the key release because some GTK Input Methods don't swallow it ++ // for us. ++ m_aPrevKeyPresses.push_back( PreviousKeyPress(pEvent) ); ++ m_nPrevKeyPresses++; ++ ++ // Also pop off the earliest key press event if there are more than 10 ++ // already. ++ while (m_nPrevKeyPresses > 10) ++ { ++ m_aPrevKeyPresses.pop_front(); ++ m_nPrevKeyPresses--; ++ } ++ ++ GObject* pRef = G_OBJECT( g_object_ref( G_OBJECT( m_pIMContext ) ) ); ++ ++ // #i51353# update spot location on every key input since we cannot ++ // know which key may activate a preedit choice window ++ updateIMSpotLocation(); ++ if( aDel.isDeleted() ) ++ return true; ++ ++ gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent ); ++ g_object_unref( pRef ); ++ ++ if( aDel.isDeleted() ) ++ return true; ++ ++ m_bPreeditJustChanged = false; ++ ++ if( bResult ) ++ return true; ++ else ++ { ++ DBG_ASSERT( m_nPrevKeyPresses > 0, "key press has vanished !" ); ++ if( ! m_aPrevKeyPresses.empty() ) // sanity check ++ { ++ // event was not swallowed, do not filter a following ++ // key release event ++ // note: this relies on gtk_im_context_filter_keypress ++ // returning without calling a handler (in the "not swallowed" ++ // case ) which might change the previous key press list so ++ // we would pop the wrong event here ++ m_aPrevKeyPresses.pop_back(); ++ m_nPrevKeyPresses--; ++ } ++ } ++ } ++ ++ // Determine if we got an earlier key press event corresponding to this key release ++ if (pEvent->type == GDK_KEY_RELEASE) ++ { ++ GObject* pRef = G_OBJECT( g_object_ref( G_OBJECT( m_pIMContext ) ) ); ++ gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent ); ++ g_object_unref( pRef ); ++ ++ if( aDel.isDeleted() ) ++ return true; ++ ++ m_bPreeditJustChanged = false; ++ ++ std::list::iterator iter = m_aPrevKeyPresses.begin(); ++ std::list::iterator iter_end = m_aPrevKeyPresses.end(); ++ while (iter != iter_end) ++ { ++ // If we found a corresponding previous key press event, swallow the release ++ // and remove the earlier key press from our list ++ if (*iter == pEvent) ++ { ++ m_aPrevKeyPresses.erase(iter); ++ m_nPrevKeyPresses--; ++ return true; ++ } ++ ++iter; ++ } ++ ++ if( bResult ) ++ return true; ++ } ++ ++ return false; ++} ++ ++/* FIXME: ++* #122282# still more hacking: some IMEs never start a preedit but simply commit ++* in this case we cannot commit a single character. Workaround: do not do the ++* single key hack for enter or space if the unicode committed does not match ++*/ ++ ++static bool checkSingleKeyCommitHack( guint keyval, sal_Unicode cCode ) ++{ ++ bool bRet = true; ++ switch( keyval ) ++ { ++ case GDK_KP_Enter: ++ case GDK_Return: ++ if( cCode != '\n' && cCode != '\r' ) ++ bRet = false; ++ break; ++ case GDK_space: ++ case GDK_KP_Space: ++ if( cCode != ' ' ) ++ bRet = false; ++ break; ++ default: ++ break; ++ } ++ return bRet; ++} ++ ++void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* pContext, gchar* pText, gpointer im_handler ) ++{ ++ GtkSalFrame::IMHandler* pThis = static_cast(im_handler); ++ ++ SolarMutexGuard aGuard; ++ vcl::DeletionListener aDel( pThis->m_pFrame ); ++ { ++ const bool bWasPreedit = ++ (pThis->m_aInputEvent.mpTextAttr != 0) || ++ pThis->m_bPreeditJustChanged; ++ ++ pThis->m_aInputEvent.mnTime = 0; ++ pThis->m_aInputEvent.mpTextAttr = 0; ++ pThis->m_aInputEvent.maText = OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ); ++ pThis->m_aInputEvent.mnCursorPos = pThis->m_aInputEvent.maText.getLength(); ++ pThis->m_aInputEvent.mnCursorFlags = 0; ++ pThis->m_aInputEvent.mbOnlyCursor = False; ++ ++ pThis->m_aInputFlags.clear(); ++ ++ /* necessary HACK: all keyboard input comes in here as soon as a IMContext is set ++ * which is logical and consequent. But since even simple input like ++ * comes through the commit signal instead of signalKey ++ * and all kinds of windows only implement KeyInput (e.g. PushButtons, ++ * RadioButtons and a lot of other Controls), will send a single ++ * KeyInput/KeyUp sequence instead of an ExtText event if there ++ * never was a preedit and the text is only one character. ++ * ++ * In this case there the last ExtText event must have been ++ * SALEVENT_ENDEXTTEXTINPUT, either because of a regular commit ++ * or because there never was a preedit. ++ */ ++ bool bSingleCommit = false; ++ if( ! bWasPreedit ++ && pThis->m_aInputEvent.maText.getLength() == 1 ++ && ! pThis->m_aPrevKeyPresses.empty() ++ ) ++ { ++ const PreviousKeyPress& rKP = pThis->m_aPrevKeyPresses.back(); ++ sal_Unicode aOrigCode = pThis->m_aInputEvent.maText[0]; ++ ++ if( checkSingleKeyCommitHack( rKP.keyval, aOrigCode ) ) ++ { ++ pThis->m_pFrame->doKeyCallback( rKP.state, rKP.keyval, rKP.hardware_keycode, rKP.group, rKP.time, aOrigCode, true, true ); ++ bSingleCommit = true; ++ } ++ } ++ if( ! bSingleCommit ) ++ { ++ pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent); ++ if( ! aDel.isDeleted() ) ++ pThis->doCallEndExtTextInput(); ++ } ++ if( ! aDel.isDeleted() ) ++ { ++ // reset input event ++ pThis->m_aInputEvent.maText.clear(); ++ pThis->m_aInputEvent.mnCursorPos = 0; ++ pThis->updateIMSpotLocation(); ++ } ++ } ++#ifdef SOLARIS ++ // #i51356# workaround a solaris IIIMP bug ++ // in case of partial commits the preedit changed signal ++ // and commit signal come in wrong order ++ if( ! aDel.isDeleted() ) ++ signalIMPreeditChanged( pContext, im_handler ); ++#else ++ (void) pContext; ++#endif ++} ++ ++void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_handler ) ++{ ++ GtkSalFrame::IMHandler* pThis = static_cast(im_handler); ++ ++ char* pText = NULL; ++ PangoAttrList* pAttrs = NULL; ++ gint nCursorPos = 0; ++ ++ gtk_im_context_get_preedit_string( pThis->m_pIMContext, ++ &pText, ++ &pAttrs, ++ &nCursorPos ); ++ if( pText && ! *pText ) // empty string ++ { ++ // change from nothing to nothing -> do not start preedit ++ // e.g. this will activate input into a calc cell without ++ // user input ++ if( pThis->m_aInputEvent.maText.getLength() == 0 ) ++ { ++ g_free( pText ); ++ pango_attr_list_unref( pAttrs ); ++ return; ++ } ++ } ++ ++ pThis->m_bPreeditJustChanged = true; ++ ++ bool bEndPreedit = (!pText || !*pText) && pThis->m_aInputEvent.mpTextAttr != NULL; ++ pThis->m_aInputEvent.mnTime = 0; ++ pThis->m_aInputEvent.maText = pText ? OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ) : OUString(); ++ pThis->m_aInputEvent.mnCursorPos = nCursorPos; ++ pThis->m_aInputEvent.mnCursorFlags = 0; ++ pThis->m_aInputEvent.mbOnlyCursor = False; ++ ++ pThis->m_aInputFlags = std::vector( std::max( 1, (int)pThis->m_aInputEvent.maText.getLength() ), 0 ); ++ ++ PangoAttrIterator *iter = pango_attr_list_get_iterator(pAttrs); ++ do ++ { ++ GSList *attr_list = NULL; ++ GSList *tmp_list = NULL; ++ gint start, end; ++ guint sal_attr = 0; ++ ++ pango_attr_iterator_range (iter, &start, &end); ++ if (end == G_MAXINT) ++ end = pText ? strlen (pText) : 0; ++ if (end == start) ++ continue; ++ ++ start = g_utf8_pointer_to_offset (pText, pText + start); ++ end = g_utf8_pointer_to_offset (pText, pText + end); ++ ++ tmp_list = attr_list = pango_attr_iterator_get_attrs (iter); ++ while (tmp_list) ++ { ++ PangoAttribute *pango_attr = static_cast(tmp_list->data); ++ ++ switch (pango_attr->klass->type) ++ { ++ case PANGO_ATTR_BACKGROUND: ++ sal_attr |= (EXTTEXTINPUT_ATTR_HIGHLIGHT | EXTTEXTINPUT_CURSOR_INVISIBLE); ++ break; ++ case PANGO_ATTR_UNDERLINE: ++ sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE; ++ break; ++ case PANGO_ATTR_STRIKETHROUGH: ++ sal_attr |= EXTTEXTINPUT_ATTR_REDTEXT; ++ break; ++ default: ++ break; ++ } ++ pango_attribute_destroy (pango_attr); ++ tmp_list = tmp_list->next; ++ } ++ if (sal_attr == 0) ++ sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE; ++ g_slist_free (attr_list); ++ ++ // Set the sal attributes on our text ++ for (int i = start; i < end; ++i) ++ { ++ SAL_WARN_IF(i >= static_cast(pThis->m_aInputFlags.size()), ++ "vcl.gtk", "pango attrib out of range. Broken range: " ++ << start << "," << end << " Legal range: 0," ++ << pThis->m_aInputFlags.size()); ++ if (i >= static_cast(pThis->m_aInputFlags.size())) ++ continue; ++ pThis->m_aInputFlags[i] |= sal_attr; ++ } ++ } while (pango_attr_iterator_next (iter)); ++ pango_attr_iterator_destroy(iter); ++ ++ pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0]; ++ ++ g_free( pText ); ++ pango_attr_list_unref( pAttrs ); ++ ++ SolarMutexGuard aGuard; ++ vcl::DeletionListener aDel( pThis->m_pFrame ); ++ ++ pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent); ++ if( bEndPreedit && ! aDel.isDeleted() ) ++ pThis->doCallEndExtTextInput(); ++ if( ! aDel.isDeleted() ) ++ pThis->updateIMSpotLocation(); ++} ++ ++void GtkSalFrame::IMHandler::signalIMPreeditStart( GtkIMContext*, gpointer /*im_handler*/ ) ++{ ++} ++ ++void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_handler ) ++{ ++ GtkSalFrame::IMHandler* pThis = static_cast(im_handler); ++ ++ pThis->m_bPreeditJustChanged = true; ++ ++ SolarMutexGuard aGuard; ++ vcl::DeletionListener aDel( pThis->m_pFrame ); ++ pThis->doCallEndExtTextInput(); ++ if( ! aDel.isDeleted() ) ++ pThis->updateIMSpotLocation(); ++} ++ ++uno::Reference ++ FindFocus(uno::Reference< accessibility::XAccessibleContext > xContext) ++{ ++ if (!xContext.is()) ++ uno::Reference< accessibility::XAccessibleEditableText >(); ++ ++ uno::Reference xState = xContext->getAccessibleStateSet(); ++ if (xState.is()) ++ { ++ if (xState->contains(accessibility::AccessibleStateType::FOCUSED)) ++ return uno::Reference(xContext, uno::UNO_QUERY); ++ } ++ ++ for (sal_Int32 i = 0; i < xContext->getAccessibleChildCount(); ++i) ++ { ++ uno::Reference< accessibility::XAccessible > xChild = xContext->getAccessibleChild(i); ++ if (!xChild.is()) ++ continue; ++ uno::Reference< accessibility::XAccessibleContext > xChildContext = xChild->getAccessibleContext(); ++ if (!xChildContext.is()) ++ continue; ++ uno::Reference< accessibility::XAccessibleEditableText > xText = FindFocus(xChildContext); ++ if (xText.is()) ++ return xText; ++ } ++ return uno::Reference< accessibility::XAccessibleEditableText >(); ++} ++ ++static uno::Reference lcl_GetxText(vcl::Window *pFocusWin) ++{ ++ uno::Reference xText; ++ try ++ { ++ uno::Reference< accessibility::XAccessible > xAccessible( pFocusWin->GetAccessible( true ) ); ++ if (xAccessible.is()) ++ xText = FindFocus(xAccessible->getAccessibleContext()); ++ } ++ catch(const uno::Exception& e) ++ { ++ SAL_WARN( "vcl.gtk", "Exception in getting input method surrounding text: " << e.Message); ++ } ++ return xText; ++} ++ ++gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* pContext, gpointer /*im_handler*/ ) ++{ ++ vcl::Window *pFocusWin = Application::GetFocusWindow(); ++ if (!pFocusWin) ++ return true; ++ ++ uno::Reference xText = lcl_GetxText(pFocusWin); ++ if (xText.is()) ++ { ++ sal_Int32 nPosition = xText->getCaretPosition(); ++ OUString sAllText = xText->getText(); ++ OString sUTF = OUStringToOString(sAllText, RTL_TEXTENCODING_UTF8); ++ OUString sCursorText(sAllText.copy(0, nPosition)); ++ gtk_im_context_set_surrounding(pContext, sUTF.getStr(), sUTF.getLength(), ++ OUStringToOString(sCursorText, RTL_TEXTENCODING_UTF8).getLength()); ++ return true; ++ } ++ ++ return false; ++} ++ ++gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint offset, gint nchars, ++ gpointer /*im_handler*/ ) ++{ ++ vcl::Window *pFocusWin = Application::GetFocusWindow(); ++ if (!pFocusWin) ++ return true; ++ ++ uno::Reference xText = lcl_GetxText(pFocusWin); ++ if (xText.is()) ++ { ++ sal_Int32 nPosition = xText->getCaretPosition(); ++ // #i111768# range checking ++ sal_Int32 nDeletePos = nPosition + offset; ++ sal_Int32 nDeleteEnd = nDeletePos + nchars; ++ if (nDeletePos < 0) ++ nDeletePos = 0; ++ if (nDeleteEnd < 0) ++ nDeleteEnd = 0; ++ if (nDeleteEnd > xText->getCharacterCount()) ++ nDeleteEnd = xText->getCharacterCount(); ++ ++ xText->deleteText(nDeletePos, nDeleteEnd); ++ //tdf91641 adjust cursor if deleted chars shift it forward (normal case) ++ if (nDeletePos < nPosition) ++ { ++ if (nDeleteEnd <= nPosition) ++ nPosition = nPosition - (nDeleteEnd - nDeletePos); ++ else ++ nPosition = nDeletePos; ++ ++ if (xText->getCharacterCount() >= nPosition) ++ xText->setCaretPosition( nPosition ); ++ } ++ return true; ++ } ++ ++ return false; ++} ++ ++Size GtkSalDisplay::GetScreenSize( int nDisplayScreen ) ++{ ++ Rectangle aRect = m_pSys->GetDisplayScreenPosSizePixel( nDisplayScreen ); ++ return Size( aRect.GetWidth(), aRect.GetHeight() ); ++} ++ ++Window GtkSalFrame::GetX11Window() ++{ ++ return widget_get_xid(m_pWindow); ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx +new file mode 100644 +index 0000000..5716058 +--- /dev/null ++++ b/vcl/unx/gtk3/gtk3gtkinst.cxx +@@ -0,0 +1,641 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ++ * This file is part of the LibreOffice project. ++ * ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ */ ++ ++#include "../../gtk/app/gtkinst.cxx" ++ ++#include ++#include "com/sun/star/lang/XServiceInfo.hpp" ++#include "com/sun/star/lang/XSingleServiceFactory.hpp" ++#include "com/sun/star/lang/XInitialization.hpp" ++#include "com/sun/star/lang/DisposedException.hpp" ++#include "com/sun/star/datatransfer/XTransferable.hpp" ++#include "com/sun/star/datatransfer/clipboard/XClipboard.hpp" ++#include "com/sun/star/datatransfer/clipboard/XClipboardEx.hpp" ++#include "com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp" ++#include "com/sun/star/datatransfer/clipboard/XClipboardListener.hpp" ++#include "com/sun/star/datatransfer/clipboard/XSystemClipboard.hpp" ++#include "com/sun/star/datatransfer/dnd/XDragSource.hpp" ++#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp" ++#include "com/sun/star/datatransfer/dnd/DNDConstants.hpp" ++#include ++#include ++#include "cppuhelper/compbase.hxx" ++#include "cppuhelper/implbase1.hxx" ++#include ++ ++using namespace com::sun::star; ++using namespace com::sun::star::uno; ++using namespace com::sun::star::lang; ++ ++namespace ++{ ++ struct TypeEntry ++ { ++ const char* pNativeType; // string corresponding to nAtom for the case of nAtom being uninitialized ++ const char* pType; // Mime encoding on our side ++ }; ++ ++ static TypeEntry aConversionTab[] = ++ { ++ { "ISO10646-1", "text/plain;charset=utf-16" }, ++ { "UTF8_STRING", "text/plain;charset=utf-8" }, ++ { "UTF-8", "text/plain;charset=utf-8" }, ++ { "text/plain;charset=UTF-8", "text/plain;charset=utf-8" }, ++ // ISO encodings ++ { "ISO8859-2", "text/plain;charset=iso8859-2" }, ++ { "ISO8859-3", "text/plain;charset=iso8859-3" }, ++ { "ISO8859-4", "text/plain;charset=iso8859-4" }, ++ { "ISO8859-5", "text/plain;charset=iso8859-5" }, ++ { "ISO8859-6", "text/plain;charset=iso8859-6" }, ++ { "ISO8859-7", "text/plain;charset=iso8859-7" }, ++ { "ISO8859-8", "text/plain;charset=iso8859-8" }, ++ { "ISO8859-9", "text/plain;charset=iso8859-9" }, ++ { "ISO8859-10", "text/plain;charset=iso8859-10" }, ++ { "ISO8859-13", "text/plain;charset=iso8859-13" }, ++ { "ISO8859-14", "text/plain;charset=iso8859-14" }, ++ { "ISO8859-15", "text/plain;charset=iso8859-15" }, ++ // asian encodings ++ { "JISX0201.1976-0", "text/plain;charset=jisx0201.1976-0" }, ++ { "JISX0208.1983-0", "text/plain;charset=jisx0208.1983-0" }, ++ { "JISX0208.1990-0", "text/plain;charset=jisx0208.1990-0" }, ++ { "JISX0212.1990-0", "text/plain;charset=jisx0212.1990-0" }, ++ { "GB2312.1980-0", "text/plain;charset=gb2312.1980-0" }, ++ { "KSC5601.1992-0", "text/plain;charset=ksc5601.1992-0" }, ++ // eastern european encodings ++ { "KOI8-R", "text/plain;charset=koi8-r" }, ++ { "KOI8-U", "text/plain;charset=koi8-u" }, ++ // String (== iso8859-1) ++ { "STRING", "text/plain;charset=iso8859-1" }, ++ // special for compound text ++ { "COMPOUND_TEXT", "text/plain;charset=compound_text" }, ++ ++ // PIXMAP ++ { "PIXMAP", "image/bmp" } ++ }; ++ ++ class DataFlavorEq : public std::unary_function ++ { ++ private: ++ const css::datatransfer::DataFlavor& m_rData; ++ public: ++ explicit DataFlavorEq(const css::datatransfer::DataFlavor& rData) : m_rData(rData) {} ++ bool operator() (const css::datatransfer::DataFlavor& rData) const ++ { ++ return rData.MimeType == m_rData.MimeType && ++ rData.DataType == m_rData.DataType; ++ } ++ }; ++} ++ ++class GtkTransferable : public ::cppu::WeakImplHelper1 < ++ css::datatransfer::XTransferable > ++{ ++private: ++ GdkAtom m_nSelection; ++ std::map m_aMimeTypeToAtom; ++public: ++ ++ GtkTransferable(GdkAtom nSelection) ++ : m_nSelection(nSelection) ++ { ++ } ++ ++ /* ++ * XTransferable ++ */ ++ ++ virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor& rFlavor) ++ throw(css::datatransfer::UnsupportedFlavorException, ++ css::io::IOException, ++ css::uno::RuntimeException, std::exception ++ ) SAL_OVERRIDE ++ { ++ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); ++ if (rFlavor.MimeType == "text/plain;charset=utf-16") ++ { ++ OUString aStr; ++ gchar *pText = gtk_clipboard_wait_for_text(clipboard); ++ if (pText) ++ aStr = OUString(pText, rtl_str_getLength(pText), RTL_TEXTENCODING_UTF8); ++ g_free(pText); ++ css::uno::Any aRet; ++ aRet <<= aStr.replaceAll("\r\n", "\n"); ++ return aRet; ++ } ++ ++ auto it = m_aMimeTypeToAtom.find(rFlavor.MimeType); ++ if (it == m_aMimeTypeToAtom.end()) ++ return css::uno::Any(); ++ ++ css::uno::Any aRet; ++ GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard, ++ it->second); ++ gint length; ++ const guchar *rawdata = gtk_selection_data_get_data_with_length(data, ++ &length); ++ Sequence aSeq(reinterpret_cast(rawdata), length); ++ gtk_selection_data_free(data); ++ aRet <<= aSeq; ++ return aRet; ++ } ++ ++ std::vector getTransferDataFlavorsAsVector() ++ { ++ std::vector aVector; ++ ++ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); ++ ++ GdkAtom *targets; ++ gint n_targets; ++ if (gtk_clipboard_wait_for_targets(clipboard, &targets, &n_targets)) ++ { ++ bool bHaveText = false, bHaveUTF16 = false; ++ ++ for (gint i = 0; i < n_targets; ++i) ++ { ++ gchar* pName = gdk_atom_name(targets[i]); ++ const char* pFinalName = pName; ++ css::datatransfer::DataFlavor aFlavor; ++ ++ for (size_t j = 0; j < SAL_N_ELEMENTS(aConversionTab); ++j) ++ { ++ if (rtl_str_compare(pName, aConversionTab[j].pNativeType) == 0) ++ { ++ pFinalName = aConversionTab[j].pType; ++ break; ++ } ++ } ++ ++ aFlavor.MimeType = OUString(pFinalName, ++ rtl_str_getLength(pFinalName), ++ RTL_TEXTENCODING_UTF8); ++ ++ m_aMimeTypeToAtom[aFlavor.MimeType] = targets[i]; ++ ++ aFlavor.DataType = cppu::UnoType>::get(); ++ ++ sal_Int32 nIndex(0); ++ if (aFlavor.MimeType.getToken(0, ';', nIndex) == "text/plain") ++ { ++ bHaveText = true; ++ OUString aToken(aFlavor.MimeType.getToken(0, ';', nIndex)); ++ if (aToken == "charset=utf-16") ++ { ++ bHaveUTF16 = true; ++ aFlavor.DataType = cppu::UnoType::get(); ++ } ++ } ++ aVector.push_back(aFlavor); ++ g_free(pName); ++ } ++ ++ g_free(targets); ++ ++ //If we have text, but no UTF-16 format which is basically the only ++ //text-format LibreOffice supports for cnp then claim we do and we ++ //will convert on demand ++ if (bHaveText && !bHaveUTF16) ++ { ++ css::datatransfer::DataFlavor aFlavor; ++ aFlavor.MimeType = "text/plain;charset=utf-16"; ++ aFlavor.DataType = cppu::UnoType::get(); ++ aVector.push_back(aFlavor); ++ } ++ } ++ ++ return aVector; ++ } ++ ++ virtual css::uno::Sequence SAL_CALL getTransferDataFlavors() ++ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE ++ { ++ return comphelper::containerToSequence(getTransferDataFlavorsAsVector()); ++ } ++ ++ virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor& rFlavor) ++ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE ++ { ++ const std::vector aAll = ++ getTransferDataFlavorsAsVector(); ++ ++ return std::find_if(aAll.begin(), aAll.end(), DataFlavorEq(rFlavor)) != aAll.end(); ++ } ++}; ++ ++//We want to use gtk_clipboard_get_owner own owner-change to distinguish between ++//us gaining the clipboard ownership vs losing it. To do that we need to use ++//gtk_clipboard_set_with_owner and to do that we need a GObject, so define ++//one here for that purpose and just give it a VclGtkClipboard* member ++class VclGtkClipboard; ++ ++typedef struct _ClipboardOwner ClipboardOwner; ++typedef struct _ClipboardOwnerClass ClipboardOwnerClass; ++ ++struct _ClipboardOwner ++{ ++ GObject parent_instance; ++ ++ /* instance members */ ++ VclGtkClipboard* m_pThis; ++}; ++ ++struct _ClipboardOwnerClass ++{ ++ GObjectClass parent_class; ++ ++ /* class members */ ++}; ++ ++#define CLIPBOARD_OWNER_OBJECT (clipboard_owner_get_type ()) ++#define CLIPBOARD_OWNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLIPBOARD_OWNER_OBJECT, ClipboardOwner)) ++ ++#ifdef __GNUC__ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wunused-function" ++#endif ++G_DEFINE_TYPE(ClipboardOwner, clipboard_owner, G_TYPE_OBJECT); ++#ifdef __GNUC__ ++#pragma GCC diagnostic pop ++#endif ++ ++static void clipboard_owner_class_init (ClipboardOwnerClass *) ++{ ++} ++ ++static void clipboard_owner_init(ClipboardOwner *) ++{ ++} ++ ++class VclGtkClipboard : ++ public cppu::WeakComponentImplHelper< ++ datatransfer::clipboard::XSystemClipboard, ++ XServiceInfo> ++{ ++ GdkAtom m_nSelection; ++ osl::Mutex m_aMutex; ++ ClipboardOwner* m_pOwner; ++ gulong m_nOwnerChangedSignalId; ++ Reference m_aContents; ++ Reference m_aOwner; ++ std::list< Reference > m_aListeners; ++ std::vector m_aGtkTargets; ++ std::vector m_aInfoToFlavor; ++ ++public: ++ ++ VclGtkClipboard(GdkAtom nSelection); ++ virtual ~VclGtkClipboard(); ++ ++ /* ++ * XServiceInfo ++ */ ++ ++ virtual OUString SAL_CALL getImplementationName() throw( RuntimeException, std::exception ) SAL_OVERRIDE; ++ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( RuntimeException, std::exception ) SAL_OVERRIDE; ++ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( RuntimeException, std::exception ) SAL_OVERRIDE; ++ ++ static OUString getImplementationName_static(); ++ static Sequence< OUString > getSupportedServiceNames_static(); ++ ++ /* ++ * XClipboard ++ */ ++ ++ virtual Reference< css::datatransfer::XTransferable > SAL_CALL getContents() ++ throw(RuntimeException, std::exception) SAL_OVERRIDE; ++ ++ virtual void SAL_CALL setContents( ++ const Reference< css::datatransfer::XTransferable >& xTrans, ++ const Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ) ++ throw(RuntimeException, std::exception) SAL_OVERRIDE; ++ ++ virtual OUString SAL_CALL getName() ++ throw(RuntimeException, std::exception) SAL_OVERRIDE; ++ ++ /* ++ * XClipboardEx ++ */ ++ ++ virtual sal_Int8 SAL_CALL getRenderingCapabilities() ++ throw(RuntimeException, std::exception) SAL_OVERRIDE; ++ ++ /* ++ * XClipboardNotifier ++ */ ++ virtual void SAL_CALL addClipboardListener( ++ const Reference< css::datatransfer::clipboard::XClipboardListener >& listener ) ++ throw(RuntimeException, std::exception) SAL_OVERRIDE; ++ ++ virtual void SAL_CALL removeClipboardListener( ++ const Reference< css::datatransfer::clipboard::XClipboardListener >& listener ) ++ throw(RuntimeException, std::exception) SAL_OVERRIDE; ++ ++ void ClipboardGet(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info); ++ void ClipboardClear(GtkClipboard *clipboard); ++ void OwnerChanged(GtkClipboard *clipboard, GdkEvent *event); ++private: ++ GtkTargetEntry makeGtkTargetEntry(const css::datatransfer::DataFlavor& rFlavor); ++}; ++ ++OUString VclGtkClipboard::getImplementationName_static() ++{ ++ return OUString( "com.sun.star.datatransfer.VclGtkClipboard" ); ++} ++ ++Sequence< OUString > VclGtkClipboard::getSupportedServiceNames_static() ++{ ++ Sequence< OUString > aRet(1); ++ aRet[0] = "com.sun.star.datatransfer.clipboard.SystemClipboard"; ++ return aRet; ++} ++ ++OUString VclGtkClipboard::getImplementationName() throw( RuntimeException, std::exception ) ++{ ++ return getImplementationName_static(); ++} ++ ++Sequence< OUString > VclGtkClipboard::getSupportedServiceNames() throw( RuntimeException, std::exception ) ++{ ++ return getSupportedServiceNames_static(); ++} ++ ++sal_Bool VclGtkClipboard::supportsService( const OUString& ServiceName ) throw( RuntimeException, std::exception ) ++{ ++ return cppu::supportsService(this, ServiceName); ++} ++ ++Reference< css::datatransfer::XTransferable > VclGtkClipboard::getContents() throw( RuntimeException, std::exception ) ++{ ++ if (G_OBJECT(m_pOwner) != gtk_clipboard_get_owner(gtk_clipboard_get(m_nSelection)) && ++ !m_aContents.is()) ++ { ++ //tdf#93887 This is the system clipboard/selection. We fetch it when we are not ++ //the owner of the clipboard and have not already fetched it. ++ m_aContents = new GtkTransferable(m_nSelection); ++ } ++ return m_aContents; ++} ++ ++void VclGtkClipboard::ClipboardGet(GtkClipboard* /*clipboard*/, GtkSelectionData *selection_data, ++ guint info) ++{ ++ if (!m_aContents.is()) ++ return; ++ ++ GdkAtom type(gdk_atom_intern(OUStringToOString(m_aInfoToFlavor[info].MimeType, ++ RTL_TEXTENCODING_UTF8).getStr(), ++ false)); ++ ++ css::datatransfer::DataFlavor aFlavor(m_aInfoToFlavor[info]); ++ if (aFlavor.MimeType == "UTF8_STRING" || aFlavor.MimeType == "STRING") ++ aFlavor.MimeType = "text/plain;charset=utf-8"; ++ ++ Sequence aData; ++ Any aValue; ++ ++ try ++ { ++ aValue = m_aContents->getTransferData(aFlavor); ++ } ++ catch(...) ++ { ++ } ++ ++ if (aValue.getValueTypeClass() == TypeClass_STRING) ++ { ++ OUString aString; ++ aValue >>= aString; ++ aData = Sequence< sal_Int8 >( reinterpret_cast(aString.getStr()), aString.getLength() * sizeof( sal_Unicode ) ); ++ } ++ else if (aValue.getValueType() == cppu::UnoType>::get()) ++ { ++ aValue >>= aData; ++ } ++ else if (aFlavor.MimeType == "text/plain;charset=utf-8") ++ { ++ //didn't have utf-8, try utf-16 and convert ++ aFlavor.MimeType = "text/plain;charset=utf-16"; ++ aFlavor.DataType = cppu::UnoType::get(); ++ try ++ { ++ aValue = m_aContents->getTransferData(aFlavor); ++ } ++ catch(...) ++ { ++ } ++ OUString aString; ++ aValue >>= aString; ++ OString aUTF8String(OUStringToOString(aString, RTL_TEXTENCODING_UTF8)); ++ gtk_selection_data_set(selection_data, type, 8, ++ reinterpret_cast(aUTF8String.getStr()), ++ aUTF8String.getLength()); ++ return; ++ } ++ ++ gtk_selection_data_set(selection_data, type, 8, ++ reinterpret_cast(aData.getArray()), ++ aData.getLength()); ++} ++ ++void VclGtkClipboard::OwnerChanged(GtkClipboard* clipboard, GdkEvent* /*event*/) ++{ ++ if (G_OBJECT(m_pOwner) != gtk_clipboard_get_owner(clipboard)) ++ { ++ //null out m_aContents to return control to the system-one which ++ //will be retrieved if getContents is called again ++ setContents(Reference(), ++ Reference()); ++ } ++} ++ ++void VclGtkClipboard::ClipboardClear(GtkClipboard * /*clipboard*/) ++{ ++ for (auto &a : m_aGtkTargets) ++ free(a.target); ++ m_aGtkTargets.clear(); ++} ++ ++GtkTargetEntry VclGtkClipboard::makeGtkTargetEntry(const css::datatransfer::DataFlavor& rFlavor) ++{ ++ GtkTargetEntry aEntry; ++ aEntry.target = ++ g_strdup(OUStringToOString(rFlavor.MimeType, RTL_TEXTENCODING_UTF8).getStr()); ++ aEntry.flags = 0; ++ auto it = std::find_if(m_aInfoToFlavor.begin(), m_aInfoToFlavor.end(), ++ DataFlavorEq(rFlavor)); ++ if (it != m_aInfoToFlavor.end()) ++ aEntry.info = std::distance(m_aInfoToFlavor.begin(), it); ++ else ++ { ++ aEntry.info = m_aInfoToFlavor.size(); ++ m_aInfoToFlavor.push_back(rFlavor); ++ } ++ return aEntry; ++} ++ ++namespace ++{ ++ void ClipboardGetFunc(GtkClipboard *clipboard, GtkSelectionData *selection_data, ++ guint info, ++ gpointer user_data_or_owner) ++ { ++ VclGtkClipboard* pThis = CLIPBOARD_OWNER(user_data_or_owner)->m_pThis; ++ pThis->ClipboardGet(clipboard, selection_data, info); ++ } ++ ++ void ClipboardClearFunc(GtkClipboard *clipboard, gpointer user_data_or_owner) ++ { ++ VclGtkClipboard* pThis = CLIPBOARD_OWNER(user_data_or_owner)->m_pThis; ++ pThis->ClipboardClear(clipboard); ++ } ++ ++ void handle_owner_change(GtkClipboard *clipboard, GdkEvent *event, gpointer user_data) ++ { ++ VclGtkClipboard* pThis = static_cast(user_data); ++ pThis->OwnerChanged(clipboard, event); ++ } ++} ++ ++VclGtkClipboard::VclGtkClipboard(GdkAtom nSelection) ++ : cppu::WeakComponentImplHelper ++ (m_aMutex) ++ , m_nSelection(nSelection) ++{ ++ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); ++ m_nOwnerChangedSignalId = g_signal_connect(clipboard, "owner-change", ++ G_CALLBACK(handle_owner_change), this); ++ m_pOwner = CLIPBOARD_OWNER(g_object_new(CLIPBOARD_OWNER_OBJECT, NULL)); ++ m_pOwner->m_pThis = this; ++} ++ ++VclGtkClipboard::~VclGtkClipboard() ++{ ++ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); ++ g_signal_handler_disconnect(clipboard, m_nOwnerChangedSignalId); ++ g_object_unref(m_pOwner); ++} ++ ++void VclGtkClipboard::setContents( ++ const Reference< css::datatransfer::XTransferable >& xTrans, ++ const Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ) ++ throw( RuntimeException, std::exception ) ++{ ++ osl::ClearableMutexGuard aGuard( m_aMutex ); ++ Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner ); ++ Reference< datatransfer::XTransferable > xOldContents( m_aContents ); ++ m_aContents = xTrans; ++ m_aOwner = xClipboardOwner; ++ ++ std::list< Reference< datatransfer::clipboard::XClipboardListener > > xListeners( m_aListeners ); ++ datatransfer::clipboard::ClipboardEvent aEv; ++ ++ if (m_aContents.is()) ++ { ++ css::uno::Sequence aFormats = xTrans->getTransferDataFlavors(); ++ std::vector aGtkTargets; ++ bool bHaveText(false), bHaveUTF8(false); ++ for (int i = 0; i < aFormats.getLength(); ++i) ++ { ++ const css::datatransfer::DataFlavor& rFlavor = aFormats[i]; ++ ++ sal_Int32 nIndex(0); ++ if (rFlavor.MimeType.getToken(0, ';', nIndex) == "text/plain") ++ { ++ bHaveText = true; ++ OUString aToken(rFlavor.MimeType.getToken(0, ';', nIndex)); ++ if (aToken == "charset=utf-8") ++ { ++ bHaveUTF8 = true; ++ } ++ } ++ GtkTargetEntry aEntry(makeGtkTargetEntry(rFlavor)); ++ aGtkTargets.push_back(aEntry); ++ } ++ ++ if (bHaveText) ++ { ++ css::datatransfer::DataFlavor aFlavor; ++ aFlavor.DataType = cppu::UnoType>::get(); ++ if (!bHaveUTF8) ++ { ++ aFlavor.MimeType = "text/plain;charset=utf-8"; ++ aGtkTargets.push_back(makeGtkTargetEntry(aFlavor)); ++ } ++ aFlavor.MimeType = "UTF8_STRING"; ++ aGtkTargets.push_back(makeGtkTargetEntry(aFlavor)); ++ aFlavor.MimeType = "STRING"; ++ aGtkTargets.push_back(makeGtkTargetEntry(aFlavor)); ++ } ++ ++ //if there was a previous gtk_clipboard_set_with_data call then ++ //ClipboardClearFunc will be called now ++ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); ++ //use with_owner with m_pOwner so we can distinguish in handle_owner_change ++ //if we have gained or lost ownership of the clipboard ++ gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(), ++ ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner)); ++ m_aGtkTargets = aGtkTargets; ++ } ++ ++ aEv.Contents = getContents(); ++ ++ aGuard.clear(); ++ ++ if( xOldOwner.is() && xOldOwner != xClipboardOwner ) ++ xOldOwner->lostOwnership( this, xOldContents ); ++ for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it = ++ xListeners.begin(); it != xListeners.end() ; ++it ) ++ { ++ (*it)->changedContents( aEv ); ++ } ++} ++ ++OUString VclGtkClipboard::getName() throw( RuntimeException, std::exception ) ++{ ++ return OUString( "CLIPBOARD" ); ++} ++ ++sal_Int8 VclGtkClipboard::getRenderingCapabilities() throw( RuntimeException, std::exception ) ++{ ++ return 0; ++} ++ ++void VclGtkClipboard::addClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener ) ++ throw( RuntimeException, std::exception ) ++{ ++ osl::ClearableMutexGuard aGuard( m_aMutex ); ++ ++ m_aListeners.push_back( listener ); ++} ++ ++void VclGtkClipboard::removeClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener ) ++ throw( RuntimeException, std::exception ) ++{ ++ osl::ClearableMutexGuard aGuard( m_aMutex ); ++ ++ m_aListeners.remove( listener ); ++} ++ ++Reference< XInterface > GtkInstance::CreateClipboard(const Sequence< Any >& arguments) ++{ ++ OUString sel; ++ if (arguments.getLength() == 0) { ++ sel = "CLIPBOARD"; ++ } else if (arguments.getLength() != 1 || !(arguments[0] >>= sel)) { ++ throw css::lang::IllegalArgumentException( ++ "bad GtkInstance::CreateClipboard arguments", ++ css::uno::Reference(), -1); ++ } ++ ++ GdkAtom nSelection = (sel == "CLIPBOARD") ? GDK_SELECTION_CLIPBOARD : GDK_SELECTION_PRIMARY; ++ ++ return Reference< XInterface >( static_cast(new VclGtkClipboard(nSelection)) ); ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/unx/gtk3/window/gtk3gtkframe.cxx b/vcl/unx/gtk3/window/gtk3gtkframe.cxx +deleted file mode 100644 +index 5710d50..0000000 +--- a/vcl/unx/gtk3/window/gtk3gtkframe.cxx ++++ /dev/null +@@ -1,12 +0,0 @@ +-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +-/* +- * This file is part of the LibreOffice project. +- * +- * This Source Code Form is subject to the terms of the Mozilla Public +- * License, v. 2.0. If a copy of the MPL was not distributed with this +- * file, You can obtain one at http://mozilla.org/MPL/2.0/. +- */ +- +-#include "../../gtk/window/gtksalframe.cxx" +- +-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +-- +2.5.0 + diff --git a/SOURCES/0001-n-up-printing-done-by-vcl-brochures-by-draw-impress.patch b/SOURCES/0001-n-up-printing-done-by-vcl-brochures-by-draw-impress.patch deleted file mode 100644 index f9a04b8..0000000 --- a/SOURCES/0001-n-up-printing-done-by-vcl-brochures-by-draw-impress.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 2c37487470c7ea76d493eb0554cf2f9458ed5075 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 23 Sep 2014 10:20:06 +0100 -Subject: [PATCH] n-up printing done by vcl, brochures by draw/impress - -Change-Id: If38365d949ad91d50138798a0a386f9543eb4f22 ---- - sd/source/ui/view/DocumentRenderer.cxx | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx -index 723aa02e..1a903f7 100644 ---- a/sd/source/ui/view/DocumentRenderer.cxx -+++ b/sd/source/ui/view/DocumentRenderer.cxx -@@ -1362,7 +1362,7 @@ private: - SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc(); - bool bIsDraw = pDocument->GetDocumentType() == DOCUMENT_TYPE_DRAW; - rInfo.meOrientation = ORIENTATION_PORTRAIT; -- bool bDoDodgyHeightWidthFit = !bIsDraw && !mpOptions->IsNotes(); -+ bool bDoDodgyHeightWidthFit = mpOptions->IsBooklet() || (!bIsDraw && !mpOptions->IsNotes()); - - if( ! mpOptions->IsBooklet()) - { -@@ -1371,7 +1371,8 @@ private: - else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height()) - rInfo.meOrientation = ORIENTATION_LANDSCAPE; - -- // Draw and Notes should abide by their specified paper size -+ // Draw and Notes should abide by their specified paper size, except -+ // for booklets - Size aPaperSize; - if (!bDoDodgyHeightWidthFit) - { -@@ -1448,8 +1449,8 @@ private: - if (mpOptions->IsTime()) - aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time( Time::SYSTEM ), false, false ); - -- // Draw should use specified paper size when printing -- if (mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_DRAW) -+ // Draw should use specified paper size when printing, except for booklets -+ if (!mpOptions->IsBooklet() && mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_DRAW) - { - aInfo.maPrintSize = mrBase.GetDocument()->GetSdPage(0, PK_STANDARD)->GetSize(); - maPrintSize = awt::Size(aInfo.maPrintSize.Width(), --- -1.9.3 - diff --git a/SOURCES/0001-negative-after-text-indents-ignored-by-msword-for-ap.patch b/SOURCES/0001-negative-after-text-indents-ignored-by-msword-for-ap.patch deleted file mode 100644 index a93db65..0000000 --- a/SOURCES/0001-negative-after-text-indents-ignored-by-msword-for-ap.patch +++ /dev/null @@ -1,87 +0,0 @@ -From b5ce50d1d07394f6b59b028373120369c83d5d66 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 7 Apr 2015 09:56:43 +0100 -Subject: [PATCH] negative after-text indents ignored by msword for apos - -Change-Id: I33e178f23bc4b1372c4c329954b301ae68902154 ---- - sw/source/filter/ww8/ww8graf.cxx | 3 +++ - sw/source/filter/ww8/ww8par.hxx | 2 ++ - sw/source/filter/ww8/ww8par6.cxx | 26 ++++++++++++++++++++++++++ - 3 files changed, 31 insertions(+) - -diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx -index 456ce25..3a11d1e 100644 ---- a/sw/source/filter/ww8/ww8graf.cxx -+++ b/sw/source/filter/ww8/ww8graf.cxx -@@ -2905,7 +2905,10 @@ SwFlyFrmFmt* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject, - MoveOutsideFly(pRetFrmFmt, aSave.GetStartPos(),!bJoined); - - aSave.Restore( this ); -+ -+ StripNegativeAfterIndent(pRetFrmFmt); - } -+ - } - return pRetFrmFmt; - } -diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx -index a7fdff5..0a34059 100644 ---- a/sw/source/filter/ww8/ww8par.hxx -+++ b/sw/source/filter/ww8/ww8par.hxx -@@ -1488,6 +1488,7 @@ private: - bool IsDropCap(); - bool IsListOrDropcap() { return (!pAktItemSet || bDropCap); }; - -+ //Apo == Absolutely Positioned Object, MSWord's old-style frames - WW8FlyPara *ConstructApo(const ApoTestResults &rApo, - const WW8_TablePos *pTabPos); - bool StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos, SvxULSpaceItem* pULSpaceItem = 0); -@@ -1495,6 +1496,7 @@ private: - bool TestSameApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); - ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd, - const WW8_TablePos *pTabPos); -+ void StripNegativeAfterIndent(SwFrmFmt *pFlyFmt) const; - - void EndSpecial(); - bool ProcessSpecial(bool &rbReSync, WW8_CP nStartCp); -diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx -index 418e130..b63e639 100644 ---- a/sw/source/filter/ww8/ww8par6.cxx -+++ b/sw/source/filter/ww8/ww8par6.cxx -@@ -2430,6 +2430,32 @@ bool SwWW8ImplReader::JoinNode(SwPaM &rPam, bool bStealAttr) - return bRet; - } - -+//In auto-width word frames negative after-indent values are ignored -+void SwWW8ImplReader::StripNegativeAfterIndent(SwFrmFmt *pFlyFmt) const -+{ -+ const SwNodeIndex* pSttNd = pFlyFmt->GetCntnt().GetCntntIdx(); -+ if (!pSttNd) -+ return; -+ -+ SwNodeIndex aIdx(*pSttNd, 1); -+ SwNodeIndex aEnd(*pSttNd->GetNode().EndOfSectionNode()); -+ while (aIdx < aEnd) -+ { -+ SwTxtNode *pNd = aIdx.GetNode().GetTxtNode(); -+ if (pNd) -+ { -+ const SvxLRSpaceItem& rLR = ItemGet(*pNd, RES_LR_SPACE); -+ if (rLR.GetRight() < 0) -+ { -+ SvxLRSpaceItem aLR(rLR); -+ aLR.SetRight(0); -+ pNd->SetAttr(aLR); -+ } -+ } -+ ++aIdx; -+ } -+} -+ - void SwWW8ImplReader::StopApo() - { - OSL_ENSURE(pWFlyPara, "no pWFlyPara to close"); --- -1.9.3 - diff --git a/SOURCES/0001-never-run-autogen.sh.patch b/SOURCES/0001-never-run-autogen.sh.patch index 3adc728..b65f8a7 100644 --- a/SOURCES/0001-never-run-autogen.sh.patch +++ b/SOURCES/0001-never-run-autogen.sh.patch @@ -12,7 +12,7 @@ index 206f5ed..14620da 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,7 +14,7 @@ MAKECMDGOALS?=all - SHELL=/usr/bin/env bash + SHELL := @SHELL_BASH@ SRCDIR := @SRC_ROOT@ BUILDDIR := @BUILDDIR@ -GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T) diff --git a/SOURCES/0001-only-set-cur.-page-once-when-removing-mult.-pages.patch b/SOURCES/0001-only-set-cur.-page-once-when-removing-mult.-pages.patch new file mode 100644 index 0000000..c52de74 --- /dev/null +++ b/SOURCES/0001-only-set-cur.-page-once-when-removing-mult.-pages.patch @@ -0,0 +1,54 @@ +From 3643ea7b660a1f8263d05ffa9be47e8180fd2504 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Thu, 5 May 2016 17:47:03 +0200 +Subject: [PATCH] only set cur. page once when removing mult. pages + +Change-Id: Id9da135a91d9591eed04fb25d2891169c45ecaaf +--- + .../ui/slidesorter/controller/SlsSelectionManager.cxx | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx +index 0768a1e..1e913b3 100644 +--- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx ++++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx +@@ -36,6 +36,9 @@ + #include "view/SlideSorterView.hxx" + #include "view/SlsLayouter.hxx" + #include "drawdoc.hxx" ++#include "drawview.hxx" ++#include "DrawViewShell.hxx" ++#include "ViewShellBase.hxx" + #include "Window.hxx" + #include + #include +@@ -117,6 +120,13 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage) + else + --nNewCurrentSlide; + ++ const auto pViewShell = mrSlideSorter.GetViewShell(); ++ const auto pDrawViewShell = pViewShell ? dynamic_cast(pViewShell->GetViewShellBase().GetMainViewShell().get()) : nullptr; ++ const auto pDrawView = pDrawViewShell ? dynamic_cast(pDrawViewShell->GetDrawView()) : nullptr; ++ ++ if (pDrawView) ++ pDrawView->BlockPageOrderChangedHint(true); ++ + // The actual deletion of the selected pages is done in one of two + // helper functions. They are specialized for normal respectively for + // master pages. +@@ -129,6 +139,12 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage) + + mrController.HandleModelChange(); + aLock.Release(); ++ if (pDrawView) ++ { ++ assert(pDrawViewShell); ++ pDrawView->BlockPageOrderChangedHint(false); ++ pDrawViewShell->ResetActualPage(); ++ } + + // Show focus and move it to next valid location. + if (bIsFocusShowing) +-- +2.7.4 + diff --git a/SOURCES/0001-ooo-93212-avoid-slicing-during-construction-of-SdrPa.patch b/SOURCES/0001-ooo-93212-avoid-slicing-during-construction-of-SdrPa.patch deleted file mode 100644 index 3c86bc4..0000000 --- a/SOURCES/0001-ooo-93212-avoid-slicing-during-construction-of-SdrPa.patch +++ /dev/null @@ -1,560 +0,0 @@ -From 9638e6207c7fc48712b1b238177462c00f5011e8 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Wed, 3 Dec 2014 22:01:57 +0100 -Subject: [PATCH] ooo#93212 avoid slicing during construction of SdrPage - -Also hide copy ctor and assignment operator of all derived classes, to -ensure that Clone() is the only method to make copies of them. - -Change-Id: Icb3b50c63b086abe8c9add32e3041fe19692d20b ---- - basctl/source/dlged/dlgedpage.cxx | 10 +++- - basctl/source/inc/dlgedpage.hxx | 5 ++ - include/svx/fmpage.hxx | 9 +++- - include/svx/obj3d.hxx | 8 ++- - include/svx/svdpage.hxx | 27 +++++++--- - reportdesign/inc/RptPage.hxx | 2 + - reportdesign/source/core/sdr/RptPage.cxx | 4 +- - sc/inc/drawpage.hxx | 3 ++ - sd/inc/sdpage.hxx | 6 ++- - sd/source/core/sdpage2.cxx | 28 ++++++----- - svx/source/engine3d/obj3d.cxx | 11 ++++- - svx/source/form/fmpage.cxx | 11 ++++- - svx/source/svdraw/svdpage.cxx | 84 +++++++++----------------------- - sw/inc/dpage.hxx | 3 ++ - 14 files changed, 122 insertions(+), 89 deletions(-) - -diff --git a/basctl/source/dlged/dlgedpage.cxx b/basctl/source/dlged/dlgedpage.cxx -index 86a792f..15f7f12 100644 ---- a/basctl/source/dlged/dlgedpage.cxx -+++ b/basctl/source/dlged/dlgedpage.cxx -@@ -33,6 +33,12 @@ DlgEdPage::DlgEdPage(DlgEdModel& rModel, bool bMasterPage) - { - } - -+DlgEdPage::DlgEdPage(const DlgEdPage& rSrcPage) -+ : SdrPage(rSrcPage) -+ , pDlgEdForm(0) -+{ -+} -+ - DlgEdPage::~DlgEdPage() - { - Clear(); -@@ -41,7 +47,9 @@ DlgEdPage::~DlgEdPage() - - SdrPage* DlgEdPage::Clone() const - { -- return new DlgEdPage( *this ); -+ DlgEdPage* const pNewPage = new DlgEdPage( *this ); -+ pNewPage->lateInit( *this ); -+ return pNewPage; - } - - -diff --git a/basctl/source/inc/dlgedpage.hxx b/basctl/source/inc/dlgedpage.hxx -index b92760f..0275292 100644 ---- a/basctl/source/inc/dlgedpage.hxx -+++ b/basctl/source/inc/dlgedpage.hxx -@@ -34,6 +34,8 @@ class DlgEdForm; - - class DlgEdPage : public SdrPage - { -+ DlgEdPage& operator=(const DlgEdPage&) SAL_DELETED_FUNCTION; -+ - private: - DlgEdForm* pDlgEdForm; - -@@ -50,6 +52,9 @@ public: - DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; } - - virtual SdrObject* SetObjectOrdNum(sal_uLong nOldObjNum, sal_uLong nNewObjNum) SAL_OVERRIDE; -+ -+protected: -+ DlgEdPage(const DlgEdPage& rSrcPage); - }; - - } // namespace basctl -diff --git a/include/svx/fmpage.hxx b/include/svx/fmpage.hxx -index e381a64..a48df9c 100644 ---- a/include/svx/fmpage.hxx -+++ b/include/svx/fmpage.hxx -@@ -40,6 +40,8 @@ class HelpEvent; - - class SVX_DLLPUBLIC FmFormPage : public SdrPage - { -+ FmFormPage& operator=(const FmFormPage&) SAL_DELETED_FUNCTION; -+ - friend class FmFormObj; - FmFormPageImpl* m_pImpl; - OUString m_sPageName; -@@ -48,12 +50,12 @@ public: - TYPEINFO_OVERRIDE(); - - FmFormPage(FmFormModel& rModel, bool bMasterPage=false); -- FmFormPage(const FmFormPage& rPage); - virtual ~FmFormPage(); - - virtual void SetModel(SdrModel* pNewModel) SAL_OVERRIDE; - - virtual SdrPage* Clone() const SAL_OVERRIDE; -+ // TODO: Uh huh, how is this supposed to work? Creating a SdrPage from FmFormPage? - using SdrPage::Clone; - - virtual void InsertObject(SdrObject* pObj, sal_uLong nPos = CONTAINER_APPEND, -@@ -73,6 +75,11 @@ public: - Window* pWin, - SdrView* pView, - const HelpEvent& rEvt ); -+ -+protected: -+ FmFormPage(const FmFormPage& rPage); -+ -+ void lateInit(const FmFormPage& rPage); - }; - - #endif // INCLUDED_SVX_FMPAGE_HXX -diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx -index bdba2c3..f370f20 100644 ---- a/include/svx/obj3d.hxx -+++ b/include/svx/obj3d.hxx -@@ -78,16 +78,22 @@ public: - - class E3dObjList : public SdrObjList - { -+ E3dObjList &operator=(const E3dObjList& rSrcList) SAL_DELETED_FUNCTION; -+ - public: - TYPEINFO_OVERRIDE(); - E3dObjList(SdrModel* pNewModel = 0, SdrPage* pNewPage = 0, E3dObjList* pNewUpList = 0); -- SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList); - SVX_DLLPUBLIC virtual ~E3dObjList(); - -+ virtual E3dObjList* Clone() const; -+ - virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL) SAL_OVERRIDE; - virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL) SAL_OVERRIDE; - virtual SdrObject* NbcRemoveObject(sal_uIntPtr nObjNum) SAL_OVERRIDE; - virtual SdrObject* RemoveObject(sal_uIntPtr nObjNum) SAL_OVERRIDE; -+ -+protected: -+ SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList); - }; - - /************************************************************************* -diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx -index c737186..87bf2f3 100644 ---- a/include/svx/svdpage.hxx -+++ b/include/svx/svdpage.hxx -@@ -78,6 +78,9 @@ public: - - class SVX_DLLPUBLIC SdrObjList - { -+ SdrObjList(const SdrObjList& rSrcList) SAL_DELETED_FUNCTION; -+ SdrObjList &operator=(const SdrObjList& rSrcList) SAL_DELETED_FUNCTION; -+ - private: - typedef ::std::vector SdrObjectContainerType; - SdrObjectContainerType maList; -@@ -97,20 +100,23 @@ friend class SdrEditView; - protected: - virtual void RecalcRects(); - -+ SdrObjList(); -+ void lateInit(const SdrObjList& rSrcList); -+ - private: - /// simple ActionChildInserted forwarder to have it on a central place - void impChildInserted(SdrObject& rChild) const; - public: - TYPEINFO(); - SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage, SdrObjList* pNewUpList=NULL); -- SdrObjList(const SdrObjList& rSrcList); - virtual ~SdrObjList(); -+ -+ virtual SdrObjList* Clone() const; -+ - // !!! Diese Methode nur fuer Leute, die ganz genau wissen was sie tun !!! - - // #110094# This should not be needed (!) - void SetObjOrdNumsDirty() { bObjOrdNumsDirty=true; } -- // pModel, pPage, pUpList und pOwnerObj werden Zuweisungeoperator nicht veraendert! -- void operator=(const SdrObjList& rSrcList); - void CopyObjects(const SdrObjList& rSrcList); - // alles Aufraeumen (ohne Undo) - void Clear(); -@@ -403,6 +409,7 @@ public: - - class SVX_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase< SdrPage > - { -+ SdrPage& operator=(const SdrPage& rSrcPage) SAL_DELETED_FUNCTION; - - // start PageUser section - private: -@@ -473,15 +480,19 @@ protected: - ::com::sun::star::drawing::XDrawPage> const&); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage(); - -+ // Copying of pages is split into two parts: construction and copying of page objects, -+ // because the copying might need access to fully initialized page. Clone() is responsible -+ // to call lateInit() after copy-construction of a new object. Any initialization in derived -+ // classes that needs access to the page objects must be deferred to lateInit. And it must -+ // call lateInit() of its parent class. -+ SdrPage(const SdrPage& rSrcPage); -+ void lateInit(const SdrPage& rSrcPage); -+ - public: - TYPEINFO_OVERRIDE(); - SdrPage(SdrModel& rNewModel, bool bMasterPage=false); -- // Copy-Ctor und Zuweisungeoperator sind nicht getestet! -- SdrPage(const SdrPage& rSrcPage); - virtual ~SdrPage(); -- // pModel, pPage, pUpList, pOwnerObj und mbInserted werden Zuweisungeoperator nicht veraendert! -- SdrPage& operator=(const SdrPage& rSrcPage); -- virtual SdrPage* Clone() const; -+ virtual SdrPage* Clone() const SAL_OVERRIDE; - virtual SdrPage* Clone(SdrModel* pNewModel) const; - bool IsMasterPage() const { return mbMaster; } - void SetInserted(bool bNew = true); -diff --git a/reportdesign/inc/RptPage.hxx b/reportdesign/inc/RptPage.hxx -index b320a3e..9ea966a 100644 ---- a/reportdesign/inc/RptPage.hxx -+++ b/reportdesign/inc/RptPage.hxx -@@ -34,6 +34,8 @@ class OReportModel; - - class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage - { -+ OReportPage& operator=(const OReportPage&) SAL_DELETED_FUNCTION; -+ - OReportModel& rModel; - ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection; - bool m_bSpecialInsertMode; -diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx -index 5009a66..c55a360 100644 ---- a/reportdesign/source/core/sdr/RptPage.cxx -+++ b/reportdesign/source/core/sdr/RptPage.cxx -@@ -61,7 +61,9 @@ OReportPage::~OReportPage() - - SdrPage* OReportPage::Clone() const - { -- return new OReportPage( *this ); -+ OReportPage *const pNewPage = new OReportPage( *this ); -+ pNewPage->lateInit( *this ); -+ return pNewPage; - } - - -diff --git a/sc/inc/drawpage.hxx b/sc/inc/drawpage.hxx -index c11d4cc..6f7b68e 100644 ---- a/sc/inc/drawpage.hxx -+++ b/sc/inc/drawpage.hxx -@@ -26,6 +26,9 @@ class ScDrawLayer; - - class ScDrawPage: public FmFormPage - { -+ ScDrawPage(const ScDrawPage&) SAL_DELETED_FUNCTION; -+ ScDrawPage& operator=(const ScDrawPage&) SAL_DELETED_FUNCTION; -+ - public: - ScDrawPage(ScDrawLayer& rNewModel, bool bMasterPage = false); - virtual ~ScDrawPage(); -diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx -index 767cf39..13ec1c2 100644 ---- a/sd/inc/sdpage.hxx -+++ b/sd/inc/sdpage.hxx -@@ -98,6 +98,8 @@ namespace sd { - - class SD_DLLPUBLIC SdPage : public FmFormPage, public SdrObjUserCall - { -+ SdPage& operator=(const SdPage&) SAL_DELETED_FUNCTION; -+ - friend class SdGenericDrawPage; - friend class SdDrawPage; - friend class sd::UndoAnimation; -@@ -153,11 +155,13 @@ protected: - sal_Int32 mnTransitionFadeColor; - double mfTransitionDuration; - -+ SdPage(const SdPage& rSrcPage); -+ void lateInit(const SdPage& rSrcPage); -+ - public: - TYPEINFO_OVERRIDE(); - - SdPage(SdDrawDocument& rNewDoc, bool bMasterPage=false); -- SdPage(const SdPage& rSrcPage); - virtual ~SdPage(); - virtual SdrPage* Clone() const SAL_OVERRIDE; - virtual SdrPage* Clone(SdrModel* pNewModel) const SAL_OVERRIDE; -diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx -index 450c646..57f4699 100644 ---- a/sd/source/core/sdpage2.cxx -+++ b/sd/source/core/sdpage2.cxx -@@ -377,15 +377,6 @@ SdPage::SdPage(const SdPage& rSrcPage) - mePageKind = rSrcPage.mePageKind; - meAutoLayout = rSrcPage.meAutoLayout; - -- // use shape list directly to preserve constness of rSrcPage -- const std::list< SdrObject* >& rShapeList = rSrcPage.maPresentationShapeList.getList(); -- for( std::list< SdrObject* >::const_iterator aIter = rShapeList.begin(); -- aIter != rShapeList.end(); ++aIter ) -- { -- SdrObject* pObj = *aIter; -- InsertPresObj(GetObj(pObj->GetOrdNum()), rSrcPage.GetPresObjKind(pObj)); -- } -- - mbSelected = false; - mnTransitionType = rSrcPage.mnTransitionType; - mnTransitionSubtype = rSrcPage.mnTransitionSubtype; -@@ -410,10 +401,24 @@ SdPage::SdPage(const SdPage& rSrcPage) - mnPaperBin = rSrcPage.mnPaperBin; - meOrientation = rSrcPage.meOrientation; - -+ mpPageLink = NULL; // is set when inserting via ConnectLink() -+} -+ -+void SdPage::lateInit(const SdPage& rSrcPage) -+{ -+ FmFormPage::lateInit(rSrcPage); -+ -+ // use shape list directly to preserve constness of rSrcPage -+ const std::list< SdrObject* >& rShapeList = rSrcPage.maPresentationShapeList.getList(); -+ for( std::list< SdrObject* >::const_iterator aIter = rShapeList.begin(); -+ aIter != rShapeList.end(); ++aIter ) -+ { -+ SdrObject* pObj = *aIter; -+ InsertPresObj(GetObj(pObj->GetOrdNum()), rSrcPage.GetPresObjKind(pObj)); -+ } -+ - // header footer - setHeaderFooterSettings( rSrcPage.getHeaderFooterSettings() ); -- -- mpPageLink = NULL; // is set when inserting via ConnectLink() - } - - -@@ -433,6 +438,7 @@ SdrPage* SdPage::Clone(SdrModel* pNewModel) const - (void)pNewModel; - - SdPage* pNewPage = new SdPage(*this); -+ pNewPage->lateInit( *this ); - - cloneAnimations( *pNewPage ); - -diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx -index eee59ad..ef50b3d 100644 ---- a/svx/source/engine3d/obj3d.cxx -+++ b/svx/source/engine3d/obj3d.cxx -@@ -91,11 +91,18 @@ E3dObjList::E3dObjList(SdrModel* pNewModel, SdrPage* pNewPage, E3dObjList* pNewU - { - } - --E3dObjList::E3dObjList(const E3dObjList& rSrcList) --: SdrObjList(rSrcList) -+E3dObjList::E3dObjList(const E3dObjList&) -+: SdrObjList() - { - } - -+E3dObjList* E3dObjList::Clone() const -+{ -+ E3dObjList* const pObjList = new E3dObjList(*this); -+ pObjList->lateInit(*this); -+ return pObjList; -+} -+ - E3dObjList::~E3dObjList() - { - } -diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx -index 365dfd3..96c3baa 100644 ---- a/svx/source/form/fmpage.cxx -+++ b/svx/source/form/fmpage.cxx -@@ -66,6 +66,12 @@ FmFormPage::FmFormPage(const FmFormPage& rPage) - :SdrPage(rPage) - ,m_pImpl(new FmFormPageImpl( *this ) ) - { -+} -+ -+void FmFormPage::lateInit(const FmFormPage& rPage) -+{ -+ SdrPage::lateInit( rPage ); -+ - m_pImpl->initFrom( rPage.GetImpl() ); - m_sPageName = rPage.m_sPageName; - } -@@ -113,8 +119,9 @@ void FmFormPage::SetModel(SdrModel* pNewModel) - - SdrPage* FmFormPage::Clone() const - { -- return new FmFormPage(*this); -- // hier fehlt noch ein kopieren der Objekte -+ FmFormPage* const pNewPage = new FmFormPage(*this); -+ pNewPage->lateInit(*this); -+ return pNewPage; - } - - -diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx -index 94139448..da27d4a 100644 ---- a/svx/source/svdraw/svdpage.cxx -+++ b/svx/source/svdraw/svdpage.cxx -@@ -88,7 +88,7 @@ SdrObjList::SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage, SdrObjList* pNewU - eListKind=SDROBJLIST_UNKNOWN; - } - --SdrObjList::SdrObjList(const SdrObjList& rSrcList): -+SdrObjList::SdrObjList(): - maList(), - mpNavigationOrder(), - mbIsNavigationOrderDirty(false) -@@ -101,7 +101,6 @@ SdrObjList::SdrObjList(const SdrObjList& rSrcList): - bRectsDirty=false; - pOwnerObj=NULL; - eListKind=SDROBJLIST_UNKNOWN; -- *this=rSrcList; - } - - SdrObjList::~SdrObjList() -@@ -115,9 +114,18 @@ SdrObjList::~SdrObjList() - Clear(); // delete contents of container - } - --void SdrObjList::operator=(const SdrObjList& rSrcList) -+SdrObjList* SdrObjList::Clone() const - { -- Clear(); -+ SdrObjList* const pObjList = new SdrObjList(); -+ pObjList->lateInit(*this); -+ return pObjList; -+} -+ -+void SdrObjList::lateInit(const SdrObjList& rSrcList) -+{ -+ // this function is only supposed to be called once, right after construction -+ assert(maList.empty()); -+ - eListKind=rSrcList.eListKind; - CopyObjects(rSrcList); - } -@@ -1246,31 +1254,6 @@ SdrPage::SdrPage(const SdrPage& rSrcPage) - mbPageBorderOnlyLeftRight(rSrcPage.mbPageBorderOnlyLeftRight) - { - aPrefVisiLayers.SetAll(); -- eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE; -- -- // copy things from source -- // Warning: this leads to slicing (see issue 93186) and has to be -- // removed as soon as possible. -- *this = rSrcPage; -- OSL_ENSURE(mpSdrPageProperties, -- "SdrPage::SdrPage: operator= did not create needed SdrPageProperties (!)"); -- -- // be careful and correct eListKind, a member of SdrObjList which -- // will be changed by the SdrOIbjList::operator= before... -- eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE; -- -- // The previous assignment to *this may have resulted in a call to -- // createUnoPage at a partially initialized (sliced) SdrPage object. -- // Due to the vtable being not yet fully set-up at this stage, -- // createUnoPage() may have been called at the wrong class. -- // To force a call to the right createUnoPage() at a later time when the -- // new object is full constructed mxUnoPage is disposed now. -- uno::Reference xComponent (mxUnoPage, uno::UNO_QUERY); -- if (xComponent.is()) -- { -- mxUnoPage = NULL; -- xComponent->dispose(); -- } - } - - SdrPage::~SdrPage() -@@ -1319,20 +1302,10 @@ SdrPage::~SdrPage() - - } - --SdrPage& SdrPage::operator=(const SdrPage& rSrcPage) -+void SdrPage::lateInit(const SdrPage& rSrcPage) - { -- if( this == &rSrcPage ) -- return *this; -- if(mpViewContact) -- { -- delete mpViewContact; -- mpViewContact = 0L; -- } -- -- // Joe also sets some parameters for the class this one -- // is derived from. SdrObjList does the same bad handling of -- // copy constructor and operator=, so i better let it stand here. -- pPage = this; -+ assert(!mpViewContact); -+ assert(!mpSdrPageProperties); - - // copy all the local parameters to make this instance - // a valid copy of source page before copying and inserting -@@ -1361,21 +1334,7 @@ SdrPage& SdrPage::operator=(const SdrPage& rSrcPage) - mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent; - - { -- // #i111122# delete SdrPageProperties when model is different -- if(mpSdrPageProperties && GetModel() != rSrcPage.GetModel()) -- { -- delete mpSdrPageProperties; -- mpSdrPageProperties = 0; -- } -- -- if(!mpSdrPageProperties) -- { -- mpSdrPageProperties = new SdrPageProperties(*this); -- } -- else -- { -- mpSdrPageProperties->ClearItem(0); -- } -+ mpSdrPageProperties = new SdrPageProperties(*this); - - if(!IsMasterPage()) - { -@@ -1385,9 +1344,12 @@ SdrPage& SdrPage::operator=(const SdrPage& rSrcPage) - mpSdrPageProperties->SetStyleSheet(rSrcPage.getSdrPageProperties().GetStyleSheet()); - } - -- // Now copy the contained objects (by cloning them) -- SdrObjList::operator=(rSrcPage); -- return *this; -+ // Now copy the contained objects -+ SdrObjList::lateInit(rSrcPage); -+ -+ // be careful and correct eListKind, a member of SdrObjList which -+ // will be changed by the SdrObjList::lateInit before... -+ eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE; - } - - SdrPage* SdrPage::Clone() const -@@ -1399,7 +1361,7 @@ SdrPage* SdrPage::Clone(SdrModel* pNewModel) const - { - if (pNewModel==NULL) pNewModel=pModel; - SdrPage* pPage2=new SdrPage(*pNewModel); -- *pPage2=*this; -+ pPage2->lateInit(*this); - return pPage2; - } - -diff --git a/sw/inc/dpage.hxx b/sw/inc/dpage.hxx -index 54aa789..8284f6e 100644 ---- a/sw/inc/dpage.hxx -+++ b/sw/inc/dpage.hxx -@@ -28,6 +28,9 @@ class SwDoc; - - class SwDPage : public FmFormPage, public SdrObjUserCall - { -+ SwDPage(const SwDPage&) SAL_DELETED_FUNCTION; -+ SwDPage &operator=(const SwDPage&) SAL_DELETED_FUNCTION; -+ - SdrPageGridFrameList* pGridLst; - SwDoc& rDoc; - --- -2.1.0 - diff --git a/SOURCES/0001-ppc64-simplify-this-a-little.patch b/SOURCES/0001-ppc64-simplify-this-a-little.patch deleted file mode 100644 index b44d7d1..0000000 --- a/SOURCES/0001-ppc64-simplify-this-a-little.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 3059edbc419e79f964a340b5b0ac828a5e866666 Mon Sep 17 00:00:00 2001 -From: Caolan McNamara -Date: Fri, 10 Jul 2015 16:00:22 +0100 -Subject: [PATCH 1/2] ppc64: simplify this a little -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Change-Id: I8166f65625d389a604750852d6d5a4fee25a88fa -Reviewed-on: https://gerrit.libreoffice.org/16935 -Reviewed-by: Caolán McNamara -Tested-by: Caolán McNamara -(cherry picked from commit fe14c55f000b9a31d885b411655232e0691e1cd4) -Reviewed-on: https://gerrit.libreoffice.org/16945 -Reviewed-by: David Tardon -Tested-by: David Tardon ---- - .../cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx | 61 +++++++++------------- - 1 file changed, 24 insertions(+), 37 deletions(-) - -diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -index 4013076..81d3d5c 100644 ---- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -@@ -124,6 +124,8 @@ void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* - if (pReturnType->pType->nSize > 8) - pRegisters[1] = r4; - } -+#else -+ (void)r4; - #endif - default: - break; -@@ -185,45 +187,29 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, - - // fill registers - __asm__ __volatile__ ( -- "ld 3, 0(%0)\n\t" -- "ld 4, 8(%0)\n\t" -- "ld 5, 16(%0)\n\t" -- "ld 6, 24(%0)\n\t" -- "ld 7, 32(%0)\n\t" -- "ld 8, 40(%0)\n\t" -- "ld 9, 48(%0)\n\t" -- "ld 10, 56(%0)\n\t" -- "lfd 1, 0(%1)\n\t" -- "lfd 2, 8(%1)\n\t" -- "lfd 3, 16(%1)\n\t" -- "lfd 4, 24(%1)\n\t" -- "lfd 5, 32(%1)\n\t" -- "lfd 6, 40(%1)\n\t" -- "lfd 7, 48(%1)\n\t" -- "lfd 8, 56(%1)\n\t" -- "lfd 9, 64(%1)\n\t" -- "lfd 10, 72(%1)\n\t" -- "lfd 11, 80(%1)\n\t" -- "lfd 12, 88(%1)\n\t" -- "lfd 13, 96(%1)\n\t" -- : : "r" (pGPR), "r" (pFPR) -- : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", -- "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", -- "fr10", "fr11", "fr12", "fr13" -+ "lfd 1, 0(%0)\n\t" -+ "lfd 2, 8(%0)\n\t" -+ "lfd 3, 16(%0)\n\t" -+ "lfd 4, 24(%0)\n\t" -+ "lfd 5, 32(%0)\n\t" -+ "lfd 6, 40(%0)\n\t" -+ "lfd 7, 48(%0)\n\t" -+ "lfd 8, 56(%0)\n\t" -+ "lfd 9, 64(%0)\n\t" -+ "lfd 10, 72(%0)\n\t" -+ "lfd 11, 80(%0)\n\t" -+ "lfd 12, 88(%0)\n\t" -+ "lfd 13, 96(%0)\n\t" -+ : : "r" (pFPR) -+ : "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", -+ "fr10", "fr11", "fr12", "fr13" - ); - - // tell gcc that r3 to r11 are not available to it for doing the TOC and exception munge on the func call - register sal_uInt64 r3 asm("r3"); - register sal_uInt64 r4 asm("r4"); -- register sal_uInt64 r5 asm("r5"); -- register sal_uInt64 r6 asm("r6"); -- register sal_uInt64 r7 asm("r7"); -- register sal_uInt64 r8 asm("r8"); -- register sal_uInt64 r9 asm("r9"); -- register sal_uInt64 r10 asm("r10"); -- register sal_uInt64 r11 asm("r11"); - -- (*pFunc)(r3, r4, r5, r6, r7, r8, r9, r10); -+ (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5], pGPR[6], pGPR[7]); - - // get return value - __asm__ __volatile__ ( -@@ -375,7 +361,6 @@ static void cpp_call( - - if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) - { --// uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, - uno_copyAndConvertData( pCppArgs[nPos] = pStack, pUnoArgs[nPos], pParamTypeDescr, - pThis->getBridge()->getUno2Cpp() ); - switch (pParamTypeDescr->eTypeClass) -@@ -383,7 +368,7 @@ static void cpp_call( - case typelib_TypeClass_HYPER: - case typelib_TypeClass_UNSIGNED_HYPER: - #if OSL_DEBUG_LEVEL > 2 -- fprintf(stderr, "hyper is %lx\n", pCppArgs[nPos]); -+ fprintf(stderr, "hyper is %lx\n", pCppArgs[nPos]); - #endif - INSERT_INT64( pCppArgs[nPos], nGPR, pGPR, pStack, bOverflow ); - break; -@@ -391,7 +376,7 @@ static void cpp_call( - case typelib_TypeClass_UNSIGNED_LONG: - case typelib_TypeClass_ENUM: - #if OSL_DEBUG_LEVEL > 2 -- fprintf(stderr, "long is %x\n", pCppArgs[nPos]); -+ fprintf(stderr, "long is %x\n", pCppArgs[nPos]); - #endif - INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, pStack, bOverflow ); - break; -@@ -406,10 +391,12 @@ static void cpp_call( - break; - case typelib_TypeClass_FLOAT: - INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, pStack, bOverflow ); -- break; -+ break; - case typelib_TypeClass_DOUBLE: - INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, pStack, bOverflow ); - break; -+ default: -+ break; - } - - // no longer needed --- -2.1.0 - diff --git a/SOURCES/0001-radio-check-top-center-bottom-alignment-for-table-ce.patch b/SOURCES/0001-radio-check-top-center-bottom-alignment-for-table-ce.patch deleted file mode 100644 index 1fcdcc5..0000000 --- a/SOURCES/0001-radio-check-top-center-bottom-alignment-for-table-ce.patch +++ /dev/null @@ -1,148 +0,0 @@ -From 7e787af122ebcef29b284e8c46d84a12c0625cd8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 12 Jan 2015 15:45:19 +0000 -Subject: [PATCH] radio check top/center/bottom alignment for table cells - -Change-Id: I30b51510ac5fbfb3c1dd09e0f86a246a8b516f1e -(cherry picked from commit 2aa40ecebb2cb1e5d2cf85d7ada70b5e541bad67) ---- - sw/source/ui/app/mn.src | 3 +++ - sw/uiconfig/sglobal/menubar/menubar.xml | 6 +++--- - sw/uiconfig/sweb/menubar/menubar.xml | 6 +++--- - sw/uiconfig/swform/menubar/menubar.xml | 6 +++--- - sw/uiconfig/swreport/menubar/menubar.xml | 6 +++--- - sw/uiconfig/swriter/menubar/menubar.xml | 6 +++--- - sw/uiconfig/swxform/menubar/menubar.xml | 6 +++--- - 7 files changed, 21 insertions(+), 18 deletions(-) - -diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src -index 4fa9b14..4bb40ac 100644 ---- a/sw/source/ui/app/mn.src -+++ b/sw/source/ui/app/mn.src -@@ -397,18 +397,21 @@ - SEPARATOR ; \ - MenuItem\ - {\ -+ RadioCheck = TRUE ; \ - Identifier = SID_TABLE_VERT_NONE ; \ - HelpId = CMD_SID_TABLE_VERT_NONE ; \ - Text [ en-US ] = "~Top" ; \ - };\ - MenuItem\ - {\ -+ RadioCheck = TRUE ; \ - Identifier = SID_TABLE_VERT_CENTER ; \ - HelpId = CMD_SID_TABLE_VERT_CENTER ; \ - Text [ en-US ] = "C~enter" ; \ - };\ - MenuItem\ - {\ -+ RadioCheck = TRUE ; \ - Identifier = SID_TABLE_VERT_BOTTOM ; \ - HelpId = CMD_SID_TABLE_VERT_BOTTOM ; \ - Text [ en-US ] = "~Bottom" ; \ -diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml -index d5736a5..6f09ae8 100644 ---- a/sw/uiconfig/sglobal/menubar/menubar.xml -+++ b/sw/uiconfig/sglobal/menubar/menubar.xml -@@ -304,9 +304,9 @@ - - - -- -- -- -+ -+ -+ - - - -diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml -index ee78c24..87115d4 100644 ---- a/sw/uiconfig/sweb/menubar/menubar.xml -+++ b/sw/uiconfig/sweb/menubar/menubar.xml -@@ -248,9 +248,9 @@ - - - -- -- -- -+ -+ -+ - - - -diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml -index ddf914f..7305ceb 100644 ---- a/sw/uiconfig/swform/menubar/menubar.xml -+++ b/sw/uiconfig/swform/menubar/menubar.xml -@@ -303,9 +303,9 @@ - - - -- -- -- -+ -+ -+ - - - -diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml -index fab0914..a41c3c2 100644 ---- a/sw/uiconfig/swreport/menubar/menubar.xml -+++ b/sw/uiconfig/swreport/menubar/menubar.xml -@@ -304,9 +304,9 @@ - - - -- -- -- -+ -+ -+ - - - -diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml -index b26b980..f5b3fa9 100644 ---- a/sw/uiconfig/swriter/menubar/menubar.xml -+++ b/sw/uiconfig/swriter/menubar/menubar.xml -@@ -312,9 +312,9 @@ - - - -- -- -- -+ -+ -+ - - - -diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml -index ec9f631..4c08ef2 100644 ---- a/sw/uiconfig/swxform/menubar/menubar.xml -+++ b/sw/uiconfig/swxform/menubar/menubar.xml -@@ -305,9 +305,9 @@ - - - -- -- -- -+ -+ -+ - - - --- -1.9.3 - diff --git a/SOURCES/0001-rerun-autoconf-after-remove-BOOST_SYSTEM.patch b/SOURCES/0001-rerun-autoconf-after-remove-BOOST_SYSTEM.patch new file mode 100644 index 0000000..bb0cbac --- /dev/null +++ b/SOURCES/0001-rerun-autoconf-after-remove-BOOST_SYSTEM.patch @@ -0,0 +1,2651 @@ +From 6fa818c04cd6b011a281ab02ab861e84a94ee549 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 22 Jan 2016 14:38:59 +0000 +Subject: [PATCH] rerun autoconf after remove BOOST_SYSTEM + +Change-Id: Id9afe7150ad721ba1d728cbb3e9b496d15f0896f +--- + external/liborcus/unusedheader.patch.0 | 2630 ++++++++++++++++++++++++++++++++ + 1 file changed, 2630 insertions(+) + +diff --git a/external/liborcus/unusedheader.patch.0 b/external/liborcus/unusedheader.patch.0 +index 4f7a77b..54f2fe6 100644 +--- a/external/liborcus/unusedheader.patch.0 ++++ b/external/liborcus/unusedheader.patch.0 +@@ -9,3 +9,2633 @@ + using namespace std; + + namespace orcus { ++--- ./configure.orig 2016-01-22 14:33:55.601487405 +0000 +++++ ./configure 2016-01-22 14:35:45.219928835 +0000 ++@@ -640,10 +640,14 @@ ++ BOOST_FILESYSTEM_LIBS ++ BOOST_FILESYSTEM_LDPATH ++ BOOST_FILESYSTEM_LDFLAGS +++BOOST_SYSTEM_LIBS +++BOOST_SYSTEM_LDPATH +++BOOST_SYSTEM_LDFLAGS ++ BOOST_PROGRAM_OPTIONS_LIBS ++ BOOST_PROGRAM_OPTIONS_LDPATH ++ BOOST_PROGRAM_OPTIONS_LDFLAGS ++ BOOST_IOSTREAMS_LIBS +++BOOST_LDPATH ++ BOOST_IOSTREAMS_LDPATH ++ BOOST_IOSTREAMS_LDFLAGS ++ WITH_TOOLS_FALSE ++@@ -660,10 +664,6 @@ ++ ZLIB_CFLAGS ++ HAVE_STATIC_LIB_FALSE ++ HAVE_STATIC_LIB_TRUE ++-BOOST_SYSTEM_LIBS ++-BOOST_LDPATH ++-BOOST_SYSTEM_LDPATH ++-BOOST_SYSTEM_LDFLAGS ++ BOOST_CPPFLAGS ++ DISTCHECK_CONFIGURE_FLAGS ++ BOOST_ROOT ++@@ -807,14 +807,13 @@ ++ with_sysroot ++ enable_libtool_lock ++ with_boost ++-enable_static_boost ++-enable_werror ++ enable_debug ++ with_tools ++ with_ods_filter ++ with_xlsx_filter ++ with_xls_xml_filter ++ with_gnumeric_filter +++enable_static_boost ++ enable_spreadsheet_model ++ ' ++ ac_precious_vars='build_alias ++@@ -1469,10 +1468,9 @@ ++ --enable-fast-install[=PKGS] ++ optimize for fast installation [default=yes] ++ --disable-libtool-lock avoid locking (might break parallel builds) +++ --enable-debug Build with debug features in mind.] ++ --enable-static-boost Prefer the static boost libraries over the shared ++ ones [no] ++- --enable-werror Treat all warnings as errors, useful for development ++- --enable-debug Build with debug features in mind.] ++ --disable-spreadsheet-model ++ Disable the spreadsheet model implementation in ++ orcus. Note that the spreadsheet-specific command ++@@ -2592,7 +2590,7 @@ ++ ++ ac_config_headers="$ac_config_headers config.h" ++ ++-am__api_version='1.14' +++am__api_version='1.12' ++ ++ ac_aux_dir= ++ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do ++@@ -2805,8 +2803,8 @@ ++ esac ++ fi ++ # Use eval to expand $SHELL ++-if eval "$MISSING --is-lightweight"; then ++- am_missing_run="$MISSING " +++if eval "$MISSING --run true"; then +++ am_missing_run="$MISSING --run " ++ else ++ am_missing_run= ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 ++@@ -3046,45 +3044,6 @@ ++ fi ++ rmdir .tst 2>/dev/null ++ ++-# Check whether --enable-silent-rules was given. ++-if test "${enable_silent_rules+set}" = set; then : ++- enableval=$enable_silent_rules; ++-fi ++- ++-case $enable_silent_rules in # ((( ++- yes) AM_DEFAULT_VERBOSITY=0;; ++- no) AM_DEFAULT_VERBOSITY=1;; ++- *) AM_DEFAULT_VERBOSITY=1;; ++-esac ++-am_make=${MAKE-make} ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 ++-$as_echo_n "checking whether $am_make supports nested variables... " >&6; } ++-if ${am_cv_make_support_nested_variables+:} false; then : ++- $as_echo_n "(cached) " >&6 ++-else ++- if $as_echo 'TRUE=$(BAR$(V)) ++-BAR0=false ++-BAR1=true ++-V=1 ++-am__doit: ++- @$(TRUE) ++-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then ++- am_cv_make_support_nested_variables=yes ++-else ++- am_cv_make_support_nested_variables=no ++-fi ++-fi ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 ++-$as_echo "$am_cv_make_support_nested_variables" >&6; } ++-if test $am_cv_make_support_nested_variables = yes; then ++- AM_V='$(V)' ++- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' ++-else ++- AM_V=$AM_DEFAULT_VERBOSITY ++- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY ++-fi ++-AM_BACKSLASH='\' ++- ++ if test "`cd $srcdir && pwd`" != "`pwd`"; then ++ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output ++ # is not polluted with repeated "-I." ++@@ -3135,70 +3094,19 @@ ++ ++ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} ++ ++-# For better backward compatibility. To be removed once Automake 1.9.x ++-# dies out for good. For more background, see: ++-# ++-# ++-mkdir_p='$(MKDIR_P)' ++- +++mkdir_p="$MKDIR_P" ++ # We need awk for the "check" target. The system "awk" is bad on ++ # some platforms. ++ # Always define AMTAR for backward compatibility. Yes, it's still used ++ # in the wild :-( We should find a proper way to deprecate it ... ++ AMTAR='$${TAR-tar}' ++ ++- ++-# We'll loop over all known methods to create a tar archive until one works. ++-_am_tools='gnutar pax cpio none' ++- ++ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' ++ ++ ++ ++ ++ ++- ++-# POSIX will say in a future version that running "rm -f" with no argument ++-# is OK; and we want to be able to make that assumption in our Makefile ++-# recipes. So use an aggressive probe to check that the usage we want is ++-# actually supported "in the wild" to an acceptable degree. ++-# See automake bug#10828. ++-# To make any issue more visible, cause the running configure to be aborted ++-# by default if the 'rm' program in use doesn't match our expectations; the ++-# user can still override this though. ++-if rm -f && rm -fr && rm -rf; then : OK; else ++- cat >&2 <<'END' ++-Oops! ++- ++-Your 'rm' program seems unable to run without file operands specified ++-on the command line, even when the '-f' option is present. This is contrary ++-to the behaviour of most rm programs out there, and not conforming with ++-the upcoming POSIX standard: ++- ++-Please tell bug-automake@gnu.org about your system, including the value ++-of your $PATH and any error possibly output before this message. This ++-can help us improve future automake versions. ++- ++-END ++- if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then ++- echo 'Configuration will proceed anyway, since you have set the' >&2 ++- echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 ++- echo >&2 ++- else ++- cat >&2 <<'END' ++-Aborting the configuration process, to ensure you take notice of the issue. ++- ++-You can download and install GNU coreutils to get an 'rm' implementation ++-that behaves properly: . ++- ++-If you want to complete the configuration process using your problematic ++-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM ++-to "yes", and re-run configure. ++- ++-END ++- as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 ++- fi ++-fi ++ # Check whether --enable-silent-rules was given. ++ if test "${enable_silent_rules+set}" = set; then : ++ enableval=$enable_silent_rules; ++@@ -4101,65 +4009,6 @@ ++ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ ++-ac_ext=c ++-ac_cpp='$CPP $CPPFLAGS' ++-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_c_compiler_gnu ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 ++-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } ++-if ${am_cv_prog_cc_c_o+:} false; then : ++- $as_echo_n "(cached) " >&6 ++-else ++- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++-/* end confdefs.h. */ ++- ++-int ++-main () ++-{ ++- ++- ; ++- return 0; ++-} ++-_ACEOF ++- # Make sure it works both with $CC and with simple cc. ++- # Following AC_PROG_CC_C_O, we do the test twice because some ++- # compilers refuse to overwrite an existing .o file with -o, ++- # though they will create one. ++- am_cv_prog_cc_c_o=yes ++- for am_i in 1 2; do ++- if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ++- ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ++- ac_status=$? ++- echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++- (exit $ac_status); } \ ++- && test -f conftest2.$ac_objext; then ++- : OK ++- else ++- am_cv_prog_cc_c_o=no ++- break ++- fi ++- done ++- rm -f core conftest* ++- unset am_i ++-fi ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 ++-$as_echo "$am_cv_prog_cc_c_o" >&6; } ++-if test "$am_cv_prog_cc_c_o" != yes; then ++- # Losing compiler, so override with the script. ++- # FIXME: It is wrong to rewrite CC. ++- # But if we don't then we get into trouble of one sort or another. ++- # A longer-term fix would be to have automake use am__CC in this case, ++- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" ++- CC="$am_aux_dir/compile $CC" ++-fi ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++- ++- ++ depcc="$CC" am_compiler_list= ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 ++@@ -7222,7 +7071,7 @@ ++ rm -rf conftest* ++ ;; ++ ++-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +++x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ ++ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++@@ -7240,10 +7089,7 @@ ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_i386" ++ ;; ++- powerpc64le-*linux*) ++- LD="${LD-ld} -m elf32lppclinux" ++- ;; ++- powerpc64-*linux*) +++ ppc64-*linux*|powerpc64-*linux*) ++ LD="${LD-ld} -m elf32ppclinux" ++ ;; ++ s390x-*linux*) ++@@ -7262,10 +7108,7 @@ ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_x86_64" ++ ;; ++- powerpcle-*linux*) ++- LD="${LD-ld} -m elf64lppc" ++- ;; ++- powerpc-*linux*) +++ ppc*-*linux*|powerpc*-*linux*) ++ LD="${LD-ld} -m elf64ppc" ++ ;; ++ s390*-*linux*|s390*-*tpf*) ++@@ -11288,14 +11131,10 @@ ++ # before this can be enabled. ++ hardcode_into_libs=yes ++ ++- # Add ABI-specific directories to the system library path. ++- sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" ++- ++ # Append ld.so.conf contents to the search path ++ if test -f /etc/ld.so.conf; then ++ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` ++- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" ++- +++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ fi ++ ++ # We used to test for /lib/ld.so.1 and disable shared libraries on ++@@ -15123,14 +14962,10 @@ ++ # before this can be enabled. ++ hardcode_into_libs=yes ++ ++- # Add ABI-specific directories to the system library path. ++- sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" ++- ++ # Append ld.so.conf contents to the search path ++ if test -f /etc/ld.so.conf; then ++ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` ++- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" ++- +++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ fi ++ ++ # We used to test for /lib/ld.so.1 and disable shared libraries on ++@@ -16203,7 +16038,7 @@ ++ # ====================== ++ # Set required ixion api ++ # ====================== ++-IXION_REQUIRED_API_VERSION=0.10 +++IXION_REQUIRED_API_VERSION=0.8 ++ ++ ++ # ============= ++@@ -16212,7 +16047,7 @@ ++ ORCUS_API_VERSION=0.8 ++ ++ ++-echo "$as_me: this is boost.m4 serial 24" >&5 +++echo "$as_me: this is boost.m4 serial 18" >&5 ++ boost_save_IFS=$IFS ++ boost_version_req=1.36 ++ IFS=. ++@@ -16356,30 +16191,17 @@ ++ if ${boost_cv_lib_version+:} false; then : ++ $as_echo_n "(cached) " >&6 ++ else ++- ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ /* end confdefs.h. */ ++ #include ++ boost-lib-version = BOOST_LIB_VERSION ++ _ACEOF ++ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++- grep -v '#' | ++- grep -Ev '^(conftest.cpp| *command-line arguments :)' | ++ tr -d '\r' | ++- tr -s '\n' ' ' | ++- $SED -n -e "/^ *boost-lib-version = /{s///;s/[\" ]//g;p;q;}" >conftest.i 2>&1; then : +++ $SED -n -e "/^boost-lib-version = /{s///;s/\"//g;p;q;}" >conftest.i 2>&1; then : ++ boost_cv_lib_version=`cat conftest.i` ++ fi ++ rm -rf conftest* ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ ++ fi ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_version" >&5 ++@@ -16388,536 +16210,40 @@ ++ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` ++ case $boost_major_version in #( ++ '' | *[!0-9]*) ++- as_fn_error $? "invalid value: boost_major_version='$boost_major_version'" "$LINENO" 5 +++ as_fn_error $? "invalid value: boost_major_version=$boost_major_version" "$LINENO" 5 ++ ;; ++ esac ++ fi ++ CPPFLAGS=$boost_save_CPPFLAGS ++ ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the toolset name used by Boost for $CXX" >&5 ++-$as_echo_n "checking for the toolset name used by Boost for $CXX... " >&6; } ++-if ${boost_cv_lib_tag+:} false; then : ++- $as_echo_n "(cached) " >&6 +++ +++# ========================================================= +++# Determine if we are going to build static lib (for MinGW) +++# ========================================================= +++ if test "$enable_shared" = no -a "$enable_static" = yes; then +++ HAVE_STATIC_LIB_TRUE= +++ HAVE_STATIC_LIB_FALSE='#' ++ else ++- boost_cv_lib_tag=unknown ++-if test x$boost_cv_inc_path != xno; then ++- ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++- # The following tests are mostly inspired by boost/config/auto_link.hpp ++- # The list is sorted to most recent/common to oldest compiler (in order ++- # to increase the likelihood of finding the right compiler with the ++- # least number of compilation attempt). ++- # Beware that some tests are sensible to the order (for instance, we must ++- # look for MinGW before looking for GCC3). ++- # I used one compilation test per compiler with a #error to recognize ++- # each compiler so that it works even when cross-compiling (let me know ++- # if you know a better approach). ++- # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): ++- # como, edg, kcc, bck, mp, sw, tru, xlc ++- # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines ++- # the same defines as GCC's). ++- for i in \ ++- "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 0 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw50" \ ++- "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc50" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 10 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw410" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 10 && !defined __ICC @ gcc410" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw49" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && !defined __ICC @ gcc49" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw48" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC @ gcc48" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw47" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC @ gcc47" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw46" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC @ gcc46" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw45" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC @ gcc45" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw44" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc44" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw43" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc43" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw42" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc42" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw41" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc41" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC && \ ++- (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw40" \ ++- "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc40" \ ++- "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ ++- && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ ++- || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ ++- "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc34" \ ++- "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc33" \ ++- "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \ ++- "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \ ++- "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc32" \ ++- "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ ++- "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc31" \ ++- "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc30" \ ++- "defined __BORLANDC__ @ bcb" \ ++- "defined __ICC && (defined __unix || defined ) @ il" \ ++- "defined __ICL @ iw" \ ++- "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ ++- "defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95 && !defined __ICC @ gcc295" \ ++- "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ ++- "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ ++- "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ ++- "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" ++- do ++- boost_tag_test=`expr "X$i" : 'X\([^@]*\) @ '` ++- boost_tag=`expr "X$i" : 'X[^@]* @ \(.*\)'` ++- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++-/* end confdefs.h. */ +++ HAVE_STATIC_LIB_TRUE='#' +++ HAVE_STATIC_LIB_FALSE= +++fi ++ ++-#if $boost_tag_test ++-/* OK */ ++-#else ++-# error $boost_tag_test ++-#endif ++ ++-int ++-main () ++-{ +++# ===== +++# Debug +++# ===== +++# Check whether --enable-debug was given. +++if test "${enable_debug+set}" = set; then : +++ enableval=$enable_debug; enable_debug="$enableval" +++else +++ enable_debug=no ++ ++- ; ++- return 0; ++-} ++-_ACEOF ++-if ac_fn_cxx_try_compile "$LINENO"; then : ++- boost_cv_lib_tag=$boost_tag; break ++-fi ++-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++- done ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++- case $boost_cv_lib_tag in #( ++- # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed ++- # to "gcc41" for instance. ++- *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. ++- gcc*) ++- boost_tag_x= ++- case $host_os in #( ++- darwin*) ++- if test $boost_major_version -ge 136; then ++- # The `x' added in r46793 of Boost. ++- boost_tag_x=x ++- fi;; ++- esac ++- # We can specify multiple tags in this variable because it's used by ++- # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... ++- boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc" ++- ;; #( ++- unknown) ++- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not figure out which toolset name to use for $CXX" >&5 ++-$as_echo "$as_me: WARNING: could not figure out which toolset name to use for $CXX" >&2;} ++- boost_cv_lib_tag= ++- ;; ++- esac ++ fi ++-fi ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_tag" >&5 ++-$as_echo "$boost_cv_lib_tag" >&6; } ++-# Check whether --enable-static-boost was given. ++-if test "${enable_static_boost+set}" = set; then : ++- enableval=$enable_static_boost; enable_static_boost=yes ++-else ++- enable_static_boost=no ++-fi ++- ++-# Check whether we do better use `mt' even though we weren't ask to. ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++-/* end confdefs.h. */ ++- ++-#if defined _REENTRANT || defined _MT || defined __MT__ ++-/* use -mt */ ++-#else ++-# error MT not needed ++-#endif ++- ++-int ++-main () ++-{ ++- ++- ; ++- return 0; ++-} ++-_ACEOF ++-if ac_fn_cxx_try_compile "$LINENO"; then : ++- boost_guess_use_mt=: ++-else ++- boost_guess_use_mt=false ++-fi ++-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++- ++-if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost system library" >&5 ++-$as_echo "$as_me: Boost not available, not searching for the Boost system library" >&6;} ++-else ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/system/error_code.hpp" >&5 ++-$as_echo "$as_me: Boost not available, not searching for boost/system/error_code.hpp" >&6;} ++-else ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-boost_save_CPPFLAGS=$CPPFLAGS ++-CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-ac_fn_cxx_check_header_mongrel "$LINENO" "boost/system/error_code.hpp" "ac_cv_header_boost_system_error_code_hpp" "$ac_includes_default" ++-if test "x$ac_cv_header_boost_system_error_code_hpp" = xyes; then : ++- ++-$as_echo "#define HAVE_BOOST_SYSTEM_ERROR_CODE_HPP 1" >>confdefs.h ++- ++-else ++- as_fn_error $? "cannot find boost/system/error_code.hpp" "$LINENO" 5 ++-fi ++- ++- ++-CPPFLAGS=$boost_save_CPPFLAGS ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-fi ++- ++-boost_save_CPPFLAGS=$CPPFLAGS ++-CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost system library" >&5 ++-$as_echo_n "checking for the Boost system library... " >&6; } ++-if ${boost_cv_lib_system+:} false; then : ++- $as_echo_n "(cached) " >&6 ++-else ++- boost_cv_lib_system=no ++- case "" in #( ++- (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++- (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( ++- (*) boost_mt=; boost_rtopt=;; ++- esac ++- if test $enable_static_boost = yes; then ++- boost_rtopt="s$boost_rtopt" ++- fi ++- # Find the proper debug variant depending on what we've been asked to find. ++- case $boost_rtopt in #( ++- (*d*) boost_rt_d=$boost_rtopt;; #( ++- (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++- boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( ++- (*) boost_rt_d='-d';; ++- esac ++- # If the PREFERRED-RT-OPT are not empty, prepend a `-'. ++- test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" ++- $boost_guess_use_mt && boost_mt=-mt ++- # Look for the abs path the static archive. ++- # $libext is computed by Libtool but let's make sure it's non empty. ++- test -z "$libext" && ++- as_fn_error $? "the libext variable is empty, did you invoke Libtool?" "$LINENO" 5 ++- boost_save_ac_objext=$ac_objext ++- # Generate the test file. ++- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++-/* end confdefs.h. */ ++-#include ++- ++-int ++-main () ++-{ ++-boost::system::error_code e; e.clear(); ++- ; ++- return 0; ++-} ++-_ACEOF ++- if ac_fn_cxx_try_compile "$LINENO"; then : ++- ac_objext=do_not_rm_me_plz ++-else ++- as_fn_error $? "cannot compile a test that uses Boost system" "$LINENO" 5 ++-fi ++-rm -f core conftest.err conftest.$ac_objext ++- ac_objext=$boost_save_ac_objext ++- boost_failed_libs= ++-# Don't bother to ident the following nested for loops, only the 2 ++-# innermost ones matter. ++-for boost_lib_ in system; do ++-for boost_tag_ in -$boost_cv_lib_tag ''; do ++-for boost_ver_ in -$boost_cv_lib_version ''; do ++-for boost_mt_ in $boost_mt -mt ''; do ++-for boost_rtopt_ in $boost_rtopt '' -d; do ++- for boost_lib in \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_ver_ ++- do ++- # Avoid testing twice the same lib ++- case $boost_failed_libs in #( ++- (*@$boost_lib@*) continue;; ++- esac ++- # If with_boost is empty, we'll search in /lib first, which is not quite ++- # right so instead we'll try to a location based on where the headers are. ++- boost_tmp_lib=$with_boost ++- test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} ++- for boost_ldpath in "$boost_tmp_lib/lib" '' \ ++- /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++- "$with_boost" C:/Boost/lib /lib* ++- do ++- # Don't waste time with directories that don't exist. ++- if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++- continue ++- fi ++- boost_save_LDFLAGS=$LDFLAGS ++- # Are we looking for a static library? ++- case $boost_ldpath:$boost_rtopt_ in #( ++- (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++- boost_cv_lib_system_LIBS="$boost_ldpath/lib$boost_lib.$libext" ++- test -e "$boost_cv_lib_system_LIBS" || continue;; #( ++- (*) # No: use -lboost_foo to find the shared library. ++- boost_cv_lib_system_LIBS="-l$boost_lib";; ++- esac ++- boost_save_LIBS=$LIBS ++- LIBS="$boost_cv_lib_system_LIBS $LIBS" ++- test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" ++- rm -f conftest$ac_exeext ++-boost_save_ac_ext=$ac_ext ++-boost_use_source=: ++-# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++-# tries to link the existing object file instead of compiling from source. ++-test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++- $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++-if { { ac_try="$ac_link" ++-case "(($ac_try" in ++- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++- *) ac_try_echo=$ac_try;; ++-esac ++-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++-$as_echo "$ac_try_echo"; } >&5 ++- (eval "$ac_link") 2>conftest.err ++- ac_status=$? ++- if test -s conftest.err; then ++- grep -v '^ *+' conftest.err >conftest.er1 ++- cat conftest.er1 >&5 ++- mv -f conftest.er1 conftest.err ++- fi ++- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++- test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err ++- } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext ++- }; then : ++- boost_cv_lib_system=yes ++-else ++- if $boost_use_source; then ++- $as_echo "$as_me: failed program was:" >&5 ++-sed 's/^/| /' conftest.$ac_ext >&5 ++- ++- fi ++- boost_cv_lib_system=no ++-fi ++-ac_objext=$boost_save_ac_objext ++-ac_ext=$boost_save_ac_ext ++-rm -f core conftest.err conftest_ipa8_conftest.oo \ ++- conftest$ac_exeext ++- ac_objext=$boost_save_ac_objext ++- LDFLAGS=$boost_save_LDFLAGS ++- LIBS=$boost_save_LIBS ++- if test x"$boost_cv_lib_system" = xyes; then ++- # Check or used cached result of whether or not using -R or ++- # -rpath makes sense. Some implementations of ld, such as for ++- # Mac OSX, require -rpath but -R is the flag known to work on ++- # other systems. https://github.com/tsuna/boost.m4/issues/19 ++- if ${boost_cv_rpath_link_ldflag+:} false; then : ++- $as_echo_n "(cached) " >&6 ++-else ++- case $boost_ldpath in ++- '') # Nothing to do. ++- boost_cv_rpath_link_ldflag= ++- boost_rpath_link_ldflag_found=yes;; ++- *) ++- for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++- LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- LIBS="$boost_save_LIBS $boost_cv_lib_system_LIBS" ++- rm -f conftest$ac_exeext ++-boost_save_ac_ext=$ac_ext ++-boost_use_source=: ++-# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++-# tries to link the existing object file instead of compiling from source. ++-test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++- $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++-if { { ac_try="$ac_link" ++-case "(($ac_try" in ++- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++- *) ac_try_echo=$ac_try;; ++-esac ++-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++-$as_echo "$ac_try_echo"; } >&5 ++- (eval "$ac_link") 2>conftest.err ++- ac_status=$? ++- if test -s conftest.err; then ++- grep -v '^ *+' conftest.err >conftest.er1 ++- cat conftest.er1 >&5 ++- mv -f conftest.er1 conftest.err ++- fi ++- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++- test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err ++- } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext ++- }; then : ++- boost_rpath_link_ldflag_found=yes ++- break ++-else ++- if $boost_use_source; then ++- $as_echo "$as_me: failed program was:" >&5 ++-sed 's/^/| /' conftest.$ac_ext >&5 ++- ++- fi ++- boost_rpath_link_ldflag_found=no ++-fi ++-ac_objext=$boost_save_ac_objext ++-ac_ext=$boost_save_ac_ext ++-rm -f core conftest.err conftest_ipa8_conftest.oo \ ++- conftest$ac_exeext ++- done ++- ;; ++- esac ++- if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++- as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++-fi ++- LDFLAGS=$boost_save_LDFLAGS ++- LIBS=$boost_save_LIBS ++- ++-fi ++- ++- test x"$boost_ldpath" != x && ++- boost_cv_lib_system_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- boost_cv_lib_system_LDPATH="$boost_ldpath" ++- break 7 ++- else ++- boost_failed_libs="$boost_failed_libs@$boost_lib@" ++- fi ++- done ++- done ++-done ++-done ++-done ++-done ++-done # boost_lib_ ++-rm -f conftest.$ac_objext ++- ++-fi ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_system" >&5 ++-$as_echo "$boost_cv_lib_system" >&6; } ++-case $boost_cv_lib_system in #( ++- (no) $as_echo "$as_me: failed program was:" >&5 ++-sed 's/^/| /' conftest.$ac_ext >&5 ++- ++- as_fn_error $? "cannot find the flags to link with Boost system" "$LINENO" 5 ++- ;; ++-esac ++-BOOST_SYSTEM_LDFLAGS=$boost_cv_lib_system_LDFLAGS ++-BOOST_SYSTEM_LDPATH=$boost_cv_lib_system_LDPATH ++-BOOST_LDPATH=$boost_cv_lib_system_LDPATH ++-BOOST_SYSTEM_LIBS=$boost_cv_lib_system_LIBS ++-CPPFLAGS=$boost_save_CPPFLAGS ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-fi ++- ++- ++- ++- ++-# ============== ++-# Werror support ++-# ============== ++-# Check whether --enable-werror was given. ++-if test "${enable_werror+set}" = set; then : ++- enableval=$enable_werror; enable_werror="$enableval" ++-else ++- enable_werror=no ++- ++-fi ++- ++-if test x"$enable_werror" == "xyes"; then : ++- ++- CXXFLAGS="$CXXFLAGS -Werror" ++- ++-fi ++- ++-# ========================================================= ++-# Determine if we are going to build static lib (for MinGW) ++-# ========================================================= ++- if test "$enable_shared" = no -a "$enable_static" = yes; then ++- HAVE_STATIC_LIB_TRUE= ++- HAVE_STATIC_LIB_FALSE='#' ++-else ++- HAVE_STATIC_LIB_TRUE='#' ++- HAVE_STATIC_LIB_FALSE= ++-fi ++- ++- ++-# ===== ++-# Debug ++-# ===== ++-# Check whether --enable-debug was given. ++-if test "${enable_debug+set}" = set; then : ++- enableval=$enable_debug; enable_debug="$enableval" ++-else ++- enable_debug=no ++- ++-fi ++- ++-if test "x$enable_debug" != "xno"; then : ++- ++- CXXFLAGS="$CXXFLAGS -g" ++- +++ +++if test "x$enable_debug" != "xno"; then : +++ +++ CXXFLAGS="$CXXFLAGS -g" +++ ++ else ++ ++ ++@@ -17123,7 +16449,151 @@ ++ WITH_TOOLS_TRUE='#' ++ WITH_TOOLS_FALSE= ++ fi ++- +++ +++ +++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the toolset name used by Boost for $CXX" >&5 +++$as_echo_n "checking for the toolset name used by Boost for $CXX... " >&6; } +++if ${boost_cv_lib_tag+:} false; then : +++ $as_echo_n "(cached) " >&6 +++else +++ boost_cv_lib_tag=unknown +++if test x$boost_cv_inc_path != xno; then +++ ac_ext=cpp +++ac_cpp='$CXXCPP $CPPFLAGS' +++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +++ # The following tests are mostly inspired by boost/config/auto_link.hpp +++ # The list is sorted to most recent/common to oldest compiler (in order +++ # to increase the likelihood of finding the right compiler with the +++ # least number of compilation attempt). +++ # Beware that some tests are sensible to the order (for instance, we must +++ # look for MinGW before looking for GCC3). +++ # I used one compilation test per compiler with a #error to recognize +++ # each compiler so that it works even when cross-compiling (let me know +++ # if you know a better approach). +++ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): +++ # como, edg, kcc, bck, mp, sw, tru, xlc +++ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines +++ # the same defines as GCC's). +++ for i in \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC @ gcc48" \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC @ gcc47" \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC @ gcc46" \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC @ gcc45" \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc44" \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc43" \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc42" \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc41" \ +++ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc40" \ +++ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ +++ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ +++ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ +++ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc34" \ +++ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc33" \ +++ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \ +++ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \ +++ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc32" \ +++ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ +++ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc31" \ +++ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc30" \ +++ "defined __BORLANDC__ @ bcb" \ +++ "defined __ICC && (defined __unix || defined ) @ il" \ +++ "defined __ICL @ iw" \ +++ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ +++ "defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95 && !defined __ICC @ gcc295" \ +++ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ +++ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ +++ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ +++ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" +++ do +++ boost_tag_test=`expr "X$i" : 'X\([^@]*\) @ '` +++ boost_tag=`expr "X$i" : 'X[^@]* @ \(.*\)'` +++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +++/* end confdefs.h. */ +++ +++#if $boost_tag_test +++/* OK */ +++#else +++# error $boost_tag_test +++#endif +++ +++int +++main () +++{ +++ +++ ; +++ return 0; +++} +++_ACEOF +++if ac_fn_cxx_try_compile "$LINENO"; then : +++ boost_cv_lib_tag=$boost_tag; break +++fi +++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +++ done +++ac_ext=cpp +++ac_cpp='$CXXCPP $CPPFLAGS' +++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +++ case $boost_cv_lib_tag in #( +++ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed +++ # to "gcc41" for instance. +++ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. +++ gcc*) +++ boost_tag_x= +++ case $host_os in #( +++ darwin*) +++ if test $boost_major_version -ge 136; then +++ # The `x' added in r46793 of Boost. +++ boost_tag_x=x +++ fi;; +++ esac +++ # We can specify multiple tags in this variable because it's used by +++ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... +++ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc" +++ ;; #( +++ unknown) +++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not figure out which toolset name to use for $CXX" >&5 +++$as_echo "$as_me: WARNING: could not figure out which toolset name to use for $CXX" >&2;} +++ boost_cv_lib_tag= +++ ;; +++ esac +++fi +++fi +++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_tag" >&5 +++$as_echo "$boost_cv_lib_tag" >&6; } +++# Check whether --enable-static-boost was given. +++if test "${enable_static_boost+set}" = set; then : +++ enableval=$enable_static_boost; enable_static_boost=yes +++else +++ enable_static_boost=no +++fi +++ +++# Check whether we do better use `mt' even though we weren't ask to. +++cat confdefs.h - <<_ACEOF >conftest.$ac_ext +++/* end confdefs.h. */ +++ +++#if defined _REENTRANT || defined _MT || defined __MT__ +++/* use -mt */ +++#else +++# error MT not needed +++#endif +++ +++int +++main () +++{ +++ +++ ; +++ return 0; +++} +++_ACEOF +++if ac_fn_cxx_try_compile "$LINENO"; then : +++ boost_guess_use_mt=: +++else +++ boost_guess_use_mt=false +++fi +++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++ if test "x$with_gnumeric_filter" != "xno"; then : ++ ++@@ -17167,6 +16637,13 @@ ++ ++ boost_save_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +++# Now let's try to find the library. The algorithm is as follows: first look +++# for a given library name according to the user's PREFERRED-RT-OPT. For each +++# library name, we prefer to use the ones that carry the tag (toolset name). +++# Each library is searched through the various standard paths were Boost is +++# usually installed. If we can't find the standard variants, we try to +++# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +++# but there's -obviously- libboost_threads-mt.dylib). ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost iostreams library" >&5 ++ $as_echo_n "checking for the Boost iostreams library... " >&6; } ++ if ${boost_cv_lib_iostreams+:} false; then : ++@@ -17174,19 +16651,19 @@ ++ else ++ boost_cv_lib_iostreams=no ++ case "" in #( ++- (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++- (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( ++- (*) boost_mt=; boost_rtopt=;; +++ mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +++ mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( +++ *) boost_mt=; boost_rtopt=;; ++ esac ++ if test $enable_static_boost = yes; then ++ boost_rtopt="s$boost_rtopt" ++ fi ++ # Find the proper debug variant depending on what we've been asked to find. ++ case $boost_rtopt in #( ++- (*d*) boost_rt_d=$boost_rtopt;; #( ++- (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') +++ *d*) boost_rt_d=$boost_rtopt;; #( +++ *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( ++- (*) boost_rt_d='-d';; +++ *) boost_rt_d='-d';; ++ esac ++ # If the PREFERRED-RT-OPT are not empty, prepend a `-'. ++ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" ++@@ -17217,22 +16694,21 @@ ++ rm -f core conftest.err conftest.$ac_objext ++ ac_objext=$boost_save_ac_objext ++ boost_failed_libs= ++-# Don't bother to ident the following nested for loops, only the 2 ++-# innermost ones matter. ++-for boost_lib_ in iostreams; do +++# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +++# matter. ++ for boost_tag_ in -$boost_cv_lib_tag ''; do ++ for boost_ver_ in -$boost_cv_lib_version ''; do ++ for boost_mt_ in $boost_mt -mt ''; do ++ for boost_rtopt_ in $boost_rtopt '' -d; do ++ for boost_lib in \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_ver_ +++ boost_iostreams$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +++ boost_iostreams$boost_tag_$boost_rtopt_$boost_ver_ \ +++ boost_iostreams$boost_tag_$boost_mt_$boost_ver_ \ +++ boost_iostreams$boost_tag_$boost_ver_ ++ do ++ # Avoid testing twice the same lib ++ case $boost_failed_libs in #( ++- (*@$boost_lib@*) continue;; +++ *@$boost_lib@*) continue;; ++ esac ++ # If with_boost is empty, we'll search in /lib first, which is not quite ++ # right so instead we'll try to a location based on where the headers are. ++@@ -17242,17 +16718,14 @@ ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* ++ do ++- # Don't waste time with directories that don't exist. ++- if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++- continue ++- fi +++ test -e "$boost_ldpath" || continue ++ boost_save_LDFLAGS=$LDFLAGS ++ # Are we looking for a static library? ++ case $boost_ldpath:$boost_rtopt_ in #( ++- (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) +++ *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++ boost_cv_lib_iostreams_LIBS="$boost_ldpath/lib$boost_lib.$libext" ++ test -e "$boost_cv_lib_iostreams_LIBS" || continue;; #( ++- (*) # No: use -lboost_foo to find the shared library. +++ *) # No: use -lboost_foo to find the shared library. ++ boost_cv_lib_iostreams_LIBS="-l$boost_lib";; ++ esac ++ boost_save_LIBS=$LIBS ++@@ -17281,11 +16754,11 @@ ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err +++ test -z "$ac_cxx_werror_flag" || +++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext +++ test "$cross_compiling" = yes || +++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_cv_lib_iostreams=yes ++ else ++@@ -17304,22 +16777,17 @@ ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++ if test x"$boost_cv_lib_iostreams" = xyes; then ++- # Check or used cached result of whether or not using -R or ++- # -rpath makes sense. Some implementations of ld, such as for ++- # Mac OSX, require -rpath but -R is the flag known to work on ++- # other systems. https://github.com/tsuna/boost.m4/issues/19 +++ # Check or used cached result of whether or not using -R or -rpath makes sense. +++ # Some implementations of ld, such as for Mac OSX, require -rpath but +++ # -R is the flag known to work on other systems. +++ # https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++ else ++- case $boost_ldpath in ++- '') # Nothing to do. ++- boost_cv_rpath_link_ldflag= ++- boost_rpath_link_ldflag_found=yes;; ++- *) ++- for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++- LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- LIBS="$boost_save_LIBS $boost_cv_lib_iostreams_LIBS" ++- rm -f conftest$ac_exeext +++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do +++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" +++ LIBS="$boost_save_LIBS $boost_cv_lib_iostreams_LIBS" +++ rm -f conftest$ac_exeext ++ boost_save_ac_ext=$ac_ext ++ boost_use_source=: ++ # If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++@@ -17342,14 +16810,14 @@ ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err +++ test -z "$ac_cxx_werror_flag" || +++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext +++ test "$cross_compiling" = yes || +++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++- break +++ break ++ else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++@@ -17362,9 +16830,7 @@ ++ ac_ext=$boost_save_ac_ext ++ rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++- done ++- ;; ++- esac +++ done ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++ fi ++@@ -17373,10 +16839,9 @@ ++ ++ fi ++ ++- test x"$boost_ldpath" != x && ++- boost_cv_lib_iostreams_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" +++ boost_cv_lib_iostreams_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++ boost_cv_lib_iostreams_LDPATH="$boost_ldpath" ++- break 7 +++ break 6 ++ else ++ boost_failed_libs="$boost_failed_libs@$boost_lib@" ++ fi ++@@ -17386,314 +16851,22 @@ ++ done ++ done ++ done ++-done # boost_lib_ ++ rm -f conftest.$ac_objext ++ ++ fi ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_iostreams" >&5 ++ $as_echo "$boost_cv_lib_iostreams" >&6; } ++ case $boost_cv_lib_iostreams in #( ++- (no) $as_echo "$as_me: failed program was:" >&5 +++ no) $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ as_fn_error $? "cannot find the flags to link with Boost iostreams" "$LINENO" 5 ++ ;; ++ esac ++-BOOST_IOSTREAMS_LDFLAGS=$boost_cv_lib_iostreams_LDFLAGS ++-BOOST_IOSTREAMS_LDPATH=$boost_cv_lib_iostreams_LDPATH ++-BOOST_LDPATH=$boost_cv_lib_iostreams_LDPATH ++-BOOST_IOSTREAMS_LIBS=$boost_cv_lib_iostreams_LIBS ++-CPPFLAGS=$boost_save_CPPFLAGS ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-fi ++- ++- ++- ++- ++-fi ++- ++-if test "x$with_tools" != "xno"; then : ++- ++- if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost program_options library" >&5 ++-$as_echo "$as_me: Boost not available, not searching for the Boost program_options library" >&6;} ++-else ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/program_options.hpp" >&5 ++-$as_echo "$as_me: Boost not available, not searching for boost/program_options.hpp" >&6;} ++-else ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-boost_save_CPPFLAGS=$CPPFLAGS ++-CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-ac_fn_cxx_check_header_mongrel "$LINENO" "boost/program_options.hpp" "ac_cv_header_boost_program_options_hpp" "$ac_includes_default" ++-if test "x$ac_cv_header_boost_program_options_hpp" = xyes; then : ++- ++-$as_echo "#define HAVE_BOOST_PROGRAM_OPTIONS_HPP 1" >>confdefs.h ++- ++-else ++- as_fn_error $? "cannot find boost/program_options.hpp" "$LINENO" 5 ++-fi ++- ++- ++-CPPFLAGS=$boost_save_CPPFLAGS ++-ac_ext=cpp ++-ac_cpp='$CXXCPP $CPPFLAGS' ++-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++-fi ++- ++-boost_save_CPPFLAGS=$CPPFLAGS ++-CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost program_options library" >&5 ++-$as_echo_n "checking for the Boost program_options library... " >&6; } ++-if ${boost_cv_lib_program_options+:} false; then : ++- $as_echo_n "(cached) " >&6 ++-else ++- boost_cv_lib_program_options=no ++- case "" in #( ++- (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++- (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( ++- (*) boost_mt=; boost_rtopt=;; ++- esac ++- if test $enable_static_boost = yes; then ++- boost_rtopt="s$boost_rtopt" ++- fi ++- # Find the proper debug variant depending on what we've been asked to find. ++- case $boost_rtopt in #( ++- (*d*) boost_rt_d=$boost_rtopt;; #( ++- (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++- boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( ++- (*) boost_rt_d='-d';; ++- esac ++- # If the PREFERRED-RT-OPT are not empty, prepend a `-'. ++- test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" ++- $boost_guess_use_mt && boost_mt=-mt ++- # Look for the abs path the static archive. ++- # $libext is computed by Libtool but let's make sure it's non empty. ++- test -z "$libext" && ++- as_fn_error $? "the libext variable is empty, did you invoke Libtool?" "$LINENO" 5 ++- boost_save_ac_objext=$ac_objext ++- # Generate the test file. ++- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++-/* end confdefs.h. */ ++-#include ++- ++-int ++-main () ++-{ ++-boost::program_options::options_description d("test"); ++- ; ++- return 0; ++-} ++-_ACEOF ++- if ac_fn_cxx_try_compile "$LINENO"; then : ++- ac_objext=do_not_rm_me_plz ++-else ++- as_fn_error $? "cannot compile a test that uses Boost program_options" "$LINENO" 5 ++-fi ++-rm -f core conftest.err conftest.$ac_objext ++- ac_objext=$boost_save_ac_objext ++- boost_failed_libs= ++-# Don't bother to ident the following nested for loops, only the 2 ++-# innermost ones matter. ++-for boost_lib_ in program_options; do ++-for boost_tag_ in -$boost_cv_lib_tag ''; do ++-for boost_ver_ in -$boost_cv_lib_version ''; do ++-for boost_mt_ in $boost_mt -mt ''; do ++-for boost_rtopt_ in $boost_rtopt '' -d; do ++- for boost_lib in \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_ver_ ++- do ++- # Avoid testing twice the same lib ++- case $boost_failed_libs in #( ++- (*@$boost_lib@*) continue;; ++- esac ++- # If with_boost is empty, we'll search in /lib first, which is not quite ++- # right so instead we'll try to a location based on where the headers are. ++- boost_tmp_lib=$with_boost ++- test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} ++- for boost_ldpath in "$boost_tmp_lib/lib" '' \ ++- /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++- "$with_boost" C:/Boost/lib /lib* ++- do ++- # Don't waste time with directories that don't exist. ++- if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++- continue ++- fi ++- boost_save_LDFLAGS=$LDFLAGS ++- # Are we looking for a static library? ++- case $boost_ldpath:$boost_rtopt_ in #( ++- (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++- boost_cv_lib_program_options_LIBS="$boost_ldpath/lib$boost_lib.$libext" ++- test -e "$boost_cv_lib_program_options_LIBS" || continue;; #( ++- (*) # No: use -lboost_foo to find the shared library. ++- boost_cv_lib_program_options_LIBS="-l$boost_lib";; ++- esac ++- boost_save_LIBS=$LIBS ++- LIBS="$boost_cv_lib_program_options_LIBS $LIBS" ++- test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" ++- rm -f conftest$ac_exeext ++-boost_save_ac_ext=$ac_ext ++-boost_use_source=: ++-# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++-# tries to link the existing object file instead of compiling from source. ++-test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++- $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++-if { { ac_try="$ac_link" ++-case "(($ac_try" in ++- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++- *) ac_try_echo=$ac_try;; ++-esac ++-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++-$as_echo "$ac_try_echo"; } >&5 ++- (eval "$ac_link") 2>conftest.err ++- ac_status=$? ++- if test -s conftest.err; then ++- grep -v '^ *+' conftest.err >conftest.er1 ++- cat conftest.er1 >&5 ++- mv -f conftest.er1 conftest.err ++- fi ++- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++- test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err ++- } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext ++- }; then : ++- boost_cv_lib_program_options=yes ++-else ++- if $boost_use_source; then ++- $as_echo "$as_me: failed program was:" >&5 ++-sed 's/^/| /' conftest.$ac_ext >&5 ++- ++- fi ++- boost_cv_lib_program_options=no ++-fi ++-ac_objext=$boost_save_ac_objext ++-ac_ext=$boost_save_ac_ext ++-rm -f core conftest.err conftest_ipa8_conftest.oo \ ++- conftest$ac_exeext ++- ac_objext=$boost_save_ac_objext ++- LDFLAGS=$boost_save_LDFLAGS ++- LIBS=$boost_save_LIBS ++- if test x"$boost_cv_lib_program_options" = xyes; then ++- # Check or used cached result of whether or not using -R or ++- # -rpath makes sense. Some implementations of ld, such as for ++- # Mac OSX, require -rpath but -R is the flag known to work on ++- # other systems. https://github.com/tsuna/boost.m4/issues/19 ++- if ${boost_cv_rpath_link_ldflag+:} false; then : ++- $as_echo_n "(cached) " >&6 ++-else ++- case $boost_ldpath in ++- '') # Nothing to do. ++- boost_cv_rpath_link_ldflag= ++- boost_rpath_link_ldflag_found=yes;; ++- *) ++- for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++- LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- LIBS="$boost_save_LIBS $boost_cv_lib_program_options_LIBS" ++- rm -f conftest$ac_exeext ++-boost_save_ac_ext=$ac_ext ++-boost_use_source=: ++-# If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++-# tries to link the existing object file instead of compiling from source. ++-test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && ++- $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 ++-if { { ac_try="$ac_link" ++-case "(($ac_try" in ++- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++- *) ac_try_echo=$ac_try;; ++-esac ++-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++-$as_echo "$ac_try_echo"; } >&5 ++- (eval "$ac_link") 2>conftest.err ++- ac_status=$? ++- if test -s conftest.err; then ++- grep -v '^ *+' conftest.err >conftest.er1 ++- cat conftest.er1 >&5 ++- mv -f conftest.er1 conftest.err ++- fi ++- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++- test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err ++- } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext ++- }; then : ++- boost_rpath_link_ldflag_found=yes ++- break ++-else ++- if $boost_use_source; then ++- $as_echo "$as_me: failed program was:" >&5 ++-sed 's/^/| /' conftest.$ac_ext >&5 ++- ++- fi ++- boost_rpath_link_ldflag_found=no ++-fi ++-ac_objext=$boost_save_ac_objext ++-ac_ext=$boost_save_ac_ext ++-rm -f core conftest.err conftest_ipa8_conftest.oo \ ++- conftest$ac_exeext ++- done ++- ;; ++- esac ++- if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++- as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++-fi ++- LDFLAGS=$boost_save_LDFLAGS ++- LIBS=$boost_save_LIBS ++- ++-fi ++- ++- test x"$boost_ldpath" != x && ++- boost_cv_lib_program_options_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- boost_cv_lib_program_options_LDPATH="$boost_ldpath" ++- break 7 ++- else ++- boost_failed_libs="$boost_failed_libs@$boost_lib@" ++- fi ++- done ++- done ++-done ++-done ++-done ++-done ++-done # boost_lib_ ++-rm -f conftest.$ac_objext ++- ++-fi ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_program_options" >&5 ++-$as_echo "$boost_cv_lib_program_options" >&6; } ++-case $boost_cv_lib_program_options in #( ++- (no) $as_echo "$as_me: failed program was:" >&5 ++-sed 's/^/| /' conftest.$ac_ext >&5 ++- ++- as_fn_error $? "cannot find the flags to link with Boost program_options" "$LINENO" 5 ++- ;; ++-esac ++-BOOST_PROGRAM_OPTIONS_LDFLAGS=$boost_cv_lib_program_options_LDFLAGS ++-BOOST_PROGRAM_OPTIONS_LDPATH=$boost_cv_lib_program_options_LDPATH ++-BOOST_LDPATH=$boost_cv_lib_program_options_LDPATH ++-BOOST_PROGRAM_OPTIONS_LIBS=$boost_cv_lib_program_options_LIBS +++BOOST_IOSTREAMS_LDFLAGS=$boost_cv_lib_iostreams_LDFLAGS +++BOOST_IOSTREAMS_LDPATH=$boost_cv_lib_iostreams_LDPATH +++BOOST_LDPATH=$boost_cv_lib_iostreams_LDPATH +++BOOST_IOSTREAMS_LIBS=$boost_cv_lib_iostreams_LIBS ++ CPPFLAGS=$boost_save_CPPFLAGS ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -17704,13 +16877,14 @@ ++ ++ ++ ++- # Do we have to check for Boost.System? This link-time dependency was ++-# added as of 1.35.0. If we have a version <1.35, we must not attempt to ++-# find Boost.System as it didn't exist by then. ++-if test $boost_major_version -ge 135; then ++- if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost system library" >&5 ++-$as_echo "$as_me: Boost not available, not searching for the Boost system library" >&6;} +++ +++fi +++ +++if test "x$with_tools" != "xno"; then : +++ +++ if test x"$boost_cv_inc_path" = xno; then +++ { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost program_options library" >&5 +++$as_echo "$as_me: Boost not available, not searching for the Boost program_options library" >&6;} ++ else ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -17718,8 +16892,8 @@ ++ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/system/error_code.hpp" >&5 ++-$as_echo "$as_me: Boost not available, not searching for boost/system/error_code.hpp" >&6;} +++ { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/program_options.hpp" >&5 +++$as_echo "$as_me: Boost not available, not searching for boost/program_options.hpp" >&6;} ++ else ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -17728,13 +16902,13 @@ ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ boost_save_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-ac_fn_cxx_check_header_mongrel "$LINENO" "boost/system/error_code.hpp" "ac_cv_header_boost_system_error_code_hpp" "$ac_includes_default" ++-if test "x$ac_cv_header_boost_system_error_code_hpp" = xyes; then : +++ac_fn_cxx_check_header_mongrel "$LINENO" "boost/program_options.hpp" "ac_cv_header_boost_program_options_hpp" "$ac_includes_default" +++if test "x$ac_cv_header_boost_program_options_hpp" = xyes; then : ++ ++-$as_echo "#define HAVE_BOOST_SYSTEM_ERROR_CODE_HPP 1" >>confdefs.h +++$as_echo "#define HAVE_BOOST_PROGRAM_OPTIONS_HPP 1" >>confdefs.h ++ ++ else ++- as_fn_error $? "cannot find boost/system/error_code.hpp" "$LINENO" 5 +++ as_fn_error $? "cannot find boost/program_options.hpp" "$LINENO" 5 ++ fi ++ ++ ++@@ -17748,26 +16922,33 @@ ++ ++ boost_save_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost system library" >&5 ++-$as_echo_n "checking for the Boost system library... " >&6; } ++-if ${boost_cv_lib_system+:} false; then : +++# Now let's try to find the library. The algorithm is as follows: first look +++# for a given library name according to the user's PREFERRED-RT-OPT. For each +++# library name, we prefer to use the ones that carry the tag (toolset name). +++# Each library is searched through the various standard paths were Boost is +++# usually installed. If we can't find the standard variants, we try to +++# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +++# but there's -obviously- libboost_threads-mt.dylib). +++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost program_options library" >&5 +++$as_echo_n "checking for the Boost program_options library... " >&6; } +++if ${boost_cv_lib_program_options+:} false; then : ++ $as_echo_n "(cached) " >&6 ++ else ++- boost_cv_lib_system=no +++ boost_cv_lib_program_options=no ++ case "" in #( ++- (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++- (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( ++- (*) boost_mt=; boost_rtopt=;; +++ mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +++ mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( +++ *) boost_mt=; boost_rtopt=;; ++ esac ++ if test $enable_static_boost = yes; then ++ boost_rtopt="s$boost_rtopt" ++ fi ++ # Find the proper debug variant depending on what we've been asked to find. ++ case $boost_rtopt in #( ++- (*d*) boost_rt_d=$boost_rtopt;; #( ++- (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') +++ *d*) boost_rt_d=$boost_rtopt;; #( +++ *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( ++- (*) boost_rt_d='-d';; +++ *) boost_rt_d='-d';; ++ esac ++ # If the PREFERRED-RT-OPT are not empty, prepend a `-'. ++ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" ++@@ -17780,12 +16961,12 @@ ++ # Generate the test file. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ /* end confdefs.h. */ ++-#include +++#include ++ ++ int ++ main () ++ { ++-boost::system::error_code e; e.clear(); +++boost::program_options::options_description d("test"); ++ ; ++ return 0; ++ } ++@@ -17793,27 +16974,26 @@ ++ if ac_fn_cxx_try_compile "$LINENO"; then : ++ ac_objext=do_not_rm_me_plz ++ else ++- as_fn_error $? "cannot compile a test that uses Boost system" "$LINENO" 5 +++ as_fn_error $? "cannot compile a test that uses Boost program_options" "$LINENO" 5 ++ fi ++ rm -f core conftest.err conftest.$ac_objext ++ ac_objext=$boost_save_ac_objext ++ boost_failed_libs= ++-# Don't bother to ident the following nested for loops, only the 2 ++-# innermost ones matter. ++-for boost_lib_ in system; do +++# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +++# matter. ++ for boost_tag_ in -$boost_cv_lib_tag ''; do ++ for boost_ver_ in -$boost_cv_lib_version ''; do ++ for boost_mt_ in $boost_mt -mt ''; do ++ for boost_rtopt_ in $boost_rtopt '' -d; do ++ for boost_lib in \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_ver_ +++ boost_program_options$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +++ boost_program_options$boost_tag_$boost_rtopt_$boost_ver_ \ +++ boost_program_options$boost_tag_$boost_mt_$boost_ver_ \ +++ boost_program_options$boost_tag_$boost_ver_ ++ do ++ # Avoid testing twice the same lib ++ case $boost_failed_libs in #( ++- (*@$boost_lib@*) continue;; +++ *@$boost_lib@*) continue;; ++ esac ++ # If with_boost is empty, we'll search in /lib first, which is not quite ++ # right so instead we'll try to a location based on where the headers are. ++@@ -17823,21 +17003,18 @@ ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* ++ do ++- # Don't waste time with directories that don't exist. ++- if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++- continue ++- fi +++ test -e "$boost_ldpath" || continue ++ boost_save_LDFLAGS=$LDFLAGS ++ # Are we looking for a static library? ++ case $boost_ldpath:$boost_rtopt_ in #( ++- (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++- boost_cv_lib_system_LIBS="$boost_ldpath/lib$boost_lib.$libext" ++- test -e "$boost_cv_lib_system_LIBS" || continue;; #( ++- (*) # No: use -lboost_foo to find the shared library. ++- boost_cv_lib_system_LIBS="-l$boost_lib";; +++ *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) +++ boost_cv_lib_program_options_LIBS="$boost_ldpath/lib$boost_lib.$libext" +++ test -e "$boost_cv_lib_program_options_LIBS" || continue;; #( +++ *) # No: use -lboost_foo to find the shared library. +++ boost_cv_lib_program_options_LIBS="-l$boost_lib";; ++ esac ++ boost_save_LIBS=$LIBS ++- LIBS="$boost_cv_lib_system_LIBS $LIBS" +++ LIBS="$boost_cv_lib_program_options_LIBS $LIBS" ++ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" ++ rm -f conftest$ac_exeext ++ boost_save_ac_ext=$ac_ext ++@@ -17862,20 +17039,20 @@ ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err +++ test -z "$ac_cxx_werror_flag" || +++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext +++ test "$cross_compiling" = yes || +++ $as_executable_p conftest$ac_exeext ++ }; then : ++- boost_cv_lib_system=yes +++ boost_cv_lib_program_options=yes ++ else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++- boost_cv_lib_system=no +++ boost_cv_lib_program_options=no ++ fi ++ ac_objext=$boost_save_ac_objext ++ ac_ext=$boost_save_ac_ext ++@@ -17884,23 +17061,18 @@ ++ ac_objext=$boost_save_ac_objext ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++- if test x"$boost_cv_lib_system" = xyes; then ++- # Check or used cached result of whether or not using -R or ++- # -rpath makes sense. Some implementations of ld, such as for ++- # Mac OSX, require -rpath but -R is the flag known to work on ++- # other systems. https://github.com/tsuna/boost.m4/issues/19 +++ if test x"$boost_cv_lib_program_options" = xyes; then +++ # Check or used cached result of whether or not using -R or -rpath makes sense. +++ # Some implementations of ld, such as for Mac OSX, require -rpath but +++ # -R is the flag known to work on other systems. +++ # https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++ else ++- case $boost_ldpath in ++- '') # Nothing to do. ++- boost_cv_rpath_link_ldflag= ++- boost_rpath_link_ldflag_found=yes;; ++- *) ++- for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++- LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- LIBS="$boost_save_LIBS $boost_cv_lib_system_LIBS" ++- rm -f conftest$ac_exeext +++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do +++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" +++ LIBS="$boost_save_LIBS $boost_cv_lib_program_options_LIBS" +++ rm -f conftest$ac_exeext ++ boost_save_ac_ext=$ac_ext ++ boost_use_source=: ++ # If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++@@ -17923,14 +17095,14 @@ ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err +++ test -z "$ac_cxx_werror_flag" || +++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext +++ test "$cross_compiling" = yes || +++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++- break +++ break ++ else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++@@ -17943,9 +17115,7 @@ ++ ac_ext=$boost_save_ac_ext ++ rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++- done ++- ;; ++- esac +++ done ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++ fi ++@@ -17954,10 +17124,9 @@ ++ ++ fi ++ ++- test x"$boost_ldpath" != x && ++- boost_cv_lib_system_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- boost_cv_lib_system_LDPATH="$boost_ldpath" ++- break 7 +++ boost_cv_lib_program_options_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" +++ boost_cv_lib_program_options_LDPATH="$boost_ldpath" +++ break 6 ++ else ++ boost_failed_libs="$boost_failed_libs@$boost_lib@" ++ fi ++@@ -17967,23 +17136,22 @@ ++ done ++ done ++ done ++-done # boost_lib_ ++ rm -f conftest.$ac_objext ++ ++ fi ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_system" >&5 ++-$as_echo "$boost_cv_lib_system" >&6; } ++-case $boost_cv_lib_system in #( ++- (no) $as_echo "$as_me: failed program was:" >&5 +++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_program_options" >&5 +++$as_echo "$boost_cv_lib_program_options" >&6; } +++case $boost_cv_lib_program_options in #( +++ no) $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++- as_fn_error $? "cannot find the flags to link with Boost system" "$LINENO" 5 +++ as_fn_error $? "cannot find the flags to link with Boost program_options" "$LINENO" 5 ++ ;; ++ esac ++-BOOST_SYSTEM_LDFLAGS=$boost_cv_lib_system_LDFLAGS ++-BOOST_SYSTEM_LDPATH=$boost_cv_lib_system_LDPATH ++-BOOST_LDPATH=$boost_cv_lib_system_LDPATH ++-BOOST_SYSTEM_LIBS=$boost_cv_lib_system_LIBS +++BOOST_PROGRAM_OPTIONS_LDFLAGS=$boost_cv_lib_program_options_LDFLAGS +++BOOST_PROGRAM_OPTIONS_LDPATH=$boost_cv_lib_program_options_LDPATH +++BOOST_LDPATH=$boost_cv_lib_program_options_LDPATH +++BOOST_PROGRAM_OPTIONS_LIBS=$boost_cv_lib_program_options_LIBS ++ CPPFLAGS=$boost_save_CPPFLAGS ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -17994,14 +17162,13 @@ ++ ++ ++ ++-fi # end of the Boost.System check. ++-boost_filesystem_save_LIBS=$LIBS ++-boost_filesystem_save_LDFLAGS=$LDFLAGS ++-LIBS="$LIBS $BOOST_SYSTEM_LIBS" ++-LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +++ # Do we have to check for Boost.System? This link-time dependency was +++# added as of 1.35.0. If we have a version <1.35, we must not attempt to +++# find Boost.System as it didn't exist by then. +++if test $boost_major_version -ge 135; then ++ if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost filesystem library" >&5 ++-$as_echo "$as_me: Boost not available, not searching for the Boost filesystem library" >&6;} +++ { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost system library" >&5 +++$as_echo "$as_me: Boost not available, not searching for the Boost system library" >&6;} ++ else ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -18009,8 +17176,8 @@ ++ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/filesystem/path.hpp" >&5 ++-$as_echo "$as_me: Boost not available, not searching for boost/filesystem/path.hpp" >&6;} +++ { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/system/error_code.hpp" >&5 +++$as_echo "$as_me: Boost not available, not searching for boost/system/error_code.hpp" >&6;} ++ else ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -18019,13 +17186,13 @@ ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ boost_save_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-ac_fn_cxx_check_header_mongrel "$LINENO" "boost/filesystem/path.hpp" "ac_cv_header_boost_filesystem_path_hpp" "$ac_includes_default" ++-if test "x$ac_cv_header_boost_filesystem_path_hpp" = xyes; then : +++ac_fn_cxx_check_header_mongrel "$LINENO" "boost/system/error_code.hpp" "ac_cv_header_boost_system_error_code_hpp" "$ac_includes_default" +++if test "x$ac_cv_header_boost_system_error_code_hpp" = xyes; then : ++ ++-$as_echo "#define HAVE_BOOST_FILESYSTEM_PATH_HPP 1" >>confdefs.h +++$as_echo "#define HAVE_BOOST_SYSTEM_ERROR_CODE_HPP 1" >>confdefs.h ++ ++ else ++- as_fn_error $? "cannot find boost/filesystem/path.hpp" "$LINENO" 5 +++ as_fn_error $? "cannot find boost/system/error_code.hpp" "$LINENO" 5 ++ fi ++ ++ ++@@ -18039,26 +17206,33 @@ ++ ++ boost_save_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost filesystem library" >&5 ++-$as_echo_n "checking for the Boost filesystem library... " >&6; } ++-if ${boost_cv_lib_filesystem+:} false; then : +++# Now let's try to find the library. The algorithm is as follows: first look +++# for a given library name according to the user's PREFERRED-RT-OPT. For each +++# library name, we prefer to use the ones that carry the tag (toolset name). +++# Each library is searched through the various standard paths were Boost is +++# usually installed. If we can't find the standard variants, we try to +++# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +++# but there's -obviously- libboost_threads-mt.dylib). +++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost system library" >&5 +++$as_echo_n "checking for the Boost system library... " >&6; } +++if ${boost_cv_lib_system+:} false; then : ++ $as_echo_n "(cached) " >&6 ++ else ++- boost_cv_lib_filesystem=no +++ boost_cv_lib_system=no ++ case "" in #( ++- (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++- (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( ++- (*) boost_mt=; boost_rtopt=;; +++ mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +++ mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( +++ *) boost_mt=; boost_rtopt=;; ++ esac ++ if test $enable_static_boost = yes; then ++ boost_rtopt="s$boost_rtopt" ++ fi ++ # Find the proper debug variant depending on what we've been asked to find. ++ case $boost_rtopt in #( ++- (*d*) boost_rt_d=$boost_rtopt;; #( ++- (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') +++ *d*) boost_rt_d=$boost_rtopt;; #( +++ *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( ++- (*) boost_rt_d='-d';; +++ *) boost_rt_d='-d';; ++ esac ++ # If the PREFERRED-RT-OPT are not empty, prepend a `-'. ++ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" ++@@ -18071,12 +17245,12 @@ ++ # Generate the test file. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ /* end confdefs.h. */ ++-#include +++#include ++ ++ int ++ main () ++ { ++-boost::filesystem::path p; +++boost::system::error_code e; e.clear(); ++ ; ++ return 0; ++ } ++@@ -18084,27 +17258,26 @@ ++ if ac_fn_cxx_try_compile "$LINENO"; then : ++ ac_objext=do_not_rm_me_plz ++ else ++- as_fn_error $? "cannot compile a test that uses Boost filesystem" "$LINENO" 5 +++ as_fn_error $? "cannot compile a test that uses Boost system" "$LINENO" 5 ++ fi ++ rm -f core conftest.err conftest.$ac_objext ++ ac_objext=$boost_save_ac_objext ++ boost_failed_libs= ++-# Don't bother to ident the following nested for loops, only the 2 ++-# innermost ones matter. ++-for boost_lib_ in filesystem; do +++# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +++# matter. ++ for boost_tag_ in -$boost_cv_lib_tag ''; do ++ for boost_ver_ in -$boost_cv_lib_version ''; do ++ for boost_mt_ in $boost_mt -mt ''; do ++ for boost_rtopt_ in $boost_rtopt '' -d; do ++ for boost_lib in \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_ver_ +++ boost_system$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +++ boost_system$boost_tag_$boost_rtopt_$boost_ver_ \ +++ boost_system$boost_tag_$boost_mt_$boost_ver_ \ +++ boost_system$boost_tag_$boost_ver_ ++ do ++ # Avoid testing twice the same lib ++ case $boost_failed_libs in #( ++- (*@$boost_lib@*) continue;; +++ *@$boost_lib@*) continue;; ++ esac ++ # If with_boost is empty, we'll search in /lib first, which is not quite ++ # right so instead we'll try to a location based on where the headers are. ++@@ -18114,21 +17287,18 @@ ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* ++ do ++- # Don't waste time with directories that don't exist. ++- if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++- continue ++- fi +++ test -e "$boost_ldpath" || continue ++ boost_save_LDFLAGS=$LDFLAGS ++ # Are we looking for a static library? ++ case $boost_ldpath:$boost_rtopt_ in #( ++- (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++- boost_cv_lib_filesystem_LIBS="$boost_ldpath/lib$boost_lib.$libext" ++- test -e "$boost_cv_lib_filesystem_LIBS" || continue;; #( ++- (*) # No: use -lboost_foo to find the shared library. ++- boost_cv_lib_filesystem_LIBS="-l$boost_lib";; +++ *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) +++ boost_cv_lib_system_LIBS="$boost_ldpath/lib$boost_lib.$libext" +++ test -e "$boost_cv_lib_system_LIBS" || continue;; #( +++ *) # No: use -lboost_foo to find the shared library. +++ boost_cv_lib_system_LIBS="-l$boost_lib";; ++ esac ++ boost_save_LIBS=$LIBS ++- LIBS="$boost_cv_lib_filesystem_LIBS $LIBS" +++ LIBS="$boost_cv_lib_system_LIBS $LIBS" ++ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" ++ rm -f conftest$ac_exeext ++ boost_save_ac_ext=$ac_ext ++@@ -18153,20 +17323,20 @@ ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err +++ test -z "$ac_cxx_werror_flag" || +++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext +++ test "$cross_compiling" = yes || +++ $as_executable_p conftest$ac_exeext ++ }; then : ++- boost_cv_lib_filesystem=yes +++ boost_cv_lib_system=yes ++ else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++- boost_cv_lib_filesystem=no +++ boost_cv_lib_system=no ++ fi ++ ac_objext=$boost_save_ac_objext ++ ac_ext=$boost_save_ac_ext ++@@ -18175,23 +17345,18 @@ ++ ac_objext=$boost_save_ac_objext ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++- if test x"$boost_cv_lib_filesystem" = xyes; then ++- # Check or used cached result of whether or not using -R or ++- # -rpath makes sense. Some implementations of ld, such as for ++- # Mac OSX, require -rpath but -R is the flag known to work on ++- # other systems. https://github.com/tsuna/boost.m4/issues/19 +++ if test x"$boost_cv_lib_system" = xyes; then +++ # Check or used cached result of whether or not using -R or -rpath makes sense. +++ # Some implementations of ld, such as for Mac OSX, require -rpath but +++ # -R is the flag known to work on other systems. +++ # https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++ else ++- case $boost_ldpath in ++- '') # Nothing to do. ++- boost_cv_rpath_link_ldflag= ++- boost_rpath_link_ldflag_found=yes;; ++- *) ++- for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++- LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- LIBS="$boost_save_LIBS $boost_cv_lib_filesystem_LIBS" ++- rm -f conftest$ac_exeext +++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do +++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" +++ LIBS="$boost_save_LIBS $boost_cv_lib_system_LIBS" +++ rm -f conftest$ac_exeext ++ boost_save_ac_ext=$ac_ext ++ boost_use_source=: ++ # If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++@@ -18214,14 +17379,14 @@ ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err +++ test -z "$ac_cxx_werror_flag" || +++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext +++ test "$cross_compiling" = yes || +++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++- break +++ break ++ else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++@@ -18234,9 +17399,7 @@ ++ ac_ext=$boost_save_ac_ext ++ rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++- done ++- ;; ++- esac +++ done ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++ fi ++@@ -18245,10 +17408,9 @@ ++ ++ fi ++ ++- test x"$boost_ldpath" != x && ++- boost_cv_lib_filesystem_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- boost_cv_lib_filesystem_LDPATH="$boost_ldpath" ++- break 7 +++ boost_cv_lib_system_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" +++ boost_cv_lib_system_LDPATH="$boost_ldpath" +++ break 6 ++ else ++ boost_failed_libs="$boost_failed_libs@$boost_lib@" ++ fi ++@@ -18258,23 +17420,22 @@ ++ done ++ done ++ done ++-done # boost_lib_ ++ rm -f conftest.$ac_objext ++ ++ fi ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_filesystem" >&5 ++-$as_echo "$boost_cv_lib_filesystem" >&6; } ++-case $boost_cv_lib_filesystem in #( ++- (no) $as_echo "$as_me: failed program was:" >&5 +++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_system" >&5 +++$as_echo "$boost_cv_lib_system" >&6; } +++case $boost_cv_lib_system in #( +++ no) $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++- as_fn_error $? "cannot find the flags to link with Boost filesystem" "$LINENO" 5 +++ as_fn_error $? "cannot find the flags to link with Boost system" "$LINENO" 5 ++ ;; ++ esac ++-BOOST_FILESYSTEM_LDFLAGS=$boost_cv_lib_filesystem_LDFLAGS ++-BOOST_FILESYSTEM_LDPATH=$boost_cv_lib_filesystem_LDPATH ++-BOOST_LDPATH=$boost_cv_lib_filesystem_LDPATH ++-BOOST_FILESYSTEM_LIBS=$boost_cv_lib_filesystem_LIBS +++BOOST_SYSTEM_LDFLAGS=$boost_cv_lib_system_LDFLAGS +++BOOST_SYSTEM_LDPATH=$boost_cv_lib_system_LDPATH +++BOOST_LDPATH=$boost_cv_lib_system_LDPATH +++BOOST_SYSTEM_LIBS=$boost_cv_lib_system_LIBS ++ CPPFLAGS=$boost_save_CPPFLAGS ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -18283,16 +17444,16 @@ ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ fi ++ ++-if test $enable_static_boost = yes && test $boost_major_version -ge 135; then ++- BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" ++-fi ++-LIBS=$boost_filesystem_save_LIBS ++-LDFLAGS=$boost_filesystem_save_LDFLAGS ++ ++ ++- if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost system library" >&5 ++-$as_echo "$as_me: Boost not available, not searching for the Boost system library" >&6;} +++fi # end of the Boost.System check. +++boost_filesystem_save_LIBS=$LIBS +++boost_filesystem_save_LDFLAGS=$LDFLAGS +++LIBS="$LIBS $BOOST_SYSTEM_LIBS" +++LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +++if test x"$boost_cv_inc_path" = xno; then +++ { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost filesystem library" >&5 +++$as_echo "$as_me: Boost not available, not searching for the Boost filesystem library" >&6;} ++ else ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -18300,8 +17461,8 @@ ++ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ if test x"$boost_cv_inc_path" = xno; then ++- { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/system/error_code.hpp" >&5 ++-$as_echo "$as_me: Boost not available, not searching for boost/system/error_code.hpp" >&6;} +++ { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/filesystem/path.hpp" >&5 +++$as_echo "$as_me: Boost not available, not searching for boost/filesystem/path.hpp" >&6;} ++ else ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -18310,13 +17471,13 @@ ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ boost_save_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-ac_fn_cxx_check_header_mongrel "$LINENO" "boost/system/error_code.hpp" "ac_cv_header_boost_system_error_code_hpp" "$ac_includes_default" ++-if test "x$ac_cv_header_boost_system_error_code_hpp" = xyes; then : +++ac_fn_cxx_check_header_mongrel "$LINENO" "boost/filesystem/path.hpp" "ac_cv_header_boost_filesystem_path_hpp" "$ac_includes_default" +++if test "x$ac_cv_header_boost_filesystem_path_hpp" = xyes; then : ++ ++-$as_echo "#define HAVE_BOOST_SYSTEM_ERROR_CODE_HPP 1" >>confdefs.h +++$as_echo "#define HAVE_BOOST_FILESYSTEM_PATH_HPP 1" >>confdefs.h ++ ++ else ++- as_fn_error $? "cannot find boost/system/error_code.hpp" "$LINENO" 5 +++ as_fn_error $? "cannot find boost/filesystem/path.hpp" "$LINENO" 5 ++ fi ++ ++ ++@@ -18330,26 +17491,33 @@ ++ ++ boost_save_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost system library" >&5 ++-$as_echo_n "checking for the Boost system library... " >&6; } ++-if ${boost_cv_lib_system+:} false; then : +++# Now let's try to find the library. The algorithm is as follows: first look +++# for a given library name according to the user's PREFERRED-RT-OPT. For each +++# library name, we prefer to use the ones that carry the tag (toolset name). +++# Each library is searched through the various standard paths were Boost is +++# usually installed. If we can't find the standard variants, we try to +++# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +++# but there's -obviously- libboost_threads-mt.dylib). +++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost filesystem library" >&5 +++$as_echo_n "checking for the Boost filesystem library... " >&6; } +++if ${boost_cv_lib_filesystem+:} false; then : ++ $as_echo_n "(cached) " >&6 ++ else ++- boost_cv_lib_system=no +++ boost_cv_lib_filesystem=no ++ case "" in #( ++- (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( ++- (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( ++- (*) boost_mt=; boost_rtopt=;; +++ mt | mt-) boost_mt=-mt; boost_rtopt=;; #( +++ mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( +++ *) boost_mt=; boost_rtopt=;; ++ esac ++ if test $enable_static_boost = yes; then ++ boost_rtopt="s$boost_rtopt" ++ fi ++ # Find the proper debug variant depending on what we've been asked to find. ++ case $boost_rtopt in #( ++- (*d*) boost_rt_d=$boost_rtopt;; #( ++- (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') +++ *d*) boost_rt_d=$boost_rtopt;; #( +++ *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') ++ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( ++- (*) boost_rt_d='-d';; +++ *) boost_rt_d='-d';; ++ esac ++ # If the PREFERRED-RT-OPT are not empty, prepend a `-'. ++ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" ++@@ -18362,12 +17530,12 @@ ++ # Generate the test file. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ /* end confdefs.h. */ ++-#include +++#include ++ ++ int ++ main () ++ { ++-boost::system::error_code e; e.clear(); +++boost::filesystem::path p; ++ ; ++ return 0; ++ } ++@@ -18375,27 +17543,26 @@ ++ if ac_fn_cxx_try_compile "$LINENO"; then : ++ ac_objext=do_not_rm_me_plz ++ else ++- as_fn_error $? "cannot compile a test that uses Boost system" "$LINENO" 5 +++ as_fn_error $? "cannot compile a test that uses Boost filesystem" "$LINENO" 5 ++ fi ++ rm -f core conftest.err conftest.$ac_objext ++ ac_objext=$boost_save_ac_objext ++ boost_failed_libs= ++-# Don't bother to ident the following nested for loops, only the 2 ++-# innermost ones matter. ++-for boost_lib_ in system; do +++# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +++# matter. ++ for boost_tag_ in -$boost_cv_lib_tag ''; do ++ for boost_ver_ in -$boost_cv_lib_version ''; do ++ for boost_mt_ in $boost_mt -mt ''; do ++ for boost_rtopt_ in $boost_rtopt '' -d; do ++ for boost_lib in \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ ++- boost_$boost_lib_$boost_tag_$boost_ver_ +++ boost_filesystem$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ +++ boost_filesystem$boost_tag_$boost_rtopt_$boost_ver_ \ +++ boost_filesystem$boost_tag_$boost_mt_$boost_ver_ \ +++ boost_filesystem$boost_tag_$boost_ver_ ++ do ++ # Avoid testing twice the same lib ++ case $boost_failed_libs in #( ++- (*@$boost_lib@*) continue;; +++ *@$boost_lib@*) continue;; ++ esac ++ # If with_boost is empty, we'll search in /lib first, which is not quite ++ # right so instead we'll try to a location based on where the headers are. ++@@ -18405,21 +17572,18 @@ ++ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ ++ "$with_boost" C:/Boost/lib /lib* ++ do ++- # Don't waste time with directories that don't exist. ++- if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then ++- continue ++- fi +++ test -e "$boost_ldpath" || continue ++ boost_save_LDFLAGS=$LDFLAGS ++ # Are we looking for a static library? ++ case $boost_ldpath:$boost_rtopt_ in #( ++- (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) ++- boost_cv_lib_system_LIBS="$boost_ldpath/lib$boost_lib.$libext" ++- test -e "$boost_cv_lib_system_LIBS" || continue;; #( ++- (*) # No: use -lboost_foo to find the shared library. ++- boost_cv_lib_system_LIBS="-l$boost_lib";; +++ *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) +++ boost_cv_lib_filesystem_LIBS="$boost_ldpath/lib$boost_lib.$libext" +++ test -e "$boost_cv_lib_filesystem_LIBS" || continue;; #( +++ *) # No: use -lboost_foo to find the shared library. +++ boost_cv_lib_filesystem_LIBS="-l$boost_lib";; ++ esac ++ boost_save_LIBS=$LIBS ++- LIBS="$boost_cv_lib_system_LIBS $LIBS" +++ LIBS="$boost_cv_lib_filesystem_LIBS $LIBS" ++ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" ++ rm -f conftest$ac_exeext ++ boost_save_ac_ext=$ac_ext ++@@ -18444,20 +17608,20 @@ ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err +++ test -z "$ac_cxx_werror_flag" || +++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext +++ test "$cross_compiling" = yes || +++ $as_executable_p conftest$ac_exeext ++ }; then : ++- boost_cv_lib_system=yes +++ boost_cv_lib_filesystem=yes ++ else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ fi ++- boost_cv_lib_system=no +++ boost_cv_lib_filesystem=no ++ fi ++ ac_objext=$boost_save_ac_objext ++ ac_ext=$boost_save_ac_ext ++@@ -18466,23 +17630,18 @@ ++ ac_objext=$boost_save_ac_objext ++ LDFLAGS=$boost_save_LDFLAGS ++ LIBS=$boost_save_LIBS ++- if test x"$boost_cv_lib_system" = xyes; then ++- # Check or used cached result of whether or not using -R or ++- # -rpath makes sense. Some implementations of ld, such as for ++- # Mac OSX, require -rpath but -R is the flag known to work on ++- # other systems. https://github.com/tsuna/boost.m4/issues/19 +++ if test x"$boost_cv_lib_filesystem" = xyes; then +++ # Check or used cached result of whether or not using -R or -rpath makes sense. +++ # Some implementations of ld, such as for Mac OSX, require -rpath but +++ # -R is the flag known to work on other systems. +++ # https://github.com/tsuna/boost.m4/issues/19 ++ if ${boost_cv_rpath_link_ldflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++ else ++- case $boost_ldpath in ++- '') # Nothing to do. ++- boost_cv_rpath_link_ldflag= ++- boost_rpath_link_ldflag_found=yes;; ++- *) ++- for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do ++- LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- LIBS="$boost_save_LIBS $boost_cv_lib_system_LIBS" ++- rm -f conftest$ac_exeext +++ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do +++ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" +++ LIBS="$boost_save_LIBS $boost_cv_lib_filesystem_LIBS" +++ rm -f conftest$ac_exeext ++ boost_save_ac_ext=$ac_ext ++ boost_use_source=: ++ # If we already have a .o, re-use it. We change $ac_ext so that $ac_link ++@@ -18505,14 +17664,14 @@ ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++- test -z "$ac_cxx_werror_flag" || ++- test ! -s conftest.err +++ test -z "$ac_cxx_werror_flag" || +++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++- test "$cross_compiling" = yes || ++- $as_executable_p conftest$ac_exeext +++ test "$cross_compiling" = yes || +++ $as_executable_p conftest$ac_exeext ++ }; then : ++ boost_rpath_link_ldflag_found=yes ++- break +++ break ++ else ++ if $boost_use_source; then ++ $as_echo "$as_me: failed program was:" >&5 ++@@ -18525,9 +17684,7 @@ ++ ac_ext=$boost_save_ac_ext ++ rm -f core conftest.err conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++- done ++- ;; ++- esac +++ done ++ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then : ++ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5 ++ fi ++@@ -18536,10 +17693,9 @@ ++ ++ fi ++ ++- test x"$boost_ldpath" != x && ++- boost_cv_lib_system_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" ++- boost_cv_lib_system_LDPATH="$boost_ldpath" ++- break 7 +++ boost_cv_lib_filesystem_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" +++ boost_cv_lib_filesystem_LDPATH="$boost_ldpath" +++ break 6 ++ else ++ boost_failed_libs="$boost_failed_libs@$boost_lib@" ++ fi ++@@ -18549,23 +17705,22 @@ ++ done ++ done ++ done ++-done # boost_lib_ ++ rm -f conftest.$ac_objext ++ ++ fi ++-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_system" >&5 ++-$as_echo "$boost_cv_lib_system" >&6; } ++-case $boost_cv_lib_system in #( ++- (no) $as_echo "$as_me: failed program was:" >&5 +++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_filesystem" >&5 +++$as_echo "$boost_cv_lib_filesystem" >&6; } +++case $boost_cv_lib_filesystem in #( +++ no) $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++- as_fn_error $? "cannot find the flags to link with Boost system" "$LINENO" 5 +++ as_fn_error $? "cannot find the flags to link with Boost filesystem" "$LINENO" 5 ++ ;; ++ esac ++-BOOST_SYSTEM_LDFLAGS=$boost_cv_lib_system_LDFLAGS ++-BOOST_SYSTEM_LDPATH=$boost_cv_lib_system_LDPATH ++-BOOST_LDPATH=$boost_cv_lib_system_LDPATH ++-BOOST_SYSTEM_LIBS=$boost_cv_lib_system_LIBS +++BOOST_FILESYSTEM_LDFLAGS=$boost_cv_lib_filesystem_LDFLAGS +++BOOST_FILESYSTEM_LDPATH=$boost_cv_lib_filesystem_LDPATH +++BOOST_LDPATH=$boost_cv_lib_filesystem_LDPATH +++BOOST_FILESYSTEM_LIBS=$boost_cv_lib_filesystem_LIBS ++ CPPFLAGS=$boost_save_CPPFLAGS ++ ac_ext=cpp ++ ac_cpp='$CXXCPP $CPPFLAGS' ++@@ -18574,6 +17729,12 @@ ++ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ fi ++ +++if test $enable_static_boost = yes && test $boost_major_version -ge 135; then +++ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" +++ +++fi +++LIBS=$boost_filesystem_save_LIBS +++LDFLAGS=$boost_filesystem_save_LDFLAGS ++ ++ ++ ++@@ -18591,12 +17752,12 @@ ++ pkg_cv_MDDS_CFLAGS="$MDDS_CFLAGS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mdds >= 0.11.0\""; } >&5 ++- ($PKG_CONFIG --exists --print-errors "mdds >= 0.11.0") 2>&5 +++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mdds >= 0.8.0\""; } >&5 +++ ($PKG_CONFIG --exists --print-errors "mdds >= 0.8.0") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++- pkg_cv_MDDS_CFLAGS=`$PKG_CONFIG --cflags "mdds >= 0.11.0" 2>/dev/null` +++ pkg_cv_MDDS_CFLAGS=`$PKG_CONFIG --cflags "mdds >= 0.8.0" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++ else ++ pkg_failed=yes ++@@ -18608,12 +17769,12 @@ ++ pkg_cv_MDDS_LIBS="$MDDS_LIBS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mdds >= 0.11.0\""; } >&5 ++- ($PKG_CONFIG --exists --print-errors "mdds >= 0.11.0") 2>&5 +++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mdds >= 0.8.0\""; } >&5 +++ ($PKG_CONFIG --exists --print-errors "mdds >= 0.8.0") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++- pkg_cv_MDDS_LIBS=`$PKG_CONFIG --libs "mdds >= 0.11.0" 2>/dev/null` +++ pkg_cv_MDDS_LIBS=`$PKG_CONFIG --libs "mdds >= 0.8.0" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++ else ++ pkg_failed=yes ++@@ -18634,14 +17795,14 @@ ++ _pkg_short_errors_supported=no ++ fi ++ if test $_pkg_short_errors_supported = yes; then ++- MDDS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mdds >= 0.11.0" 2>&1` +++ MDDS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mdds >= 0.8.0" 2>&1` ++ else ++- MDDS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mdds >= 0.11.0" 2>&1` +++ MDDS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mdds >= 0.8.0" 2>&1` ++ fi ++ # Put the nasty error message in config.log where it belongs ++ echo "$MDDS_PKG_ERRORS" >&5 ++ ++- as_fn_error $? "Package requirements (mdds >= 0.11.0) were not met: +++ as_fn_error $? "Package requirements (mdds >= 0.8.0) were not met: ++ ++ $MDDS_PKG_ERRORS ++ ++@@ -20538,7 +19699,7 @@ ++ ++ case $ac_file$ac_mode in ++ "depfiles":C) test x"$AMDEP_TRUE" != x"" || { ++- # Older Autoconf quotes --file arguments for eval, but not when files +++ # Autoconf 2.62 quotes --file arguments for eval, but not when files ++ # are listed without --file. Let's play safe and only enable the eval ++ # if we detect the quoting. ++ case $CONFIG_FILES in ++@@ -20589,7 +19750,7 @@ ++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` ++ test -z "$DEPDIR" && continue ++ am__include=`sed -n 's/^am__include = //p' < "$mf"` ++- test -z "$am__include" && continue +++ test -z "am__include" && continue ++ am__quote=`sed -n 's/^am__quote = //p' < "$mf"` ++ # Find all dependency output files, they are included files with ++ # $(DEPDIR) in their names. We invoke sed twice because it is the ++@@ -21476,7 +20637,6 @@ ++ ============================================================================== ++ Build configuration: ++ debug: $enable_debug ++- werror: $enable_werror ++ spreadsheet-model: $enable_spreadsheet_model ++ gnumeric-filter: $with_gnumeric_filter ++ ods-filter: $with_ods_filter ++@@ -21489,7 +20649,6 @@ ++ ============================================================================== ++ Build configuration: ++ debug: $enable_debug ++- werror: $enable_werror ++ spreadsheet-model: $enable_spreadsheet_model ++ gnumeric-filter: $with_gnumeric_filter ++ ods-filter: $with_ods_filter +-- +2.5.0 + diff --git a/SOURCES/0001-rhbz-1111216-allow-to-export-an-empty-sheet-to-PDF.patch b/SOURCES/0001-rhbz-1111216-allow-to-export-an-empty-sheet-to-PDF.patch deleted file mode 100644 index c3c6e86..0000000 --- a/SOURCES/0001-rhbz-1111216-allow-to-export-an-empty-sheet-to-PDF.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0b793116deaf35ce67245c1106e5ed5a722c7560 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Thu, 19 Jun 2014 16:57:03 +0200 -Subject: [PATCH] rhbz#1111216 allow to export an empty sheet to PDF - -This is to consolidate Calc's behaviour with the other applications, -which always present at least one page for printing / PDF export. - -Change-Id: Iedf438618020c1e6d8ded5ac950c8ca2b12ad439 ---- - sc/source/ui/unoobj/docuno.cxx | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx -index 9aeceb7..75cabca 100644 ---- a/sc/source/ui/unoobj/docuno.cxx -+++ b/sc/source/ui/unoobj/docuno.cxx -@@ -958,7 +958,7 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const uno::Any& aSelection, - StringRangeEnumerator aRangeEnum( aPagesStr, 0, nPages-1 ); - nSelectCount = aRangeEnum.size(); - } -- return nSelectCount; -+ return (nSelectCount > 0) ? nSelectCount : 1; - } - - static sal_Int32 lcl_GetRendererNum( sal_Int32 nSelRenderer, const OUString& rPagesStr, sal_Int32 nTotalPages ) --- -1.9.3 - diff --git a/SOURCES/0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch b/SOURCES/0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch new file mode 100644 index 0000000..592c15d --- /dev/null +++ b/SOURCES/0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch @@ -0,0 +1,111 @@ +From 6184f8debb94571c11ab085ccbc5f431459fe1d5 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Wed, 20 Jan 2016 18:40:06 +0100 +Subject: [PATCH] rhbz#1168757 propagate selected slides to print dialog + +(cherry picked from commit f90f8329fe5e95f25ba449e307fd40d56d68d3bb) + +Change-Id: Icef119baffb8985ea0cb94d7e59f0daae88023ac +--- + sd/source/ui/view/DocumentRenderer.cxx | 41 ++++++++++++++++++++++++++++++---- + 1 file changed, 37 insertions(+), 4 deletions(-) + +diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx +index 734c61a..8924468 100644 +--- a/sd/source/ui/view/DocumentRenderer.cxx ++++ b/sd/source/ui/view/DocumentRenderer.cxx +@@ -33,10 +33,12 @@ + #include "FrameView.hxx" + #include "Outliner.hxx" + #include "OutlineViewShell.hxx" ++#include "SlideSorterViewShell.hxx" + + #include + #include + #include ++#include + #include + #include + #include +@@ -333,8 +335,9 @@ namespace { + class DialogCreator : Resource + { + public: +- DialogCreator (bool bImpress, sal_Int32 nCurPage) ++ DialogCreator (ViewShellBase &rBase, bool bImpress, sal_Int32 nCurPage) + : Resource(SdResId(_STR_IMPRESS_PRINT_UI_OPTIONS)) ++ , mrBase(rBase) + , mbImpress(bImpress) + , mnCurPage(nCurPage) + { +@@ -359,6 +362,7 @@ namespace { + } + + private: ++ ViewShellBase &mrBase; + ::std::vector maProperties; + ::std::vector maSlidesPerPage; + bool mbImpress; +@@ -584,19 +588,48 @@ namespace { + aWidgetIds[0] = "printallpages"; + aWidgetIds[1] = "printpages"; + aWidgetIds[2] = "printselection"; ++ ++ // check if there is a selection of slides ++ OUString aPageRange(OUString::number(mnCurPage + 1)); ++ int nPrintRange(0); ++ using sd::slidesorter::SlideSorterViewShell; ++ SlideSorterViewShell* const pSSViewSh(SlideSorterViewShell::GetSlideSorter(mrBase)); ++ if (pSSViewSh) ++ { ++ const boost::shared_ptr pPageSelection(pSSViewSh->GetPageSelection()); ++ if (bool(pPageSelection) && pPageSelection->size() > 1) ++ { ++ OUStringBuffer aBuf; ++ // TODO: this could be improved by writing ranges instead of consecutive page ++ // numbers if appropriate. Do we have a helper function for that somewhere? ++ bool bFirst(true); ++ for (auto pPage: *pPageSelection) ++ { ++ if (!bFirst) ++ { ++ aBuf.append(','); ++ bFirst = false; ++ } ++ aBuf.append(OUString::number(pPage->GetPageNum() / 2 + 1)); ++ } ++ aPageRange = aBuf.getStr(); ++ nPrintRange = 1; ++ } ++ } ++ + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt(aWidgetIds, "", + aHelpIds, + aPrintRangeName, + CreateChoice(mbImpress + ? _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE + : _STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE), +- 0 ) ++ nPrintRange ) + ); + // create a an Edit dependent on "Pages" selected + vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, true ); + AddDialogControl(vcl::PrinterOptionsHelper::setEditControlOpt("pagerange", "", + ".HelpID:vcl:PrintDialog:PageRange:Edit", "PageRange", +- OUString::number(mnCurPage + 1), aPageRangeOpt)); ++ aPageRange, aPageRangeOpt)); + + FreeResource(); + } +@@ -1140,7 +1173,7 @@ public: + , mpPrintView() + , mbHasOrientationWarningBeenShown(false) + { +- DialogCreator aCreator( mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS, GetCurrentPageIndex() ); ++ DialogCreator aCreator( mrBase, mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS, GetCurrentPageIndex() ); + m_aUIProperties = aCreator.GetDialogControls(); + maSlidesPerPage = aCreator.GetSlidesPerPage(); + +-- +2.5.0 + diff --git a/SOURCES/0001-rhbz-1198848-sw-delete-all-table-redlines-to-fix-DOC.patch b/SOURCES/0001-rhbz-1198848-sw-delete-all-table-redlines-to-fix-DOC.patch deleted file mode 100644 index 09d206b..0000000 --- a/SOURCES/0001-rhbz-1198848-sw-delete-all-table-redlines-to-fix-DOC.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 37469a1e3eb5b3295f5b496e27fc6f0445699339 Mon Sep 17 00:00:00 2001 -From: Michael Stahl -Date: Wed, 22 Apr 2015 14:28:38 +0200 -Subject: [PATCH] rhbz#1198848: sw: delete *all* table redlines to fix DOCX - import crash - -SwExtraRedlineTbl::DeleteAllTableRedlines() increments its position even -when deleting the current element from the vector. - -(cherry picked from commit 28764d7ed5df874c2bfbc6025a97968e08cf2315) - -Conflicts: - sw/source/core/doc/docredln.cxx - -Change-Id: Ie827a7b66fa9690bbabaf53204e9ec77247239f2 ---- - sw/source/core/doc/docredln.cxx | 24 ++++++++++++++---------- - 1 file changed, 14 insertions(+), 10 deletions(-) - -diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx -index cb1520a..f7cdc7f 100644 ---- a/sw/source/core/doc/docredln.cxx -+++ b/sw/source/core/doc/docredln.cxx -@@ -1529,7 +1529,7 @@ bool SwExtraRedlineTbl::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rTab - */ - } - -- for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos < GetSize(); ++nCurRedlinePos ) -+ for (sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos < GetSize(); ) - { - SwExtraRedline* pExtraRedline = GetRedline(nCurRedlinePos); - const SwTableCellRedline* pTableCellRedline = dynamic_cast(pExtraRedline); -@@ -1544,11 +1544,12 @@ bool SwExtraRedlineTbl::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rTab - sal_uInt16 nRedlineType = aRedlineData.GetType(); - - // Check if this redline object type should be deleted -- if( USHRT_MAX != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType ) -- continue; -- -- DeleteAndDestroy( nCurRedlinePos ); -- bChg = true; -+ if (USHRT_MAX == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType) -+ { -+ DeleteAndDestroy( nCurRedlinePos ); -+ bChg = true; -+ continue; // don't increment position after delete -+ } - } - } - else -@@ -1566,14 +1567,17 @@ bool SwExtraRedlineTbl::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rTab - sal_uInt16 nRedlineType = aRedlineData.GetType(); - - // Check if this redline object type should be deleted -- if( USHRT_MAX != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType ) -- continue; -+ if (USHRT_MAX == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType) - -- DeleteAndDestroy( nCurRedlinePos ); -- bChg = true; -+ { -+ DeleteAndDestroy( nCurRedlinePos ); -+ bChg = true; -+ continue; // don't increment position after delete -+ } - } - } - } -+ ++nCurRedlinePos; - } - - if( bChg ) --- -2.1.0 - diff --git a/SOURCES/0001-rhbz-1213173-connectivity-Calc-driver-prevent-docume.patch b/SOURCES/0001-rhbz-1213173-connectivity-Calc-driver-prevent-docume.patch deleted file mode 100644 index a0a8e3e..0000000 --- a/SOURCES/0001-rhbz-1213173-connectivity-Calc-driver-prevent-docume.patch +++ /dev/null @@ -1,163 +0,0 @@ -From 9954f77b2ecd2591a904dac23aee5e8395334180 Mon Sep 17 00:00:00 2001 -From: Michael Stahl -Date: Wed, 29 Apr 2015 15:49:46 +0200 -Subject: [PATCH] rhbz#1213173: connectivity: Calc driver: prevent document - being disposed -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -... by adding a XCloseListener that vetoes any attempt to close it. - -The Calc document can be opened by the user in the UI and closed again. - -(cherry picked from commit 7368b6ca3f61e750765f42e97d0a00e10fcac516) - -Conflicts: - unotools/source/misc/closeveto.cxx - -Change-Id: Ied427b67274d925c911e516c0a50a4c0b2b18db9 -Reviewed-on: https://gerrit.libreoffice.org/15567 -Reviewed-by: Caolán McNamara -Tested-by: Caolán McNamara -(cherry picked from commit e8777783db81279a6b0e9cc7b308f10719bd8a7b) ---- - connectivity/source/drivers/calc/CConnection.cxx | 10 ++++++++-- - connectivity/source/inc/calc/CConnection.hxx | 10 +++++++--- - include/unotools/closeveto.hxx | 3 ++- - unotools/source/misc/closeveto.cxx | 17 +++++++++-------- - 4 files changed, 26 insertions(+), 14 deletions(-) - -diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx -index b81a585..731c4a3 100644 ---- a/connectivity/source/drivers/calc/CConnection.cxx -+++ b/connectivity/source/drivers/calc/CConnection.cxx -@@ -31,6 +31,7 @@ - #include "calc/CPreparedStatement.hxx" - #include "calc/CStatement.hxx" - #include -+#include - #include - #include - #include -@@ -165,13 +166,17 @@ Reference< XSpreadsheetDocument> OCalcConnection::acquireDoc() - ::dbtools::throwGenericSQLException( sError, *this, aErrorDetails ); - } - osl_atomic_increment(&m_nDocCount); -+ m_pCloseListener.reset(new utl::CloseVeto(m_xDoc, true)); - return m_xDoc; - } - - void OCalcConnection::releaseDoc() - { - if ( osl_atomic_decrement(&m_nDocCount) == 0 ) -- ::comphelper::disposeComponent( m_xDoc ); -+ { -+ m_pCloseListener.reset(); // dispose m_xDoc -+ m_xDoc.clear(); -+ } - } - - void OCalcConnection::disposing() -@@ -179,7 +184,8 @@ void OCalcConnection::disposing() - ::osl::MutexGuard aGuard(m_aMutex); - - m_nDocCount = 0; -- ::comphelper::disposeComponent( m_xDoc ); -+ m_pCloseListener.reset(); // dispose m_xDoc -+ m_xDoc.clear(); - - OConnection::disposing(); - } -diff --git a/connectivity/source/inc/calc/CConnection.hxx b/connectivity/source/inc/calc/CConnection.hxx -index b66d892..14e8580 100644 ---- a/connectivity/source/inc/calc/CConnection.hxx -+++ b/connectivity/source/inc/calc/CConnection.hxx -@@ -23,9 +23,11 @@ - #include "file/FConnection.hxx" - #include - --namespace com { namespace sun { namespace star { namespace sheet { -- class XSpreadsheetDocument; --} } } } -+namespace com { namespace sun { namespace star { -+ namespace sheet { class XSpreadsheetDocument; } -+} } } -+ -+namespace utl { class CloseVeto; } - - - namespace connectivity -@@ -37,6 +39,8 @@ namespace connectivity - { - // the spreadsheet document: - ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument > m_xDoc; -+ /// close listener that vetoes so nobody disposes m_xDoc -+ ::std::unique_ptr< ::utl::CloseVeto> m_pCloseListener; - OUString m_sPassword; - OUString m_aFileName; - oslInterlockedCount m_nDocCount; -diff --git a/include/unotools/closeveto.hxx b/include/unotools/closeveto.hxx -index 9beb0b5..9ed27a7 100644 ---- a/include/unotools/closeveto.hxx -+++ b/include/unotools/closeveto.hxx -@@ -41,7 +41,8 @@ namespace utl - class UNOTOOLS_DLLPUBLIC CloseVeto - { - public: -- CloseVeto( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_closeable ); -+ CloseVeto( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_closeable, -+ bool bHasOwnership = false); - ~CloseVeto(); - - private: -diff --git a/unotools/source/misc/closeveto.cxx b/unotools/source/misc/closeveto.cxx -index 4044fa7..9ecf82e 100644 ---- a/unotools/source/misc/closeveto.cxx -+++ b/unotools/source/misc/closeveto.cxx -@@ -51,8 +51,8 @@ namespace utl - class CloseListener_Impl : public CloseListener_Base - { - public: -- CloseListener_Impl() -- :m_bHasOwnership( false ) -+ CloseListener_Impl(bool const bHasOwnership) -+ : m_bHasOwnership(bHasOwnership) - { - } - -@@ -107,12 +107,13 @@ namespace utl - namespace - { - -- void lcl_init( CloseVeto_Data& i_data, const Reference< XInterface >& i_closeable ) -+ void lcl_init( CloseVeto_Data& i_data, const Reference< XInterface >& i_closeable, -+ bool const hasOwnership) - { - i_data.xCloseable.set( i_closeable, UNO_QUERY ); - ENSURE_OR_RETURN_VOID( i_data.xCloseable.is(), "CloseVeto: the component is not closeable!" ); - -- i_data.pListener = new CloseListener_Impl; -+ i_data.pListener = new CloseListener_Impl(hasOwnership); - i_data.xCloseable->addCloseListener( i_data.pListener.get() ); - } - -@@ -138,11 +139,11 @@ namespace utl - } - - //= CloseVeto -- -- CloseVeto::CloseVeto( const Reference< XInterface >& i_closeable ) -- :m_pData( new CloseVeto_Data ) -+ CloseVeto::CloseVeto(const Reference< XInterface >& i_closeable, -+ bool const hasOwnership) -+ : m_pData(new CloseVeto_Data) - { -- lcl_init( *m_pData, i_closeable ); -+ lcl_init(*m_pData, i_closeable, hasOwnership); - } - - CloseVeto::~CloseVeto() --- -2.1.0 - diff --git a/SOURCES/0001-rhbz-1233420-handle-inexistent-cond.-format.patch b/SOURCES/0001-rhbz-1233420-handle-inexistent-cond.-format.patch new file mode 100644 index 0000000..63f3948 --- /dev/null +++ b/SOURCES/0001-rhbz-1233420-handle-inexistent-cond.-format.patch @@ -0,0 +1,97 @@ +From b12cd99fd46e81e710479e2530e80c75404f3443 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Fri, 19 Jun 2015 13:52:49 +0200 +Subject: [PATCH] rhbz#1233420 handle inexistent cond. format + +Change-Id: I3fbbd0f3b42a3be1c2a9c54eb8f35dd18f550b16 +--- + sc/source/core/data/table4.cxx | 45 ++++++++++++++++++++++++++++-------------- + 1 file changed, 30 insertions(+), 15 deletions(-) + +diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx +index a1bc8ee5..bc8e40e 100644 +--- a/sc/source/core/data/table4.cxx ++++ b/sc/source/core/data/table4.cxx +@@ -618,9 +618,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + itr != itrEnd; ++itr) + { + ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); +- ScRangeList aRange = pCondFormat->GetRange(); +- aRange.Join(ScRange(nCol, nY1, nTab, nCol, nY2, nTab)); +- pCondFormat->SetRange(aRange); ++ if (pCondFormat) ++ { ++ ScRangeList aRange = pCondFormat->GetRange(); ++ aRange.Join(ScRange(nCol, nY1, nTab, nCol, nY2, nTab)); ++ pCondFormat->SetRange(aRange); ++ } + } + } + +@@ -648,9 +651,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + itr != itrEnd; ++itr) + { + ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); +- ScRangeList aRange = pCondFormat->GetRange(); +- aRange.Join(ScRange(nCol, nRow, nTab, nCol, nRow, nTab)); +- pCondFormat->SetRange(aRange); ++ if (pCondFormat) ++ { ++ ScRangeList aRange = pCondFormat->GetRange(); ++ aRange.Join(ScRange(nCol, nRow, nTab, nCol, nRow, nTab)); ++ pCondFormat->SetRange(aRange); ++ } + } + } + +@@ -1568,9 +1574,12 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + itr != itrEnd; ++itr) + { + ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); +- ScRangeList aRange = pCondFormat->GetRange(); +- aRange.Join(ScRange(nCol, nIMin, nTab, nCol, nIMax, nTab)); +- pCondFormat->SetRange(aRange); ++ if (pCondFormat) ++ { ++ ScRangeList aRange = pCondFormat->GetRange(); ++ aRange.Join(ScRange(nCol, nIMin, nTab, nCol, nIMax, nTab)); ++ pCondFormat->SetRange(aRange); ++ } + } + } + else +@@ -1585,9 +1594,12 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + itr != itrEnd; ++itr) + { + ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); +- ScRangeList aRange = pCondFormat->GetRange(); +- aRange.Join(ScRange(nCol, nAtRow, nTab, nCol, nAtRow, nTab)); +- pCondFormat->SetRange(aRange); ++ if (pCondFormat) ++ { ++ ScRangeList aRange = pCondFormat->GetRange(); ++ aRange.Join(ScRange(nCol, nAtRow, nTab, nCol, nAtRow, nTab)); ++ pCondFormat->SetRange(aRange); ++ } + } + } + } +@@ -1603,9 +1615,12 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + itr != itrEnd; ++itr) + { + ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); +- ScRangeList aRange = pCondFormat->GetRange(); +- aRange.Join(ScRange(nAtCol, static_cast(nRow), nTab, nAtCol, static_cast(nRow), nTab)); +- pCondFormat->SetRange(aRange); ++ if (pCondFormat) ++ { ++ ScRangeList aRange = pCondFormat->GetRange(); ++ aRange.Join(ScRange(nAtCol, static_cast(nRow), nTab, nAtCol, static_cast(nRow), nTab)); ++ pCondFormat->SetRange(aRange); ++ } + } + } + } +-- +2.4.2 + diff --git a/SOURCES/0001-rhbz-1283420-cairo-text-xrender-bodge.patch b/SOURCES/0001-rhbz-1283420-cairo-text-xrender-bodge.patch new file mode 100644 index 0000000..9250596 --- /dev/null +++ b/SOURCES/0001-rhbz-1283420-cairo-text-xrender-bodge.patch @@ -0,0 +1,49 @@ +From 98dedb1abb5197ca9bf823ddbcf0b0e55a260505 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 15 Dec 2015 12:35:05 +0000 +Subject: [PATCH] rhbz#1283420: cairo text + xrender bodge + +Change-Id: I926881bcfa4911f3d7f4899711be44a2f6d82026 +--- + vcl/unx/generic/gdi/x11cairotextrender.cxx | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/vcl/unx/generic/gdi/x11cairotextrender.cxx b/vcl/unx/generic/gdi/x11cairotextrender.cxx +index 8734526..17cb462 100644 +--- a/vcl/unx/generic/gdi/x11cairotextrender.cxx ++++ b/vcl/unx/generic/gdi/x11cairotextrender.cxx +@@ -42,6 +42,10 @@ struct _XRegion + BOX extents; + }; + ++#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0) ++# define CAIRO_OPERATOR_DIFFERENCE (static_cast(23)) ++#endif ++ + X11CairoTextRender::X11CairoTextRender(X11SalGraphics& rParent) + : mrParent(rParent) + { +@@ -78,6 +82,20 @@ cairo_t* X11CairoTextRender::getCairoContext() + + cairo_t *cr = cairo_create(surface); + cairo_surface_destroy(surface); ++ ++ //rhbz#1283420 bodge to draw and undraw something which has the side effect ++ //of making the mysterious xrender related problem go away ++ if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0)) ++ { ++ cairo_save(cr); ++ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); ++ cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); ++ cairo_rectangle(cr, 0, 0, 1, 1); ++ cairo_fill_preserve(cr); ++ cairo_fill(cr); ++ cairo_restore(cr); ++ } ++ + return cr; + } + +-- +2.5.0 + diff --git a/SOURCES/0001-rhbz-1326602-avoid-exp.-bg-bitmaps-from-deleted-slid.patch b/SOURCES/0001-rhbz-1326602-avoid-exp.-bg-bitmaps-from-deleted-slid.patch new file mode 100644 index 0000000..ea6562f --- /dev/null +++ b/SOURCES/0001-rhbz-1326602-avoid-exp.-bg-bitmaps-from-deleted-slid.patch @@ -0,0 +1,301 @@ +From 9a36cf42d6ea424a2ca5c92f8bf1546ab618dc5d Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Tue, 26 Apr 2016 09:17:11 +0200 +Subject: [PATCH] rhbz#1326602 avoid exp. bg bitmaps from deleted slides + +ODF export uses SvxUnoBitmapTable (impl. of +com.sun.star.drawing.BitmapTable) to create fill bitmap styles. That +returns all XATTR_FILLBITMAP items that are in the document's pool. So +we ensure that bitmaps that are only used on deleted (either explicitly +or by undoing their insertion) slides are not in the pool. + +(cherry picked from commit b876bbe2cacce8af379b10d82da6c7e7d229b361) + +Change-Id: I54c594a94989158f22b156fe660c1e716b988b3e +--- + include/svx/svdundo.hxx | 13 ++++++++ + sd/source/ui/func/undoback.cxx | 44 ++++++++++++++++++++++++-- + sd/source/ui/inc/undoback.hxx | 6 ++++ + svx/source/svdraw/svdundo.cxx | 70 ++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 131 insertions(+), 2 deletions(-) + +diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx +index a6c9f24..6472946 100644 +--- a/include/svx/svdundo.hxx ++++ b/include/svx/svdundo.hxx +@@ -20,6 +20,11 @@ + #ifndef INCLUDED_SVX_SVDUNDO_HXX + #define INCLUDED_SVX_SVDUNDO_HXX + ++#include ++ ++#include ++#include ++ + #include + #include + #include +@@ -29,6 +34,7 @@ + #include + + class SfxItemSet; ++class SfxPoolItem; + class SfxStyleSheet; + class SdrView; + class SdrPageView; +@@ -589,6 +595,8 @@ class SVX_DLLPUBLIC SdrUndoDelPage : public SdrUndoPageList + // When deleting a MasterPage, we remember all relations of the + // Character Page with the MasterPage in this UndoGroup. + SdrUndoGroup* pUndoGroup; ++ std::unique_ptr mpFillBitmapItem; ++ bool mbHasFillBitmap; + + public: + SdrUndoDelPage(SdrPage& rNewPg); +@@ -602,6 +610,11 @@ public: + + virtual void SdrRepeat(SdrView& rView) SAL_OVERRIDE; + virtual bool CanSdrRepeat(SdrView& rView) const SAL_OVERRIDE; ++ ++private: ++ void queryFillBitmap(const SfxItemSet &rItemSet); ++ void clearFillBitmap(); ++ void restoreFillBitmap(); + }; + + /** +diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx +index bfb421b..3e3575a 100644 +--- a/sd/source/ui/func/undoback.cxx ++++ b/sd/source/ui/func/undoback.cxx +@@ -21,8 +21,13 @@ + #include "sdpage.hxx" + #include "sdresid.hxx" + #include "strings.hrc" ++ ++#include ++ + #include + ++#include ++ + TYPEINIT1( SdBackgroundObjUndoAction, SdUndoAction ); + + SdBackgroundObjUndoAction::SdBackgroundObjUndoAction( +@@ -31,10 +38,12 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction( + const SfxItemSet& rItenSet) + : SdUndoAction(&rDoc), + mrPage(rPage), +- mpItemSet(new SfxItemSet(rItenSet)) ++ mpItemSet(new SfxItemSet(rItenSet)), ++ mbHasFillBitmap(false) + { + OUString aString( SdResId( STR_UNDO_CHANGE_PAGEFORMAT ) ); + SetComment( aString ); ++ saveFillBitmap(*mpItemSet); + } + + SdBackgroundObjUndoAction::~SdBackgroundObjUndoAction() +@@ -46,9 +55,14 @@ void SdBackgroundObjUndoAction::ImplRestoreBackgroundObj() + { + SfxItemSet* pNew = new SfxItemSet(mrPage.getSdrPageProperties().GetItemSet()); + mrPage.getSdrPageProperties().ClearItem(); ++ if (bool(mpFillBitmapItem)) ++ restoreFillBitmap(*mpItemSet); ++ mpFillBitmapItem.reset(); ++ mbHasFillBitmap = false; + mrPage.getSdrPageProperties().PutItemSet(*mpItemSet); + delete mpItemSet; + mpItemSet = pNew; ++ saveFillBitmap(*mpItemSet); + + // tell the page that it's visualization has changed + mrPage.ActionChanged(); +@@ -66,7 +80,33 @@ void SdBackgroundObjUndoAction::Redo() + + SdUndoAction* SdBackgroundObjUndoAction::Clone() const + { +- return new SdBackgroundObjUndoAction(*mpDoc, mrPage, *mpItemSet); ++ std::unique_ptr pCopy(new SdBackgroundObjUndoAction(*mpDoc, mrPage, *mpItemSet)); ++ if (mpFillBitmapItem) ++ pCopy->mpFillBitmapItem.reset(mpFillBitmapItem->Clone()); ++ pCopy->mbHasFillBitmap = mbHasFillBitmap; ++ return pCopy.release(); ++} ++ ++void SdBackgroundObjUndoAction::saveFillBitmap(SfxItemSet &rItemSet) ++{ ++ const SfxPoolItem *pItem = nullptr; ++ if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET) ++ mpFillBitmapItem.reset(pItem->Clone()); ++ if (bool(mpFillBitmapItem)) ++ { ++ if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET) ++ mbHasFillBitmap = static_cast(pItem)->GetValue() == css::drawing::FillStyle_BITMAP; ++ rItemSet.ClearItem(XATTR_FILLBITMAP); ++ if (mbHasFillBitmap) ++ rItemSet.ClearItem(XATTR_FILLSTYLE); ++ } ++} ++ ++void SdBackgroundObjUndoAction::restoreFillBitmap(SfxItemSet &rItemSet) ++{ ++ rItemSet.Put(*mpFillBitmapItem); ++ if (mbHasFillBitmap) ++ rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP)); + } + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx +index 360f7f5..4234424 100644 +--- a/sd/source/ui/inc/undoback.hxx ++++ b/sd/source/ui/inc/undoback.hxx +@@ -20,11 +20,13 @@ + #ifndef INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX + #define INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX + ++#include + #include "sdundo.hxx" + + class SdDrawDocument; + class SdPage; + class SfxItemSet; ++class SfxPoolItem; + + // SdBackgroundObjUndoAction + class SdBackgroundObjUndoAction : public SdUndoAction +@@ -33,8 +35,12 @@ private: + + SdPage& mrPage; + SfxItemSet* mpItemSet; ++ std::unique_ptr mpFillBitmapItem; ++ bool mbHasFillBitmap; + + void ImplRestoreBackgroundObj(); ++ void saveFillBitmap(SfxItemSet &rItemSet); ++ void restoreFillBitmap(SfxItemSet &rItemSet); + + public: + +diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx +index 7466532..e4dfa12 100644 +--- a/svx/source/svdraw/svdundo.cxx ++++ b/svx/source/svdraw/svdundo.cxx +@@ -17,6 +17,7 @@ + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + ++#include + + #include + +@@ -27,6 +28,7 @@ + #include + #include + #include ++#include + #include "svx/svdstr.hrc" + #include "svdglob.hxx" + #include +@@ -1483,9 +1485,24 @@ SdrUndoPageList::~SdrUndoPageList() + SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg) + : SdrUndoPageList(rNewPg) + , pUndoGroup(NULL) ++ , mbHasFillBitmap(false) + { + bItsMine = true; + ++ // keep fill bitmap separately to remove it from pool if not used elsewhere ++ if (mrPage.IsMasterPage()) ++ { ++ SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); ++ if (pStyleSheet) ++ queryFillBitmap(pStyleSheet->GetItemSet()); ++ } ++ else ++ { ++ queryFillBitmap(mrPage.getSdrPageProperties().GetItemSet()); ++ } ++ if (bool(mpFillBitmapItem)) ++ clearFillBitmap(); ++ + // now remember the master page relationships + if(mrPage.IsMasterPage()) + { +@@ -1520,6 +1537,8 @@ SdrUndoDelPage::~SdrUndoDelPage() + + void SdrUndoDelPage::Undo() + { ++ if (bool(mpFillBitmapItem)) ++ restoreFillBitmap(); + ImpInsertPage(nPageNum); + if (pUndoGroup!=NULL) + { +@@ -1533,6 +1552,8 @@ void SdrUndoDelPage::Undo() + void SdrUndoDelPage::Redo() + { + ImpRemovePage(nPageNum); ++ if (bool(mpFillBitmapItem)) ++ clearFillBitmap(); + // master page relations are dissolved automatically + DBG_ASSERT(!bItsMine,"RedoDeletePage: mrPage already belongs to UndoAction."); + bItsMine=true; +@@ -1561,6 +1582,55 @@ bool SdrUndoDelPage::CanSdrRepeat(SdrView& /*rView*/) const + return false; + } + ++void SdrUndoDelPage::queryFillBitmap(const SfxItemSet& rItemSet) ++{ ++ const SfxPoolItem *pItem = nullptr; ++ if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET) ++ mpFillBitmapItem.reset(pItem->Clone()); ++ if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET) ++ mbHasFillBitmap = static_cast(pItem)->GetValue() == css::drawing::FillStyle_BITMAP; ++} ++ ++void SdrUndoDelPage::clearFillBitmap() ++{ ++ if (mrPage.IsMasterPage()) ++ { ++ SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); ++ assert(bool(pStyleSheet)); // who took away my stylesheet? ++ SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); ++ rItemSet.ClearItem(XATTR_FILLBITMAP); ++ if (mbHasFillBitmap) ++ rItemSet.ClearItem(XATTR_FILLSTYLE); ++ } ++ else ++ { ++ SdrPageProperties &rPageProps = mrPage.getSdrPageProperties(); ++ rPageProps.ClearItem(XATTR_FILLBITMAP); ++ if (mbHasFillBitmap) ++ rPageProps.ClearItem(XATTR_FILLSTYLE); ++ } ++} ++ ++void SdrUndoDelPage::restoreFillBitmap() ++{ ++ if (mrPage.IsMasterPage()) ++ { ++ SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); ++ assert(bool(pStyleSheet)); // who took away my stylesheet? ++ SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); ++ rItemSet.Put(*mpFillBitmapItem); ++ if (mbHasFillBitmap) ++ rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP)); ++ } ++ else ++ { ++ SdrPageProperties &rPageProps = mrPage.getSdrPageProperties(); ++ rPageProps.PutItem(*mpFillBitmapItem); ++ if (mbHasFillBitmap) ++ rPageProps.PutItem(XFillStyleItem(css::drawing::FillStyle_BITMAP)); ++ } ++} ++ + + + void SdrUndoNewPage::Undo() +-- +2.7.4 + diff --git a/SOURCES/0001-rtf-m_aStates-can-be-empty-in-the-inner-condition.patch b/SOURCES/0001-rtf-m_aStates-can-be-empty-in-the-inner-condition.patch new file mode 100644 index 0000000..deaf0b4 --- /dev/null +++ b/SOURCES/0001-rtf-m_aStates-can-be-empty-in-the-inner-condition.patch @@ -0,0 +1,37 @@ +From 4ce2689bf8616463d224ebfed1d5bc80691c6b8c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 10 May 2016 09:34:58 +0100 +Subject: [PATCH] rtf: m_aStates can be empty in the inner condition + +Change-Id: Id262a3019a693f236630b798579f360c9462d12e +(cherry picked from commit 05cc87ce45fad402445c8d748817e386e56148af) +--- + writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +index 799186d..995772a 100644 +--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx ++++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +@@ -455,11 +455,15 @@ writerfilter::Reference::Pointer_t RTFDocumentImpl::getProperties(RT + + // cloneAndDeduplicate() wants to know about only a single "style", so + // let's merge paragraph and character style properties here. +- int nCharStyle = m_aStates.top().nCurrentCharacterStyleIndex; +- RTFReferenceTable::Entries_t::iterator itChar = m_aStyleTableEntries.find(nCharStyle); ++ RTFReferenceTable::Entries_t::iterator itChar = m_aStyleTableEntries.end(); ++ if (!m_aStates.empty()) ++ { ++ int nCharStyle = m_aStates.top().nCurrentCharacterStyleIndex; ++ itChar = m_aStyleTableEntries.find(nCharStyle); ++ } ++ + RTFSprms aStyleSprms; + RTFSprms aStyleAttributes; +- + // Ensure the paragraph style is a flat list. + lcl_copyFlatten(rProps, aStyleAttributes, aStyleSprms); + +-- +2.7.4 + diff --git a/SOURCES/0001-rulers-Make-the-numbers-a-bit-smaller-and-always-wit.patch b/SOURCES/0001-rulers-Make-the-numbers-a-bit-smaller-and-always-wit.patch deleted file mode 100644 index 0513ece..0000000 --- a/SOURCES/0001-rulers-Make-the-numbers-a-bit-smaller-and-always-wit.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e17e162d0d61a3320b7d69e1a505eed3732c1a6d Mon Sep 17 00:00:00 2001 -From: Jan Holesovsky -Date: Wed, 3 Dec 2014 11:07:18 +0100 -Subject: [PATCH] rulers: Make the numbers a bit smaller, and always with odd - size. - -Change-Id: Id27bb0435d00f2026ff8c82ed246ca67947e9e42 ---- - svtools/source/control/ruler.cxx | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx -index 29655de..c9727cb 100644 ---- a/svtools/source/control/ruler.cxx -+++ b/svtools/source/control/ruler.cxx -@@ -992,6 +992,15 @@ void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom ) - } - } - -+static int adjustSize(int nOrig) -+{ -+ if (nOrig <= 0) -+ return 0; -+ -+ // make sure we return an odd number, that looks better in the ruler -+ return ( (3*nOrig) / 8) * 2 + 1; -+} -+ - void Ruler::ImplInitSettings( bool bFont, bool bForeground, bool bBackground ) - { - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); -@@ -1000,6 +1009,11 @@ void Ruler::ImplInitSettings( bool bFont, bool bForeground, bool bBackground ) - { - Font aFont; - aFont = rStyleSettings.GetToolFont(); -+ -+ // make the font a bit smaller than default -+ Size aSize(adjustSize(aFont.GetSize().Width()), adjustSize(aFont.GetSize().Height())); -+ aFont.SetSize(aSize); -+ - if ( IsControlFont() ) - aFont.Merge( GetControlFont() ); - SetZoomedPointFont( aFont ); --- -2.4.0 - diff --git a/SOURCES/0001-scrolling-very-slow-in-calc.patch b/SOURCES/0001-scrolling-very-slow-in-calc.patch deleted file mode 100644 index 30143c3..0000000 --- a/SOURCES/0001-scrolling-very-slow-in-calc.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 52ac64848e41c6c3bba86c98361757aaf89ef3c6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 15 Jul 2014 16:42:42 +0100 -Subject: [PATCH] scrolling very slow in calc - -even on a short spreadsheet scrolling up and down leaves -the first/last row (depending on the direction of scroll) -unchanged until the scrolling stops. - -http://people.freedesktop.org/~mst/calc_4.2_scrolling.webm - -On larger document there are rendering artifacts during scrolling which go away -after scrolling for me and mstahl, but a bunch of people can show us piles of -horribly broken spreadsheets after scrolling, esp wheel scrolling - -Revert "fdo#75026: Sometimes we need to update grid view... - -while not being active." - -This reverts commit 52cc88d6191ba0c4b6477e5c4b9c5d0f0228030d. - -Revert "fdo#68961: Check visible range during scrolling, and re-paint if necessary." - -This reverts commit e36c8a674845ab19577fc06d44b780549757e1e7. - -Revert "Repaint grid view when the visible area changes." - -This reverts commit b54c1a53b4d400b1c2d282c186af1fa8f151894e. - -Conflicts: - sc/source/ui/app/scmod.cxx - -Revert "Update visible ranges when updating the scroll bars." - -This reverts commit 391a57ef65687f2e373bac8d410e551aafa780ec. - -Change-Id: Ie170308cba18a9a74c7c72daf07dfa0a4ef7bd13 ---- - sc/source/ui/inc/tabview.hxx | 6 ------ - sc/source/ui/view/gridwin4.cxx | 2 ++ - sc/source/ui/view/tabview.cxx | 4 ---- - sc/source/ui/view/tabview3.cxx | 10 ---------- - sc/source/ui/view/tabview4.cxx | 7 ++++++- - 5 files changed, 8 insertions(+), 21 deletions(-) - -diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx -index a5d7392..891af9e 100644 ---- a/sc/source/ui/inc/tabview.hxx -+++ b/sc/source/ui/inc/tabview.hxx -@@ -204,12 +204,6 @@ private: - - void PaintRangeFinderEntry (ScRangeFindData* pData, SCTAB nTab); - -- /** -- * Check the visible grid area to see if the visible range has changed. If -- * so, update the stored visible range, and re-paint the grid area. -- */ -- void UpdateGrid(); -- - protected: - void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL, - const SCROW* pPosY = NULL ); -diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx -index fa697ee5..a60fb82 100644 ---- a/sc/source/ui/view/gridwin4.cxx -+++ b/sc/source/ui/view/gridwin4.cxx -@@ -390,6 +390,8 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod - - OSL_ENSURE( ValidCol(nX2) && ValidRow(nY2), "GridWin Draw Bereich zu gross" ); - -+ UpdateVisibleRange(); -+ - if (nX2 < maVisibleRange.mnCol1 || nY2 < maVisibleRange.mnRow1) - return; - // unsichtbar -diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx -index aafd114..02b99b9 100644 ---- a/sc/source/ui/view/tabview.cxx -+++ b/sc/source/ui/view/tabview.cxx -@@ -1198,8 +1198,6 @@ void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars ) - if (pColOutline[eWhich]) pColOutline[eWhich]->ScrollPixel( nDiff ); - if (bUpdBars) - UpdateScrollBars(); -- else -- UpdateGrid(); - } - - if (nDeltaX==1 || nDeltaX==-1) -@@ -1285,8 +1283,6 @@ void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars ) - if (pRowOutline[eWhich]) pRowOutline[eWhich]->ScrollPixel( nDiff ); - if (bUpdBars) - UpdateScrollBars(); -- else -- UpdateGrid(); - } - - if (nDeltaY==1 || nDeltaY==-1) -diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx -index 7053037..50066ba 100644 ---- a/sc/source/ui/view/tabview3.cxx -+++ b/sc/source/ui/view/tabview3.cxx -@@ -2089,16 +2089,6 @@ void ScTabView::PaintRangeFinderEntry (ScRangeFindData* pData, const SCTAB nTab) - } - } - --void ScTabView::UpdateGrid() --{ -- if (!UpdateVisibleRange()) -- // Visible range hasn't changed. No need to re-paint. -- return; -- -- SC_MOD()->AnythingChanged(); // if visible area has changed -- PaintGrid(); --} -- - void ScTabView::PaintRangeFinder( long nNumber ) - { - ScInputHandler* pHdl = SC_MOD()->GetInputHdl( aViewData.GetViewShell() ); -diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx -index 2f72a20..8528431 100644 ---- a/sc/source/ui/view/tabview4.cxx -+++ b/sc/source/ui/view/tabview4.cxx -@@ -421,7 +421,12 @@ void ScTabView::UpdateScrollBars() - } - - // set visible area for online spelling -- UpdateGrid(); -+ -+ if ( aViewData.IsActive() ) -+ { -+ if (UpdateVisibleRange()) -+ SC_MOD()->AnythingChanged(); // if visible area has changed -+ } - } - - #ifndef HDR_SLIDERSIZE --- -1.9.3 - diff --git a/SOURCES/0001-strip-off-hard-coded-numbering-from-outliner-preview.patch b/SOURCES/0001-strip-off-hard-coded-numbering-from-outliner-preview.patch deleted file mode 100644 index 3937ee4..0000000 --- a/SOURCES/0001-strip-off-hard-coded-numbering-from-outliner-preview.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 0f1fc84029475565fda1bad43d99a114391afdc7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 11 Nov 2014 13:33:53 +0000 -Subject: [PATCH] strip off hard-coded numbering from outliner preview on load - -how to reproduce an outline which won't update wrt the numbering style - -file->new->presentation -view->master->slide master -select first entry of outliner, i.e. "Click to edit the outline text format" -make it underlined, save, reload -view->master->slide master -now use bullet and numbering -set level 1 to e.g. none, ok -nothing happens to the outliner. It remains "stuck" with its default numbering - -Change-Id: I95708b1f1c9cc74ae5129dbfad8ca0d37b00fa13 ---- - sd/source/filter/xml/sdxmlwrp.cxx | 15 ++++++++++++++- - 1 file changed, 14 insertions(+), 1 deletion(-) - -diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx -index fd8cacc..ad1cd23 100644 ---- a/sd/source/filter/xml/sdxmlwrp.cxx -+++ b/sd/source/filter/xml/sdxmlwrp.cxx -@@ -55,6 +55,7 @@ - #include - #include - #include -+#include - #include - - // include necessary for XML progress bar at load time -@@ -444,6 +445,7 @@ void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc) - const sal_Int32 nParaCount = pOutliner->GetParagraphCount(); - for (sal_Int32 j = 0; j < nParaCount; ++j) - { -+ //Make sure the depth of the paragraph matches that of the outline style it previews - const sal_Int16 nExpectedDepth = j; - if (nExpectedDepth != pOutliner->GetDepth(j)) - { -@@ -451,10 +453,21 @@ void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc) - pOutliner->SetDepth(p, nExpectedDepth); - bInconsistent = true; - } -+ -+ //If the preview has hard-coded bullets/numbering then they must -+ //be stripped to reveal the true underlying styles attributes -+ SfxItemSet aAttrs(pOutliner->GetParaAttribs(j)); -+ if (aAttrs.GetItemState(EE_PARA_NUMBULLET) == SFX_ITEM_SET) -+ { -+ aAttrs.ClearItem(EE_PARA_NUMBULLET); -+ pOutliner->SetParaAttribs(j, aAttrs); -+ bInconsistent = true; -+ } -+ - } - if (bInconsistent) - { -- SAL_WARN("sd.filter", "Fixing inconsistent outline numbering placeholder preview depth"); -+ SAL_WARN("sd.filter", "Fixing inconsistent outline numbering placeholder preview"); - pMasterOutline->SetOutlinerParaObject(pOutliner->CreateParaObject(0, nParaCount)); - } - pOutliner->Clear(); --- -1.9.3 - diff --git a/SOURCES/0001-tdf-39271-allow-to-export-only-notes-pages.patch b/SOURCES/0001-tdf-39271-allow-to-export-only-notes-pages.patch new file mode 100644 index 0000000..54aa224 --- /dev/null +++ b/SOURCES/0001-tdf-39271-allow-to-export-only-notes-pages.patch @@ -0,0 +1,346 @@ +From 770a1752cda8ba629ce11bd514869a2c800f0817 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Thu, 24 Mar 2016 14:52:35 +0100 +Subject: [PATCH] tdf#39271 allow to export only notes pages + +Change-Id: Ia03062cf31b6bab8196dc317a7e8fbcfc86fadf0 +--- + filter/source/pdf/impdialog.cxx | 23 +++++++++++++ + filter/source/pdf/impdialog.hxx | 3 ++ + filter/source/pdf/pdfexport.cxx | 18 ++++++---- + filter/source/pdf/pdfexport.hxx | 1 + + filter/uiconfig/ui/pdfgeneralpage.ui | 38 +++++++++++++++++----- + .../schema/org/openoffice/Office/Common.xcs | 7 ++++ + 6 files changed, 75 insertions(+), 15 deletions(-) + +diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx +index 89a1351..8c9bd31 100644 +--- a/filter/source/pdf/impdialog.cxx ++++ b/filter/source/pdf/impdialog.cxx +@@ -86,6 +86,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue > + mbExportNotes( true ), + mbViewPDF( false ), + mbExportNotesPages( false ), ++ mbExportOnlyNotesPages( false ), + mbUseTransitionEffects( false ), + mbIsSkipEmptyPages( true ), + mbAddStream( false ), +@@ -193,7 +194,10 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue > + mbUseTaggedPDF = maConfigItem.ReadBool( "UseTaggedPDF", false ); + mnPDFTypeSelection = maConfigItem.ReadInt32( "SelectPdfVersion", 0 ); + if ( mbIsPresentation ) ++ { + mbExportNotesPages = maConfigItem.ReadBool( "ExportNotesPages", false ); ++ mbExportOnlyNotesPages = maConfigItem.ReadBool( "ExportOnlyNotesPages", false ); ++ } + mbExportNotes = maConfigItem.ReadBool( "ExportNotes", false ); + mbViewPDF = maConfigItem.ReadBool( "ViewPDFAfterExport", false ); + +@@ -395,7 +399,10 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() + maConfigItem.WriteInt32("SelectPdfVersion", mnPDFTypeSelection ); + + if ( mbIsPresentation ) ++ { + maConfigItem.WriteBool( "ExportNotesPages", mbExportNotesPages ); ++ maConfigItem.WriteBool( "ExportOnlyNotesPages", mbExportOnlyNotesPages ); ++ } + maConfigItem.WriteBool( "ExportNotes", mbExportNotes ); + maConfigItem.WriteBool( "ViewPDFAfterExport", mbViewPDF ); + +@@ -543,6 +550,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(vcl::Window* pParent, const SfxItemSe + get(mpCbExportHiddenSlides, "hiddenpages"); + get(mpCbExportNotes, "comments"); + get(mpCbExportNotesPages, "notes"); ++ get(mpCbExportOnlyNotesPages, "onlynotes"); + get(mpCbExportEmptyPages, "emptypages"); + get(mpCbViewPDF, "viewpdf"); + +@@ -580,6 +588,7 @@ void ImpPDFTabGeneralPage::dispose() + mpCbExportNotes.clear(); + mpCbViewPDF.clear(); + mpCbExportNotesPages.clear(); ++ mpCbExportOnlyNotesPages.clear(); + mpCbExportEmptyPages.clear(); + mpCbAddStream.clear(); + mpCbWatermark.clear(); +@@ -661,6 +670,10 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent ) + mpRbRange->SetText(get("slides")->GetText()); + mpCbExportNotesPages->Show(true); + mpCbExportNotesPages->Check(paParent->mbExportNotesPages); ++ mpCbExportNotesPages->SetToggleHdl( LINK(this, ImpPDFTabGeneralPage, ToggleExportNotesPagesHdl ) ); ++ mpCbExportOnlyNotesPages->Show(); ++ mpCbExportOnlyNotesPages->Check(paParent->mbExportOnlyNotesPages); ++ mpCbExportOnlyNotesPages->Enable(paParent->mbExportNotesPages); + mpCbExportHiddenSlides->Show(true); + mpCbExportHiddenSlides->Check(paParent->mbExportHiddenSlides); + } +@@ -668,6 +681,8 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent ) + { + mpCbExportNotesPages->Show(false); + mpCbExportNotesPages->Check(false); ++ mpCbExportOnlyNotesPages->Show(false); ++ mpCbExportOnlyNotesPages->Check(false); + mpCbExportHiddenSlides->Show(false); + mpCbExportHiddenSlides->Check(false); + } +@@ -693,7 +708,10 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) + paParent->mbExportNotes = mpCbExportNotes->IsChecked(); + paParent->mbViewPDF = mpCbViewPDF->IsChecked(); + if ( mbIsPresentation ) ++ { + paParent->mbExportNotesPages = mpCbExportNotesPages->IsChecked(); ++ paParent->mbExportOnlyNotesPages = mpCbExportOnlyNotesPages->IsChecked(); ++ } + paParent->mbExportBookmarks = mpCbExportBookmarks->IsChecked(); + if ( mbIsPresentation ) + paParent->mbExportHiddenSlides = mpCbExportHiddenSlides->IsChecked(); +@@ -758,6 +776,11 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportFormFieldsHdl) + return 0; + } + ++IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportNotesPagesHdl) ++{ ++ mpCbExportOnlyNotesPages->Enable(mpCbExportNotesPages->IsChecked()); ++ return 0; ++} + + IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleCompressionHdl) + { +diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx +index e828721..191bd48 100644 +--- a/filter/source/pdf/impdialog.hxx ++++ b/filter/source/pdf/impdialog.hxx +@@ -104,6 +104,7 @@ protected: + bool mbExportNotes; + bool mbViewPDF; + bool mbExportNotesPages; ++ bool mbExportOnlyNotesPages; + bool mbUseTransitionEffects; + bool mbIsSkipEmptyPages; + bool mbAddStream; +@@ -218,6 +219,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage + VclPtr mpCbExportNotes; + VclPtr mpCbViewPDF; + VclPtr mpCbExportNotesPages; ++ VclPtr mpCbExportOnlyNotesPages; + + VclPtr mpCbExportEmptyPages; + VclPtr mpCbAddStream; +@@ -237,6 +239,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage + DECL_LINK( ToggleWatermarkHdl, void* ); + DECL_LINK( ToggleAddStreamHdl, void* ); + DECL_LINK( ToggleExportFormFieldsHdl, void* ); ++ DECL_LINK( ToggleExportNotesPagesHdl, void* ); + + public: + DECL_LINK( ToggleExportPDFAHdl, void* ); +diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx +index daf4689..1856308 100644 +--- a/filter/source/pdf/pdfexport.cxx ++++ b/filter/source/pdf/pdfexport.cxx +@@ -100,6 +100,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc, + mbExportNotes ( true ), + mbViewPDF ( true ), + mbExportNotesPages ( false ), ++ mbExportOnlyNotesPages ( false ), + mbUseTransitionEffects ( true ), + mbExportBookmarks ( true ), + mbExportHiddenSlides ( false ), +@@ -464,6 +465,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& + rFilterData[ nData ].Value >>= mbViewPDF; + else if ( rFilterData[ nData ].Name == "ExportNotesPages" ) + rFilterData[ nData ].Value >>= mbExportNotesPages; ++ else if ( rFilterData[ nData ].Name == "ExportOnlyNotesPages" ) ++ rFilterData[ nData ].Value >>= mbExportOnlyNotesPages; + else if ( rFilterData[ nData ].Name == "UseTransitionEffects" ) + rFilterData[ nData ].Value >>= mbUseTransitionEffects; + else if ( rFilterData[ nData ].Name == "ExportFormFields" ) +@@ -840,7 +843,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& + aSelection = Any(); + aSelection <<= mxSrcDoc; + } +- bool bSecondPassForImpressNotes = false; ++ bool bExportNotesPages = false; + bool bReChangeToNormalView = false; + OUString sShowOnlineLayout( "ShowOnlineLayout" ); + uno::Reference< beans::XPropertySet > xViewProperties; +@@ -870,8 +873,9 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& + { + uno::Reference< drawing::XShapes > xShapes; // sj: do not allow to export notes when + if ( ! ( aSelection >>= xShapes ) ) // exporting a selection -> todo: in the dialog +- bSecondPassForImpressNotes = true; // the export notes checkbox needs to be disabled ++ bExportNotesPages = true; + } ++ const bool bExportPages = bExportNotesPages ? !mbExportOnlyNotesPages : true; + + if( aPageRange.isEmpty() ) + { +@@ -885,18 +889,18 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& + if ( pResMgr ) + { + sal_Int32 nTotalPageCount = aRangeEnum.size(); +- if ( bSecondPassForImpressNotes ) ++ if ( bExportPages && bExportNotesPages ) + nTotalPageCount *= 2; + mxStatusIndicator->start( OUString( ResId( PDF_PROGRESS_BAR, *pResMgr ) ), nTotalPageCount ); + } + } + +- if( nPageCount > 0 ) ++ bRet = nPageCount > 0; ++ ++ if ( bRet && bExportPages ) + bRet = ExportSelection( *pPDFWriter, xRenderable, aSelection, aRangeEnum, aRenderOptions, nPageCount ); +- else +- bRet = false; + +- if ( bRet && bSecondPassForImpressNotes ) ++ if ( bRet && bExportNotesPages ) + { + rExportNotesValue <<= sal_True; + bRet = ExportSelection( *pPDFWriter, xRenderable, aSelection, aRangeEnum, aRenderOptions, nPageCount ); +diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx +index 499beb1..47e960a 100644 +--- a/filter/source/pdf/pdfexport.hxx ++++ b/filter/source/pdf/pdfexport.hxx +@@ -49,6 +49,7 @@ private: + bool mbExportNotes; + bool mbViewPDF; + bool mbExportNotesPages; ++ bool mbExportOnlyNotesPages; + bool mbUseTransitionEffects; + bool mbExportBookmarks; + bool mbExportHiddenSlides; +diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui b/filter/uiconfig/ui/pdfgeneralpage.ui +index 7ba4a25..52314ac 100644 +--- a/filter/uiconfig/ui/pdfgeneralpage.ui ++++ b/filter/uiconfig/ui/pdfgeneralpage.ui +@@ -1,5 +1,5 @@ + +- ++ + + + +@@ -111,8 +111,8 @@ + + False + True +- 0 + Slides: ++ 0 + + + 0 +@@ -191,9 +191,9 @@ + + True + False +- 0 + _Quality: + True ++ 0 + + + +@@ -378,10 +378,10 @@ + + True + False +- 0 + Text: + True + watermarkentry ++ 0 + + + +@@ -512,10 +512,10 @@ + + True + False +- 0 + Submit _format: + True + format ++ 0 + + + 0 +@@ -604,7 +604,7 @@ + + + 0 +- 9 ++ 10 + + + +@@ -619,7 +619,7 @@ + + + 0 +- 10 ++ 11 + + + +@@ -634,7 +634,7 @@ + + + 0 +- 8 ++ 9 + +
+ +@@ -652,6 +652,28 @@ + 7 + + ++ ++ ++ True ++ False ++ 12 ++ ++ ++ Export onl_y notes pages ++ True ++ True ++ False ++ True ++ 0 ++ True ++ ++ ++ ++ ++ 0 ++ 8 ++ ++ +
+
+
+diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs +index ad22cd2..782734a 100644 +--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs ++++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs +@@ -5134,6 +5134,13 @@ + + false + ++ ++ ++ Specifies if only notes pages (i.e., not slides) are exported to PDF. (Notes pages ++ are available in Impress documents only). ++ ++ false ++ + + + Specifies slide transitions are exported to PDF. This option +-- +2.5.0 + diff --git a/SOURCES/0001-tdf-86575-for-OOXML-write-plain-REF-if-deleted-parts.patch b/SOURCES/0001-tdf-86575-for-OOXML-write-plain-REF-if-deleted-parts.patch new file mode 100644 index 0000000..341f36d --- /dev/null +++ b/SOURCES/0001-tdf-86575-for-OOXML-write-plain-REF-if-deleted-parts.patch @@ -0,0 +1,75 @@ +From 8727412bd1619f42f0dcd9ea820c2348a9bd8af9 Mon Sep 17 00:00:00 2001 +Message-Id: <8727412bd1619f42f0dcd9ea820c2348a9bd8af9.1462798322.git.erack@redhat.com> +From: Eike Rathke +Date: Fri, 6 May 2016 16:56:29 +0200 +Subject: [PATCH] tdf#86575 for OOXML write plain #REF! if deleted parts +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------erAck-patch-parts" + +This is a multi-part message in MIME format. +--------------erAck-patch-parts +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + + +(cherry picked from commit bb0ef99fb9dce30e99a7e9f7fa295a634d07b423) + +write the [#REF!] as defined in ODFF, tdf#86575 related + +... if a part of the reference was deleted, instead of [.#REF!A1] + +Actually this is a regression that already can be tracked down to +c54616f62bc70a9d39abf8837a9d7c3031c80a41 which changed things to use +ValidAddress() only. + +(cherry picked from commit eeb203089f2ba6dffba9a2543c9a7e8bf551bbc5) + +70f68722d7af02f6da3380c2dd9d54704c20b451 + +Change-Id: Ie3233d72bdbdd0ab82386c98a46755ce64ef3e7f +Reviewed-on: https://gerrit.libreoffice.org/24705 +Tested-by: Jenkins +Reviewed-by: Markus Mohrhard +--- + sc/source/core/tool/compiler.cxx | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + + +--------------erAck-patch-parts +Content-Type: text/x-patch; name="0001-tdf-86575-for-OOXML-write-plain-REF-if-deleted-parts.patch" +Content-Transfer-Encoding: 8bit +Content-Disposition: attachment; filename="0001-tdf-86575-for-OOXML-write-plain-REF-if-deleted-parts.patch" + +diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx +index 80f37a4..091e2e3 100644 +--- a/sc/source/core/tool/compiler.cxx ++++ b/sc/source/core/tool/compiler.cxx +@@ -1011,7 +1011,8 @@ struct ConventionOOO_A1_ODF : public ConventionOOO_A1 + if( !bSingleRef ) + aAbs2 = rRef.Ref2.toAbs(rPos); + +- if (FormulaGrammar::isODFF(eGram) && (!ValidAddress(aAbs1) || !ValidAddress(aAbs2))) ++ if (FormulaGrammar::isODFF(eGram) && (rRef.Ref1.IsDeleted() || !ValidAddress(aAbs1) || ++ (!bSingleRef && (rRef.Ref2.IsDeleted() || !ValidAddress(aAbs2))))) + { + rBuffer.append(rErrRef); + // For ODFF write [#REF!], but not for PODF so apps reading ODF +@@ -1408,6 +1409,14 @@ struct ConventionXL_OOX : public ConventionXL_A1 + aPos.SetRow(0); + } + ++ if (rRef.Ref1.IsDeleted() || (!bSingleRef && rRef.Ref2.IsDeleted())) ++ { ++ // For OOXML write plain "#REF!" instead of detailed sheet/col/row ++ // information. ++ rBuf.append(rErrRef); ++ return; ++ } ++ + ConventionXL_A1::makeRefStr( rBuf, eGram, aPos, rErrRef, rTabNames, rRef, bSingleRef, bFromRangeName); + } + + +--------------erAck-patch-parts-- + + diff --git a/SOURCES/0001-tdf-87400-sw-fix-SwIndexReg-assertion-in-AutoCorrect.patch b/SOURCES/0001-tdf-87400-sw-fix-SwIndexReg-assertion-in-AutoCorrect.patch deleted file mode 100644 index 4994d38..0000000 --- a/SOURCES/0001-tdf-87400-sw-fix-SwIndexReg-assertion-in-AutoCorrect.patch +++ /dev/null @@ -1,59 +0,0 @@ -From f752aa8de421ab6ee296370b4c287354fc2ba06c Mon Sep 17 00:00:00 2001 -From: Michael Stahl -Date: Thu, 2 Apr 2015 22:32:59 +0200 -Subject: [PATCH 1/4] tdf#87400: sw: fix ~SwIndexReg assertion in AutoCorrect -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -SwAutoFormat::DoUnderline() calls DeleteSel() with a SwPaM that is not -corrected, except if it's passed along directly to SwDoc methods. - -(regression from f9b62506b22c3eb885ffd5a4ec8025c33df7b2d4) - -(cherry picked from commit 41e4998cdeb54a6fc316f349de61296be820fe47) -Reviewed-on: https://gerrit.libreoffice.org/15127 -Reviewed-by: Caolán McNamara -Tested-by: Caolán McNamara -(cherry picked from commit d8d946210a39400e4fc0b83f186e6234ad364836) - -Conflicts: - sw/source/core/edit/eddel.cxx - -Change-Id: I741e0391e7f8e09a64bcfe99ca4d650f1016aaa7 ---- - sw/source/core/edit/eddel.cxx | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx -index 47614f2c..fad1eaf 100644 ---- a/sw/source/core/edit/eddel.cxx -+++ b/sw/source/core/edit/eddel.cxx -@@ -89,14 +89,20 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo ) - } - else - { -- SwPaM aPam(rPam); -+ std::unique_ptr pNewPam; -+ SwPaM * pPam = &rPam; - if (bSelectAll) -+ { -+ assert(dynamic_cast(&rPam)); // must be corrected pam -+ pNewPam.reset(new SwPaM(rPam)); - // Selection starts at the first para of the first cell, but we - // want to delete the table node before the first cell as well. -- aPam.Start()->nNode = aPam.Start()->nNode.GetNode().FindTableNode()->GetIndex(); -+ pNewPam->Start()->nNode = pNewPam->Start()->nNode.GetNode().FindTableNode()->GetIndex(); -+ pPam = pNewPam.get(); -+ } - // delete everything -- GetDoc()->DeleteAndJoin( aPam ); -- SaveTblBoxCntnt( aPam.GetPoint() ); -+ GetDoc()->DeleteAndJoin( *pPam ); -+ SaveTblBoxCntnt( pPam->GetPoint() ); - } - - // Selection is not needed anymore --- -2.1.0 - diff --git a/SOURCES/0001-tdf-95210-SetHandleControllerPosition-is-busted-wrt-.patch b/SOURCES/0001-tdf-95210-SetHandleControllerPosition-is-busted-wrt-.patch new file mode 100644 index 0000000..f6dc981 --- /dev/null +++ b/SOURCES/0001-tdf-95210-SetHandleControllerPosition-is-busted-wrt-.patch @@ -0,0 +1,64 @@ +From eafd3ee3f01bceef0eb3327be3139a8eee2a2b2e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 5 Nov 2015 13:42:13 +0000 +Subject: [PATCH] tdf#95210 SetHandleControllerPosition is busted wrt + HandleFlags::REFX + +so instead of saving the initial pos and trying to restore the pos, instead use +a bigger hammer and save the entire geometry and restore that instead. + +Change-Id: Id06ea8f205f30771987089c5dc949bb52adc7a27 +--- + cui/source/tabpages/transfrm.cxx | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx +index f6b1f26..0db63db 100644 +--- a/cui/source/tabpages/transfrm.cxx ++++ b/cui/source/tabpages/transfrm.cxx +@@ -633,10 +633,15 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) + SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier(); + if (eKind == OBJ_CUSTOMSHAPE) + { ++ //save geometry ++ SdrCustomShapeGeometryItem aInitialGeometry = ++ static_cast(pObj->GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)); ++ + EnhancedCustomShape2d aShape(pObj); +- Point aInitialPosition; ++ + for (int i = 0; i < 2; ++i) + { ++ Point aInitialPosition; + if (!aShape.GetHandlePosition(i, aInitialPosition)) + break; + m_aControlGroups[i]->Enable(); +@@ -655,14 +660,10 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) + aShape.GetHandlePosition(i, aMinPosition); + + Rectangle aLogicRect = aShape.GetLogicRect(); ++ aInitialPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); + aMaxPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); + aMinPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); + +- aPosition.X = aInitialPosition.X(); +- aPosition.Y = aInitialPosition.Y(); +- aInitialPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); +- aShape.SetHandleControllerPosition(i, aPosition); +- + SetMetricValue(*m_aControlX[i], aInitialPosition.X(), ePoolUnit); + SetMetricValue(*m_aControlY[i], aInitialPosition.Y(), ePoolUnit); + +@@ -681,6 +682,9 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) + m_aControlY[i]->SetMax(aMaxPosition.Y(), FUNIT_MM); + } + } ++ ++ //restore geometry ++ pObj->SetMergedItem(aInitialGeometry); + } + } + for (int i = 0; i < 2; ++i) +-- +2.5.0 + diff --git a/SOURCES/0001-tdf-97665-Let-s-hope-that-over-activation-isn-t-real.patch b/SOURCES/0001-tdf-97665-Let-s-hope-that-over-activation-isn-t-real.patch new file mode 100644 index 0000000..1041213 --- /dev/null +++ b/SOURCES/0001-tdf-97665-Let-s-hope-that-over-activation-isn-t-real.patch @@ -0,0 +1,328 @@ +From fcab9d2bcef3997790f3ae68521444cbaa0c5b29 Mon Sep 17 00:00:00 2001 +From: Maxim Monastirsky +Date: Sun, 7 Feb 2016 17:53:40 +0200 +Subject: [PATCH] tdf#97665 Let's hope that over activation isn't really needed + +- MenuBarManager::Activate has a check for duplicate activation, + which makes the second activation attempt fail. Removing this + check or deactivating after each activation will likely affect + performance even more, but on the other hand should solve + lp#1296715, which was the main reason of the over activation + in the first place. So let's activate only one menu at a time, + and do full activation only on the initial update. + +- Unfortunately the HUD activation callback doesn't work, so + we still have to keep active status listener for all menu + items. (Which is BTW against the recommendation in + XPopupMenuController::updatePopupMenu IDL doc. Fortunately + the performance problem hardly noticeable on modern hw.) + +Reviewed-on: https://gerrit.libreoffice.org/22369 +Tested-by: Jenkins +Reviewed-by: Maxim Monastirsky +(cherry picked from commit 2abdcfd641883f246fe78f2fbe38499c9382c059) + +Change-Id: I96affa72412f3f38160fdca4b6efd20ca68d059f +--- + framework/inc/uielement/menubarmanager.hxx | 4 +- + .../source/uielement/generictoolbarcontroller.cxx | 2 +- + framework/source/uielement/menubarmanager.cxx | 13 ++--- + include/vcl/menu.hxx | 9 +--- + vcl/inc/salmenu.hxx | 1 + + vcl/inc/unx/gtk/gtksalmenu.hxx | 4 +- + vcl/source/window/menu.cxx | 20 +++----- + vcl/unx/gtk/window/gloactiongroup.cxx | 2 +- + vcl/unx/gtk/window/gtksalmenu.cxx | 59 ++++++---------------- + 9 files changed, 38 insertions(+), 76 deletions(-) + +diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx +index b72d515..99f0df0 100644 +--- a/framework/inc/uielement/menubarmanager.hxx ++++ b/framework/inc/uielement/menubarmanager.hxx +@@ -95,7 +95,8 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener + const OUString& aModuleIdentifier, + Menu* pMenu, + bool bDelete, +- bool bDeleteChildren ); ++ bool bDeleteChildren, ++ bool bHasMenuBar = true ); + + virtual ~MenuBarManager(); + +@@ -217,6 +218,7 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener + bool m_bRetrieveImages : 1, + m_bAcceleratorCfg : 1; + bool m_bModuleIdentified; ++ bool m_bHasMenuBar; + OUString m_aMenuItemCommand; + OUString m_aModuleIdentifier; + Menu* m_pVCLMenu; +diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx +index 183da37..6e83c54 100644 +--- a/framework/source/uielement/generictoolbarcontroller.cxx ++++ b/framework/source/uielement/generictoolbarcontroller.cxx +@@ -348,7 +348,7 @@ MenuToolbarController::createPopupWindow() throw (::com::sun::star::uno::Runtime + Reference< XDispatchProvider > xDispatch; + Reference< XURLTransformer > xURLTransformer = URLTransformer::create( m_xContext ); + pMenu = new Toolbarmenu(); +- m_xMenuManager.set( new MenuBarManager( m_xContext, m_xFrame, xURLTransformer, xDispatch, m_aModuleIdentifier, pMenu, true, true ) ); ++ m_xMenuManager.set( new MenuBarManager( m_xContext, m_xFrame, xURLTransformer, xDispatch, m_aModuleIdentifier, pMenu, true, true, false ) ); + if (m_xMenuManager.is()) + { + MenuBarManager& rMgr = dynamic_cast(*m_xMenuManager.get()); +diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx +index 13e145f..2096408 100644 +--- a/framework/source/uielement/menubarmanager.cxx ++++ b/framework/source/uielement/menubarmanager.cxx +@@ -135,12 +135,13 @@ MenuBarManager::MenuBarManager( + const Reference< XURLTransformer >& _xURLTransformer, + const Reference< XDispatchProvider >& rDispatchProvider, + const OUString& rModuleIdentifier, +- Menu* pMenu, bool bDelete, bool bDeleteChildren ): ++ Menu* pMenu, bool bDelete, bool bDeleteChildren, bool bHasMenuBar ): + OWeakObject() + , m_bDisposed( false ) + , m_bRetrieveImages( false ) + , m_bAcceleratorCfg( false ) + , m_bModuleIdentified( false ) ++ , m_bHasMenuBar( bHasMenuBar ) + , m_aListenerContainer( m_mutex ) + , m_xContext(rxContext) + , m_xURLTransformer(_xURLTransformer) +@@ -163,6 +164,7 @@ MenuBarManager::MenuBarManager( + , m_bRetrieveImages( true ) + , m_bAcceleratorCfg( false ) + , m_bModuleIdentified( false ) ++ , m_bHasMenuBar( true ) + , m_aListenerContainer( m_mutex ) + , m_xContext(rxContext) + , m_xURLTransformer(_xURLTransformer) +@@ -392,9 +394,6 @@ throw ( RuntimeException, std::exception ) + + SolarMutexGuard aSolarGuard; + { +- vcl::MenuInvalidator::Invalidated(); +- } +- { + if ( m_bDisposed ) + return; + +@@ -492,6 +491,8 @@ throw ( RuntimeException, std::exception ) + pMenuItemHandler->xMenuItemDispatch.clear(); + } + } ++ if ( m_bHasMenuBar && !m_bActive ) ++ m_pVCLMenu->UpdateNativeMenu(); + } + } + +@@ -896,8 +897,8 @@ IMPL_LINK_TYPED( MenuBarManager, Activate, Menu *, pMenu, bool ) + if ( !bPopupMenu ) + { + xMenuItemDispatch->addStatusListener( static_cast< XStatusListener* >( this ), aTargetURL ); +- xMenuItemDispatch->removeStatusListener( static_cast< XStatusListener* >( this ), aTargetURL ); +- xMenuItemDispatch->addStatusListener( static_cast< XStatusListener* >( this ), aTargetURL ); ++ if ( !m_bHasMenuBar ) ++ xMenuItemDispatch->removeStatusListener( static_cast< XStatusListener* >( this ), aTargetURL ); + } + } + else if ( !bPopupMenu ) +diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx +index 2a4abcf..a44f2a8 100644 +--- a/include/vcl/menu.hxx ++++ b/include/vcl/menu.hxx +@@ -308,6 +308,8 @@ public: + void RemoveDisabledEntries( bool bCheckPopups = true, bool bRemoveEmptyPopups = false ); + bool HasValidEntries( bool bCheckPopups = true ); + ++ void UpdateNativeMenu(); ++ + void SetItemText( sal_uInt16 nItemId, const OUString& rStr ); + OUString GetItemText( sal_uInt16 nItemId ) const; + +@@ -413,13 +415,6 @@ public: + }; + + +-namespace vcl { namespace MenuInvalidator { +- +-VCL_DLLPUBLIC VclEventListeners2* GetMenuInvalidateListeners(); +-VCL_DLLPUBLIC void Invalidated(); +- +-}} +- + class VCL_DLLPUBLIC MenuBar : public Menu + { + Link<> maCloseHdl; +diff --git a/vcl/inc/salmenu.hxx b/vcl/inc/salmenu.hxx +index aaea364..182958a 100644 +--- a/vcl/inc/salmenu.hxx ++++ b/vcl/inc/salmenu.hxx +@@ -80,6 +80,7 @@ public: + virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, FloatWinPopupFlags nFlags); + virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure + virtual void RemoveMenuBarButton( sal_uInt16 nId ); ++ virtual void Update() {} + + // TODO: implement show/hide for the Win/Mac VCL native backends + virtual void ShowItem( unsigned nPos, bool bShow ) { EnableItem( nPos, bShow ); } +diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx +index e74de22..a8f289c 100644 +--- a/vcl/inc/unx/gtk/gtksalmenu.hxx ++++ b/vcl/inc/unx/gtk/gtksalmenu.hxx +@@ -97,11 +97,11 @@ public: + void NativeSetAccelerator( unsigned nSection, unsigned nItemPos, const vcl::KeyCode& rKeyCode, const OUString& rKeyName ); + + void DispatchCommand( gint itemId, const gchar* aCommand ); +- void Activate(); ++ void Activate( const gchar* aMenuCommand = nullptr ); + void Deactivate( const gchar* aMenuCommand ); + void Display( bool bVisible ); + bool PrepUpdate(); +- void Update(); // Update this menu only. ++ virtual void Update() override; // Update this menu only. + void UpdateFull(); // Update full menu hierarchy from this menu. + }; + +diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx +index cb83637..70e5ea1 100644 +--- a/vcl/source/window/menu.cxx ++++ b/vcl/source/window/menu.cxx +@@ -2295,6 +2295,12 @@ sal_uLong Menu::DeactivateMenuBar(sal_uLong nFocusId) + return nFocusId; + } + ++void Menu::UpdateNativeMenu() ++{ ++ if ( ImplGetSalMenu() ) ++ ImplGetSalMenu()->Update(); ++} ++ + void Menu::MenuBarKeyInput(const KeyEvent&) + { + } +@@ -3200,18 +3206,4 @@ ImplMenuDelData::~ImplMenuDelData() + const_cast< Menu* >( mpMenu )->ImplRemoveDel( *this ); + } + +-namespace vcl { namespace MenuInvalidator { +- static VclEventListeners2* pMenuInvalidateListeners = NULL; +- VclEventListeners2* GetMenuInvalidateListeners() +- { +- if(!pMenuInvalidateListeners) +- pMenuInvalidateListeners = new VclEventListeners2(); +- return pMenuInvalidateListeners; +- } +- void Invalidated() +- { +- VclSimpleEvent aEvent(0); +- GetMenuInvalidateListeners()->callListeners(&aEvent); +- }; +-} } + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/unx/gtk/window/gloactiongroup.cxx b/vcl/unx/gtk/window/gloactiongroup.cxx +index 23307fd..2066abd 100644 +--- a/vcl/unx/gtk/window/gloactiongroup.cxx ++++ b/vcl/unx/gtk/window/gloactiongroup.cxx +@@ -201,7 +201,7 @@ g_lo_action_group_perform_submenu_action (GLOActionGroup *group, + SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group << " to " << bState); + + if (bState) +- pSalMenu->Activate(); ++ pSalMenu->Activate (action_name); + else + pSalMenu->Deactivate (action_name); + } +diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx +index 4a18999..b07b8e5 100644 +--- a/vcl/unx/gtk/window/gtksalmenu.cxx ++++ b/vcl/unx/gtk/window/gtksalmenu.cxx +@@ -371,51 +371,9 @@ void GtkSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsig + pItem->mpSubMenu = pGtkSubMenu; + } + +-static bool bInvalidMenus = false; +-static gboolean RefreshMenusUnity(gpointer) +-{ +- SolarMutexGuard g; +- +- SalDisplay* pSalDisplay = vcl_sal::getSalDisplay(GetGenericData()); +- std::list< SalFrame* >::const_iterator pSalFrame = pSalDisplay->getFrames().begin(); +- std::list< SalFrame* >::const_iterator pEndSalFrame = pSalDisplay->getFrames().end(); +- for(; pSalFrame != pEndSalFrame; ++pSalFrame) { +- const GtkSalFrame* pGtkSalFrame = static_cast< const GtkSalFrame* >( *pSalFrame ); +- GtkSalFrame* pFrameNonConst = const_cast(pGtkSalFrame); +- GtkSalMenu* pSalMenu = static_cast(pFrameNonConst->GetMenu()); +- if(pSalMenu) { +- pSalMenu->Activate(); +- pSalMenu->UpdateFull(); +- } +- } +- bInvalidMenus = false; +- return FALSE; +-} +- +-static long RefreshMenusUnity(void*, void*) +-{ +- if(!bInvalidMenus) { +- g_timeout_add(10, &RefreshMenusUnity, NULL); +- bInvalidMenus = true; +- } +- return 0; +-} +- +-static Link<>* getRefreshLinkInstance() +-{ +- static Link<>* pLink = NULL; +- if(!pLink) { +- pLink = new Link<>(NULL, &RefreshMenusUnity); +- } +- return pLink; +-} +- + void GtkSalMenu::SetFrame( const SalFrame* pFrame ) + { + SolarMutexGuard aGuard; +- { +- vcl::MenuInvalidator::GetMenuInvalidateListeners()->addListener(*getRefreshLinkInstance()); +- } + + assert(mbMenuBar); + SAL_INFO("vcl.unity", "GtkSalMenu set to frame"); +@@ -671,6 +629,7 @@ void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand ) + void GtkSalMenu::ActivateAllSubmenus(MenuBar* pMenuBar) + { + pMenuBar->HandleMenuActivateEvent(mpVCLMenu); ++ pMenuBar->HandleMenuDeActivateEvent(mpVCLMenu); + for ( sal_uInt16 nPos = 0; nPos < maItems.size(); nPos++ ) + { + GtkSalMenuItem *pSalItem = maItems[ nPos ]; +@@ -682,11 +641,23 @@ void GtkSalMenu::ActivateAllSubmenus(MenuBar* pMenuBar) + } + } + +-void GtkSalMenu::Activate() ++void GtkSalMenu::Activate( const gchar* aMenuCommand ) + { + if ( !mbMenuBar ) + return; +- ActivateAllSubmenus(static_cast(mpVCLMenu)); ++ ++ if ( !aMenuCommand ) { ++ ActivateAllSubmenus( static_cast< MenuBar* >( mpVCLMenu ) ); ++ return; ++ } ++ ++ GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aMenuCommand), TRUE ); ++ ++ if ( pSalSubMenu != nullptr ) { ++ MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu ); ++ pMenuBar->HandleMenuActivateEvent( pSalSubMenu->mpVCLMenu ); ++ pSalSubMenu->Update(); ++ } + } + + void GtkSalMenu::Deactivate( const gchar* aMenuCommand ) +-- +2.7.1 + diff --git a/SOURCES/0001-tdf-99353-take-the-footgun-away-from-FilterCache.patch b/SOURCES/0001-tdf-99353-take-the-footgun-away-from-FilterCache.patch new file mode 100644 index 0000000..3fef21e --- /dev/null +++ b/SOURCES/0001-tdf-99353-take-the-footgun-away-from-FilterCache.patch @@ -0,0 +1,44 @@ +From 390ddd3bde617388e481b6747aa7bbea17d5ddf1 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Tue, 3 May 2016 14:49:34 +0200 +Subject: [PATCH] tdf#99353 take the footgun away from FilterCache + +FilterCache::impl_saveItem changes the properties of a config. item +one-by-one. But it also listens to the configuration changes and reloads +the whole item from the configuration on change... + +Change-Id: I9e4ed1c6b013925d07f0942717fe3421f924279d +--- + filter/source/config/cache/filtercache.cxx | 2 +- + filter/source/config/cache/filtercache.hxx | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx +index b9d15cf..6f5616d 100644 +--- a/filter/source/config/cache/filtercache.cxx ++++ b/filter/source/config/cache/filtercache.cxx +@@ -1786,7 +1786,7 @@ CacheItemList::iterator FilterCache::impl_loadItemOnDemand( EItemType + + void FilterCache::impl_saveItem(const css::uno::Reference< css::container::XNameReplace >& xItem, + EItemType eType, +- const CacheItem& aItem) ++ const CacheItem aItem) + throw(css::uno::Exception) + { + CacheItem::const_iterator pIt; +diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx +index 93c8d78..4f8b063 100644 +--- a/filter/source/config/cache/filtercache.hxx ++++ b/filter/source/config/cache/filtercache.hxx +@@ -809,7 +809,7 @@ class FilterCache : public BaseLock + /** TODO */ + static void impl_saveItem(const css::uno::Reference< css::container::XNameReplace >& xSet , + EItemType eType , +- const CacheItem& aValue) ++ const CacheItem aValue) + throw(css::uno::Exception); + + +-- +2.7.4 + diff --git a/SOURCES/0001-tdf-99460-sw-layout-don-t-split-table-before-fly.patch b/SOURCES/0001-tdf-99460-sw-layout-don-t-split-table-before-fly.patch new file mode 100644 index 0000000..c6d4d94 --- /dev/null +++ b/SOURCES/0001-tdf-99460-sw-layout-don-t-split-table-before-fly.patch @@ -0,0 +1,107 @@ +From ac0400203d643242d5d4363590668ad5c667faba Mon Sep 17 00:00:00 2001 +From: Michael Stahl +Date: Fri, 22 Apr 2016 18:09:39 +0200 +Subject: [PATCH] tdf#99460 sw: layout: don't split table before fly + +First the table is formatted properly and then the following paragraph +is formatted, along with its anchored objects. +The Fly frame is aligned to the bottom of the page by +SwAnchoredObjectPosition::_AdjustVerRelPos() without checking for any +overlap, and thus overlaps the table. +Then SwFlyNotify and Notify_Background() invalidate the table's PrtArea, +and the table responds by splitting numerous times, until finally there +is a page where the table does not overlap with the fly any more. +Instead of the table splitting, the paragraph with the Fly anchored to +it should move to the next page; suppressing the table invalidation in +Notify_Background() appears to achieve that. + +Change-Id: If65879f1756856bda344e0ef8fbffbc33e80f3ec +Reviewed-on: https://gerrit.libreoffice.org/24307 +Tested-by: Jenkins +Reviewed-by: Michael Stahl +--- + sw/source/core/layout/frmtool.cxx | 51 ++++++++++++++++++++++++++++----------- + 1 file changed, 37 insertions(+), 14 deletions(-) + +diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx +index 72bfaef..f73402d 100644 +--- a/sw/source/core/layout/frmtool.cxx ++++ b/sw/source/core/layout/frmtool.cxx +@@ -2962,37 +2962,60 @@ void Notify_Background( const SdrObject* pObj, + } + SwFrm *pLastTab = 0; + ++ bool isValidTableBeforeAnchor(false); + while ( pCnt && pArea && pArea->IsAnLower( pCnt ) ) + { + ::lcl_NotifyContent( pObj, pCnt, rRect, eHint ); + if ( pCnt->IsInTab() ) + { +- SwLayoutFrm* pCell = pCnt->GetUpper(); +- // #i40606# - use +- // instead of , because a recalculation +- // of the bounding rectangle isn't intended here. +- if ( pCell->IsCellFrm() && +- ( pCell->Frm().IsOver( pObj->GetLastBoundRect() ) || +- pCell->Frm().IsOver( rRect ) ) ) +- { +- const SwFormatVertOrient &rOri = pCell->GetFormat()->GetVertOrient(); +- if ( text::VertOrientation::NONE != rOri.GetVertOrient() ) +- pCell->InvalidatePrt(); +- } + SwTabFrm *pTab = pCnt->FindTabFrm(); + if ( pTab != pLastTab ) + { + pLastTab = pTab; ++ isValidTableBeforeAnchor = false; ++ if (PREP_FLY_ARRIVE == eHint ++ && pFlyFrm // TODO: do it for draw objects too? ++ && pTab->IsFollow() // table starts on previous page? ++ // "through" means they will actually overlap anyway ++ && SURROUND_THROUGHT != pFlyFrm->GetFormat()->GetSurround().GetSurround() ++ // if it's anchored in footer it can't move to other page ++ && !pAnchor->FindFooterOrHeader()) ++ { ++ SwFrm * pTmp(pAnchor->GetPrev()); ++ while (pTmp) ++ { ++ if (pTmp == pTab) ++ { ++ // tdf#99460 the table shouldn't be moved by the fly ++ isValidTableBeforeAnchor = true; ++ break; ++ } ++ pTmp = pTmp->GetPrev(); ++ } ++ } + // #i40606# - use + // instead of , because a recalculation + // of the bounding rectangle isn't intended here. +- if ( pTab->Frm().IsOver( pObj->GetLastBoundRect() ) || +- pTab->Frm().IsOver( rRect ) ) ++ if (!isValidTableBeforeAnchor ++ && (pTab->Frm().IsOver(pObj->GetLastBoundRect()) || ++ pTab->Frm().IsOver(rRect))) + { + if ( !pFlyFrm || !pFlyFrm->IsLowerOf( pTab ) ) + pTab->InvalidatePrt(); + } + } ++ SwLayoutFrm* pCell = pCnt->GetUpper(); ++ // #i40606# - use ++ // instead of , because a recalculation ++ // of the bounding rectangle isn't intended here. ++ if (!isValidTableBeforeAnchor && pCell->IsCellFrm() && ++ ( pCell->Frm().IsOver( pObj->GetLastBoundRect() ) || ++ pCell->Frm().IsOver( rRect ) ) ) ++ { ++ const SwFormatVertOrient &rOri = pCell->GetFormat()->GetVertOrient(); ++ if ( text::VertOrientation::NONE != rOri.GetVertOrient() ) ++ pCell->InvalidatePrt(); ++ } + } + pCnt = pCnt->GetNextContentFrm(); + } +-- +2.7.3 + diff --git a/SOURCES/0001-these-popups-should-start-invisible-and-take-default.patch b/SOURCES/0001-these-popups-should-start-invisible-and-take-default.patch new file mode 100644 index 0000000..be6a440 --- /dev/null +++ b/SOURCES/0001-these-popups-should-start-invisible-and-take-default.patch @@ -0,0 +1,49 @@ +From bd8559a4722825b4a1fdb33042b90b63295ef835 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 17 Dec 2015 16:33:41 +0000 +Subject: [PATCH 1/2] these popups should start invisible and take default + popup menu bits + +so they can position correctly under wayland + +Change-Id: Idf65c0ef27be5aa6027a516207fd34c2e03407ca +--- + svx/uiconfig/ui/floatingundoredo.ui | 1 - + svx/uiconfig/ui/paralinespacingcontrol.ui | 2 -- + 2 files changed, 3 deletions(-) + +diff --git a/svx/uiconfig/ui/floatingundoredo.ui b/svx/uiconfig/ui/floatingundoredo.ui +index 66f30a6..2c48f82 100644 +--- a/svx/uiconfig/ui/floatingundoredo.ui ++++ b/svx/uiconfig/ui/floatingundoredo.ui +@@ -11,7 +11,6 @@ + True + popup-menu + True +- False + False + + +diff --git a/svx/uiconfig/ui/paralinespacingcontrol.ui b/svx/uiconfig/ui/paralinespacingcontrol.ui +index 5d7402b..67ca9c1 100644 +--- a/svx/uiconfig/ui/paralinespacingcontrol.ui ++++ b/svx/uiconfig/ui/paralinespacingcontrol.ui +@@ -45,7 +45,6 @@ + 1 + + +- True + False + True + True +@@ -54,7 +53,6 @@ + True + popup-menu + True +- False + False + + +-- +2.5.0 + diff --git a/SOURCES/0001-time-stamp-object-selections-and-use-newest-as-ref-f.patch b/SOURCES/0001-time-stamp-object-selections-and-use-newest-as-ref-f.patch new file mode 100644 index 0000000..b801190 --- /dev/null +++ b/SOURCES/0001-time-stamp-object-selections-and-use-newest-as-ref-f.patch @@ -0,0 +1,124 @@ +From aff2d164a982917c57be5e8a18c6c1366b836c09 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 28 Aug 2015 15:13:41 +0100 +Subject: [PATCH] time stamp object selections and use newest as ref for + equalization + +Change-Id: I1bf22ddbaf263b240288f70d03d6949611f86b69 +--- + include/svx/svdmark.hxx | 8 ++++++++ + svx/source/svdraw/svdedtv2.cxx | 18 ++++++++++++++++-- + svx/source/svdraw/svdmark.cxx | 12 +++++++++--- + 3 files changed, 33 insertions(+), 5 deletions(-) + +diff --git a/include/svx/svdmark.hxx b/include/svx/svdmark.hxx +index cba0a75..aee9dd7 100644 +--- a/include/svx/svdmark.hxx ++++ b/include/svx/svdmark.hxx +@@ -42,7 +42,10 @@ typedef std::set SdrUShortCont; + // Everything a View needs to know about a selected object + class SVX_DLLPUBLIC SdrMark : public sdr::ObjectUser + { ++private: ++ void setTime(); + protected: ++ sal_Int64 mnTimeStamp; + SdrObject* mpSelectedSdrObject; // the selected object + SdrPageView* mpPageView; + SdrUShortCont* mpPoints; // Selected Points +@@ -145,6 +148,11 @@ public: + + return mpGluePoints; + } ++ ++ sal_Int64 getTimeStamp() const ++ { ++ return mnTimeStamp; ++ } + }; + + class SVX_DLLPUBLIC SdrMarkList +diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx +index 719355d..090efa7 100644 +--- a/svx/source/svdraw/svdedtv2.cxx ++++ b/svx/source/svdraw/svdedtv2.cxx +@@ -1181,7 +1181,19 @@ void SdrEditView::EqualizeMarkedObjects(bool bWidth) + if (nMarked < 2) + return; + +- SdrObject* pLastSelectedObj = rMarkList.GetMark(nMarked-1)->GetMarkedSdrObj(); ++ size_t nLastSelected = 0; ++ sal_Int64 nLastSelectedTime = rMarkList.GetMark(0)->getTimeStamp(); ++ for (size_t a = 1; a < nMarked; ++a) ++ { ++ sal_Int64 nCandidateTime = rMarkList.GetMark(a)->getTimeStamp(); ++ if (nCandidateTime > nLastSelectedTime) ++ { ++ nLastSelectedTime = nCandidateTime; ++ nLastSelected = a; ++ } ++ } ++ ++ SdrObject* pLastSelectedObj = rMarkList.GetMark(nLastSelected)->GetMarkedSdrObj(); + Size aLastRectSize(pLastSelectedObj->GetLogicRect().GetSize()); + + const bool bUndo = IsUndoEnabled(); +@@ -1189,8 +1201,10 @@ void SdrEditView::EqualizeMarkedObjects(bool bWidth) + if (bUndo) + BegUndo(); + +- for (size_t a = 0; a < nMarked-1; ++a) ++ for (size_t a = 0; a < nMarked; ++a) + { ++ if (a == nLastSelected) ++ continue; + SdrMark* pM = rMarkList.GetMark(a); + SdrObject* pObj = pM->GetMarkedSdrObj(); + Rectangle aLogicRect(pObj->GetLogicRect()); +diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx +index 7ddde61..8b7f3e09c 100644 +--- a/svx/source/svdraw/svdmark.cxx ++++ b/svx/source/svdraw/svdmark.cxx +@@ -38,8 +38,12 @@ + #include + #include + +- +- ++void SdrMark::setTime() ++{ ++ TimeValue aNow; ++ osl_getSystemTime(&aNow); ++ mnTimeStamp = sal_Int64(aNow.Seconds) * 1000000000L + aNow.Nanosec; ++} + + SdrMark::SdrMark(SdrObject* pNewObj, SdrPageView* pNewPageView) + : mpSelectedSdrObject(pNewObj), +@@ -55,10 +59,12 @@ SdrMark::SdrMark(SdrObject* pNewObj, SdrPageView* pNewPageView) + { + mpSelectedSdrObject->AddObjectUser( *this ); + } ++ setTime(); + } + + SdrMark::SdrMark(const SdrMark& rMark) + : ObjectUser(), ++ mnTimeStamp(0), + mpSelectedSdrObject(0L), + mpPageView(0L), + mpPoints(0L), +@@ -117,10 +123,10 @@ void SdrMark::SetMarkedSdrObj(SdrObject* pNewObj) + } + } + +- + SdrMark& SdrMark::operator=(const SdrMark& rMark) + { + SetMarkedSdrObj(rMark.mpSelectedSdrObject); ++ mnTimeStamp = rMark.mnTimeStamp; + mpPageView = rMark.mpPageView; + mbCon1 = rMark.mbCon1; + mbCon2 = rMark.mbCon2; +-- +2.4.0 + diff --git a/SOURCES/0001-use-the-users-preferred-initials-for-impress-annotat.patch b/SOURCES/0001-use-the-users-preferred-initials-for-impress-annotat.patch new file mode 100644 index 0000000..f68e972 --- /dev/null +++ b/SOURCES/0001-use-the-users-preferred-initials-for-impress-annotat.patch @@ -0,0 +1,200 @@ +From 9ba33206ca799d58fc18c0d320fa0e7c47eb00d1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 5 Feb 2016 10:44:12 +0000 +Subject: [PATCH] use the users preferred initials for impress annotations + +i.e. the ones entered in the tools->options + +and save and load those to/from odf similarly to +what we do for writer annotation initials + +Change-Id: Iadc0e994bfaf58632ce25b8f7cdc737580ee97bc +--- + offapi/com/sun/star/office/XAnnotation.idl | 3 +++ + sd/source/core/annotations/Annotation.cxx | 23 +++++++++++++++++++++++ + sd/source/ui/annotations/annotationmanager.cxx | 2 ++ + sd/source/ui/annotations/annotationtag.cxx | 8 +++++--- + xmloff/source/draw/sdxmlexp.cxx | 12 ++++++++++++ + xmloff/source/draw/ximppage.cxx | 7 +++++++ + 6 files changed, 52 insertions(+), 3 deletions(-) + +diff --git a/offapi/com/sun/star/office/XAnnotation.idl b/offapi/com/sun/star/office/XAnnotation.idl +index da3a235..d305743 100644 +--- a/offapi/com/sun/star/office/XAnnotation.idl ++++ b/offapi/com/sun/star/office/XAnnotation.idl +@@ -58,6 +58,9 @@ interface XAnnotation + /** stores the full name of the author who created this annotation. */ + [attribute] string Author; + ++ /** stores the initials of the author who created this annotation. */ ++ [attribute] string Initials; ++ + /** stores the date and time this annotation was last edited. */ + [attribute] ::com::sun::star::util::DateTime DateTime; + +diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx +index 21a096b..9c2af42 100644 +--- a/sd/source/core/annotations/Annotation.cxx ++++ b/sd/source/core/annotations/Annotation.cxx +@@ -82,6 +82,9 @@ public: + virtual void SAL_CALL setSize( const ::com::sun::star::geometry::RealSize2D& _size ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + virtual OUString SAL_CALL getAuthor() throw (RuntimeException, std::exception) SAL_OVERRIDE; + virtual void SAL_CALL setAuthor(const OUString & the_value) throw (RuntimeException, std::exception) SAL_OVERRIDE; ++ virtual OUString SAL_CALL getInitials() throw (RuntimeException, std::exception) SAL_OVERRIDE; ++ virtual void SAL_CALL setInitials(const OUString & the_value) throw (RuntimeException, std::exception) SAL_OVERRIDE; ++ + virtual util::DateTime SAL_CALL getDateTime() throw (RuntimeException, std::exception) SAL_OVERRIDE; + virtual void SAL_CALL setDateTime(const util::DateTime & the_value) throw (RuntimeException, std::exception) SAL_OVERRIDE; + virtual Reference< XText > SAL_CALL getTextRange() throw (RuntimeException, std::exception) SAL_OVERRIDE; +@@ -103,6 +106,7 @@ private: + RealPoint2D m_Position; + RealSize2D m_Size; + OUString m_Author; ++ OUString m_Initials; + util::DateTime m_DateTime; + rtl::Reference< TextApiObject > m_TextRange; + }; +@@ -126,6 +130,7 @@ struct AnnotationData + RealPoint2D m_Position; + RealSize2D m_Size; + OUString m_Author; ++ OUString m_Initials; + util::DateTime m_DateTime; + + void get( const rtl::Reference< Annotation >& xAnnotation ) +@@ -133,6 +138,7 @@ struct AnnotationData + m_Position = xAnnotation->getPosition(); + m_Size = xAnnotation->getSize(); + m_Author = xAnnotation->getAuthor(); ++ m_Initials = xAnnotation->getInitials(); + m_DateTime = xAnnotation->getDateTime(); + } + +@@ -141,6 +147,7 @@ struct AnnotationData + xAnnotation->setPosition(m_Position); + xAnnotation->setSize(m_Size); + xAnnotation->setAuthor(m_Author); ++ xAnnotation->setInitials(m_Initials); + xAnnotation->setDateTime(m_DateTime); + } + }; +@@ -290,6 +297,22 @@ void SAL_CALL Annotation::setAuthor(const OUString & the_value) throw (RuntimeEx + } + } + ++OUString SAL_CALL Annotation::getInitials() throw (RuntimeException, std::exception) ++{ ++ osl::MutexGuard g(m_aMutex); ++ return m_Initials; ++} ++ ++void SAL_CALL Annotation::setInitials(const OUString & the_value) throw (RuntimeException, std::exception) ++{ ++ prepareSet("Initials", Any(), Any(), nullptr); ++ { ++ osl::MutexGuard g(m_aMutex); ++ createChangeUndo(); ++ m_Initials = the_value; ++ } ++} ++ + util::DateTime SAL_CALL Annotation::getDateTime() throw (RuntimeException, std::exception) + { + osl::MutexGuard g(m_aMutex); +diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx +index 99451ab..ce5d487 100644 +--- a/sd/source/ui/annotations/annotationmanager.cxx ++++ b/sd/source/ui/annotations/annotationmanager.cxx +@@ -396,6 +396,7 @@ void AnnotationManagerImpl::InsertAnnotation() + // set current author to new annotation + SvtUserOptions aUserOptions; + xAnnotation->setAuthor( aUserOptions.GetFullName() ); ++ xAnnotation->setInitials( aUserOptions.GetID() ); + + // set current time to new annotation + xAnnotation->setDateTime( getCurrentDateTime() ); +@@ -467,6 +468,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq ) + + SvtUserOptions aUserOptions; + xAnnotation->setAuthor( aUserOptions.GetFullName() ); ++ xAnnotation->setInitials( aUserOptions.GetID() ); + + // set current time to reply + xAnnotation->setDateTime( getCurrentDateTime() ); +diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx +index 4faec96..86e4549 100644 +--- a/sd/source/ui/annotations/annotationtag.cxx ++++ b/sd/source/ui/annotations/annotationtag.cxx +@@ -517,9 +517,11 @@ BitmapEx AnnotationTag::CreateAnnotationBitmap( bool bSelected ) + { + ScopedVclPtrInstance< VirtualDevice > pVDev; + +- OUString sAuthor( getInitials( mxAnnotation->getAuthor() ) ); +- sAuthor += OUString( ' ' ); +- sAuthor += OUString::number( mnIndex ); ++ OUString sInitials(mxAnnotation->getInitials()); ++ if (sInitials.isEmpty()) ++ sInitials = getInitials(mxAnnotation->getAuthor()); ++ ++ OUString sAuthor(sInitials + " " + OUString::number(mnIndex)); + + pVDev->SetFont( mrFont ); + +diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx +index 9371913..3698f76 100644 +--- a/xmloff/source/draw/sdxmlexp.cxx ++++ b/xmloff/source/draw/sdxmlexp.cxx +@@ -2718,6 +2718,18 @@ void SdXMLExport::exportAnnotations( const Reference& xDrawPage ) + this->Characters(aAuthor); + } + ++ if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012) ++ { ++ // initials ++ OUString aInitials( xAnnotation->getInitials() ); ++ if( !aInitials.isEmpty() ) ++ { ++ SvXMLElementExport aInitialsElem( *this, XML_NAMESPACE_LO_EXT, ++ XML_SENDER_INITIALS, true, false ); ++ this->Characters(aInitials); ++ } ++ } ++ + { + // date time + com::sun::star::util::DateTime aDate( xAnnotation->getDateTime() ); +diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx +index d60ed0f..26e3e7a 100644 +--- a/xmloff/source/draw/ximppage.cxx ++++ b/xmloff/source/draw/ximppage.cxx +@@ -67,6 +67,7 @@ private: + Reference< XTextCursor > mxCursor; + + OUStringBuffer maAuthorBuffer; ++ OUStringBuffer maInitialsBuffer; + OUStringBuffer maDateBuffer; + }; + +@@ -141,6 +142,11 @@ SvXMLImportContext * DrawAnnotationContext::CreateChildContext( sal_uInt16 nPref + else if( IsXMLToken( rLocalName, XML_DATE ) ) + pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maDateBuffer); + } ++ else if( (XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) && ++ IsXMLToken(rLocalName, XML_SENDER_INITIALS) ) ++ { ++ pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maInitialsBuffer); ++ } + else + { + // create text cursor on demand +@@ -188,6 +194,7 @@ void DrawAnnotationContext::EndElement() + if( mxAnnotation.is() ) + { + mxAnnotation->setAuthor( maAuthorBuffer.makeStringAndClear() ); ++ mxAnnotation->setInitials( maInitialsBuffer.makeStringAndClear() ); + + util::DateTime aDateTime; + if (::sax::Converter::parseDateTime(aDateTime, 0, +-- +2.5.0 + diff --git a/SOURCES/0001-valgrind-scary-warning-that-the-cairo-font-options-w.patch b/SOURCES/0001-valgrind-scary-warning-that-the-cairo-font-options-w.patch new file mode 100644 index 0000000..ba3a09b --- /dev/null +++ b/SOURCES/0001-valgrind-scary-warning-that-the-cairo-font-options-w.patch @@ -0,0 +1,209 @@ +From 78c32c11b0911b905fced7519d8881262d6fb4a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Dec 2015 20:35:28 +0000 +Subject: [PATCH] valgrind: scary warning that the cairo font options were + deleted before use + +(cherry picked from commit 3520b0f82aa2146958fbc1bda1cf7e9b5beb9a5d) + +Change-Id: I58427aafb30eca64a67bcf7dd9a7738d8da3e085 +--- + include/vcl/settings.hxx | 3 --- + vcl/inc/salinst.hxx | 4 ++++ + vcl/inc/unx/gtk/gtkinst.hxx | 2 ++ + vcl/source/app/settings.cxx | 16 ---------------- + vcl/unx/generic/gdi/cairotextrender.cxx | 12 ++++++------ + vcl/unx/gtk/app/gtkinst.cxx | 5 +++++ + vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 4 ---- + vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 3 --- + 8 files changed, 17 insertions(+), 32 deletions(-) + +diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx +index 006e758..6df8b0d 100644 +--- a/include/vcl/settings.hxx ++++ b/include/vcl/settings.hxx +@@ -442,9 +442,6 @@ public: + void SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider ); + bool GetPrimaryButtonWarpsSlider() const; + +- void SetCairoFontOptions( const void *pOptions ); +- const void* GetCairoFontOptions() const; +- + void SetAppFont( const vcl::Font& rFont ); + const vcl::Font& GetAppFont() const; + +diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx +index f49bb4c..d89b1dd 100644 +--- a/vcl/inc/salinst.hxx ++++ b/vcl/inc/salinst.hxx +@@ -60,6 +60,8 @@ enum class VclInputFlags; + + enum SalYieldResult { EVENT, TIMEOUT }; + ++typedef struct _cairo_font_options cairo_font_options_t; ++ + class VCL_PLUGIN_PUBLIC SalInstance + { + private: +@@ -181,6 +183,8 @@ public: + virtual void updatePrinterUpdate() {} + virtual void jobStartedPrinterUpdate() {} + virtual void jobEndedPrinterUpdate() {} ++ ++ virtual const cairo_font_options_t* GetCairoFontOptions() { return nullptr; } + }; + + // called from SVMain +diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx +index 189b6900..1ea6f8e 100644 +--- a/vcl/inc/unx/gtk/gtkinst.hxx ++++ b/vcl/inc/unx/gtk/gtkinst.hxx +@@ -98,6 +98,8 @@ public: + virtual css::uno::Reference< css::uno::XInterface > CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) SAL_OVERRIDE; + #endif + ++ virtual const cairo_font_options_t* GetCairoFontOptions() override; ++ + void RemoveTimer (SalTimer *pTimer); + + // for managing a mirror of the in-flight un-dispatched gdk event queue +diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx +index 664f755..2f457c5 100644 +--- a/vcl/source/app/settings.cxx ++++ b/vcl/source/app/settings.cxx +@@ -191,7 +191,6 @@ struct ImplStyleData + bool mbPrimaryButtonWarpsSlider; + DialogStyle maDialogStyle; + FrameStyle maFrameStyle; +- const void* mpFontOptions; + + sal_uInt16 mnEdgeBlending; + Color maEdgeBlendingTopLeftColor; +@@ -546,7 +545,6 @@ ImplStyleData::ImplStyleData() : + mbAutoMnemonic = true; + mnToolbarIconSize = ToolbarIconSize::Unknown; + meUseImagesInMenus = TRISTATE_INDET; +- mpFontOptions = NULL; + mnEdgeBlending = 35; + maEdgeBlendingTopLeftColor = RGB_COLORDATA(0xC0, 0xC0, 0xC0); + maEdgeBlendingBottomRightColor = RGB_COLORDATA(0x40, 0x40, 0x40); +@@ -667,7 +665,6 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : + mnToolbarIconSize = rData.mnToolbarIconSize; + mIconThemeScanner.reset(new vcl::IconThemeScanner(*rData.mIconThemeScanner)); + mIconThemeSelector.reset(new vcl::IconThemeSelector(*rData.mIconThemeSelector)); +- mpFontOptions = rData.mpFontOptions; + mnEdgeBlending = rData.mnEdgeBlending; + maEdgeBlendingTopLeftColor = rData.maEdgeBlendingTopLeftColor; + maEdgeBlendingBottomRightColor = rData.maEdgeBlendingBottomRightColor; +@@ -1547,19 +1544,6 @@ StyleSettings::GetPrimaryButtonWarpsSlider() const + } + + void +-StyleSettings::SetCairoFontOptions( const void *pOptions ) +-{ +- CopyData(); +- mxData->mpFontOptions = pOptions; +-} +- +-const void* +-StyleSettings::GetCairoFontOptions() const +-{ +- return mxData->mpFontOptions; +-} +- +-void + StyleSettings::SetAppFont( const vcl::Font& rFont ) + { + CopyData(); +diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx +index 2e3aa90..4ffddf3 100644 +--- a/vcl/unx/generic/gdi/cairotextrender.cxx ++++ b/vcl/unx/generic/gdi/cairotextrender.cxx +@@ -214,8 +214,9 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout ) + return; + } + +- if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions()) +- cairo_set_font_options(cr, static_cast(pOptions)); ++ ImplSVData* pSVData = ImplGetSVData(); ++ if (const cairo_font_options_t* pFontOptions = pSVData->mpDefInst->GetCairoFontOptions()) ++ cairo_set_font_options(cr, pFontOptions); + + double nDX, nDY; + getSurfaceOffset(nDX, nDY); +@@ -462,12 +463,11 @@ void CairoTextRender::GetDevFontList( PhysicalFontCollection* pFontCollection ) + + void cairosubcallback(void* pPattern) + { +- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); +- const void* pFontOptions = rStyleSettings.GetCairoFontOptions(); ++ ImplSVData* pSVData = ImplGetSVData(); ++ const cairo_font_options_t* pFontOptions = pSVData->mpDefInst->GetCairoFontOptions(); + if( !pFontOptions ) + return; +- cairo_ft_font_options_substitute(static_cast(pFontOptions), +- static_cast(pPattern)); ++ cairo_ft_font_options_substitute(pFontOptions, static_cast(pPattern)); + } + + ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize) +diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx +index 9242b88..7d8111c 100644 +--- a/vcl/unx/gtk/app/gtkinst.cxx ++++ b/vcl/unx/gtk/app/gtkinst.cxx +@@ -473,4 +473,9 @@ GtkInstance::getPrintWrapper() const + return m_xPrintWrapper; + } + ++const cairo_font_options_t* GtkInstance::GetCairoFontOptions() ++{ ++ return gdk_screen_get_font_options(gdk_screen_get_default()); ++} ++ + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +index 1220596..aa53b65 100644 +--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx ++++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +@@ -3928,7 +3928,6 @@ void GtkSalGraphics::refreshFontconfig( GtkSettings *pSettings ) + + void GtkSalGraphics::updateSettings( AllSettings& rSettings ) + { +- GdkScreen* pScreen = gtk_widget_get_screen( m_pWindow ); + gtk_widget_ensure_style( m_pWindow ); + GtkStyle* pStyle = gtk_widget_get_style( m_pWindow ); + GtkSettings* pSettings = gtk_widget_get_settings( m_pWindow ); +@@ -4257,9 +4256,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) + + aStyleSet.SetToolbarIconSize( ToolbarIconSize::Large ); + +- const cairo_font_options_t* pNewOptions = gdk_screen_get_font_options( pScreen ); +- aStyleSet.SetCairoFontOptions( pNewOptions ); +- + // finally update the collected settings + rSettings.SetStyleSettings( aStyleSet ); + } +diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +index 90d8734..2d639bf 100644 +--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx ++++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +@@ -1452,7 +1452,6 @@ static inline ::Color getColorFromColor( const GdkColor& rCol ) + + void GtkSalGraphics::updateSettings( AllSettings& rSettings ) + { +- GdkScreen* pScreen = gtk_widget_get_screen( mpWindow ); + GtkStyleContext* pStyle = gtk_widget_get_style_context( mpWindow ); + GtkSettings* pSettings = gtk_widget_get_settings( mpWindow ); + StyleSettings aStyleSet = rSettings.GetStyleSettings(); +@@ -1801,8 +1800,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) + + aStyleSet.SetToolbarIconSize( ToolbarIconSize::Large ); + +- const cairo_font_options_t* pNewOptions = gdk_screen_get_font_options(pScreen); +- aStyleSet.SetCairoFontOptions( pNewOptions ); + // finally update the collected settings + rSettings.SetStyleSettings( aStyleSet ); + gchar* pThemeName = NULL; +-- +2.5.0 + diff --git a/SOURCES/0002-Fix-memleak-of-strings-allocated-in-VclGtkClipboard-.patch b/SOURCES/0002-Fix-memleak-of-strings-allocated-in-VclGtkClipboard-.patch new file mode 100644 index 0000000..a39d1a3 --- /dev/null +++ b/SOURCES/0002-Fix-memleak-of-strings-allocated-in-VclGtkClipboard-.patch @@ -0,0 +1,71 @@ +From b88646fc68cfc1c3840024fe3a59727c9eb9f95d Mon Sep 17 00:00:00 2001 +From: Dennis Francis +Date: Fri, 11 Dec 2015 09:19:22 +0530 +Subject: [PATCH 2/3] Fix memleak of strings allocated in + VclGtkClipboard::makeGtkTargetEntry + +This leak is produced when copy and paste of text/numbers +is done in Calc/Writer. + +Following is the trace produced by valgrind (trimmed) + + malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) + g_malloc (in /usr/lib64/libglib-2.0.so.0.4600.2) + g_strdup (in /usr/lib64/libglib-2.0.so.0.4600.2) + VclGtkClipboard::makeGtkTargetEntry(...) (gtk3gtkinst.cxx:467) + VclGtkClipboard::setContents(...) (gtk3gtkinst.cxx:557) + TransferableHelper::CopyToSelection(vcl::Window*) const (transfer.cxx:1019) + ScTabView::CheckSelectionTransfer() (tabview3.cxx:319) + ScTabView::UpdateAutoFillMark() (tabview3.cxx:144) + ScTabView::SelectionChanged() (tabview3.cxx:365) + ScViewFunc::PostPasteFromClip(ScRangeList const&, ScMarkData const&) (viewfun3.cxx:1753) + ScViewFunc::PasteFromClip(...) (viewfun3.cxx:1415) + ScClipUtil::PasteFromClipboard(ScViewData*, ScTabViewShell*, bool) (cliputil.cxx:69) + ScCellShell::ExecuteEdit(SfxRequest&) (cellsh1.cxx:1285) + SfxStubScCellShellExecuteEdit(SfxShell*, SfxRequest&) (scslots.hxx:7135) + SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) (shell.hxx:206) + SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (dispatch.cxx:258)... + ... + +Change-Id: I12468e746f33a64e2b5f05e9ac1c6814c702ffd7 +Reviewed-on: https://gerrit.libreoffice.org/20646 +Reviewed-by: jan iversen +Tested-by: jan iversen +(cherry picked from commit 97df0e601a0d76664b4207d075fa6e2a5a51625c) +--- + vcl/unx/gtk3/gtk3gtkinst.cxx | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx +index e9210d0..f1a9ddc 100644 +--- a/vcl/unx/gtk3/gtk3gtkinst.cxx ++++ b/vcl/unx/gtk3/gtk3gtkinst.cxx +@@ -456,7 +456,7 @@ void VclGtkClipboard::OwnerChanged(GtkClipboard* clipboard, GdkEvent* /*event*/) + void VclGtkClipboard::ClipboardClear(GtkClipboard * /*clipboard*/) + { + for (auto &a : m_aGtkTargets) +- free(a.target); ++ g_free(a.target); + m_aGtkTargets.clear(); + } + +@@ -518,6 +518,7 @@ VclGtkClipboard::~VclGtkClipboard() + GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); + g_signal_handler_disconnect(clipboard, m_nOwnerChangedSignalId); + g_object_unref(m_pOwner); ++ ClipboardClear(nullptr); + } + + void VclGtkClipboard::setContents( +@@ -577,6 +578,8 @@ void VclGtkClipboard::setContents( + //if there was a previous gtk_clipboard_set_with_data call then + //ClipboardClearFunc will be called now + GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); ++ if(G_OBJECT(m_pOwner) == gtk_clipboard_get_owner(clipboard)) ++ gtk_clipboard_clear(clipboard); + //use with_owner with m_pOwner so we can distinguish in handle_owner_change + //if we have gained or lost ownership of the clipboard + gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(), +-- +2.5.0 + diff --git a/SOURCES/0002-Linux-AArch64-port.patch b/SOURCES/0002-Linux-AArch64-port.patch deleted file mode 100644 index db7bfa6..0000000 --- a/SOURCES/0002-Linux-AArch64-port.patch +++ /dev/null @@ -1,1497 +0,0 @@ -From 09f49fc55104ee7b0fe18dbb5068a4cad7d9fc25 Mon Sep 17 00:00:00 2001 -From: Stephan Bergmann -Date: Fri, 29 Aug 2014 17:17:42 +0200 -Subject: [PATCH 2/2] Linux AArch64 port - -(cherry picked from commit 235fa0334e0b45c736b636ba1689e2f8c7458697) -Conflicts: - bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx - bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx - bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx - configure.ac - -Change-Id: I37044a37348b203944a8eb9d2204e619055f069d ---- - bridges/Library_cpp_uno.mk | 5 + - bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx | 310 ++++++++++++++ - bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx | 87 ++++ - .../gcc3_linux_aarch64/callvirtualfunction.cxx | 66 +++ - .../gcc3_linux_aarch64/callvirtualfunction.hxx | 33 ++ - .../source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx | 464 +++++++++++++++++++++ - .../source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx | 376 +++++++++++++++++ - configure.ac | 6 + - desktop/source/deployment/misc/dp_platform.cxx | 4 +- - jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx | 2 + - solenv/gbuild/platform/LINUX_AARCH64_GCC.mk | 14 + - 11 files changed, 1366 insertions(+), 1 deletion(-) - create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx - create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx - create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx - create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.hxx - create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx - create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx - create mode 100644 solenv/gbuild/platform/LINUX_AARCH64_GCC.mk - -diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk -index c6ab9a0..0fcaf6b 100644 ---- a/bridges/Library_cpp_uno.mk -+++ b/bridges/Library_cpp_uno.mk -@@ -35,6 +35,11 @@ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,gcc3_uno)) : \ - EXTRAOBJECTLISTS += $(call gb_CustomTarget_get_workdir,bridges/source/cpp_uno/gcc3_linux_arm)/armhelper.objectlist - endif - -+else ifeq ($(OS)-$(CPUNAME),LINUX-AARCH64) -+ -+bridges_SELECTED_BRIDGE := gcc3_linux_aarch64 -+bridge_exception_objects := abi callvirtualfunction cpp2uno uno2cpp -+ - else ifeq ($(OS)-$(CPUNAME),LINUX-AXP) - - bridges_SELECTED_BRIDGE := gcc3_linux_alpha -diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx -new file mode 100644 -index 0000000..c177b22 ---- /dev/null -+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx -@@ -0,0 +1,310 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . -+ */ -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+namespace { -+ -+OUString toUnoName(char const * name) { -+ assert(name != 0); -+ OUStringBuffer b; -+ bool scoped = *name == 'N'; -+ if (scoped) { -+ ++name; -+ } -+ for (;;) { -+ assert(*name >= '0' && *name <= '9'); -+ std::size_t n = *name++ - '0'; -+ while (*name >= '0' && *name <= '9') { -+ n = 10 * n + (*name++ - '0'); -+ } -+ b.appendAscii(name, n); -+ name += n; -+ if (!scoped) { -+ assert(*name == 0); -+ break; -+ } -+ if (*name == 'E') { -+ assert(name[1] == 0); -+ break; -+ } -+ b.append('.'); -+ } -+ return b.makeStringAndClear(); -+} -+ -+class Rtti { -+public: -+ Rtti(): app_(dlopen(0, RTLD_LAZY)) {} -+ -+ ~Rtti() { dlclose(app_); } -+ -+ std::type_info * getRtti(typelib_TypeDescription const & type); -+ -+private: -+ typedef boost::unordered_map Map; -+ -+ void * app_; -+ -+ osl::Mutex mutex_; -+ Map map_; -+}; -+ -+std::type_info * Rtti::getRtti(typelib_TypeDescription const & type) { -+ OUString unoName(type.pTypeName); -+ osl::MutexGuard g(mutex_); -+ Map::iterator i(map_.find(unoName)); -+ if (i == map_.end()) { -+ OStringBuffer b; -+ b.append("_ZTIN"); -+ for (sal_Int32 j = 0; j != -1;) { -+ OString t( -+ OUStringToOString( -+ unoName.getToken(0, '.', j), RTL_TEXTENCODING_ASCII_US)); -+ b.append(t.getLength()); -+ b.append(t); -+ } -+ b.append('E'); -+ OString sym(b.makeStringAndClear()); -+ std::type_info * rtti = static_cast( -+ dlsym(app_, sym.getStr())); -+ if (rtti == 0) { -+ char const * rttiName = sym.getStr() + std::strlen("_ZTI"); -+ assert(type.eTypeClass == typelib_TypeClass_EXCEPTION); -+ typelib_CompoundTypeDescription const & ctd -+ = reinterpret_cast( -+ type); -+ if (ctd.pBaseTypeDescription == 0) { -+ rtti = new __cxxabiv1::__class_type_info(strdup(rttiName)); -+ } else { -+ std::type_info * base = getRtti( -+ ctd.pBaseTypeDescription->aBase); -+ rtti = new __cxxabiv1::__si_class_type_info( -+ strdup(rttiName), -+ static_cast<__cxxabiv1::__class_type_info *>(base)); -+ } -+ } -+ i = map_.insert(Map::value_type(unoName, rtti)).first; -+ } -+ return i->second; -+} -+ -+struct theRttiFactory: public rtl::Static {}; -+ -+std::type_info * getRtti(typelib_TypeDescription const & type) { -+ return theRttiFactory::get().getRtti(type); -+} -+ -+extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void * exception) { -+ abi_aarch64::__cxa_exception * header = -+ static_cast(exception) - 1; -+ OUString unoName(toUnoName(header->exceptionType->name())); -+ typelib_TypeDescription * td = 0; -+ typelib_typedescription_getByName(&td, unoName.pData); -+ assert(td != 0); -+ uno_destructData(exception, td, &css::uno::cpp_release); -+ typelib_typedescription_release(td); -+} -+ -+enum StructKind { -+ STRUCT_KIND_EMPTY, STRUCT_KIND_FLOAT, STRUCT_KIND_DOUBLE, STRUCT_KIND_POD, -+ STRUCT_KIND_DTOR -+}; -+ -+StructKind getStructKind(typelib_CompoundTypeDescription const * type) { -+ StructKind k = type->pBaseTypeDescription == 0 -+ ? STRUCT_KIND_EMPTY : getStructKind(type->pBaseTypeDescription); -+ for (sal_Int32 i = 0; i != type->nMembers; ++i) { -+ StructKind k2 = StructKind(); -+ switch (type->ppTypeRefs[i]->eTypeClass) { -+ case typelib_TypeClass_BOOLEAN: -+ case typelib_TypeClass_BYTE: -+ case typelib_TypeClass_SHORT: -+ case typelib_TypeClass_UNSIGNED_SHORT: -+ case typelib_TypeClass_LONG: -+ case typelib_TypeClass_UNSIGNED_LONG: -+ case typelib_TypeClass_HYPER: -+ case typelib_TypeClass_UNSIGNED_HYPER: -+ case typelib_TypeClass_CHAR: -+ case typelib_TypeClass_ENUM: -+ k2 = STRUCT_KIND_POD; -+ break; -+ case typelib_TypeClass_FLOAT: -+ k2 = STRUCT_KIND_FLOAT; -+ break; -+ case typelib_TypeClass_DOUBLE: -+ k2 = STRUCT_KIND_DOUBLE; -+ break; -+ case typelib_TypeClass_STRING: -+ case typelib_TypeClass_TYPE: -+ case typelib_TypeClass_ANY: -+ case typelib_TypeClass_SEQUENCE: -+ case typelib_TypeClass_INTERFACE: -+ k2 = STRUCT_KIND_DTOR; -+ break; -+ case typelib_TypeClass_STRUCT: -+ { -+ typelib_TypeDescription * td = 0; -+ TYPELIB_DANGER_GET(&td, type->ppTypeRefs[i]); -+ k2 = getStructKind( -+ reinterpret_cast( -+ td)); -+ TYPELIB_DANGER_RELEASE(td); -+ break; -+ } -+ default: -+ assert(false); -+ } -+ switch (k2) { -+ case STRUCT_KIND_EMPTY: -+ // this means an empty sub-object, which nevertheless obtains a byte -+ // of storage (TODO: does it?), so the full object cannot be a -+ // homogenous collection of float or double -+ case STRUCT_KIND_POD: -+ assert(k != STRUCT_KIND_DTOR); -+ k = STRUCT_KIND_POD; -+ break; -+ case STRUCT_KIND_FLOAT: -+ case STRUCT_KIND_DOUBLE: -+ if (k == STRUCT_KIND_EMPTY) { -+ k = k2; -+ } else if (k != k2) { -+ assert(k != STRUCT_KIND_DTOR); -+ k = STRUCT_KIND_POD; -+ } -+ break; -+ case STRUCT_KIND_DTOR: -+ return STRUCT_KIND_DTOR; -+ } -+ } -+ return k; -+} -+ -+} -+ -+namespace abi_aarch64 { -+ -+void mapException( -+ __cxa_exception * exception, uno_Any * any, uno_Mapping * mapping) -+{ -+ assert(exception != 0); -+ OUString unoName(toUnoName(exception->exceptionType->name())); -+ typelib_TypeDescription * td = 0; -+ typelib_typedescription_getByName(&td, unoName.pData); -+ if (td == 0) { -+ css::uno::RuntimeException e( -+ "exception type not found: " + unoName, -+ css::uno::Reference()); -+ uno_type_any_constructAndConvert( -+ any, &e, -+ cppu::UnoType::get().getTypeLibType(), -+ mapping); -+ } else { -+ uno_any_constructAndConvert(any, exception->adjustedPtr, td, mapping); -+ typelib_typedescription_release(td); -+ } -+} -+ -+void raiseException(uno_Any * any, uno_Mapping * mapping) { -+ typelib_TypeDescription * td = 0; -+ TYPELIB_DANGER_GET(&td, any->pType); -+ if (td == 0) { -+ throw css::uno::RuntimeException( -+ "no typedescription for " + OUString(any->pType->pTypeName), -+ css::uno::Reference()); -+ } -+ void * exc = __cxxabiv1::__cxa_allocate_exception(td->nSize); -+ uno_copyAndConvertData(exc, any->pData, td, mapping); -+ uno_any_destruct(any, 0); -+ std::type_info * rtti = getRtti(*td); -+ TYPELIB_DANGER_RELEASE(td); -+ __cxxabiv1::__cxa_throw(exc, rtti, deleteException); -+} -+ -+ReturnKind getReturnKind(typelib_TypeDescription const * type) { -+ switch (type->eTypeClass) { -+ default: -+ assert(false); -+ // fall through to avoid warnings -+ case typelib_TypeClass_VOID: -+ case typelib_TypeClass_BOOLEAN: -+ case typelib_TypeClass_BYTE: -+ case typelib_TypeClass_SHORT: -+ case typelib_TypeClass_UNSIGNED_SHORT: -+ case typelib_TypeClass_LONG: -+ case typelib_TypeClass_UNSIGNED_LONG: -+ case typelib_TypeClass_HYPER: -+ case typelib_TypeClass_UNSIGNED_HYPER: -+ case typelib_TypeClass_FLOAT: -+ case typelib_TypeClass_DOUBLE: -+ case typelib_TypeClass_CHAR: -+ case typelib_TypeClass_ENUM: -+ assert(type->nSize <= 16); -+ return RETURN_KIND_REG; -+ case typelib_TypeClass_STRING: -+ case typelib_TypeClass_TYPE: -+ case typelib_TypeClass_ANY: -+ case typelib_TypeClass_SEQUENCE: -+ case typelib_TypeClass_INTERFACE: -+ return RETURN_KIND_INDIRECT; -+ case typelib_TypeClass_STRUCT: -+ if (type->nSize > 16) { -+ return RETURN_KIND_INDIRECT; -+ } -+ switch (getStructKind( -+ reinterpret_cast( -+ type))) -+ { -+ case STRUCT_KIND_FLOAT: -+ return RETURN_KIND_HFA_FLOAT; -+ case STRUCT_KIND_DOUBLE: -+ return RETURN_KIND_HFA_DOUBLE; -+ case STRUCT_KIND_DTOR: -+ return RETURN_KIND_INDIRECT; -+ default: -+ return RETURN_KIND_REG; -+ } -+ } -+} -+ -+} -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx -new file mode 100644 -index 0000000..2e3ce61 ---- /dev/null -+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx -@@ -0,0 +1,87 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . -+ */ -+ -+#ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_AARCH64_ABI_HXX -+#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_AARCH64_ABI_HXX -+ -+#include -+ -+#include -+#include -+ -+#include -+#include -+#include -+ -+namespace abi_aarch64 { -+ -+// Following declarations from libstdc++-v3/libsupc++/unwind-cxx.h and -+// lib/gcc/*-*-*/*/include/unwind.h: -+ -+struct _Unwind_Exception -+{ -+ unsigned exception_class __attribute__((__mode__(__DI__))); -+ void * exception_cleanup; -+ unsigned private_1 __attribute__((__mode__(__word__))); -+ unsigned private_2 __attribute__((__mode__(__word__))); -+} __attribute__((__aligned__)); -+ -+struct __cxa_exception -+{ -+ std::type_info *exceptionType; -+ void (*exceptionDestructor)(void *); -+ -+ std::unexpected_handler unexpectedHandler; -+ std::terminate_handler terminateHandler; -+ -+ __cxa_exception *nextException; -+ -+ int handlerCount; -+ -+ int handlerSwitchValue; -+ const unsigned char *actionRecord; -+ const unsigned char *languageSpecificData; -+ void *catchTemp; -+ void *adjustedPtr; -+ -+ _Unwind_Exception unwindHeader; -+}; -+ -+struct __cxa_eh_globals -+{ -+ __cxa_exception *caughtExceptions; -+ unsigned int uncaughtExceptions; -+}; -+ -+void mapException( -+ __cxa_exception * exception, uno_Any * any, uno_Mapping * mapping); -+ -+void raiseException(uno_Any * any, uno_Mapping * mapping); -+ -+enum ReturnKind { -+ RETURN_KIND_REG, RETURN_KIND_HFA_FLOAT, RETURN_KIND_HFA_DOUBLE, -+ RETURN_KIND_INDIRECT }; -+ -+ReturnKind getReturnKind(typelib_TypeDescription const * type); -+ -+} -+ -+#endif -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx -new file mode 100644 -index 0000000..09f7696 ---- /dev/null -+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx -@@ -0,0 +1,66 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . -+ */ -+ -+#include -+ -+#include -+ -+#include -+#include -+ -+#include -+ -+void callVirtualFunction( -+ unsigned long function, unsigned long * gpr, unsigned long * fpr, -+ unsigned long * stack, sal_Int32 sp, void * ret) -+{ -+ void * stackargs; -+ if (sp != 0) { -+ stackargs = alloca(((sp + 1) >> 1) * 16); -+ std::memcpy(stackargs, stack, sp * 8); -+ } -+ asm volatile( -+ "ldp x0, x1, [%[gpr_]]\n\t" -+ "ldp x2, x3, [%[gpr_], #16]\n\t" -+ "ldp x4, x5, [%[gpr_], #32]\n\t" -+ "ldp x6, x7, [%[gpr_], #48]\n\t" -+ "ldr x8, %[ret_]\n\t" -+ "ldr x9, %[function_]\n\t" -+ "ldp d0, d1, [%[fpr_]]\n\t" -+ "ldp d2, d3, [%[fpr_], #16]\n\t" -+ "ldp d4, d5, [%[fpr_], #32]\n\t" -+ "ldp d6, d7, [%[fpr_], #48]\n\t" -+ "blr x9\n\t" -+ "stp x0, x1, [%[gpr_]]\n\t" -+ "stp d0, d1, [%[fpr_]]\n\t" -+ "stp d2, d3, [%[fpr_], #16]\n\t" -+ :: [gpr_]"r" (gpr), [fpr_]"r" (fpr), [function_]"m" (function), -+ [ret_]"m" (ret), -+ "m" (stackargs) // dummy input to prevent optimizing the alloca away -+ : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", -+ "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18"/*TODO?*/, "v0", -+ "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", -+ "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21", -+ "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", -+ "memory" -+ // only the bottom 64 bits of v8--15 need to be preserved by callees -+ ); -+} -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.hxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.hxx -new file mode 100644 -index 0000000..b1b003f ---- /dev/null -+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.hxx -@@ -0,0 +1,33 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . -+ */ -+ -+#ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_AARCH64_CALLVIRTUALFUNCTION_HXX -+#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_AARCH64_CALLVIRTUALFUNCTION_HXX -+ -+#include -+ -+#include -+ -+void callVirtualFunction( -+ unsigned long function, unsigned long * gpr, unsigned long * fpr, -+ unsigned long * stack, sal_Int32 sp, void * ret); -+ -+#endif -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx -new file mode 100644 -index 0000000..a73d9be ---- /dev/null -+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx -@@ -0,0 +1,464 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . -+ */ -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+extern "C" void vtableSlotCall_(); -+ -+namespace { -+ -+void call( -+ bridges::cpp_uno::shared::CppInterfaceProxy * proxy, -+ css::uno::TypeDescription const & description, -+ typelib_TypeDescriptionReference * returnType, sal_Int32 count, -+ typelib_MethodParameter * parameters, unsigned long * gpr, -+ unsigned long * fpr, unsigned long * stack, void * indirectRet) -+{ -+ typelib_TypeDescription * rtd = 0; -+ if (returnType != 0) { -+ TYPELIB_DANGER_GET(&rtd, returnType); -+ } -+ abi_aarch64::ReturnKind retKind = rtd == 0 -+ ? abi_aarch64::RETURN_KIND_REG : abi_aarch64::getReturnKind(rtd); -+ bool retConv = rtd != 0 -+ && bridges::cpp_uno::shared::relatesToInterfaceType(rtd); -+ void * retin = retKind == abi_aarch64::RETURN_KIND_INDIRECT && !retConv -+ ? indirectRet : rtd == 0 ? 0 : alloca(rtd->nSize); -+ void ** args = static_cast< void ** >(alloca(count * sizeof (void *))); -+ void ** cppArgs = static_cast< void ** >(alloca(count * sizeof (void *))); -+ typelib_TypeDescription ** argtds = static_cast( -+ alloca(count * sizeof (typelib_TypeDescription *))); -+ sal_Int32 ngpr = 1; -+ sal_Int32 nfpr = 0; -+ sal_Int32 sp = 0; -+ for (sal_Int32 i = 0; i != count; ++i) { -+ if (!parameters[i].bOut -+ && bridges::cpp_uno::shared::isSimpleType(parameters[i].pTypeRef)) -+ { -+ switch (parameters[i].pTypeRef->eTypeClass) { -+ case typelib_TypeClass_BOOLEAN: -+ case typelib_TypeClass_BYTE: -+ case typelib_TypeClass_SHORT: -+ case typelib_TypeClass_UNSIGNED_SHORT: -+ case typelib_TypeClass_LONG: -+ case typelib_TypeClass_UNSIGNED_LONG: -+ case typelib_TypeClass_HYPER: -+ case typelib_TypeClass_UNSIGNED_HYPER: -+ case typelib_TypeClass_CHAR: -+ case typelib_TypeClass_ENUM: -+ args[i] = ngpr == 8 ? stack + sp++ : gpr + ngpr++; -+ break; -+ case typelib_TypeClass_FLOAT: -+ case typelib_TypeClass_DOUBLE: -+ args[i] = nfpr == 8 ? stack + sp++ : fpr + nfpr++; -+ break; -+ default: -+ assert(false); -+ } -+ argtds[i] = 0; -+ } else { -+ cppArgs[i] = reinterpret_cast( -+ ngpr == 8 ? stack[sp++] : gpr[ngpr++]); -+ typelib_TypeDescription * ptd = 0; -+ TYPELIB_DANGER_GET(&ptd, parameters[i].pTypeRef); -+ if (!parameters[i].bIn) { -+ args[i] = alloca(ptd->nSize); -+ argtds[i] = ptd; -+ } else if (bridges::cpp_uno::shared::relatesToInterfaceType(ptd)) { -+ args[i] = alloca(ptd->nSize); -+ uno_copyAndConvertData( -+ args[i], cppArgs[i], ptd, proxy->getBridge()->getCpp2Uno()); -+ argtds[i] = ptd; -+ } else { -+ args[i] = cppArgs[i]; -+ argtds[i] = 0; -+ TYPELIB_DANGER_RELEASE(ptd); -+ } -+ } -+ } -+ uno_Any exc; -+ uno_Any * pexc = &exc; -+ proxy->getUnoI()->pDispatcher( -+ proxy->getUnoI(), description.get(), retin, args, &pexc); -+ if (pexc != 0) { -+ for (sal_Int32 i = 0; i != count; ++i) { -+ if (argtds[i] != 0) { -+ if (parameters[i].bIn) { -+ uno_destructData(args[i], argtds[i], 0); -+ } -+ TYPELIB_DANGER_RELEASE(argtds[i]); -+ } -+ } -+ if (rtd != 0) { -+ TYPELIB_DANGER_RELEASE(rtd); -+ } -+ abi_aarch64::raiseException(&exc, proxy->getBridge()->getUno2Cpp()); -+ } -+ for (sal_Int32 i = 0; i != count; ++i) { -+ if (argtds[i] != 0) { -+ if (parameters[i].bOut) { -+ uno_destructData( -+ cppArgs[i], argtds[i], -+ reinterpret_cast(css::uno::cpp_release)); -+ uno_copyAndConvertData( -+ cppArgs[i], args[i], argtds[i], -+ proxy->getBridge()->getUno2Cpp()); -+ } -+ uno_destructData(args[i], argtds[i], 0); -+ TYPELIB_DANGER_RELEASE(argtds[i]); -+ } -+ } -+ void * retout = 0; // avoid false -Werror=maybe-uninitialized -+ switch (retKind) { -+ case abi_aarch64::RETURN_KIND_REG: -+ switch (rtd == 0 ? typelib_TypeClass_VOID : rtd->eTypeClass) { -+ case typelib_TypeClass_VOID: -+ break; -+ case typelib_TypeClass_BOOLEAN: -+ case typelib_TypeClass_BYTE: -+ case typelib_TypeClass_SHORT: -+ case typelib_TypeClass_UNSIGNED_SHORT: -+ case typelib_TypeClass_LONG: -+ case typelib_TypeClass_UNSIGNED_LONG: -+ case typelib_TypeClass_HYPER: -+ case typelib_TypeClass_UNSIGNED_HYPER: -+ case typelib_TypeClass_CHAR: -+ case typelib_TypeClass_ENUM: -+ std::memcpy(gpr, retin, rtd->nSize); -+ assert(!retConv); -+ break; -+ case typelib_TypeClass_FLOAT: -+ case typelib_TypeClass_DOUBLE: -+ std::memcpy(fpr, retin, rtd->nSize); -+ assert(!retConv); -+ break; -+ case typelib_TypeClass_STRUCT: -+ if (retConv) { -+ retout = gpr; -+ } else { -+ std::memcpy(gpr, retin, rtd->nSize); -+ } -+ break; -+ default: -+ assert(false); -+ } -+ break; -+ case abi_aarch64::RETURN_KIND_HFA_FLOAT: -+ assert(rtd != 0); -+ switch (rtd->nSize) { -+ case 16: -+ std::memcpy(fpr + 3, static_cast(retin) + 12, 4); -+ // fall through -+ case 12: -+ std::memcpy(fpr + 2, static_cast(retin) + 8, 4); -+ // fall through -+ case 8: -+ std::memcpy(fpr + 1, static_cast(retin) + 4, 4); -+ // fall through -+ case 4: -+ std::memcpy(fpr, retin, 4); -+ break; -+ default: -+ assert(false); -+ } -+ assert(!retConv); -+ break; -+ case abi_aarch64::RETURN_KIND_HFA_DOUBLE: -+ assert(rtd != 0); -+ std::memcpy(fpr, retin, rtd->nSize); -+ assert(!retConv); -+ break; -+ case abi_aarch64::RETURN_KIND_INDIRECT: -+ retout = indirectRet; -+ break; -+ } -+ if (retConv) { -+ uno_copyAndConvertData( -+ retout, retin, rtd, proxy->getBridge()->getUno2Cpp()); -+ uno_destructData(retin, rtd, 0); -+ } -+ if (rtd != 0) { -+ TYPELIB_DANGER_RELEASE(rtd); -+ } -+} -+ -+extern "C" void vtableCall( -+ sal_Int32 functionIndex, sal_Int32 vtableOffset, -+ unsigned long * gpr, unsigned long * fpr, unsigned long * stack, -+ void * indirectRet) -+{ -+ bridges::cpp_uno::shared::CppInterfaceProxy * proxy -+ = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( -+ reinterpret_cast(gpr[0]) - vtableOffset); -+ typelib_InterfaceTypeDescription * type = proxy->getTypeDescr(); -+ assert(functionIndex < type->nMapFunctionIndexToMemberIndex); -+ sal_Int32 pos = type->pMapFunctionIndexToMemberIndex[functionIndex]; -+ css::uno::TypeDescription desc(type->ppAllMembers[pos]); -+ switch (desc.get()->eTypeClass) { -+ case typelib_TypeClass_INTERFACE_ATTRIBUTE: -+ if (type->pMapMemberIndexToFunctionIndex[pos] == functionIndex) { -+ // Getter: -+ call( -+ proxy, desc, -+ reinterpret_cast( -+ desc.get())->pAttributeTypeRef, -+ 0, 0, gpr, fpr, stack, indirectRet); -+ } else { -+ // Setter: -+ typelib_MethodParameter param = { -+ 0, -+ reinterpret_cast( -+ desc.get())->pAttributeTypeRef, -+ true, false }; -+ call(proxy, desc, 0, 1, ¶m, gpr, fpr, stack, indirectRet); -+ } -+ break; -+ case typelib_TypeClass_INTERFACE_METHOD: -+ switch (functionIndex) { -+ case 1: -+ proxy->acquireProxy(); -+ break; -+ case 2: -+ proxy->releaseProxy(); -+ break; -+ case 0: -+ { -+ typelib_TypeDescription * td = 0; -+ TYPELIB_DANGER_GET( -+ &td, -+ (reinterpret_cast(gpr[1]) -+ ->getTypeLibType())); -+ if (td != 0 && td->eTypeClass == typelib_TypeClass_INTERFACE) { -+ css::uno::XInterface * ifc = 0; -+ proxy->getBridge()->getCppEnv()->getRegisteredInterface( -+ proxy->getBridge()->getCppEnv(), -+ reinterpret_cast(&ifc), proxy->getOid().pData, -+ reinterpret_cast( -+ td)); -+ if (ifc != 0) { -+ uno_any_construct( -+ reinterpret_cast(indirectRet), &ifc, td, -+ reinterpret_cast( -+ css::uno::cpp_acquire)); -+ ifc->release(); -+ TYPELIB_DANGER_RELEASE(td); -+ break; -+ } -+ TYPELIB_DANGER_RELEASE(td); -+ } -+ } -+ // fall through -+ default: -+ call( -+ proxy, desc, -+ reinterpret_cast( -+ desc.get())->pReturnTypeRef, -+ reinterpret_cast( -+ desc.get())->nParams, -+ reinterpret_cast( -+ desc.get())->pParams, -+ gpr, fpr, stack, indirectRet); -+ } -+ break; -+ default: -+ assert(false); -+ } -+} -+ -+struct aarch64_va_list { -+ void * stack; -+ void * gr_top; -+ void * vr_top; -+ int gr_offs; -+ int vr_offs; -+}; -+ -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wvolatile-register-var" -+extern "C" void vtableSlotCall( -+ unsigned long gpr0, unsigned long gpr1, unsigned long gpr2, -+ unsigned long gpr3, unsigned long gpr4, unsigned long gpr5, -+ unsigned long gpr6, unsigned long gpr7, double fpr0, double fpr1, -+ double fpr2, double fpr3, double fpr4, double fpr5, double fpr6, -+ double fpr7, ...) -+{ -+ register void * volatile indirectRet asm ("x8"); -+ register sal_Int32 volatile functionIndex asm ("x9"); -+ register sal_Int32 volatile vtableOffset asm ("x10"); -+ va_list ap; -+ va_start(ap, fpr7); -+ assert(sizeof (va_list) == sizeof (aarch64_va_list)); -+ unsigned long gpr[8]; -+ gpr[0] = gpr0; -+ gpr[1] = gpr1; -+ gpr[2] = gpr2; -+ gpr[3] = gpr3; -+ gpr[4] = gpr4; -+ gpr[5] = gpr5; -+ gpr[6] = gpr6; -+ gpr[7] = gpr7; -+ double fpr[8]; -+ fpr[0] = fpr0; -+ fpr[1] = fpr1; -+ fpr[2] = fpr2; -+ fpr[3] = fpr3; -+ fpr[4] = fpr4; -+ fpr[5] = fpr5; -+ fpr[6] = fpr6; -+ fpr[7] = fpr7; -+ vtableCall( -+ functionIndex, vtableOffset, gpr, -+ reinterpret_cast(fpr), -+ static_cast( -+ reinterpret_cast(&ap)->stack), -+ indirectRet); -+ asm volatile( -+ "ldp x0, x1, [%[gpr_]]\n\t" -+ "ldp d0, d1, [%[fpr_]]\n\t" -+ "ldp d2, d3, [%[fpr_], #16]\n\t" -+ :: [gpr_]"r" (gpr), [fpr_]"r" (fpr) -+ : "r0", "r1", "v0", "v1", "v2", "v3"); -+} -+#pragma GCC diagnostic pop -+ -+std::size_t const codeSnippetSize = 8 * 4; -+ -+unsigned char * generateCodeSnippet( -+ unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset) -+{ -+ // movz x9, -+ reinterpret_cast(code)[0] = 0xD2800009 -+ | ((functionIndex & 0xFFFF) << 5); -+ // movk x9, , LSL #16 -+ reinterpret_cast(code)[1] = 0xF2A00009 -+ | ((functionIndex >> 16) << 5); -+ // movz x10, -+ reinterpret_cast(code)[2] = 0xD280000A -+ | ((vtableOffset & 0xFFFF) << 5); -+ // movk x10, , LSL #16 -+ reinterpret_cast(code)[3] = 0xF2A0000A -+ | ((vtableOffset >> 16) << 5); -+ // ldr x11, +2*4 -+ reinterpret_cast(code)[4] = 0x5800004B; -+ // br x11 -+ reinterpret_cast(code)[5] = 0xD61F0160; -+ reinterpret_cast(code)[3] -+ = reinterpret_cast(&vtableSlotCall); -+ return code + codeSnippetSize; -+} -+ -+} -+ -+struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; }; -+ -+bridges::cpp_uno::shared::VtableFactory::Slot * -+bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) { -+ return static_cast(block) + 2; -+} -+ -+sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( -+ sal_Int32 slotCount) -+{ -+ return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; -+} -+ -+bridges::cpp_uno::shared::VtableFactory::Slot * -+bridges::cpp_uno::shared::VtableFactory::initializeBlock( -+ void * block, sal_Int32 slotCount) -+{ -+ Slot * slots = mapBlockToVtable(block); -+ slots[-2].fn = 0; -+ slots[-1].fn = 0; -+ return slots + slotCount; -+} -+ -+unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( -+ Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff, -+ typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, -+ sal_Int32 functionCount, sal_Int32 vtableOffset) -+{ -+ (*slots) -= functionCount; -+ Slot * s = *slots; -+ for (sal_Int32 i = 0; i != type->nMembers; ++i) { -+ typelib_TypeDescription * td = 0; -+ TYPELIB_DANGER_GET(&td, type->ppMembers[i]); -+ assert(td != 0); -+ switch (td->eTypeClass) { -+ case typelib_TypeClass_INTERFACE_ATTRIBUTE: -+ { -+ typelib_InterfaceAttributeTypeDescription * atd -+ = reinterpret_cast< -+ typelib_InterfaceAttributeTypeDescription *>(td); -+ // Getter: -+ (s++)->fn = code + writetoexecdiff; -+ code = generateCodeSnippet( -+ code, functionOffset++, vtableOffset); -+ // Setter: -+ if (!atd->bReadOnly) { -+ (s++)->fn = code + writetoexecdiff; -+ code = generateCodeSnippet( -+ code, functionOffset++, vtableOffset); -+ } -+ break; -+ } -+ case typelib_TypeClass_INTERFACE_METHOD: -+ (s++)->fn = code + writetoexecdiff; -+ code = generateCodeSnippet(code, functionOffset++, vtableOffset); -+ break; -+ default: -+ assert(false); -+ } -+ TYPELIB_DANGER_RELEASE(td); -+ } -+ return code; -+} -+ -+void bridges::cpp_uno::shared::VtableFactory::flushCode( -+ unsigned char const * begin, unsigned char const * end) -+{ -+ static void (*clear_cache)(unsigned char const *, unsigned char const *) -+ = (void (*)(unsigned char const *, unsigned char const *)) dlsym( -+ RTLD_DEFAULT, "__clear_cache"); -+ (*clear_cache)(begin, end); -+} -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx -new file mode 100644 -index 0000000..9c9a24a ---- /dev/null -+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx -@@ -0,0 +1,376 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . -+ */ -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+namespace { -+ -+void pushArgument( -+ unsigned long value, unsigned long * stack, sal_Int32 * sp, -+ unsigned long * regs, sal_Int32 * nregs) -+{ -+ (*nregs != 8 ? regs[(*nregs)++] : stack[(*sp)++]) = value; -+} -+ -+void call( -+ bridges::cpp_uno::shared::UnoInterfaceProxy * proxy, -+ bridges::cpp_uno::shared::VtableSlot slot, -+ typelib_TypeDescriptionReference * returnType, sal_Int32 count, -+ typelib_MethodParameter * parameters, void * returnValue, void ** arguments, -+ uno_Any ** exception) -+{ -+ typelib_TypeDescription * rtd = 0; -+ TYPELIB_DANGER_GET(&rtd, returnType); -+ abi_aarch64::ReturnKind retKind = abi_aarch64::getReturnKind(rtd); -+ bool retConv = bridges::cpp_uno::shared::relatesToInterfaceType(rtd); -+ void * ret = retConv ? alloca(rtd->nSize) : returnValue; -+ unsigned long ** thisPtr -+ = reinterpret_cast(proxy->getCppI()) + slot.offset; -+ unsigned long * stack = static_cast( -+ alloca(count * sizeof (unsigned long))); -+ sal_Int32 sp = 0; -+ unsigned long gpr[8]; -+ sal_Int32 ngpr = 0; -+ unsigned long fpr[8]; -+ sal_Int32 nfpr = 0; -+ gpr[ngpr++] = reinterpret_cast(thisPtr); -+ void ** cppArgs = static_cast(alloca(count * sizeof (void *))); -+ typelib_TypeDescription ** ptds = -+ static_cast( -+ alloca(count * sizeof (typelib_TypeDescription *))); -+ for (sal_Int32 i = 0; i != count; ++i) { -+ if (!parameters[i].bOut && -+ bridges::cpp_uno::shared::isSimpleType(parameters[i].pTypeRef)) -+ { -+ cppArgs[i] = 0; -+ switch (parameters[i].pTypeRef->eTypeClass) { -+ case typelib_TypeClass_BOOLEAN: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ case typelib_TypeClass_BYTE: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ case typelib_TypeClass_SHORT: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ case typelib_TypeClass_UNSIGNED_SHORT: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ case typelib_TypeClass_LONG: -+ case typelib_TypeClass_ENUM: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ case typelib_TypeClass_UNSIGNED_LONG: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ case typelib_TypeClass_HYPER: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ case typelib_TypeClass_UNSIGNED_HYPER: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ case typelib_TypeClass_FLOAT: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, fpr, -+ &nfpr); -+ break; -+ case typelib_TypeClass_DOUBLE: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, -+ fpr, &nfpr); -+ break; -+ case typelib_TypeClass_CHAR: -+ pushArgument( -+ *static_cast(arguments[i]), stack, &sp, gpr, -+ &ngpr); -+ break; -+ default: -+ assert(false); -+ } -+ } else { -+ typelib_TypeDescription * ptd = 0; -+ TYPELIB_DANGER_GET(&ptd, parameters[i].pTypeRef); -+ if (!parameters[i].bIn) { -+ cppArgs[i] = alloca(ptd->nSize); -+ uno_constructData(cppArgs[i], ptd); -+ ptds[i] = ptd; -+ pushArgument( -+ reinterpret_cast(cppArgs[i]), stack, &sp, -+ gpr, &ngpr); -+ } else if (bridges::cpp_uno::shared::relatesToInterfaceType(ptd)) { -+ cppArgs[i] = alloca(ptd->nSize); -+ uno_copyAndConvertData( -+ cppArgs[i], arguments[i], ptd, -+ proxy->getBridge()->getUno2Cpp()); -+ ptds[i] = ptd; -+ pushArgument( -+ reinterpret_cast(cppArgs[i]), stack, &sp, -+ gpr, &ngpr); -+ } else { -+ cppArgs[i] = 0; -+ pushArgument( -+ reinterpret_cast(arguments[i]), stack, &sp, -+ gpr, &ngpr); -+ TYPELIB_DANGER_RELEASE(ptd); -+ } -+ } -+ } -+ try { -+ try { -+ callVirtualFunction( -+ (*thisPtr)[slot.index], gpr, fpr, stack, sp, ret); -+ } catch (css::uno::Exception &) { -+ throw; -+ } catch (std::exception & e) { -+ throw css::uno::RuntimeException( -+ ("C++ code threw " -+ + OStringToOUString(typeid(e).name(), RTL_TEXTENCODING_UTF8) -+ + ": " + OStringToOUString(e.what(), RTL_TEXTENCODING_UTF8)), -+ css::uno::Reference()); -+ } catch (...) { -+ throw css::uno::RuntimeException( -+ "C++ code threw unknown exception", -+ css::uno::Reference()); -+ } -+ } catch (css::uno::Exception &) { -+ abi_aarch64::mapException( -+ reinterpret_cast( -+ __cxxabiv1::__cxa_get_globals())->caughtExceptions, -+ *exception, proxy->getBridge()->getCpp2Uno()); -+ for (sal_Int32 i = 0; i != count; ++i) { -+ if (cppArgs[i] != 0) { -+ uno_destructData( -+ cppArgs[i], ptds[i], -+ reinterpret_cast(css::uno::cpp_release)); -+ TYPELIB_DANGER_RELEASE(ptds[i]); -+ } -+ } -+ TYPELIB_DANGER_RELEASE(rtd); -+ return; -+ } -+ *exception = 0; -+ for (sal_Int32 i = 0; i != count; ++i) { -+ if (cppArgs[i] != 0) { -+ if (parameters[i].bOut) { -+ if (parameters[i].bIn) { -+ uno_destructData(arguments[i], ptds[i], 0); -+ } -+ uno_copyAndConvertData( -+ arguments[i], cppArgs[i], ptds[i], -+ proxy->getBridge()->getCpp2Uno()); -+ } -+ uno_destructData( -+ cppArgs[i], ptds[i], -+ reinterpret_cast(css::uno::cpp_release)); -+ TYPELIB_DANGER_RELEASE(ptds[i]); -+ } -+ } -+ switch (retKind) { -+ case abi_aarch64::RETURN_KIND_REG: -+ switch (rtd->eTypeClass) { -+ case typelib_TypeClass_VOID: -+ break; -+ case typelib_TypeClass_BOOLEAN: -+ case typelib_TypeClass_BYTE: -+ case typelib_TypeClass_SHORT: -+ case typelib_TypeClass_UNSIGNED_SHORT: -+ case typelib_TypeClass_LONG: -+ case typelib_TypeClass_UNSIGNED_LONG: -+ case typelib_TypeClass_HYPER: -+ case typelib_TypeClass_UNSIGNED_HYPER: -+ case typelib_TypeClass_CHAR: -+ case typelib_TypeClass_ENUM: -+ case typelib_TypeClass_STRUCT: -+ std::memcpy(ret, gpr, rtd->nSize); -+ break; -+ case typelib_TypeClass_FLOAT: -+ case typelib_TypeClass_DOUBLE: -+ std::memcpy(ret, fpr, rtd->nSize); -+ break; -+ default: -+ assert(false); -+ } -+ break; -+ case abi_aarch64::RETURN_KIND_HFA_FLOAT: -+ switch (rtd->nSize) { -+ case 16: -+ std::memcpy(static_cast(ret) + 12, fpr + 3, 4); -+ // fall through -+ case 12: -+ std::memcpy(static_cast(ret) + 8, fpr + 2, 4); -+ // fall through -+ case 8: -+ std::memcpy(static_cast(ret) + 4, fpr + 1, 4); -+ // fall through -+ case 4: -+ std::memcpy(ret, fpr, 4); -+ break; -+ default: -+ assert(false); -+ } -+ break; -+ case abi_aarch64::RETURN_KIND_HFA_DOUBLE: -+ std::memcpy(ret, fpr, rtd->nSize); -+ break; -+ case abi_aarch64::RETURN_KIND_INDIRECT: -+ break; -+ } -+ if (retConv) { -+ uno_copyAndConvertData( -+ returnValue, ret, rtd, proxy->getBridge()->getCpp2Uno()); -+ uno_destructData( -+ ret, rtd, reinterpret_cast(css::uno::cpp_release)); -+ } -+ TYPELIB_DANGER_RELEASE(rtd); -+} -+ -+} -+ -+namespace bridges { namespace cpp_uno { namespace shared { -+ -+void unoInterfaceProxyDispatch( -+ uno_Interface * pUnoI, typelib_TypeDescription const * pMemberDescr, -+ void * pReturn, void ** pArgs, uno_Any ** ppException) -+{ -+ UnoInterfaceProxy * proxy = static_cast(pUnoI); -+ switch (pMemberDescr->eTypeClass) { -+ case typelib_TypeClass_INTERFACE_ATTRIBUTE: -+ { -+ typelib_InterfaceAttributeTypeDescription const * atd -+ = reinterpret_cast< -+ typelib_InterfaceAttributeTypeDescription const *>( -+ pMemberDescr); -+ VtableSlot slot(getVtableSlot(atd)); -+ if (pReturn != 0) { // getter -+ call( -+ proxy, slot, atd->pAttributeTypeRef, 0, 0, pReturn, pArgs, -+ ppException); -+ } else { // setter -+ typelib_MethodParameter param = { -+ 0, atd->pAttributeTypeRef, true, false }; -+ typelib_TypeDescriptionReference * rtd = 0; -+ typelib_typedescriptionreference_new( -+ &rtd, typelib_TypeClass_VOID, OUString("void").pData); -+ slot.index += 1; -+ call(proxy, slot, rtd, 1, ¶m, pReturn, pArgs, ppException); -+ typelib_typedescriptionreference_release(rtd); -+ } -+ break; -+ } -+ case typelib_TypeClass_INTERFACE_METHOD: -+ { -+ typelib_InterfaceMethodTypeDescription const * mtd -+ = reinterpret_cast< -+ typelib_InterfaceMethodTypeDescription const *>( -+ pMemberDescr); -+ VtableSlot slot(getVtableSlot(mtd)); -+ switch (slot.index) { -+ case 1: -+ pUnoI->acquire(pUnoI); -+ *ppException = 0; -+ break; -+ case 2: -+ pUnoI->release(pUnoI); -+ *ppException = 0; -+ break; -+ case 0: -+ { -+ typelib_TypeDescription * td = 0; -+ TYPELIB_DANGER_GET( -+ &td, -+ (reinterpret_cast(pArgs[0]) -+ ->getTypeLibType())); -+ if (td != 0) { -+ uno_Interface * ifc = 0; -+ proxy->pBridge->getUnoEnv()->getRegisteredInterface( -+ proxy->pBridge->getUnoEnv(), -+ reinterpret_cast(&ifc), proxy->oid.pData, -+ reinterpret_cast< -+ typelib_InterfaceTypeDescription *>(td)); -+ if (ifc != 0) { -+ uno_any_construct( -+ reinterpret_cast(pReturn), &ifc, td, -+ 0); -+ ifc->release(ifc); -+ TYPELIB_DANGER_RELEASE(td); -+ *ppException = 0; -+ break; -+ } -+ TYPELIB_DANGER_RELEASE(td); -+ } -+ } -+ // fall through -+ default: -+ call( -+ proxy, slot, mtd->pReturnTypeRef, mtd->nParams, -+ mtd->pParams, pReturn, pArgs, ppException); -+ break; -+ } -+ break; -+ } -+ default: -+ assert(false); -+ } -+} -+ -+} } } -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/configure.ac b/configure.ac -index 5ead2a0..826797f8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -4292,6 +4292,12 @@ linux-gnu*) - - case "$host_cpu" in - -+ aarch64) -+ CPUNAME=AARCH64 -+ PLATFORMID=linux_aarch64 -+ RTL_ARCH=AARCH64 -+ OUTPATH=unxlngaarch64 -+ ;; - alpha) - CPUNAME=AXP - RTL_ARCH=ALPHA -diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx -index 09b3fcd..6b04004 100644 ---- a/desktop/source/deployment/misc/dp_platform.cxx -+++ b/desktop/source/deployment/misc/dp_platform.cxx -@@ -45,7 +45,7 @@ - #define PLATFORM_LINUX_S390x "linux_s390x" - #define PLATFORM_LINUX_HPPA "linux_hppa" - #define PLATFORM_LINUX_ALPHA "linux_alpha" -- -+#define PLATFORM_LINUX_AARCH64 "linux_aarch64" - - - #define PLATFORM_SOLARIS_SPARC "solaris_sparc" -@@ -149,6 +149,8 @@ namespace - ret = checkOSandCPU("Linux", "HPPA"); - else if (token == PLATFORM_LINUX_ALPHA) - ret = checkOSandCPU("Linux", "ALPHA"); -+ else if (token == PLATFORM_LINUX_AARCH64) -+ ret = checkOSandCPU("Linux", "AARCH64"); - else if (token == PLATFORM_SOLARIS_SPARC) - ret = checkOSandCPU("Solaris", "SPARC"); - else if (token == PLATFORM_SOLARIS_SPARC64) -diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx -index 25baaee5..29f2641 100644 ---- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx -+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx -@@ -65,6 +65,8 @@ OpenJDK at least, but probably not true for Lemotes JDK */ - #define JFW_PLUGIN_ARCH "parisc" - #elif defined AXP - #define JFW_PLUGIN_ARCH "alpha" -+#elif defined AARCH64 -+#define JFW_PLUGIN_ARCH "aarch64" - #else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA - #error unknown platform - #endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA -diff --git a/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk b/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk -new file mode 100644 -index 0000000..682199e ---- /dev/null -+++ b/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk -@@ -0,0 +1,14 @@ -+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -+# -+# This file is part of the LibreOffice project. -+# -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+# -+ -+gb_COMPILERDEFAULTOPTFLAGS := -Os -+ -+include $(GBUILDDIR)/platform/linux.mk -+ -+# vim: set noet sw=4: --- -1.9.3 - diff --git a/SOURCES/0002-Related-tdf-93676-msword-wraps-slightly-differently-.patch b/SOURCES/0002-Related-tdf-93676-msword-wraps-slightly-differently-.patch new file mode 100644 index 0000000..90ddc6b --- /dev/null +++ b/SOURCES/0002-Related-tdf-93676-msword-wraps-slightly-differently-.patch @@ -0,0 +1,61 @@ +From d9aed0bc2e741fa02a6ffdf90193aae7ce471e52 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 8 Sep 2015 09:45:12 +0100 +Subject: [PATCH] Related: tdf#93676 msword wraps slightly differently than us + +Change-Id: I688d4d193709d9c9829065c87f0d656a94fd9f16 +--- + sw/source/filter/ww8/docxsdrexport.cxx | 16 +++++++++++++++- + sw/source/filter/ww8/wrtw8esh.cxx | 2 +- + 2 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx +index 02b134a..71a357e 100644 +--- a/sw/source/filter/ww8/docxsdrexport.cxx ++++ b/sw/source/filter/ww8/docxsdrexport.cxx +@@ -516,6 +516,21 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons + } + m_pImpl->m_pSerializer->endElementNS(XML_wp, XML_positionH); + m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_positionV, XML_relativeFrom, relativeFromV, FSEND); ++ ++ sal_Int64 nTwipstoEMU = TwipsToEMU(aPos.Y); ++ ++ // tdf#93675, 0 below line/paragraph and/or top line/paragraph with ++ // wrap top+bottom or other wraps is affecting the line directly ++ // above the anchor line, which seems odd, but a tiny adjustment ++ // here to bring the top down convinces msoffice to wrap like us ++ if (nTwipstoEMU == 0 && ++ (strcmp(relativeFromV, "line") == 0 || strcmp(relativeFromV, "paragraph") == 0) && ++ (!alignV || strcmp(alignV, "top") == 0)) ++ { ++ alignV = NULL; ++ nTwipstoEMU = 635; ++ } ++ + if (alignV != NULL) + { + m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_align, FSEND); +@@ -525,7 +540,6 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons + else + { + m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_posOffset, FSEND); +- sal_Int64 nTwipstoEMU = TwipsToEMU(aPos.Y); + if (nTwipstoEMU > MAX_INTEGER_VALUE) + { + nTwipstoEMU = MAX_INTEGER_VALUE; +diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx +index fd6dfbc..2b7cebe 100644 +--- a/sw/source/filter/ww8/wrtw8esh.cxx ++++ b/sw/source/filter/ww8/wrtw8esh.cxx +@@ -810,7 +810,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const + // wrap top+bottom or other wraps is affecting the line directly + // above the anchor line, which seems odd, but a tiny adjustment + // here to bring the top down convinces msoffice to wrap like us +- if (nTop < 8 && !rFrameFormat.IsInline() && ++ if (nTop == 0 && !rFrameFormat.IsInline() && + rVOr.GetVertOrient() == text::VertOrientation::NONE && + rVOr.GetRelationOrient() == text::RelOrientation::FRAME) + { +-- +2.1.0 + diff --git a/SOURCES/0002-coverity-1266485-Untrusted-value-as-argument.patch b/SOURCES/0002-coverity-1266485-Untrusted-value-as-argument.patch deleted file mode 100644 index 519d081..0000000 --- a/SOURCES/0002-coverity-1266485-Untrusted-value-as-argument.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 614d84a00890fae37f89b39c7d3e2e02508ab5c6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 26 Jan 2015 11:26:41 +0000 -Subject: [PATCH 2/4] coverity#1266485 Untrusted value as argument - -Change-Id: I7708ecaf5412535055584ed6c71beaa9cd71c10c -(cherry picked from commit 0934ed1a40c59c169354b177d7dab4228de66171) - -min legal size here is > 4 - -(cherry picked from commit 3131205c05a3fde4ef1e3322cc48ca23c443f6d3) - -Change-Id: I9f68d000b32623db4d949d13284043630f5689f4 -(cherry picked from commit 964000d415bcf491704dad57aee7e0656ea60dab) -Reviewed-on: https://gerrit.libreoffice.org/16983 -Reviewed-by: David Tardon -Tested-by: David Tardon -(cherry picked from commit 81d1123ac317d9dad9872a9d2feda8cc6bd32492) ---- - vcl/source/gdi/jobset.cxx | 29 +++++++++++++++++------------ - 1 file changed, 17 insertions(+), 12 deletions(-) - -diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx -index ec1f44f..c67255e 100644 ---- a/vcl/source/gdi/jobset.cxx -+++ b/vcl/source/gdi/jobset.cxx -@@ -218,19 +218,24 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup ) - DBG_ASSERTWARNING( rIStream.GetVersion(), "JobSetup::>> - Solar-Version not set on rOStream" ); - - { -- sal_Size nFirstPos = rIStream.Tell(); -- - sal_uInt16 nLen = 0; - rIStream.ReadUInt16( nLen ); -- if ( !nLen ) -+ if (nLen <= 4) - return rIStream; - - sal_uInt16 nSystem = 0; - rIStream.ReadUInt16( nSystem ); -- -- boost::scoped_array pTempBuf(new char[nLen]); -- rIStream.Read( pTempBuf.get(), nLen - sizeof( nLen ) - sizeof( nSystem ) ); -- if ( nLen >= sizeof(ImplOldJobSetupData)+4 ) -+ const size_t nRead = nLen - sizeof(nLen) - sizeof(nSystem); -+ if (nRead > rIStream.remainingSize()) -+ { -+ SAL_WARN("vcl", "Parsing error: " << rIStream.remainingSize() << -+ " max possible entries, but " << nRead << " claimed, truncating"); -+ return rIStream; -+ } -+ sal_Size nFirstPos = rIStream.Tell(); -+ boost::scoped_array pTempBuf(new char[nRead]); -+ rIStream.Read(pTempBuf.get(), nRead); -+ if (nRead >= sizeof(ImplOldJobSetupData)) - { - ImplOldJobSetupData* pData = (ImplOldJobSetupData*)pTempBuf.get(); - if ( rJobSetup.mpData ) -@@ -255,7 +260,7 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup ) - nSystem == JOBSET_FILE605_SYSTEM ) - { - Impl364JobSetupData* pOldJobData = (Impl364JobSetupData*)(pTempBuf.get() + sizeof( ImplOldJobSetupData )); -- sal_uInt16 nOldJobDataSize = SVBT16ToShort( pOldJobData->nSize ); -+ sal_uInt16 nOldJobDataSize = SVBT16ToShort( pOldJobData->nSize ); - pJobData->mnSystem = SVBT16ToShort( pOldJobData->nSystem ); - pJobData->mnDriverDataLen = SVBT32ToUInt32( pOldJobData->nDriverDataLen ); - pJobData->meOrientation = (Orientation)SVBT16ToShort( pOldJobData->nOrientation ); -@@ -272,8 +277,8 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup ) - } - if( nSystem == JOBSET_FILE605_SYSTEM ) - { -- rIStream.Seek( nFirstPos + sizeof( ImplOldJobSetupData ) + 4 + sizeof( Impl364JobSetupData ) + pJobData->mnDriverDataLen ); -- while( rIStream.Tell() < nFirstPos + nLen ) -+ rIStream.Seek( nFirstPos + sizeof( ImplOldJobSetupData ) + sizeof( Impl364JobSetupData ) + pJobData->mnDriverDataLen ); -+ while( rIStream.Tell() < nFirstPos + nRead ) - { - OUString aKey = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); - OUString aValue = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); -@@ -291,9 +296,9 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup ) - else - pJobData->maValueMap[ aKey ] = aValue; - } -- DBG_ASSERT( rIStream.Tell() == nFirstPos+nLen, "corrupted job setup" ); -+ DBG_ASSERT( rIStream.Tell() == nFirstPos+nRead, "corrupted job setup" ); - // ensure correct stream position -- rIStream.Seek( nFirstPos + nLen ); -+ rIStream.Seek(nFirstPos + nRead); - } - } - } --- -2.5.0 - diff --git a/SOURCES/0002-disable-tearability-of-color-window.patch b/SOURCES/0002-disable-tearability-of-color-window.patch new file mode 100644 index 0000000..8dc0268 --- /dev/null +++ b/SOURCES/0002-disable-tearability-of-color-window.patch @@ -0,0 +1,46 @@ +From 011f42c0c6104228f5c15daae58e432ccf2be69d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 17 Dec 2015 17:04:52 +0000 +Subject: [PATCH 2/2] disable tearability of color window + +the new popup controllers take care to destroy the popup +and recreate a non-popup and move the contents into it + +so we should re-implement the color popup as one of those +in the meantime, turn it into a non-tearable thing + +Change-Id: I6ba26bf19badcbf910b7200b7e1b8b2a64ce4eec +--- + svx/source/tbxctrls/tbcontrl.cxx | 3 +-- + svx/uiconfig/ui/colorwindow.ui | 1 - + 2 files changed, 1 insertion(+), 3 deletions(-) + +diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx +index ae696ae..28691dc 100644 +--- a/svx/source/tbxctrls/tbcontrl.cxx ++++ b/svx/source/tbxctrls/tbcontrl.cxx +@@ -2659,8 +2659,7 @@ VclPtr SvxColorToolBoxControl::CreatePopupWindow() + break; + } + +- pColorWin->StartPopupMode( &GetToolBox(), +- FloatWinPopupFlags::AllowTearOff|FloatWinPopupFlags::NoAppFocusClose ); ++ pColorWin->StartPopupMode( &GetToolBox(), FloatWinPopupFlags::NoAppFocusClose ); + pColorWin->StartSelection(); + SetPopupWindow( pColorWin ); + if ( !bSidebarType ) +diff --git a/svx/uiconfig/ui/colorwindow.ui b/svx/uiconfig/ui/colorwindow.ui +index 9482562..702bee3 100644 +--- a/svx/uiconfig/ui/colorwindow.ui ++++ b/svx/uiconfig/ui/colorwindow.ui +@@ -25,7 +25,6 @@ + True + popup-menu + True +- False + False + + +-- +2.5.0 + diff --git a/SOURCES/0002-java-dir-for-powepc64-and-powepc64le-can-differ.patch b/SOURCES/0002-java-dir-for-powepc64-and-powepc64le-can-differ.patch deleted file mode 100644 index 9b41179..0000000 --- a/SOURCES/0002-java-dir-for-powepc64-and-powepc64le-can-differ.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 337e7e62285ff90978438173a2ba8899eabc3955 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Tue, 12 May 2015 12:10:16 +0200 -Subject: [PATCH] java dir for powepc64 and powepc64le can differ - -E.g., RHEL >= 7.1 uses ppc64le for reasons listed in -https://bugs.openjdk.java.net/browse/JDK-8073139 . - -This is a follow-up to commit 7a66dbe982623be620ad6ac426fe689a434e5f51. - -Change-Id: I685f76d51e9775788a7fb225c6a5e2309a45ceb7 ---- - config_host/config_java.h.in | 6 ++++++ - configure.ac | 3 +++ - jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx | 6 +++++- - 3 files changed, 14 insertions(+), 1 deletion(-) - create mode 100644 config_host/config_java.h.in - -diff --git a/config_host/config_java.h.in b/config_host/config_java.h.in -new file mode 100644 -index 0000000..8b23de9 ---- /dev/null -+++ b/config_host/config_java.h.in -@@ -0,0 +1,6 @@ -+#ifndef CONFIG_JAVA_H -+#define CONFIG_JAVA_H -+ -+#undef JAVA_ARCH -+ -+#endif -diff --git a/configure.ac b/configure.ac -index d8266b4..d764c33 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -7259,6 +7259,7 @@ then - ;; - powerpc64le) - AS_IF([test -d "$JAVA_HOME/jre/lib/ppc64le"], [my_java_arch=ppc64le], [my_java_arch=ppc64]) -+ JAVA_ARCH=$my_java_arch - ;; - x86_64) - my_java_arch=amd64 -@@ -7268,6 +7269,7 @@ then - ;; - esac - JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt" -+ AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])]) - fi - AC_MSG_RESULT([$JAWTLIB]) - fi -@@ -13042,6 +13044,7 @@ AC_CONFIG_HEADERS([config_host/config_folders.h]) - AC_CONFIG_HEADERS([config_host/config_gcc.h]) - AC_CONFIG_HEADERS([config_host/config_global.h]) - AC_CONFIG_HEADERS([config_host/config_graphite.h]) -+AC_CONFIG_HEADERS([config_host/config_java.h]) - AC_CONFIG_HEADERS([config_host/config_lgpl.h]) - AC_CONFIG_HEADERS([config_host/config_locales.h]) - AC_CONFIG_HEADERS([config_host/config_mpl.h]) -diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx -index 29f2641..ffc05c1 100644 ---- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx -+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx -@@ -20,6 +20,8 @@ - #ifndef INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_VENDORBASE_HXX - #define INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_VENDORBASE_HXX - -+#include "config_java.h" -+ - #include "rtl/ustring.hxx" - #include "rtl/ref.hxx" - #include "osl/endian.h" -@@ -31,7 +33,9 @@ namespace jfw_plugin - - - //Used by subclasses of VendorBase to build paths to Java runtime --#if defined(__sparcv9) -+#if defined(JAVA_ARCH) -+#define JFW_PLUGIN_ARCH JAVA_ARCH -+#elif defined(__sparcv9) - #define JFW_PLUGIN_ARCH "sparcv9" - #elif defined SPARC - #define JFW_PLUGIN_ARCH "sparc" --- -2.4.0 - diff --git a/SOURCES/0002-ppc64-using-a-fp-register-also-consumes-a-gp-registe.patch b/SOURCES/0002-ppc64-using-a-fp-register-also-consumes-a-gp-registe.patch deleted file mode 100644 index 720e65a..0000000 --- a/SOURCES/0002-ppc64-using-a-fp-register-also-consumes-a-gp-registe.patch +++ /dev/null @@ -1,165 +0,0 @@ -From f31326f623b0be2392b3846f710df75ea8760446 Mon Sep 17 00:00:00 2001 -From: Caolan McNamara -Date: Fri, 10 Jul 2015 16:36:41 +0100 -Subject: [PATCH 2/2] ppc64: using a fp register also consumes a gp register - slot -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Change-Id: Idf6f40081f4598c0fa9d1e10bdc208eae49e4cd1 -Reviewed-on: https://gerrit.libreoffice.org/16936 -Reviewed-by: Caolán McNamara -Tested-by: Caolán McNamara -(cherry picked from commit e8ac3b5bd973054c6fd74db017bb448721e2c3e2) -Reviewed-on: https://gerrit.libreoffice.org/16946 -Reviewed-by: David Tardon -Tested-by: David Tardon ---- - bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx | 6 ++++++ - bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx | 16 ++++++++++------ - testtools/com/sun/star/comp/bridge/TestComponent.java | 4 ++++ - testtools/source/bridgetest/bridgetest.cxx | 4 ++++ - testtools/source/bridgetest/cli/cli_cs_testobj.cs | 5 +++++ - testtools/source/bridgetest/cppobj.cxx | 2 ++ - testtools/source/bridgetest/idl/bridgetest.idl | 6 ++++++ - 7 files changed, 37 insertions(+), 6 deletions(-) - -diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx -index 6b58246..6ac003b 100644 ---- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx -+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx -@@ -133,6 +133,12 @@ static typelib_TypeClass cpp2uno_call( - } - pCppArgs[nPos] = pUnoArgs[nPos] = fpreg++; - nf++; -+ -+ if (ng < ppc64::MAX_GPR_REGS) -+ { -+ ng++; -+ gpreg++; -+ } - } - else - { -diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -index 81d3d5c..28dfaf8 100644 ---- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx -@@ -229,16 +229,20 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, - - // The value in %xmm register is already prepared to be retrieved as a float, - // thus we treat float and double the same --#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverflow ) \ -- if ( nr < ppc64::MAX_SSE_REGS ) \ -+#define INSERT_FLOAT( pSV, nr, pFPR, nGPR, pDS, bOverflow ) \ -+ if ( nGPR < ppc64::MAX_GPR_REGS ) \ -+ ++nGPR; \ -+ if ( nr < ppc64::MAX_SSE_REGS ) \ - pFPR[nr++] = *reinterpret_cast( pSV ); \ - else \ - bOverflow = true; \ - if (bOverflow) \ - *pDS++ = *reinterpret_cast( pSV ); // verbatim! - --#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, bOverflow ) \ -- if ( nr < ppc64::MAX_SSE_REGS ) \ -+#define INSERT_DOUBLE( pSV, nr, pFPR, nGPR, pDS, bOverflow ) \ -+ if ( nGPR < ppc64::MAX_GPR_REGS ) \ -+ ++nGPR; \ -+ if ( nr < ppc64::MAX_SSE_REGS ) \ - pFPR[nr++] = *reinterpret_cast( pSV ); \ - else \ - bOverflow = true; \ -@@ -390,10 +394,10 @@ static void cpp_call( - INSERT_INT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverflow ); - break; - case typelib_TypeClass_FLOAT: -- INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, pStack, bOverflow ); -+ INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverflow ); - break; - case typelib_TypeClass_DOUBLE: -- INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, pStack, bOverflow ); -+ INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverflow ); - break; - default: - break; -diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java -index bf1524d..8e07d1a 100644 ---- a/testtools/com/sun/star/comp/bridge/TestComponent.java -+++ b/testtools/com/sun/star/comp/bridge/TestComponent.java -@@ -498,6 +498,10 @@ public class TestComponent { - return i2; - } - -+ public int testPPC64Alignment( double d1, double d2, double d3, int i1 ) throws com.sun.star.uno.RuntimeException { -+ return i1; -+ } -+ - public double testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 ) { - return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10; - } -diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx -index ea37b9a..427513f 100644 ---- a/testtools/source/bridgetest/bridgetest.cxx -+++ b/testtools/source/bridgetest/bridgetest.cxx -@@ -529,6 +529,10 @@ static bool performTest( - bRet &= check(i2 == 0xBEAF, "ppc-style alignment test"); - } - { -+ sal_Int32 i1 = xLBT->testPPC64Alignment(1.0, 2.0, 3.0, 0xBEAF); -+ bRet &= check(i1 == 0xBEAF, "ppc64-style alignment test"); -+ } -+ { - double d1 = xLBT->testTenDoubles(0.1, 0.2, 0.3, 0.4, 0.5, - 0.6, 0.7, 0.8, 0.9, 1.0); - bRet &= check(d1 == 5.5, "armhf doubles test"); -diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs -index 9d0ac7a..8f396c9 100644 ---- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs -+++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs -@@ -255,6 +255,11 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2 - return i2; - } - -+ public int testPPC64Alignment( double d1, double d2, double d3, int i1 ) -+ { -+ return i1; -+ } -+ - public double testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 ) - { - return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10; -diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx -index a468d90..30f85f0 100644 ---- a/testtools/source/bridgetest/cppobj.cxx -+++ b/testtools/source/bridgetest/cppobj.cxx -@@ -220,6 +220,8 @@ public: - { return rStruct; } - virtual sal_Int32 SAL_CALL testPPCAlignment( sal_Int64, sal_Int64, sal_Int32, sal_Int64, sal_Int32 i2 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE - { return i2; } -+ virtual sal_Int32 SAL_CALL testPPC64Alignment( double , double , double , sal_Int32 i1 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE -+ { return i1; } - virtual double SAL_CALL testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE - { return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10; } - virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE -diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl -index a11ba28..22612b8 100644 ---- a/testtools/source/bridgetest/idl/bridgetest.idl -+++ b/testtools/source/bridgetest/idl/bridgetest.idl -@@ -307,6 +307,12 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface - long testPPCAlignment( [in] hyper l1, [in] hyper l2, [in] long i1, [in] hyper l3, [in] long i2 ); - - /** -+ * PPC64 Alignment test -+ */ -+ long testPPC64Alignment( [in] double d1, [in] double d2, [in] double d3, [in] long i1 ); -+ -+ -+ /** - * VFP ABI (armhf) doubles test - */ - double testTenDoubles( [in] double d1, [in] double d2, [in] double d3, [in] double d4, [in] double d5, [in] double d6, [in] double d7, [in] double d8, [in] double d9, [in] double d10 ); --- -2.1.0 - diff --git a/SOURCES/0002-propagate-user-set-CFLAGS-to-build.patch b/SOURCES/0002-propagate-user-set-CFLAGS-to-build.patch deleted file mode 100644 index 92840ab..0000000 --- a/SOURCES/0002-propagate-user-set-CFLAGS-to-build.patch +++ /dev/null @@ -1,54 +0,0 @@ -From d156d513869d1e0634e981c85860c3a08b18d093 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Thu, 5 Feb 2015 15:46:58 +0100 -Subject: [PATCH 2/2] propagate user-set CFLAGS to build - -Change-Id: I9d72270ddd8698b776b80d4cca0a23f2ebda066a ---- - external/redland/ExternalProject_raptor.mk | 2 +- - external/redland/ExternalProject_rasqal.mk | 2 +- - external/redland/ExternalProject_redland.mk | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/external/redland/ExternalProject_raptor.mk b/external/redland/ExternalProject_raptor.mk -index 70d6fe7..8f2a6d5 100644 ---- a/external/redland/ExternalProject_raptor.mk -+++ b/external/redland/ExternalProject_raptor.mk -@@ -35,7 +35,7 @@ else - $(call gb_ExternalProject_get_state_target,raptor,build): - $(call gb_ExternalProject_run,build,\ - $(if $(filter IOS,$(OS)),LIBS="-liconv") \ -- CFLAGS="$(if $(debug),-g,-O) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) \ -+ CFLAGS="$(CFLAGS) $(if $(debug),-g,-O) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) \ - $(if $(filter GCCLINUXPOWERPC64,$(COM)$(OS)$(CPUNAME)),-mminimal-toc)" \ - LDFLAGS=" \ - $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib") \ -diff --git a/external/redland/ExternalProject_rasqal.mk b/external/redland/ExternalProject_rasqal.mk -index 6b695de..1f373ce 100644 ---- a/external/redland/ExternalProject_rasqal.mk -+++ b/external/redland/ExternalProject_rasqal.mk -@@ -41,7 +41,7 @@ $(call gb_ExternalProject_get_state_target,rasqal,build): - else - $(call gb_ExternalProject_get_state_target,rasqal,build): - $(call gb_ExternalProject_run,build,\ -- CFLAGS="$(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden)" \ -+ CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden)" \ - LDFLAGS=" \ - $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib") \ - $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \ -diff --git a/external/redland/ExternalProject_redland.mk b/external/redland/ExternalProject_redland.mk -index 9b96c9c..872384b 100644 ---- a/external/redland/ExternalProject_redland.mk -+++ b/external/redland/ExternalProject_redland.mk -@@ -44,7 +44,7 @@ $(call gb_ExternalProject_get_state_target,redland,build): - else - $(call gb_ExternalProject_get_state_target,redland,build): - $(call gb_ExternalProject_run,build,\ -- CFLAGS="$(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden)" \ -+ CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden)" \ - LDFLAGS=" \ - $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib") \ - $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \ --- -2.1.0 - diff --git a/SOURCES/0002-remove-newly-unused-WB_NEEDSFOCUS-and-fragile-FLOAT_.patch b/SOURCES/0002-remove-newly-unused-WB_NEEDSFOCUS-and-fragile-FLOAT_.patch new file mode 100644 index 0000000..3341e46 --- /dev/null +++ b/SOURCES/0002-remove-newly-unused-WB_NEEDSFOCUS-and-fragile-FLOAT_.patch @@ -0,0 +1,178 @@ +From b9431532ba696a39e7d35597f4083ea356b63eb3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 16 Dec 2015 21:30:22 +0000 +Subject: [PATCH] remove newly unused WB_NEEDSFOCUS and fragile FLOAT_FOCUSABLE +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: Idce03318fbc01039a6c0638879785607970993c0 +Reviewed-on: https://gerrit.libreoffice.org/20746 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + include/tools/wintypes.hxx | 1 - + vcl/inc/salframe.hxx | 2 - + vcl/inc/unx/gtk/gtkframe.hxx | 3 +- + vcl/osx/salframeview.mm | 1807 ----------------------------------------- + vcl/source/window/brdwin.cxx | 2 +- + vcl/source/window/window.cxx | 4 +- + vcl/unx/gtk/gtksalframe.cxx | 11 +- + vcl/unx/gtk3/gtk3gtkframe.cxx | 9 +- + 8 files changed, 8 insertions(+), 1831 deletions(-) + delete mode 100644 vcl/osx/salframeview.mm + +diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx +index 897e635..3943cc4 100644 +--- a/include/tools/wintypes.hxx ++++ b/include/tools/wintypes.hxx +@@ -180,7 +180,6 @@ WinBits const WB_NOSHADOW = SAL_CONST_INT64(0x400000000); + WinBits const WB_TOOLTIPWIN = SAL_CONST_INT64(0x800000000); + WinBits const WB_OWNERDRAWDECORATION = SAL_CONST_INT64(0x2000000000); + WinBits const WB_DEFAULTWIN = SAL_CONST_INT64(0x4000000000); +-WinBits const WB_NEEDSFOCUS = SAL_CONST_INT64(0x1000000000); + WinBits const WB_POPUP = SAL_CONST_INT64(0x20000000); + + WinBits const WB_HSCROLL = WB_HORZ; +diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx +index 9b3d52e..1016d3c 100644 +--- a/vcl/inc/salframe.hxx ++++ b/vcl/inc/salframe.hxx +@@ -76,8 +76,6 @@ struct SystemEnvData; + #define SAL_FRAME_STYLE_SYSTEMCHILD ((sal_uLong)0x08000000) + // floating window + #define SAL_FRAME_STYLE_FLOAT ((sal_uLong)0x20000000) +-// floating window that needs to be focusable +-#define SAL_FRAME_STYLE_FLOAT_FOCUSABLE ((sal_uLong)0x04000000) + // toolwindows should be painted with a smaller decoration + #define SAL_FRAME_STYLE_TOOLWINDOW ((sal_uLong)0x40000000) + // the window containing the intro bitmap, aka splashscreen +diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx +index a55ff2c..479a41b 100644 +--- a/vcl/inc/unx/gtk/gtkframe.hxx ++++ b/vcl/inc/unx/gtk/gtkframe.hxx +@@ -292,8 +292,7 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider + return + (m_nStyle & SAL_FRAME_STYLE_FLOAT) && // only a float can be floatgrab + !(m_nStyle & SAL_FRAME_STYLE_TOOLTIP) && // tool tips are not +- !(m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && // toolbars are also not +- !(m_nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE); // focusable floats are not ++ !(m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION); // toolbars are also not + } + + bool isChild( bool bPlug = true, bool bSysChild = true ) +diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx +index f57ab37..0e354bd 100644 +--- a/vcl/source/window/brdwin.cxx ++++ b/vcl/source/window/brdwin.cxx +@@ -1750,7 +1750,7 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, + { + // remove all unwanted WindowBits + WinBits nOrgStyle = nStyle; +- WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_NEEDSFOCUS | WB_POPUP); ++ WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_POPUP); + if ( nTypeStyle & BORDERWINDOW_STYLE_APP ) + nTestStyle |= WB_APP; + nStyle &= nTestStyle; +diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx +index 808d683..87b8e93 100644 +--- a/vcl/source/window/window.cxx ++++ b/vcl/source/window/window.cxx +@@ -911,7 +911,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p + nBorderTypeStyle |= BORDERWINDOW_STYLE_FRAME; + nStyle |= WB_BORDER; + } +- VclPtrInstance pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_NEEDSFOCUS), nBorderTypeStyle ); ++ VclPtrInstance pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL), nBorderTypeStyle ); + ((vcl::Window*)pBorderWin)->mpWindowImpl->mpClientWindow = this; + pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); + mpWindowImpl->mpBorderWindow = pBorderWin; +@@ -966,8 +966,6 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p + nFrameStyle = SAL_FRAME_STYLE_FLOAT; + if( nStyle & WB_OWNERDRAWDECORATION ) + nFrameStyle |= (SAL_FRAME_STYLE_OWNERDRAWDECORATION | SAL_FRAME_STYLE_NOSHADOW); +- if( nStyle & WB_NEEDSFOCUS ) +- nFrameStyle |= SAL_FRAME_STYLE_FLOAT_FOCUSABLE; + } + else if( mpWindowImpl->mbFloatWin ) + nFrameStyle |= SAL_FRAME_STYLE_TOOLWINDOW; +diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx +index 03f25dd..bd9662c 100644 +--- a/vcl/unx/gtk/gtksalframe.cxx ++++ b/vcl/unx/gtk/gtksalframe.cxx +@@ -1373,8 +1373,7 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + m_nStyle = nStyle; + + GtkWindowType eWinType = ( (nStyle & SAL_FRAME_STYLE_FLOAT) && +- ! (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION| +- SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) ++ ! (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) + ) + ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL; + +@@ -1419,7 +1418,7 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + bool bDecoHandling = + ! isChild() && + ( ! (nStyle & SAL_FRAME_STYLE_FLOAT) || +- (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) ); ++ (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION ) ); + + if( bDecoHandling ) + { +@@ -1441,10 +1440,6 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; + lcl_set_accept_focus( GTK_WINDOW(m_pWindow), false, true ); + } +- else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) +- { +- eType = GDK_WINDOW_TYPE_HINT_UTILITY; +- } + #if !GTK_CHECK_VERSION(3,0,0) + if( (nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ) + && getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) +@@ -2770,7 +2765,7 @@ void GtkSalFrame::ToTop( sal_uInt16 nFlags ) + * to our window - which it of course won't since our input hint + * is set to false. + */ +- if( (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) ) ++ if (m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) + { + // sad but true: this can cause an XError, we need to catch that + // to do this we need to synchronize with the XServer +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index d41be9d..4ac3da7 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -1121,8 +1121,7 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + m_nStyle = nStyle; + + GtkWindowType eWinType = ( (nStyle & SAL_FRAME_STYLE_FLOAT) && +- ! (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION| +- SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) ++ ! (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) + ) + ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL; + +@@ -1167,7 +1166,7 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + bool bDecoHandling = + ! isChild() && + ( ! (nStyle & SAL_FRAME_STYLE_FLOAT) || +- (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) ); ++ (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION ) ); + + if( bDecoHandling ) + { +@@ -1190,10 +1189,6 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) + gtk_window_set_accept_focus(GTK_WINDOW(m_pWindow), false); + gtk_window_set_decorated(GTK_WINDOW(m_pWindow), false); + } +- else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) +- { +- eType = GDK_WINDOW_TYPE_HINT_UTILITY; +- } + gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType ); + gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC ); + } +-- +2.5.0 + diff --git a/SOURCES/0002-sw-fix-crash-on-SwUndoDelete-after-select-all-with-t.patch b/SOURCES/0002-sw-fix-crash-on-SwUndoDelete-after-select-all-with-t.patch deleted file mode 100644 index 7b20ce6..0000000 --- a/SOURCES/0002-sw-fix-crash-on-SwUndoDelete-after-select-all-with-t.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 647ce83f41e7cda6ef8171c575c6c1ec5245b43f Mon Sep 17 00:00:00 2001 -From: Michael Stahl -Date: Thu, 2 Apr 2015 23:33:41 +0200 -Subject: [PATCH 2/4] sw: fix crash on SwUndoDelete after select-all with table - at start -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Somehow the Redo leaves the shell cursor at an invalid offset into the -paragraph, which then leads to out-of-bounds string access. - -Noticed that SwUndRng::SetPaM() leaves an invalid nContent.m_nIndex on -the start position, due to a surprising omission in SwIndex::ChgValue(). - -(regression from 555ff26501d1bbd8a7872c20671c6303db1e1701) - -Change-Id: I6e6ad7f70835d7e9d6da1fb680e2ae15469fad71 -(cherry picked from commit b24a15a0aaea310806259eaa20a7d509ce30e5c8) -Reviewed-on: https://gerrit.libreoffice.org/15128 -Reviewed-by: Caolán McNamara -Tested-by: Caolán McNamara -(cherry picked from commit add86b9d5fcf3cb52549e64be148ba9e7bb4005e) ---- - sw/source/core/bastyp/index.cxx | 1 + - sw/source/core/edit/eddel.cxx | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx -index 81da0bb..88eb691 100644 ---- a/sw/source/core/bastyp/index.cxx -+++ b/sw/source/core/bastyp/index.cxx -@@ -80,6 +80,7 @@ SwIndex& SwIndex::ChgValue( const SwIndex& rIdx, sal_Int32 nNewValue ) - assert(m_pIndexReg == rIdx.m_pIndexReg); - if (!m_pIndexReg) - { -+ m_nIndex = 0; - return *this; // no IndexReg => no list to sort into; m_nIndex is 0 - } - SwIndex* pFnd = const_cast(&rIdx); -diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx -index fad1eaf..9e2c7b2 100644 ---- a/sw/source/core/edit/eddel.cxx -+++ b/sw/source/core/edit/eddel.cxx -@@ -98,6 +98,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo ) - // Selection starts at the first para of the first cell, but we - // want to delete the table node before the first cell as well. - pNewPam->Start()->nNode = pNewPam->Start()->nNode.GetNode().FindTableNode()->GetIndex(); -+ pNewPam->Start()->nContent.Assign(nullptr, 0); - pPam = pNewPam.get(); - } - // delete everything --- -2.1.0 - diff --git a/SOURCES/0003-Resolves-rhbz-1240591-gtk3-store-clipboard-when-Libr.patch b/SOURCES/0003-Resolves-rhbz-1240591-gtk3-store-clipboard-when-Libr.patch new file mode 100644 index 0000000..9bedd4c --- /dev/null +++ b/SOURCES/0003-Resolves-rhbz-1240591-gtk3-store-clipboard-when-Libr.patch @@ -0,0 +1,100 @@ +From 3f20d5f3b46160c2a5e425bfd50b2e0319cda021 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 21 Jan 2016 11:28:50 +0000 +Subject: [PATCH] Resolves: rhbz#1240591 gtk3: store clipboard when LibreOffice + is closed + +now contents copied to clipboard persist after LibreOffice exits + +Change-Id: I4433543944fb9664f87ade43da1198dcdd4e2a7c +(cherry picked from commit f1358edf469e70df1fb044bb58cd888fea15173c) +--- + vcl/unx/gtk3/gtk3gtkinst.cxx | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx +index f727462..8654b45 100644 +--- a/vcl/unx/gtk3/gtk3gtkinst.cxx ++++ b/vcl/unx/gtk3/gtk3gtkinst.cxx +@@ -13,12 +13,12 @@ + #include "com/sun/star/lang/XServiceInfo.hpp" + #include "com/sun/star/lang/XSingleServiceFactory.hpp" + #include "com/sun/star/lang/XInitialization.hpp" +-#include "com/sun/star/lang/DisposedException.hpp" + #include "com/sun/star/datatransfer/XTransferable.hpp" + #include "com/sun/star/datatransfer/clipboard/XClipboard.hpp" + #include "com/sun/star/datatransfer/clipboard/XClipboardEx.hpp" + #include "com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp" + #include "com/sun/star/datatransfer/clipboard/XClipboardListener.hpp" ++#include "com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp" + #include "com/sun/star/datatransfer/clipboard/XSystemClipboard.hpp" + #include "com/sun/star/datatransfer/dnd/XDragSource.hpp" + #include "com/sun/star/datatransfer/dnd/XDropTarget.hpp" +@@ -275,6 +275,7 @@ static void clipboard_owner_init(ClipboardOwner *) + class VclGtkClipboard : + public cppu::WeakComponentImplHelper< + datatransfer::clipboard::XSystemClipboard, ++ datatransfer::clipboard::XFlushableClipboard, + XServiceInfo> + { + GdkAtom m_nSelection; +@@ -326,6 +327,12 @@ public: + throw(RuntimeException, std::exception) SAL_OVERRIDE; + + /* ++ * XFlushableClipboard ++ */ ++ virtual void SAL_CALL flushClipboard() ++ throw(RuntimeException, std::exception) override; ++ ++ /* + * XClipboardNotifier + */ + virtual void SAL_CALL addClipboardListener( +@@ -503,7 +510,8 @@ namespace + } + + VclGtkClipboard::VclGtkClipboard(GdkAtom nSelection) +- : cppu::WeakComponentImplHelper ++ : cppu::WeakComponentImplHelper + (m_aMutex) + , m_nSelection(nSelection) + { +@@ -514,6 +522,16 @@ VclGtkClipboard::VclGtkClipboard(GdkAtom nSelection) + m_pOwner->m_pThis = this; + } + ++void VclGtkClipboard::flushClipboard() ++ throw (RuntimeException, std::exception) ++{ ++ if (GDK_SELECTION_CLIPBOARD != m_nSelection) ++ return; ++ ++ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); ++ gtk_clipboard_store(clipboard); ++} ++ + VclGtkClipboard::~VclGtkClipboard() + { + GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); +@@ -525,7 +543,7 @@ VclGtkClipboard::~VclGtkClipboard() + void VclGtkClipboard::setContents( + const Reference< css::datatransfer::XTransferable >& xTrans, + const Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ) +- throw( RuntimeException, std::exception ) ++ throw(RuntimeException, std::exception) + { + osl::ClearableMutexGuard aGuard( m_aMutex ); + Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner ); +@@ -585,6 +603,7 @@ void VclGtkClipboard::setContents( + //if we have gained or lost ownership of the clipboard + gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(), + ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner)); ++ gtk_clipboard_set_can_store(clipboard, aGtkTargets.data(), aGtkTargets.size()); + } + m_aGtkTargets = aGtkTargets; + } +-- +2.5.0 + diff --git a/SOURCES/0003-gtk3-wayland-start-floating-windows-hidden.patch b/SOURCES/0003-gtk3-wayland-start-floating-windows-hidden.patch new file mode 100644 index 0000000..94af791 --- /dev/null +++ b/SOURCES/0003-gtk3-wayland-start-floating-windows-hidden.patch @@ -0,0 +1,56 @@ +From dab2582f05979cd99a5937cb95a387cfed70bb8d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 16 Dec 2015 14:18:11 +0000 +Subject: [PATCH 3/3] gtk3+wayland: start floating windows hidden + +once they are visible we can't move them under wayland, so +start then hidden, move them and then show + +these floating windows are very delicate. + +Change-Id: Ia233c23f25cec453df79ef70cab6210dbdd280a0 +--- + sfx2/uiconfig/ui/floatingrecord.ui | 1 - + svx/uiconfig/ui/colorwindow.ui | 1 - + svx/uiconfig/ui/floatingundoredo.ui | 1 - + 3 files changed, 3 deletions(-) + +diff --git a/sfx2/uiconfig/ui/floatingrecord.ui b/sfx2/uiconfig/ui/floatingrecord.ui +index 653867a..9136b38 100644 +--- a/sfx2/uiconfig/ui/floatingrecord.ui ++++ b/sfx2/uiconfig/ui/floatingrecord.ui +@@ -3,7 +3,6 @@ + + + +- True + False + True + 6 +diff --git a/svx/uiconfig/ui/colorwindow.ui b/svx/uiconfig/ui/colorwindow.ui +index 71cda63..9482562 100644 +--- a/svx/uiconfig/ui/colorwindow.ui ++++ b/svx/uiconfig/ui/colorwindow.ui +@@ -17,7 +17,6 @@ + 1 + + +- True + False + True + True +diff --git a/svx/uiconfig/ui/floatingundoredo.ui b/svx/uiconfig/ui/floatingundoredo.ui +index 10491f8..66f30a6 100644 +--- a/svx/uiconfig/ui/floatingundoredo.ui ++++ b/svx/uiconfig/ui/floatingundoredo.ui +@@ -3,7 +3,6 @@ + + + +- True + False + True + True +-- +2.5.0 + diff --git a/SOURCES/0003-rhbz-1205072-sw-resource-mangement-SNAFU-caused-by-S.patch b/SOURCES/0003-rhbz-1205072-sw-resource-mangement-SNAFU-caused-by-S.patch deleted file mode 100644 index e7d6f6b..0000000 --- a/SOURCES/0003-rhbz-1205072-sw-resource-mangement-SNAFU-caused-by-S.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 2b23c9c3d39667a740b8dc83326875d84454ab93 Mon Sep 17 00:00:00 2001 -From: Michael Stahl -Date: Sat, 25 Apr 2015 21:25:00 +0200 -Subject: [PATCH 3/4] rhbz#1205072: sw: resource mangement SNAFU caused by - SwPaM copy ctor - -SwPaM copy ctor has the surprising habit of linking the new one into the -old one's Ring. If you copy a shell cursor, *this* epic fail happens: - -==948== Thread 6 SelectionManager: -==948== Invalid free() / delete / delete[] / realloc() -==948== at 0x4A07CE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) -==948== by 0x222F542B: SwPaM::operator delete(void*, unsigned long) (in /libreoffice-4-3/instdir/program/libswlo.so) -==948== by 0x2239E20E: SwPaM::~SwPaM() (pam.cxx:422) -==948== by 0x22368630: CheckRange(SwCursor*) (crsrsh.cxx:111) -==948== by 0x2236DECC: SwCrsrShell::UpdateCrsr(unsigned short, bool) (crsrsh.cxx:1397) -==948== by 0x22369113: SwCrsrShell::EndAction(bool) (crsrsh.cxx:290) -==948== by 0x2268971F: SwEditShell::EndAllAction() (edws.cxx:87) -==948== by 0x2262BEF3: SwBaseLink::DataChanged(rtl::OUString const&, com::sun::star::uno::Any const&) (swbaslnk.cxx:274) -==948== by 0x2262C78E: SwBaseLink::SwapIn(bool, bool) (swbaslnk.cxx:411) -==948== by 0x227102EC: SwGrfNode::SwapIn(bool) (ndgrf.cxx:539) -==948== by 0x227121BC: SwGrfNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndgrf.cxx:999) -==948== by 0x22610E4D: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1862) -==948== by 0x225B98E0: SwDoc::CopyWithFlyInFly(SwNodeRange const&, int, SwNodeIndex const&, SwPaM const*, bool, bool, bool) const (ndcopy.cxx:1336) -==948== by 0x224AC1FF: SwDoc::CopyLayoutFmt(SwFrmFmt const&, SwFmtAnchor const&, bool, bool) (doclay.cxx:446) -==948== by 0x2294D2D4: SwTxtFlyCnt::CopyFlyFmt(SwDoc*) (atrflyin.cxx:130) -==948== by 0x229A5B96: MakeTxtAttr(SwDoc&, SfxPoolItem&, int, int, CopyOrNew_t, SwTxtNode*) (thints.cxx:1060) -==948== by 0x229A64E6: SwTxtNode::InsertItem(SfxPoolItem&, int, int, unsigned short) (thints.cxx:1224) -==948== by 0x2298E536: SwTxtNode::CopyText(SwTxtNode*, SwIndex const&, SwIndex const&, int, bool) (ndtxt.cxx:1773) -==948== by 0x2298DC08: SwTxtNode::CopyText(SwTxtNode*, SwIndex const&, int, bool) (ndtxt.cxx:1555) -==948== by 0x225B4C9D: SwTxtNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndcopy.cxx:286) -==948== by 0x22610E4D: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1862) -==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) -==948== by 0x225B5D8D: SwTableNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndcopy.cxx:475) -==948== by 0x22610ACA: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1790) -==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) -==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) -==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) -==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) -==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) -==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) -==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) -==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) -==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) -==948== by 0x225B98E0: SwDoc::CopyWithFlyInFly(SwNodeRange const&, int, SwNodeIndex const&, SwPaM const*, bool, bool, bool) const (ndcopy.cxx:1336) -==948== by 0x225B8F15: SwDoc::CopyImpl(SwPaM&, SwPosition&, bool, bool, SwPaM*) const (ndcopy.cxx:1239) -==948== by 0x225B6EE0: SwDoc::CopyRange(SwPaM&, SwPosition&, bool) const (ndcopy.cxx:707) -==948== by 0x22667E69: SwEditShell::_CopySelToDoc(SwDoc*, SwNodeIndex*) (edglss.cxx:244) -==948== by 0x226C8400: SwFEShell::Copy(SwDoc*, rtl::OUString const*) (fecopy.cxx:214) -==948== by 0x22DBF72B: (anonymous namespace)::lclOverWriteDoc(SwWrtShell&, SwDoc&) (swdtflvr.cxx:373) -==948== by 0x22DBFBC6: SwTransferable::GetData(com::sun::star::datatransfer::DataFlavor const&, rtl::OUString const&) (swdtflvr.cxx:439) -==948== by 0x7CB36C7: TransferableHelper::getTransferData2(com::sun::star::datatransfer::DataFlavor const&, rtl::OUString const&) (transfer.cxx:332) -==948== by 0x7CB34B5: TransferableHelper::getTransferData(com::sun::star::datatransfer::DataFlavor const&) (transfer.cxx:306) -==948== by 0x17A7E949: x11::SelectionManager::convertData(com::sun::star::uno::Reference const&, unsigned long, unsigned long, int&, com::sun::star::uno::Sequence&) (X11_selection.cxx:655) -==948== by 0x17A823CA: x11::SelectionManager::sendData(x11::SelectionAdaptor*, unsigned long, unsigned long, unsigned long, unsigned long) (X11_selection.cxx:1503) -==948== by 0x17A82E03: x11::SelectionManager::handleSelectionRequest(XSelectionRequestEvent&) (X11_selection.cxx:1729) -==948== by 0x17A8A08A: x11::SelectionManager::handleXEvent(_XEvent&) (X11_selection.cxx:3574) -==948== Address 0x21e31a60 is on thread 6's stack -==948== in frame #40, created by SwEditShell::_CopySelToDoc(SwDoc*, SwNodeIndex*) (edglss.cxx:158) - -(regression from 49505336a629a75f4fb48bbe0c532b402e857ed4) - -(cherry picked from commit c55599fd0e7198773087c6433031f7119aaaca36) - -Conflicts: - sw/source/core/edit/edglss.cxx - -Reviewed-on: https://gerrit.libreoffice.org/15533 -Reviewed-by: Miklos Vajna -Tested-by: Miklos Vajna -(cherry picked from commit 8f570028b0871dbaaaa99722cca76c0d1179e06c) - -Conflicts: - sw/source/core/edit/edglss.cxx - -Change-Id: I3d0a288a83b4719dda7977b4898dea656ea67388 ---- - sw/source/core/edit/eddel.cxx | 2 +- - sw/source/core/edit/edglss.cxx | 5 ++++- - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx -index 9e2c7b2..c5ed1e9 100644 ---- a/sw/source/core/edit/eddel.cxx -+++ b/sw/source/core/edit/eddel.cxx -@@ -94,7 +94,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo ) - if (bSelectAll) - { - assert(dynamic_cast(&rPam)); // must be corrected pam -- pNewPam.reset(new SwPaM(rPam)); -+ pNewPam.reset(new SwPaM(*rPam.GetMark(), *rPam.GetPoint())); - // Selection starts at the first para of the first cell, but we - // want to delete the table node before the first cell as well. - pNewPam->Start()->nNode = pNewPam->Start()->nNode.GetNode().FindTableNode()->GetIndex(); -diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx -index 7a17737..084c221 100644 ---- a/sw/source/core/edit/edglss.cxx -+++ b/sw/source/core/edit/edglss.cxx -@@ -235,12 +235,15 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) - // Make a copy, so that in case we need to adjust the selection - // for the purpose of copying, our shell cursor is not touched. - // (Otherwise we would have to restore it.) -- SwPaM aPaM(*PCURCRSR); -+ SwPaM aPaM(*PCURCRSR->GetMark(), *PCURCRSR->GetPoint()); - if (bSelectAll) -+ { - // Selection starts at the first para of the first cell, - // but we want to copy the table and the start node before - // the first cell as well. - aPaM.Start()->nNode = aPaM.Start()->nNode.GetNode().FindTableNode()->GetIndex(); -+ aPaM.Start()->nContent.Assign(nullptr, 0); -+ } - bRet = GetDoc()->CopyRange( aPaM, aPos, false ) || bRet; - } - --- -2.1.0 - diff --git a/SOURCES/0003-ww8-make-sure-we-don-t-wrap-around.patch b/SOURCES/0003-ww8-make-sure-we-don-t-wrap-around.patch deleted file mode 100644 index 8e3daf5..0000000 --- a/SOURCES/0003-ww8-make-sure-we-don-t-wrap-around.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 96f39ec02da9f29f9087f3072a184b38c95813dd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 13 Jul 2015 10:31:30 +0100 -Subject: [PATCH 3/4] ww8: make sure we don't wrap around - -Change-Id: I667bb264f92024b72f230c2ddbba3887471345f2 -(cherry picked from commit 755b9320c81948358a1d4104c8875594b5700d39) -Reviewed-on: https://gerrit.libreoffice.org/16981 -Reviewed-by: David Tardon -Tested-by: David Tardon -(cherry picked from commit 9f0044e16a42930d447f63e6129e9979f5e186ec) ---- - sw/source/filter/ww8/ww8scan.cxx | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx -index fceb5c3..f9f88a3 100644 ---- a/sw/source/filter/ww8/ww8scan.cxx -+++ b/sw/source/filter/ww8/ww8scan.cxx -@@ -1540,7 +1540,11 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ) - if( 2 == clxt ) // PLCFfpcd ? - break; // PLCFfpcd gefunden - if( 1 == clxt ) // clxtGrpprl ? -+ { -+ if (nGrpprl == SHRT_MAX) -+ return NULL; - nGrpprl++; -+ } - sal_uInt16 nLen(0); - pStr->ReadUInt16( nLen ); - nLeft -= 2 + nLen; --- -2.5.0 - diff --git a/SOURCES/0004-convert-pStatus-to-vector-and-use-at-to-check-offset.patch b/SOURCES/0004-convert-pStatus-to-vector-and-use-at-to-check-offset.patch deleted file mode 100644 index 9d45f2b..0000000 --- a/SOURCES/0004-convert-pStatus-to-vector-and-use-at-to-check-offset.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 694cc3d7e392021c5e3d6ab4522a7b1d836fef48 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 13 Aug 2015 10:58:06 +0100 -Subject: [PATCH 4/4] convert pStatus to vector and use at to check offsets - -(cherry picked from commit ea70088895ed45dc60abf18319acc1b4fa3018dd) - -Change-Id: I5186f6a65bb9d5ed8a0d1ab1d71f7e2c13865411 -Reviewed-on: https://gerrit.libreoffice.org/17695 -Reviewed-by: David Tardon -Tested-by: David Tardon -(cherry picked from commit 92c3a5b80ac575e1c538894b7c1a4170093785b5) ---- - sw/source/filter/ww8/ww8scan.cxx | 18 +++++++++--------- - sw/source/filter/ww8/ww8scan.hxx | 4 ++-- - 2 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx -index f9f88a3..2d010e0 100644 ---- a/sw/source/filter/ww8/ww8scan.cxx -+++ b/sw/source/filter/ww8/ww8scan.cxx -@@ -3941,7 +3941,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen - } - - WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTblSt, const WW8Fib& rFib) -- : WW8PLCFx(rFib.GetFIBVersion(), false), pStatus(0), nIsEnd(0), nBookmarkId(1) -+ : WW8PLCFx(rFib.GetFIBVersion(), false), nIsEnd(0), nBookmarkId(1) - { - if( !rFib.fcPlcfbkf || !rFib.lcbPlcfbkf || !rFib.fcPlcfbkl || - !rFib.lcbPlcfbkl || !rFib.fcSttbfbkmk || !rFib.lcbSttbfbkmk ) -@@ -3966,14 +3966,12 @@ WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTblSt, const WW8Fib& rFib) - nIMax = pBook[0]->GetIMax(); - if( pBook[1]->GetIMax() < nIMax ) - nIMax = pBook[1]->GetIMax(); -- pStatus = new eBookStatus[ nIMax ]; -- memset( pStatus, 0, nIMax * sizeof( eBookStatus ) ); -+ aStatus.resize(nIMax); - } - } - - WW8PLCFx_Book::~WW8PLCFx_Book() - { -- delete[] pStatus; - delete pBook[1]; - delete pBook[0]; - } -@@ -4091,18 +4089,20 @@ long WW8PLCFx_Book::GetLen() const - return nNum; - } - --void WW8PLCFx_Book::SetStatus(sal_uInt16 nIndex, eBookStatus eStat ) -+void WW8PLCFx_Book::SetStatus(sal_uInt16 nIndex, eBookStatus eStat) - { -- OSL_ENSURE(nIndex < nIMax, "set status of non existing bookmark!"); -- pStatus[nIndex] = (eBookStatus)( pStatus[nIndex] | eStat ); -+ SAL_WARN_IF(nIndex >= nIMax, "sw.ww8", -+ "bookmark index " << nIndex << " invalid"); -+ eBookStatus eStatus = aStatus.at(nIndex); -+ aStatus[nIndex] = static_cast(eStatus | eStat); - } - - eBookStatus WW8PLCFx_Book::GetStatus() const - { -- if( !pStatus ) -+ if (aStatus.empty()) - return BOOK_NORMAL; - long nEndIdx = GetHandle(); -- return ( nEndIdx < nIMax ) ? pStatus[nEndIdx] : BOOK_NORMAL; -+ return ( nEndIdx < nIMax ) ? aStatus[nEndIdx] : BOOK_NORMAL; - } - - long WW8PLCFx_Book::GetHandle() const -diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx -index 1e6a43a..4d84961 100644 ---- a/sw/source/filter/ww8/ww8scan.hxx -+++ b/sw/source/filter/ww8/ww8scan.hxx -@@ -734,8 +734,8 @@ class WW8PLCFx_Book : public WW8PLCFx - { - private: - WW8PLCFspecial* pBook[2]; // Start and End Position -- ::std::vector aBookNames; // Name -- eBookStatus* pStatus; -+ std::vector aBookNames; // Name -+ std::vector aStatus; - long nIMax; // Number of Booknotes - sal_uInt16 nIsEnd; - sal_Int32 nBookmarkId; // counter incremented by GetUniqueBookmarkName. --- -2.5.0 - diff --git a/SOURCES/0004-sw-fix-SwAccessibleParagraph-crash-on-delete.patch b/SOURCES/0004-sw-fix-SwAccessibleParagraph-crash-on-delete.patch deleted file mode 100644 index 00f7f03..0000000 --- a/SOURCES/0004-sw-fix-SwAccessibleParagraph-crash-on-delete.patch +++ /dev/null @@ -1,52 +0,0 @@ -From db92a0c238d82a32fd915f05fc7efb6167e4ea91 Mon Sep 17 00:00:00 2001 -From: Michael Stahl -Date: Fri, 24 Apr 2015 23:31:06 +0200 -Subject: [PATCH 4/4] sw: fix SwAccessibleParagraph crash on delete - -It happens that SwAccessibleParagraph::getCharacterBounds() is called -from ATK with a clearly invalid pPortionData member; the SwTxtNode has -no text but there are portions. - -This is because after a deletion both a POS_CHANGED and a -INVALID_CONTENT event are created for the same SwAccessibleParagraph, -and they are merged into one POS_CHANGED event by -SwAccessibleMap::AppendEvent(), but -SwAccessibleContext::InvalidatePosOrSize() returns early if the -paragraph happens to not be visible, skipping the invalidation. - -(regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba, which - removed a Dispose() call; not sure if the Dispose() is needed here) - -Change-Id: I985e9a439ee6c7024963eace876186f2247b9e03 -(cherry picked from commit 104ed86c382b73505b477bf3024982dd27823023) -Reviewed-on: https://gerrit.libreoffice.org/15534 -Reviewed-by: Miklos Vajna -Tested-by: Miklos Vajna -(cherry picked from commit 84f10b5f154e130981de5826f83d63b5eadd33ac) ---- - sw/source/core/access/acccontext.cxx | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx -index 1e84758..7152006 100644 ---- a/sw/source/core/access/acccontext.cxx -+++ b/sw/source/core/access/acccontext.cxx -@@ -1166,12 +1166,9 @@ void SwAccessibleContext::InvalidatePosOrSize( const SwRect& ) - FireVisibleDataEvent(); - } - -- if( !bIsNewShowingState && -- SwAccessibleChild( GetParent() ).IsVisibleChildrenOnly() ) -- { -- return; -- } -- -+ // note: InvalidatePosOrSize must call _InvalidateContent so that -+ // SwAccessibleParagraph updates its portions, or dispose it -+ // (see accmap.cxx: INVALID_CONTENT is contained in POS_CHANGED) - _InvalidateContent( true ); - } - --- -2.1.0 - diff --git a/SOURCES/openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch b/SOURCES/openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch index 2186171..02368bd 100644 --- a/SOURCES/openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch +++ b/SOURCES/openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch @@ -1,20 +1,40 @@ -From 3b77bbe76b9f99d871074e8baa6e0845f4756442 Mon Sep 17 00:00:00 2001 +From 4ee0775161d44acc5089aeec2013d461fe592e23 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 3 Feb 2014 20:24:50 +0100 Subject: [PATCH] i#86080 unopkg bodge --- - desktop/scripts/unopkg.sh | 33 +++++++++++++++++++++++++++++++-- - 1 file changed, 31 insertions(+), 2 deletions(-) + desktop/scripts/unopkg.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh -index d16d226..aefc918 100755 +index ca1e3bc..6393e99 100755 --- a/desktop/scripts/unopkg.sh +++ b/desktop/scripts/unopkg.sh -@@ -53,6 +53,33 @@ AIX) - ;; - esac +@@ -78,6 +78,53 @@ if [ "$(id -u)" -eq "0" ]; then + fi + fi ++if [ $isnotuser -eq 1 ]; then ++ echo $@ | grep -q env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY ++ if [ $? -ne 0 ]; then ++ set -- $@ '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' ++ fi ++ echo $@ | grep -q env:UNO_JAVA_JFW_INSTALL_DATA ++ if [ $? -ne 0 -a -w $sd_prog/../share/config/javasettingsunopkginstall.xml ]; then ++ set -- $@ '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml' ++ fi ++ echo $@ | grep -q env:UserInstallation ++ if [ $? -ne 0 ]; then ++ INSTDIR=`/bin/mktemp -d --tmpdir unoinstall.XXXXXX` ++ if [ $? -ne 0 ]; then ++ echo "Could not create tmp dir" >&2 ++ exit 1 ++ fi ++ set -- $@ '-env:UserInstallation=file://'$INSTDIR ++ fi ++fi ++ +isnotuser=0 +for arg in $@ +do @@ -42,10 +62,10 @@ index d16d226..aefc918 100755 + fi +fi + - #collect all bootstrap variables specified on the command line - #so that they can be passed as arguments to javaldx later on - for arg in $@ -@@ -92,6 +119,8 @@ unset XENVIRONMENT + # extend the ld_library_path for java: javaldx checks the sofficerc for us + if [ -x "${sd_prog}/javaldx" ] ; then + my_path=`"${sd_prog}/javaldx" $BOOTSTRAPVARS \ +@@ -106,6 +153,8 @@ unset XENVIRONMENT # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS # execute binary @@ -57,5 +77,5 @@ index d16d226..aefc918 100755 + rm -rf $INSTDIR +fi -- -1.8.4.2 +2.4.2 diff --git a/SPECS/libreoffice.spec b/SPECS/libreoffice.spec index 530f30f..dcb3a27 100644 --- a/SPECS/libreoffice.spec +++ b/SPECS/libreoffice.spec @@ -1,5 +1,5 @@ # download path contains version without the last (fourth) digit -%define libo_version 4.3.7 +%define libo_version 5.0.6 # Should contain .alphaX / .betaX, if this is pre-release (actually # pre-RC) version. The pre-release string is part of tarball file names, # so we need a way to define it easily at one place. @@ -20,7 +20,6 @@ # rhbz#465664 jar-repacking breaks help by reordering META-INF/MANIFEST.MF %define __jar_repack %{nil} # make it easier to download sources from pre-release site -# http://dev-builds.libreoffice.org/pre-releases/src # %%define source_url http://dev-builds.libreoffice.org/pre-releases/src %define source_url http://download.documentfoundation.org/libreoffice/src/%{libo_version} # URL for external projects' tarballs @@ -53,7 +52,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.2 -Release: 5%{?libo_prerelease}%{?dist}.1 +Release: 3%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0 Group: Applications/Productivity URL: http://www.libreoffice.org/ @@ -67,56 +66,29 @@ Source5: %{external_url}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zi Source6: %{external_url}/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz Source7: %{external_url}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip Source8: %{external_url}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip - -%if 0%{?fedora} || 0%{?rhel} >= 7 #Unfortunately later versions of hsqldb changed the file format, so if we use a later version we loose #backwards compatability. Source9: %{external_url}/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip %global bundling_options %{?bundling_options} --without-system-hsqldb -%endif %if 0%{?rhel} Source10: %{external_url}/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz %global bundling_options %{?bundling_options} --without-system-ucpp -%if 0%{?rhel} < 7 -Source11: %{external_url}/594eb47b4b1210e25438d51825404d5a-glew-1.10.0.zip -Source12: %{external_url}/bae83fa5dc7f081768daace6e199adc3-glm-0.9.4.6-libreoffice.zip -Source13: %{external_url}/7681383be6ce489d84c1c74f4e7f9643-liborcus-0.7.0.tar.bz2 -%global bundling_options %{?bundling_options} --without-system-glew --without-system-glm --without-system-orcus -Source14: %{external_url}/cb4207cb913c7a5a8bfa5b91234618ee-mdds_0.11.2.tar.bz2 -Source15: %{external_url}/46e92b68e31e858512b680b3b61dc4c1-mythes-1.2.3.tar.gz -Source16: %{external_url}/32f8e1417a64d3c6f2c727f9053f55ea-redland-1.0.16.tar.gz -Source17: %{external_url}/4ceb9316488b0ea01acf011023cf7fff-raptor2-2.0.9.tar.gz -Source18: %{external_url}/b12c5f9cfdb6b04efce5a4a186b8416b-rasqal-0.9.30.tar.gz -Source19: %{external_url}/ae330b9493bd4503ac390106ff6060d7-libexttextcat-3.4.3.tar.bz2 -Source20: %{external_url}/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz -Source21: %{external_url}/lcms2-2.6.tar.gz -Source22: %{external_url}/36271d3fa0d9dec1632029b6d7aac925-liblangtag-0.5.1.tar.bz2 -Source23: %{external_url}/d6eef4b4cacb2183f2bf265a5a03a354-boost_1_55_0.tar.bz2 -Source24: %{external_url}/harfbuzz-0.9.23.tar.bz2 -Source25: %{external_url}/22f8a85daf4a012180322e1f52a7563b-libcmis-0.4.1.tar.gz -Source26: %{external_url}/language-subtag-registry-2014-12-03.tar.bz2 -%global bundling_options %{?bundling_options} --without-system-mdds --without-system-mythes --without-system-redland --without-system-libexttextcat --without-system-clucene --without-system-lcms2 --without-system-liblangtag --without-system-boost --without-system-harfbuzz --without-system-libcmis -Source27: %{external_url}/libcdr-0.1.0.tar.bz2 -Source28: %{external_url}/libwpg-0.3.0.tar.bz2 -Source29: %{external_url}/libwpd-0.10.0.tar.bz2 -Source30: %{external_url}/libwps-0.3.0.tar.bz2 -Source31: %{external_url}/libvisio-0.1.0.tar.bz2 -Source32: %{external_url}/libmspub-0.1.1.tar.bz2 -Source33: %{external_url}/libodfgen-0.1.1.tar.bz2 -Source34: %{external_url}/libmwaw-0.3.1.tar.bz2 -Source35: %{external_url}/libetonyek-0.1.1.tar.bz2 -Source36: %{external_url}/libfreehand-0.1.0.tar.bz2 -Source37: %{external_url}/libabw-0.1.0.tar.bz2 -Source38: %{external_url}/librevenge-0.0.1.tar.bz2 -%global bundling_options %{?bundling_options} --without-system-libcdr --without-system-libwpg --without-system-libwpd --without-system-libwps --without-system-libvisio --without-system-libmspub --without-system-libodfgen --without-system-libmwaw --without-system-libetonyek --without-system-libfreehand --without-system-libabw --without-system-librevenge -%endif %endif %if 0%{?fedora} -Source39: %{external_url}/4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2 +Source40: %{external_url}/4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2 %endif +# symbolic icons +Source42: https://raw.githubusercontent.com/gnome-design-team/gnome-icons/master/apps-symbolic/Adwaita/scalable/apps/libreoffice-base-symbolic.svg +Source43: https://raw.githubusercontent.com/gnome-design-team/gnome-icons/master/apps-symbolic/Adwaita/scalable/apps/libreoffice-calc-symbolic.svg +Source44: https://raw.githubusercontent.com/gnome-design-team/gnome-icons/master/apps-symbolic/Adwaita/scalable/apps/libreoffice-draw-symbolic.svg +Source45: https://raw.githubusercontent.com/gnome-design-team/gnome-icons/master/apps-symbolic/Adwaita/scalable/apps/libreoffice-impress-symbolic.svg +Source46: https://raw.githubusercontent.com/gnome-design-team/gnome-icons/master/apps-symbolic/Adwaita/scalable/apps/libreoffice-main-symbolic.svg +Source47: https://raw.githubusercontent.com/gnome-design-team/gnome-icons/master/apps-symbolic/Adwaita/scalable/apps/libreoffice-math-symbolic.svg +Source48: https://raw.githubusercontent.com/gnome-design-team/gnome-icons/master/apps-symbolic/Adwaita/scalable/apps/libreoffice-writer-symbolic.svg + # build tools BuildRequires: autoconf BuildRequires: automake @@ -139,128 +111,98 @@ BuildRequires: make BuildRequires: perl(Archive::Zip) BuildRequires: perl(Digest::MD5) %if 0%{?fedora} +BuildRequires: libappstream-glib BuildRequires: ucpp %endif BuildRequires: zip # libs / headers - common +BuildRequires: %{libo_python}-devel +BuildRequires: boost-devel BuildRequires: cups-devel BuildRequires: expat-devel BuildRequires: fontpackages-devel +BuildRequires: glm-devel BuildRequires: hyphen-devel BuildRequires: libicu-devel +BuildRequires: libjpeg-turbo-devel BuildRequires: lpsolve-devel BuildRequires: openldap-devel BuildRequires: pam-devel +BuildRequires: pkgconfig(bluez) BuildRequires: pkgconfig(cppunit) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(evolution-data-server-1.2) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gconf-2.0) +BuildRequires: pkgconfig(glew) >= 1.10.0 BuildRequires: pkgconfig(glu) +BuildRequires: pkgconfig(graphite2) +BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) BuildRequires: pkgconfig(gtk+-2.0) +BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(hunspell) BuildRequires: pkgconfig(ice) +BuildRequires: pkgconfig(lcms2) +BuildRequires: pkgconfig(libabw-0.1) +BuildRequires: pkgconfig(libcdr-0.1) +BuildRequires: pkgconfig(libclucene-core) +BuildRequires: pkgconfig(libcmis-0.5) BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(libetonyek-0.1) +BuildRequires: pkgconfig(libexttextcat) +BuildRequires: pkgconfig(libfreehand-0.1) BuildRequires: pkgconfig(libidn) +BuildRequires: pkgconfig(liblangtag) +BuildRequires: pkgconfig(libmspub-0.1) +BuildRequires: pkgconfig(libmwaw-0.3) +BuildRequires: pkgconfig(libodfgen-0.1) +BuildRequires: pkgconfig(liborcus-0.8) +BuildRequires: pkgconfig(libpagemaker-0.0) +BuildRequires: pkgconfig(librevenge-0.0) +BuildRequires: pkgconfig(libvisio-0.1) +BuildRequires: pkgconfig(libwpd-0.10) +BuildRequires: pkgconfig(libwpg-0.3) +BuildRequires: pkgconfig(libwps-0.3) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libxslt) +BuildRequires: pkgconfig(mdds) >= 0.12.0 +BuildRequires: pkgconfig(mythes) BuildRequires: pkgconfig(neon) BuildRequires: pkgconfig(nss) BuildRequires: pkgconfig(poppler) +BuildRequires: pkgconfig(poppler-cpp) BuildRequires: pkgconfig(redland) BuildRequires: pkgconfig(sane-backends) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xinerama) BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(zlib) +BuildRequires: postgresql-devel BuildRequires: unixODBC-devel BuildRequires: vigra-devel + # libs / headers - conditional %if 0%{?fedora} BuildRequires: firebird-devel -BuildRequires: firebird-libfbembed BuildRequires: kdelibs4-devel BuildRequires: openCOLLADA-devel +BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(libe-book-0.1) BuildRequires: pkgconfig(libeot) BuildRequires: pkgconfig(libgltf-0.0) %endif -%if 0%{?fedora} || 0%{?rhel} >= 7 -BuildRequires: boost-devel -BuildRequires: glm-devel -BuildRequires: pkgconfig(glew) >= 1.10.0 -BuildRequires: pkgconfig(graphite2) -BuildRequires: pkgconfig(harfbuzz) -BuildRequires: pkgconfig(lcms2) -BuildRequires: pkgconfig(libabw-0.1) -BuildRequires: pkgconfig(libcdr-0.1) -BuildRequires: pkgconfig(libcmis-0.4) -BuildRequires: pkgconfig(libclucene-core) -BuildRequires: pkgconfig(libetonyek-0.1) -BuildRequires: pkgconfig(libexttextcat) -BuildRequires: pkgconfig(libfreehand-0.1) -BuildRequires: pkgconfig(liblangtag) -BuildRequires: pkgconfig(libmspub-0.1) -BuildRequires: pkgconfig(libmwaw-0.3) -BuildRequires: pkgconfig(libodfgen-0.1) -BuildRequires: pkgconfig(liborcus-0.8) -BuildRequires: pkgconfig(librevenge-0.0) -BuildRequires: pkgconfig(libvisio-0.1) -BuildRequires: pkgconfig(libwpd-0.10) -BuildRequires: pkgconfig(libwpg-0.3) -BuildRequires: pkgconfig(libwps-0.3) -BuildRequires: pkgconfig(mdds) -BuildRequires: pkgconfig(mythes) -BuildRequires: pkgconfig(poppler-cpp) -BuildRequires: postgresql-devel -%endif - -# libs / headers - special cases -%if 0%{?rhel} && 0%{?rhel} < 7 -BuildRequires: gstreamer-devel -BuildRequires: gstreamer-plugins-base-devel -%else -BuildRequires: pkgconfig(gstreamer-1.0) -BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) -%endif - -%if 0%{?fedora} || 0%{?rhel} >= 7 -BuildRequires: libjpeg-turbo-devel -%else -BuildRequires: libjpeg-devel -%endif - -%if 0%{?fedora} || 0%{?rhel} >= 7 -BuildRequires: pkgconfig(bluez) -%else -%ifnarch s390 s390x -BuildRequires: pkgconfig(bluez) -%endif -%endif - -BuildRequires: %{libo_python}-devel - # java stuff BuildRequires: ant -%if 0%{?rhel} && 0%{?rhel} < 7 -BuildRequires: jakarta-commons-codec -BuildRequires: jakarta-commons-lang -%else BuildRequires: apache-commons-codec BuildRequires: apache-commons-lang -%endif BuildRequires: bsh -%if 0%{?rhel} && 0%{?rhel} < 7 -BuildRequires: hsqldb -%endif BuildRequires: java-devel BuildRequires: jakarta-commons-httpclient -%if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: junit -%endif BuildRequires: pentaho-reporting-flow-engine # fonts needed for unit tests @@ -282,109 +224,99 @@ Patch0: openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch Patch1: openoffice.org-3.1.0.oooXXXXX.solenv.allowmissing.patch # not upstreamed Patch2: libreoffice-installfix.patch -%if 0%{?rhel} -# not upstreamed -Patch3: 0001-disable-failing-test-on-rhel.patch -%if 0%{?rhel} < 7 # not upstreamed -Patch4: libreoffice-rhel6gcj.patch +Patch3: 0001-Resolves-rhbz-1035092-no-shortcut-key-for-Italian-To.patch # not upstreamed -Patch5: libreoffice-rhel6poppler.patch +Patch4: 0001-disable-firebird-unit-test.patch # not upstreamed -Patch6: libreoffice-rhel6langs.patch +Patch5: 0001-never-run-autogen.sh.patch # not upstreamed -Patch7: libreoffice-rhel6glib.patch +Patch6: 0001-add-X-TryExec-entries-to-desktop-files.patch # not upstreamed -Patch8: 0001-disable-failing-test-on-rhel-6.patch -%endif +Patch7: 0001-disable-PSD-import-test-which-deadlocks-on-ARM.patch +# upstreamed +Patch8: 0001-Resolves-tdf-89905-don-t-copy-palettes-from-shared-t.patch +Patch9: 0001-Resolves-tdf-49407-enable-CaseMap-property-in-impres.patch +Patch10: 0001-rhbz-1233420-handle-inexistent-cond.-format.patch +Patch11: 0001-allow-slide-design-to-affect-multiple-standard-pages.patch +Patch12: 0001-implement-equalize-width-and-height-for-impress-draw.patch +Patch13: 0001-f22-openjdk-for-ppc64le-has-both-these-dirs-but-jawt.patch +Patch14: 0001-implement-undo-for-equalize-marked-objects.patch +Patch15: 0001-time-stamp-object-selections-and-use-newest-as-ref-f.patch +Patch16: 0001-Resolves-rhbz-1256843-no-obvious-means-to-close-temp.patch +Patch17: 0001-implement-undo-of-delete-impress-cell-contents.patch +Patch18: 0001-Fix-export-of-tdf-93675-to-.docx-as-much-as-is-possi.patch +Patch19: 0001-default-to-as-character-caption-contents.patch +Patch20: 0001-Related-tdf-93676-msword-wraps-slightly-differently-.patch +Patch21: 0002-Related-tdf-93676-msword-wraps-slightly-differently-.patch +Patch22: 0001-implement-save-slide-background-for-impress.patch +Patch23: 0001-Related-tdf-72880-presumably-using-startcenter-as-ge.patch +Patch24: 0001-implement-dialog-control-over-enhanced-shape-control.patch +Patch25: 0001-tdf-95210-SetHandleControllerPosition-is-busted-wrt-.patch +Patch26: 0001-Resolves-tdf-95682-spell-dialog-add-a-button-to-open.patch +Patch27: 0001-backport-5-1-idle-timers-loop-to-5-0.patch +Patch28: 0001-gtk3-implement-SAL_INVERT_50-rectangle-case.patch +Patch29: 0001-Resolves-tdf-95962-incorrect-scanline-stride.patch +Patch30: 0001-Related-rhbz-1281906-wayland-toolbar-drawn-over-menu.patch +Patch31: 0001-Resolves-rhbz-1285380-get-menus-working-under-waylan.patch +Patch32: 0001-gtk3-wayland-wrong-dialog-sizes.patch +Patch33: 0001-Resolves-rhbz-1289398-unable-to-use-scroll-wheel-und.patch +Patch34: 0001-valgrind-scary-warning-that-the-cairo-font-options-w.patch +Patch35: 0001-gtk3-gtk_gesture_get_point-may-return-false.patch +Patch36: 0001-move-things-around-a-little-to-make-backporting-easi.patch +Patch37: 0001-Resolves-tdf-96285-restore-bodge-for-unresizable-win.patch +Patch38: 0001-gtk3-wayland-dialogs-work-a-lot-better-if-a-min-size.patch +Patch39: 0001-Related-rhbz-1290014-gtk3-use-gtk_window_set_modal-o.patch +Patch40: 0001-Resolves-rhbz-1289394-gtk3-implement-tooltips-native.patch +Patch41: 0001-rhbz-1283420-cairo-text-xrender-bodge.patch +Patch42: 0001-Resolves-rhbz-1287581-explicitly-state-we-don-t-want.patch +Patch43: 0001-gtk3-wayland-enable-manual-movement-of-toolbars.patch +Patch44: 0001-gtk3-stop-the-ever-shrinking-size-of-toplevel-on-eve.patch +Patch45: 0001-Resolves-rhbz-1291925-implement-SAL_INVERT_TRACKFRAM.patch +Patch46: 0001-Related-rhbz-1281906-set-a-min-size-on-un-resizeable.patch +Patch47: 0001-but-only-for-dialog.patch +Patch48: 0001-impress-s-AnnotationWindow-is-the-only-user-of-WB_NE.patch +Patch49: 0002-remove-newly-unused-WB_NEEDSFOCUS-and-fragile-FLOAT_.patch +Patch50: 0003-gtk3-wayland-start-floating-windows-hidden.patch +Patch51: 0001-these-popups-should-start-invisible-and-take-default.patch +Patch52: 0002-disable-tearability-of-color-window.patch +Patch53: 0001-Resolves-tdf-99604-ungrab-modal-dialogs.patch +Patch54: 0001-gtk3-avoid-empty-target-clipboard-warning.patch +Patch55: 0002-Fix-memleak-of-strings-allocated-in-VclGtkClipboard-.patch +Patch56: 0003-Resolves-rhbz-1240591-gtk3-store-clipboard-when-Libr.patch +Patch57: 0001-rerun-autoconf-after-remove-BOOST_SYSTEM.patch +Patch58: 0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch +Patch59: 0001-Resolves-rhbz-1294208-trackpad-two-finger-scroll-doe.patch +Patch60: 0001-use-the-users-preferred-initials-for-impress-annotat.patch +Patch61: 0001-gtk3-Resolves-tdf-96333-fix-RTL-menu-positioning.patch +Patch62: 0001-tdf-97665-Let-s-hope-that-over-activation-isn-t-real.patch +Patch63: 0001-Resolves-rhbz-1315385-use-preferred-size-if-widget-s.patch +Patch64: 0001-Resolves-tdf-96989-videos-playback-at-maximum-possib.patch +Patch65: 0001-delete-hidden-pages-before-deleting-unused-masters.patch +Patch66: 0001-tdf-39271-allow-to-export-only-notes-pages.patch +Patch67: 0001-Resolves-tdf-91778-drawing-the-background-over-an-ac.patch +Patch68: 0001-Pasting-from-a-pdf-from-a-fallback-font-doesn-t-give.patch +Patch69: 0001-tdf-99460-sw-layout-don-t-split-table-before-fly.patch +Patch70: 0001-Resolves-tdf-99498-don-t-overwrite-trwWidth-value-if.patch +Patch71: 0001-rhbz-1326602-avoid-exp.-bg-bitmaps-from-deleted-slid.patch +Patch72: 0001-Resolves-tdf-99417-explicitly-track-formula-cells-fo.patch +Patch73: 0001-tdf-99353-take-the-footgun-away-from-FilterCache.patch +Patch74: 0001-Resolves-tdf-94146-a11y-crash-obtain-formula-using-t.patch +Patch75: 0001-only-set-cur.-page-once-when-removing-mult.-pages.patch +Patch76: 0001-tdf-86575-for-OOXML-write-plain-REF-if-deleted-parts.patch +Patch77: 0001-improve-perf.-of-VCL-event-dispatch.patch +Patch78: 0001-rtf-m_aStates-can-be-empty-in-the-inner-condition.patch +Patch79: 0001-Resolves-rhbz-1364335-tooltips-are-truncated.patch + +%if 0%{?rhel} # not upstreamed -# TODO: fails on ppc; investigate -Patch9: 0001-disable-swui-test-on-RHEL-7.patch +Patch500: 0001-disable-libe-book-support.patch # not upstreamed -Patch10: 0001-disable-libe-book-support.patch +Patch501: 0001-Revert-upload-libwps-0.4.0.patch %endif -# not upstreamed -Patch12: 0001-Resolves-rhbz-1035092-no-shortcut-key-for-Italian-To.patch -# not upstreamed -Patch13: 0001-disable-firebird-unit-test.patch -# not upstreamed -Patch14: 0001-never-run-autogen.sh.patch -# not upstreamed -Patch15: 0001-add-X-TryExec-entries-to-desktop-files.patch -# not upstreamed -Patch16: 0001-disable-PSD-import-test-which-deadlocks-on-ARM.patch -Patch17: 0001-rhbz-1111216-allow-to-export-an-empty-sheet-to-PDF.patch -Patch18: 0001-avoid-problems-detecting-HTML-files-with-.xls-ext.patch -Patch19: 0001-scrolling-very-slow-in-calc.patch -Patch20: 0001-Related-rhbz-1117853-nStartPara-of-EE_PARA_NOT_FOUND.patch -Patch21: 0001-Resolves-fdo-81487-pasting-into-outline-view-crashes.patch -Patch22: 0001-Related-rhbz-1130264-plausible-fix-for-reported-cras.patch -Patch23: 0001-if-_CALL_ELF-if-defined-_CALL_ELF-_CALL_ELF-2.patch -Patch24: 0002-Linux-AArch64-port.patch -Patch25: 0001-fix-KDE4-detection-on-aarch64.patch -Patch26: 0001-drop-useless-test-for-ant-apache-regexp.patch -Patch27: 0001-No-fstack-protect-strong-for-gcc3_linux_aarch64-cpp2.patch -Patch28: 0001-fdo-82496-Change-picture-option-by-rightclicking.patch -Patch29: 0001-create-a-master-document-template-type.patch -Patch30: 0001-Resolves-fdo-80911-don-t-swap-notes-page-width-heigh.patch -Patch31: 0001-default-n-up-printing-of-notes-to-sensible-2-x-1-not.patch -Patch32: 0001-n-up-printing-done-by-vcl-brochures-by-draw-impress.patch -Patch33: 0001-Resolves-fdo-68967-looping-layout.patch -Patch34: 0001-Remove-smb-from-X-KDE-Protocols-lines.patch -Patch35: 0001-libgcrypt-and-gnutls-are-only-used-by-our-internal-e.patch -Patch36: 0001-allow-to-build-with-system-opencollada.patch -Patch37: 0001-Resolves-fdo-37559-revert-adding-extra-dummy-polygon.patch -Patch38: 0001-implement-toggling-off-removeable-master-elements-wi.patch -Patch39: 0001-Resolves-fdo-78151-change-style-on-toggling-bullets-.patch -Patch40: 0001-Resolves-rhbz-1161238-sync-PRESOBJ_OUTLINE-para-dept.patch -Patch41: 0001-strip-off-hard-coded-numbering-from-outliner-preview.patch -Patch42: 0001-have-a-stab-at-improving-impossible-question.patch -Patch43: 0001-just-use-ANSI-C-declarations.patch -Patch44: 0001-Related-fdo-78151-only-make-outline-title-and-subtit.patch -Patch45: 0001-ooo-93212-avoid-slicing-during-construction-of-SdrPa.patch -Patch46: 0001-don-t-copy-stylesheet-s-HelpID-if-this-s-a-rename.patch -Patch47: 0001-fdo-37682-paint-the-right-area.patch -Patch48: 0001-Related-fdo-87242-init-VirtualDevice-with-size-of-su.patch -Patch49: 0001-fdo-36772-Move-the-scrollbar-and-sheet-tabs-in-a-sep.patch -Patch50: 0001-radio-check-top-center-bottom-alignment-for-table-ce.patch -Patch51: 0001-allow-comparing-documents-which-only-differ-by-frame.patch -Patch52: 0001-Use-the-same-advanced-Ellipse-and-Rectangle-shapes-i.patch -Patch53: 0001-if-we-change-the-keys-we-have-to-resort-based-on-the.patch -Patch54: 0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch -Patch55: 0001-During-DocumentRedlineManager-SetRedlineMode-the-arr.patch -Patch56: 0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch -Patch57: 0001-add-accel.-to-switch-monitors-to-pres.-console.patch -Patch58: 0001-build-libetonyek-with-no-strict-aliasing.patch -Patch59: 0002-propagate-user-set-CFLAGS-to-build.patch -Patch60: 0001-fdo-69036-do-not-try-to-create-a-sfxApplication-when.patch -Patch61: 0001-Resolves-rhbz-1204244-group-sdb-windows-together-as-.patch -Patch62: 0001-Resolves-tdf-90256-repair-invalid-docking-positions.patch -Patch63: 0001-negative-after-text-indents-ignored-by-msword-for-ap.patch -Patch64: 0001-Resolves-tdf-73211-gtk-checkboxes-need-erase-afer-to.patch -Patch65: 0001-rhbz-1198848-sw-delete-all-table-redlines-to-fix-DOC.patch -Patch66: 0001-Resolves-rhbz-1215060-get-LibreOffice-to-load-specif.patch -Patch67: 0001-tdf-87400-sw-fix-SwIndexReg-assertion-in-AutoCorrect.patch -Patch68: 0002-sw-fix-crash-on-SwUndoDelete-after-select-all-with-t.patch -Patch69: 0003-rhbz-1205072-sw-resource-mangement-SNAFU-caused-by-S.patch -Patch70: 0004-sw-fix-SwAccessibleParagraph-crash-on-delete.patch -Patch71: 0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch -Patch72: 0001-rhbz-1213173-connectivity-Calc-driver-prevent-docume.patch -Patch73: 0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch -Patch74: 0001-Resolves-tdf-91078-check-also-DBData-modified-not-on.patch -Patch75: 0001-misspell-some-words-copy-and-paste-slide-to-gimp.patch -Patch76: 0001-java-dir-for-powepc64-and-powepc64le-can-differ.patch -Patch77: 0002-java-dir-for-powepc64-and-powepc64le-can-differ.patch -Patch78: 0001-rulers-Make-the-numbers-a-bit-smaller-and-always-wit.patch -Patch79: 0001-ppc64-simplify-this-a-little.patch -Patch80: 0002-ppc64-using-a-fp-register-also-consumes-a-gp-registe.patch -Patch81: 0001-LinkUpdateMode-is-a-global-setting.patch -Patch82: 0002-coverity-1266485-Untrusted-value-as-argument.patch -Patch83: 0003-ww8-make-sure-we-don-t-wrap-around.patch -Patch84: 0004-convert-pStatus-to-vector-and-use-at-to-check-offset.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice -%define ureinstdir %{baseinstdir}/ure %define sdkinstdir %{baseinstdir}/sdk %define fontname opensymbol @@ -422,34 +354,27 @@ Requires: liberation-sans-fonts >= 1.0, liberation-serif-fonts >= 1.0, liberatio Requires: dejavu-sans-fonts, dejavu-serif-fonts, dejavu-sans-mono-fonts Requires: google-crosextra-caladea-fonts, google-crosextra-carlito-fonts Requires: hyphen-en, hyphen >= 2.4, autocorr-en -%if 0%{?rhel} && 0%{?rhel} < 7 -Requires: hunspell-en -%else # rhbz#949106 libreoffice-core drags in both openjdk 1.7.0 and 1.8.0 Requires: java-headless >= 1:1.6 Requires: hunspell-en-US -%endif Requires(pre): gtk2 >= 2.9.4 Requires(post): gtk2 >= 2.9.4 Requires(preun): gtk2 >= 2.9.4 Requires(postun): gtk2 >= 2.9.4 Obsoletes: libreoffice-appdata < 1:4.3.3.0 Obsoletes: libreoffice-binfilter < 1:4.0.0.0 +Obsoletes: libreoffice-headless < 1:4.4.0.0 Obsoletes: libreoffice-javafilter < 1:4.1.0.0 Obsoletes: openoffice.org-core < 1:3.3.1 Obsoletes: openoffice.org-brand < 1:3.3.1, broffice.org-brand < 1:3.3.1 +Obsoletes: openoffice.org-headless < 1:3.3.1 Obsoletes: openoffice.org-javafilter < 1:3.3.1 Obsoletes: openoffice.org-langpack-ms < 1:3.3.1, libreoffice-langpack-ms < 1:3.3.99.1 Obsoletes: openoffice.org-langpack-ur < 1:3.3.1, libreoffice-langpack-ur < 1:3.3.99.1 Obsoletes: openoffice.org-testtools < 1:3.3.1 Obsoletes: libreoffice-testtools < 1:3.4.99.1 Obsoletes: autocorr-eu < 1:4.0.1.2 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-core = 1:3.3.0 -Provides: openoffice.org-core%{?_isa} = 1:3.3.0 -Provides: openoffice.org-brand = 1:3.3.0, broffice.org-brand = 1:3.3.0 -Provides: openoffice.org-brand%{?_isa} = 1:3.3.0, broffice.org-brand%{?_isa} = 1:3.3.0 -%endif +Provides: libreoffice-headless = %{epoch}:%{version}-%{release} %description core The shared core libraries and support files for LibreOffice. @@ -461,10 +386,6 @@ Requires: %{name}-core = %{epoch}:%{version}-%{release} Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{libo_python} Obsoletes: openoffice.org-pyuno < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-pyuno = 1:3.3.0 -Provides: openoffice.org-pyuno%{?_isa} = 1:3.3.0 -%endif %description pyuno Python bindings for the LibreOffice UNO component model. Allows scripts both @@ -476,24 +397,14 @@ Summary: Database front-end for LibreOffice Group: Applications/Productivity Requires: pentaho-reporting-flow-engine Requires: postgresql-jdbc -%if 0%{?rhel} && 0%{?rhel} < 7 -Requires: hsqldb -%endif -Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} Requires: %{name}-calc = %{epoch}:%{version}-%{release} +Requires: %{name}-pyuno = %{epoch}:%{version}-%{release} +Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: %{name}-report-builder < 1:4.1.0.0 Obsoletes: openoffice.org-base-core < 1:3.3.1 Obsoletes: openoffice.org-base < 1:3.3.1, broffice.org-base < 1:3.3.1 Obsoletes: openoffice.org-report-builder < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-base-core = 1:3.3.0 -Provides: openoffice.org-base-core%{?_isa} = 1:3.3.0 -Provides: openoffice.org-base = 1:3.3.0, broffice.org-base = 1:3.3.0 -Provides: openoffice.org-base%{?_isa} = 1:3.3.0, broffice.org-base%{?_isa} = 1:3.3.0 -Provides: openoffice.org-report-builder = 1:3.3.0 -Provides: openoffice.org-report-builder%{?_isa} = 1:3.3.0 -%endif %description base GUI database front-end for LibreOffice. Allows creation and management of @@ -505,10 +416,6 @@ Group: Development/Libraries Requires: bsh Requires: %{name}-core = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-bsh < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-bsh = 1:3.3.0 -Provides: openoffice.org-bsh%{?_isa} = 1:3.3.0 -%endif %description bsh Support BeanShell scripts in LibreOffice. @@ -528,10 +435,6 @@ Summary: JavaScript support for LibreOffice Group: Development/Libraries Requires: %{name}-core = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-rhino < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-rhino = 1:3.3.0 -Provides: openoffice.org-rhino%{?_isa} = 1:3.3.0 -%endif %description rhino Support JavaScript scripts in LibreOffice. @@ -539,21 +442,12 @@ Support JavaScript scripts in LibreOffice. %package wiki-publisher Summary: Create Wiki articles on MediaWiki servers with LibreOffice Group: Applications/Productivity -%if 0%{?rhel} && 0%{?rhel} < 7 -Requires: jakarta-commons-codec, jakarta-commons-httpclient -Requires: jakarta-commons-lang, jakarta-commons-logging -%else Requires: apache-commons-codec, jakarta-commons-httpclient Requires: apache-commons-lang, apache-commons-logging -%endif -Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-writer = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-wiki-publisher < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-wiki-publisher = 1:3.3.0 -Provides: openoffice.org-wiki-publisher%{?_isa} = 1:3.3.0 -%endif %description wiki-publisher The Wiki Publisher enables you to create Wiki articles on MediaWiki servers @@ -563,9 +457,9 @@ your new and existing documents transparently with writer to a wiki page. %package nlpsolver Summary: Non-linear solver engine for LibreOffice Calc Group: Applications/Productivity -Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} Requires: %{name}-calc = %{epoch}:%{version}-%{release} +Requires: %{name}-ure = %{epoch}:%{version}-%{release} %description nlpsolver A non-linear solver engine for Calc as an alternative to the default linear @@ -574,14 +468,10 @@ programming model when more complex, nonlinear programming is required. %package ogltrans Summary: 3D OpenGL slide transitions for LibreOffice Group: Applications/Productivity -Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} Requires: %{name}-impress = %{epoch}:%{version}-%{release} +Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-ogltrans < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-ogltrans = 1:3.3.0 -Provides: openoffice.org-ogltrans%{?_isa} = 1:3.3.0 -%endif %description ogltrans OpenGL Transitions enable 3D slide transitions to be used in LibreOffice. @@ -590,14 +480,10 @@ Requires good quality 3D support for your graphics card for best experience. %package pdfimport Summary: PDF Importer for LibreOffice Draw Group: Applications/Productivity -Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} Requires: %{name}-draw = %{epoch}:%{version}-%{release} +Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-pdfimport < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-pdfimport = 1:3.3.0 -Provides: openoffice.org-pdfimport%{?_isa} = 1:3.3.0 -%endif %description pdfimport The PDF Importer imports PDF into drawing documents to preserve layout @@ -610,10 +496,6 @@ Requires: fontpackages-filesystem Obsoletes: openoffice.org-fonts < 1:3.3.1 Obsoletes: openoffice.org-opensymbol-fonts < 1:3.3.1 BuildArch: noarch -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-fonts = 1:3.3.0 -Provides: openoffice.org-opensymbol-fonts = 1:3.3.0 -%endif %description %{fontname}-fonts A dingbats font, OpenSymbol, suitable for use by LibreOffice for bullets and @@ -623,15 +505,10 @@ mathematical symbols. Summary: LibreOffice Word Processor Application Group: Applications/Productivity Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-pyuno = %{epoch}:%{version}-%{release} Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-writer-core < 1:3.3.1 Obsoletes: openoffice.org-writer < 1:3.3.1, broffice.org-writer < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-writer-core = 1:3.3.0 -Provides: openoffice.org-writer-core%{?_isa} = 1:3.3.0 -Provides: openoffice.org-writer = 1:3.3.0, broffice.org-writer = 1:3.3.0 -Provides: openoffice.org-writer%{?_isa} = 1:3.3.0, broffice.org-writer%{?_isa} = 1:3.3.0 -%endif %description writer The LibreOffice Word Processor application. @@ -642,10 +519,6 @@ Group: Applications/Productivity Requires: %{name}-writer = %{epoch}:%{version}-%{release} Requires: %{name}-pyuno = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-emailmerge < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-emailmerge = 1:3.3.0 -Provides: openoffice.org-emailmerge%{?_isa} = 1:3.3.0 -%endif %description emailmerge Enables the LibreOffice writer module to mail-merge to email. @@ -654,15 +527,10 @@ Enables the LibreOffice writer module to mail-merge to email. Summary: LibreOffice Spreadsheet Application Group: Applications/Productivity Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-pyuno = %{epoch}:%{version}-%{release} Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-calc-core < 1:3.3.1 Obsoletes: openoffice.org-calc < 1:3.3.1, broffice.org-calc < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-calc-core = 1:3.3.0 -Provides: openoffice.org-calc-core%{?_isa} = 1:3.3.0 -Provides: openoffice.org-calc = 1:3.3.0, broffice.org-calc = 1:3.3.0 -Provides: openoffice.org-calc%{?_isa} = 1:3.3.0, broffice.org-calc%{?_isa} = 1:3.3.0 -%endif %description calc The LibreOffice Spreadsheet application. @@ -671,17 +539,12 @@ The LibreOffice Spreadsheet application. Summary: LibreOffice Drawing Application Group: Applications/Productivity Requires: %{name}-core = %{epoch}:%{version}-%{release} -Requires: %{name}-ure = %{epoch}:%{version}-%{release} +Requires: %{name}-pyuno = %{epoch}:%{version}-%{release} Requires: %{name}-pdfimport = %{epoch}:%{version}-%{release} Requires: %{name}-graphicfilter = %{epoch}:%{version}-%{release} +Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-draw-core < 1:3.3.1 Obsoletes: openoffice.org-draw < 1:3.3.1, broffice.org-draw < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-draw-core = 1:3.3.0 -Provides: openoffice.org-draw-core%{?_isa} = 1:3.3.0 -Provides: openoffice.org-draw = 1:3.3.0, broffice.org-draw = 1:3.3.0 -Provides: openoffice.org-draw%{?_isa} = 1:3.3.0, broffice.org-draw%{?_isa} = 1:3.3.0 -%endif %description draw The LibreOffice Drawing Application. @@ -690,6 +553,7 @@ The LibreOffice Drawing Application. Summary: LibreOffice Presentation Application Group: Applications/Productivity Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-pyuno = %{epoch}:%{version}-%{release} Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: %{name}-presentation-minimizer < 2:4.2.0.0-1.alpha1 Obsoletes: %{name}-presenter-screen < 2:4.0.0.0-1.beta1 @@ -699,16 +563,6 @@ Obsoletes: openoffice.org-presentation-minimizer < 1:3.3.1 Obsoletes: openoffice.org-presenter-screen < 1:3.3.1 Provides: %{name}-presentation-minimizer%{?_isa} = %{epoch}:%{version}-%{release} Provides: %{name}-presenter-screen%{?_isa} = %{epoch}:%{version}-%{release} -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-impress-core = 1:3.3.0 -Provides: openoffice.org-impress-core%{?_isa} = 1:3.3.0 -Provides: openoffice.org-impress = 1:3.3.0, broffice.org-impress = 1:3.3.0 -Provides: openoffice.org-impress%{?_isa} = 1:3.3.0, broffice.org-impress%{?_isa} = 1:3.3.0 -Provides: openoffice.org-presentation-minimizer = 1:3.3.0 -Provides: openoffice.org-presentation-minimizer%{?_isa} = 1:3.3.0 -Provides: openoffice.org-presenter-screen = 1:3.3.0 -Provides: openoffice.org-presenter-screen%{?_isa} = 1:3.3.0 -%endif %description impress The LibreOffice Presentation Application. @@ -717,15 +571,10 @@ The LibreOffice Presentation Application. Summary: LibreOffice Equation Editor Application Group: Applications/Productivity Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-pyuno = %{epoch}:%{version}-%{release} Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-math-core < 1:3.3.1 Obsoletes: openoffice.org-math < 1:3.3.1, broffice.org-math < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-math-core = 1:3.3.0 -Provides: openoffice.org-math-core%{?_isa} = 1:3.3.0 -Provides: openoffice.org-math = 1:3.3.0, broffice.org-math = 1:3.3.0 -Provides: openoffice.org-math%{?_isa} = 1:3.3.0, broffice.org-math%{?_isa} = 1:3.3.0 -%endif %description math The LibreOffice Equation Editor Application. @@ -733,13 +582,9 @@ The LibreOffice Equation Editor Application. %package graphicfilter Summary: LibreOffice Extra Graphic filters Group: Applications/Productivity -Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-ure = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-graphicfilter < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-graphicfilter = 1:3.3.0 -Provides: openoffice.org-graphicfilter%{?_isa} = 1:3.3.0 -%endif %description graphicfilter The graphicfilter module for LibreOffice provides graphic filters, e.g. svg and @@ -750,16 +595,11 @@ Summary: Optional xsltfilter module for LibreOffice Group: Applications/Productivity Requires: %{name}-core = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-xsltfilter < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-xsltfilter = 1:3.3.0 -Provides: openoffice.org-xsltfilter%{?_isa} = 1:3.3.0 -%endif %description xsltfilter The xsltfilter module for LibreOffice, provides additional docbook and xhtml export transforms. Install this to enable docbook export. -%if 0%{?fedora} || 0%{?rhel} >= 7 %package postgresql Summary: PostgreSQL connector for LibreOffice Group: Applications/Productivity @@ -771,7 +611,6 @@ Requires: postgresql-libs %description postgresql A PostgreSQL connector for the database front-end for LibreOffice. Allows creation and management of PostgreSQL databases through a GUI. -%endif %package ure Summary: UNO Runtime Environment @@ -782,10 +621,6 @@ Requires: libjvm.so()(64bit) %endif Requires: unzip Obsoletes: openoffice.org-ure < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-ure = 1:3.3.0 -Provides: openoffice.org-ure%{?_isa} = 1:3.3.0 -%endif %description ure UNO is the component model of LibreOffice. UNO offers interoperability between @@ -798,14 +633,10 @@ an appropriate bridge or adapter exists %package sdk Summary: Software Development Kit for LibreOffice Group: Development/Libraries -Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: unzip, java-devel Obsoletes: openoffice.org-sdk < 1:3.3.1, openoffice.org-devel < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-sdk = 1:3.3.0, openoffice.org-devel = 1:3.3.0 -Provides: openoffice.org-sdk%{?_isa} = 1:3.3.0, openoffice.org-devel%{?_isa} = 1:3.3.0 -%endif %description sdk The LibreOffice SDK is an add-on for the LibreOffice office suite. It provides @@ -818,37 +649,16 @@ Summary: Software Development Kit documentation for LibreOffice Group: Documentation Requires: %{name}-sdk = %{epoch}:%{version}-%{release} Obsoletes: openoffice.org-sdk-doc < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-sdk-doc = 1:3.3.0 -Provides: openoffice.org-sdk-doc%{?_isa} = 1:3.3.0 -%endif %description sdk-doc This provides documentation for programming using the LibreOffice APIs and examples of creating extensions (UNO components) for LibreOffice. -%package headless -Summary: LibreOffice Headless plug-in -Group: Development/Libraries -Requires: %{name}-ure = %{epoch}:%{version}-%{release} -Requires: %{name}-core = %{epoch}:%{version}-%{release} -Obsoletes: openoffice.org-headless < 1:3.3.1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Provides: openoffice.org-headless = 1:3.3.0 -Provides: openoffice.org-headless%{?_isa} = 1:3.3.0 -%endif - -%description headless -A plug-in for LibreOffice that enables it to function without an X server. -It implements the -headless command line option and allows LibreOffice to be -used as a backend server for e.g. document conversion. - %package glade Summary: Support for creating LibreOffice dialogs in glade Group: Development/Libraries -Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} -Requires: glade3-libgladeui +Requires: %{name}-ure = %{epoch}:%{version}-%{release} %description glade %{name}-glade contains a catalog of LibreOffice-specific widgets for @@ -875,6 +685,15 @@ Requires: %{name}-core = %{epoch}:%{version}-%{release} %description kde A plug-in for LibreOffice that enables integration into the KDE desktop environment. +%package gtk3 +Summary: LibreOffice GTK+ 3 integration plug-in +Group: Applications/Productivity +Requires: %{name}-core = %{epoch}:%{version}-%{release} + +%description gtk3 +A plug-in for LibreOffice that enables integration into GTK+ 3 environment. +This plugin is experimental and it is not suggested for normal use. + %endif %if 0%{?_enable_debug_packages} @@ -888,7 +707,7 @@ Group: Development/Debug AutoReqProv: 0 %if 0%{?fedora} Requires: libreoffice-core = %{epoch}:%{version}-%{release} -Requires: libreoffice-gdb-debug-support = %{epoch}:%{version}-%{release} +Recommends: libreoffice-gdb-debug-support = %{epoch}:%{version}-%{release} %endif %description debuginfo @@ -1048,9 +867,7 @@ Rules for auto-correcting common %{langname} typing errors. \ %langpack -l as -n Assamese -F -H -Y -o as_IN -w as_IN %langpack -l bg -n Bulgarian -F -H -Y -M -A -T -X -o bg_BG -V -w bg_BG %langpack -l bn -n Bengali -F -H -Y -T -O -v bn_IN -W -%if 0%{?fedora} || 0%{?rhel} >= 7 %langpack -l br -n Breton -F -H -%endif %langpack -l ca -n Catalan -F -H -Y -M -A -T -o ca_ES -V -w ca_ES -X %langpack -l cs -n Czech -F -H -Y -M -A -T -X -o cs_CZ -V -w cs_CZ %langpack -l cy -n Welsh -F -H -Y -o cy_GB -V -w cy_GB @@ -1061,14 +878,8 @@ Rules for auto-correcting common %{langname} typing errors. \ %langpack -l es -n Spanish -F -H -Y -M -A -T -X -O -W %langpack -l et -n Estonian -F -H -Y -T -o et_EE -V -w et_EE %langpack -l eu -n Basque -F -H -Y -T -o eu_ES -V -w eu_ES -%if 0%{?fedora} || 0%{?rhel} >= 7 %langpack -l fa -n Farsi -A -H -Y -s ctl -X -%endif -%if 0%{?rhel} && 0%{?rhel} < 7 -%langpack -l fi -n Finnish -F -A -T -o fi_FI -V -w fi_FI -X -%else %langpack -l fi -n Finnish -F -r libreoffice-voikko -A -T -o fi_FI -V -w fi_FI -X -%endif %langpack -l fr -n French -F -H -Y -M -A -T -X -O -W %langpack -l ga -n Irish -F -H -Y -M -A -o ga_IE -w ga_IE %langpack -l gl -n Galician -F -H -Y -T -o gl_ES -V -w gl_ES @@ -1079,19 +890,12 @@ Rules for auto-correcting common %{langname} typing errors. \ %langpack -l hu -n Hungarian -F -H -Y -M -A -T -X -o hu_HU -V -w hu_HU %langpack -l it -n Italian -F -H -Y -M -A -T -X -O -W %langpack -l ja -n Japanese -F -A -s cjk -T -X -o ja_JP -V -w ja_JP -%if 0%{?fedora} || 0%{?rhel} >= 7 %langpack -l kk -n Kazakh -F -H -%endif %langpack -l kn -n Kannada -F -H -Y -o kn_IN -w ka_IN -%langpack -l ko -n Korean -F -H -A -s cjk -T -c korea -X -o ko_KR -V -w ko_KR +%langpack -l ko -n Korean -F -H -A -s cjk -T -X -o ko_KR -V -w ko_KR %langpack -l lt -n Lithuanian -F -H -Y -A -o lt_LT -V -w lt_LT -X -%if 0%{?fedora} || 0%{?rhel} >= 7 %langpack -l lv -n Latvian -F -H -Y -M -%endif %langpack -l mai -n Maithili -F -o mai_IN -%if 0%{?rhel} && 0%{?rhel} < 7 -%langpack -l ms -n Malay -F -H -o ms_MY -%endif %langpack -l ml -n Malayalam -F -H -Y -o ml_IN -w ml_IN %langpack -l mr -n Marathi -F -H -Y -o mr_IN -w mr_IN %langpack -l nb -n Bokmal -F -H -Y -M -T -o nb_NO -V -w nb_NO @@ -1109,9 +913,7 @@ Rules for auto-correcting common %{langname} typing errors. \ %langpack -l pt-PT -n Portuguese -f pt -h pt -y pt -m pt -a pt -p pt_PT -T -L pt -x pt -o pt_PT -v pt -W %langpack -l ro -n Romanian -A -F -H -Y -M -O -X %langpack -l ru -n Russian -F -H -Y -M -A -T -X -O -W -%if 0%{?fedora} || 0%{?rhel} >= 7 %langpack -l si -n Sinhalese -F -H -S ctl -T -O -%endif %langpack -l sk -n Slovak -F -H -Y -M -A -T -X -o sk_SK -V -w sk_SK %langpack -l sl -n Slovenian -F -H -Y -M -A -T -X -o sl_SI -V -w sl_SI %{baseinstdir}/share/wordbook/sl.dic @@ -1129,9 +931,6 @@ Rules for auto-correcting common %{langname} typing errors. \ %langpack -l tr -n Turkish -F -A -T -X -o tr_TR -V -W %langpack -l ts -n Tsonga -F -H -o ts_ZA -V -w ts_ZA %langpack -l uk -n Ukrainian -F -H -Y -M -T -O -%if 0%{?rhel} && 0%{?rhel} < 7 -%langpack -l ur -n Urdu -F -H -O -W -%endif %langpack -l ve -n Venda -F -H -o ve_ZA %langpack -l xh -n Xhosa -F -H -o xh_ZA %define langpack_lang Simplified Chinese @@ -1217,21 +1016,11 @@ git commit -q -a -m 'add Red Hat colors to palette' # apply patches git am %{patches} -%ifarch ppc -sed -i -e /CppunitTest_services/d postprocess/Module_postprocess.mk -git commit -q -a -m 'disable failing unit test' -%endif -%ifarch ppc64le -sed -i -e /CppunitTest_writerperfect_draw/d writerperfect/Module_writerperfect.mk -git commit -q -a -m 'disable failing unit test' -%endif - -%if 0%{?rhel} && 0%{?rhel} < 7 -cp -r translations/source/en-GB translations/source/ms -cp -r translations/source/en-GB translations/source/ur -git add -A -git commit -q -a -m 'fix translations' -%endif +sed -i -e /CppunitTest_sw_ooxmlimport/d sw/Module_sw.mk +# fails on all secondary platforms +sed -i -e /CppunitTest_vcl_outdev/d vcl/Module_vcl.mk +sed -i -e /CppunitTest_vcl_bitmap_test/d vcl/Module_vcl.mk +git commit -q -a -m 'temporarily disable failing tests' # Seeing .git dir makes some of the build tools change their behavior. # We do not want that. Note: it is still possible to use @@ -1258,23 +1047,18 @@ for i in $RPM_OPT_FLAGS; do esac ARCH_FLAGS="$ARCH_FLAGS $i" done +%ifarch s390 aarch64 +# these builders typically do not have enough memory to link the big libs with -g2 +ARCH_FLAGS="$ARCH_FLAGS -g1" +%endif export ARCH_FLAGS export CFLAGS=$ARCH_FLAGS export CXXFLAGS=$ARCH_FLAGS %if 0%{?rhel} -%if 0%{?rhel} < 7 -# make segfaults on parallel build -%define distrooptions --disable-eot --disable-gltf --disable-firebird-sdbc --disable-graphite --without-junit --enable-gstreamer-0-10 --disable-gstreamer --disable-postgresql-sdbc --enable-python=system --with-system-hsqldb --without-doxygen --with-parallelism=-j1 - -%ifarch s390 s390x -%define archoptions --disable-sdremote-bluetooth -%endif -%else # rhel7 -%define distrooptions --disable-eot --disable-gltf --disable-firebird-sdbc --disable-gstreamer-0-10 --enable-gstreamer --with-system-mythes --enable-python=system %{?_smp_mflags:--with-parallelism=%{_smp_mflags}} -%endif +%define distrooptions --disable-eot --disable-gltf --disable-firebird-sdbc --enable-python=system %else # fedora -%define distrooptions --enable-eot --enable-kde4 --disable-gstreamer-0-10 --enable-gstreamer --with-system-mythes --with-system-libgltf --with-system-opencollada %{?_smp_mflags:--with-parallelism=%{_smp_mflags}} +%define distrooptions --enable-eot --enable-gtk3 --enable-kde4 --with-system-opencollada --with-system-ucpp export OPENCOLLADA_CFLAGS='-I/usr/include/COLLADABaseUtils -I/usr/include/COLLADAFramework -I/usr/include/COLLADASaxFrameworkLoader -I/usr/include/GeneratedSaxParser' export OPENCOLLADA_LIBS='-lOpenCOLLADABaseUtils -lOpenCOLLADAFramework -lOpenCOLLADASaxFrameworkLoader -lGeneratedSaxParser' %endif @@ -1285,13 +1069,8 @@ export OPENCOLLADA_LIBS='-lOpenCOLLADABaseUtils -lOpenCOLLADAFramework -lOpenCOL %if ! 0%{libo_use_python3} export PYTHON=%{_bindir}/python -%if 0%{?fedora} || 0%{?rhel} >= 7 export PYTHON_CFLAGS=`pkg-config --cflags python` export PYTHON_LIBS=`pkg-config --libs python` -%else -export PYTHON_CFLAGS=`python-config --cflags python` -export PYTHON_LIBS=`python-config --libs python` -%endif %endif # %%if 0%%{?rhel} && 0%%{?rhel} < 7 @@ -1305,6 +1084,7 @@ touch autogen.lastrun %configure \ %vendoroption \ %{?with_lang} \ + %{?_smp_mflags:--with-parallelism=%{_smp_mflags}} \ --disable-coinmp \ --disable-fetch-external \ --disable-gnome-vfs \ @@ -1322,9 +1102,7 @@ touch autogen.lastrun --with-help \ --with-system-dicts \ --with-system-libs \ - --with-system-ucpp \ --without-fonts \ - --without-ppds \ --without-system-npapi-headers \ --with-gdrive-client-secret="GYWrDtzyZQZ0_g5YoBCC6F0I" \ --with-gdrive-client-id="457862564325.apps.googleusercontent.com" \ @@ -1333,13 +1111,15 @@ touch autogen.lastrun %{?archoptions} ulimit -c unlimited -make VERBOSE=true +# make VERBOSE=true +make verbose=true build-nocheck #generate the icons and mime type stuff export DESTDIR=../output export KDEMAINDIR=/usr export GNOMEDIR=/usr export GNOME_MIME_THEME=hicolor +export PREFIXDIR=/usr # TODO use empty variables? Should make the renaming hacks in %%install # unnecessary. . ./bin/get_config_variables PRODUCTVERSIONSHORT PRODUCTVERSION WORKDIR @@ -1405,15 +1185,18 @@ pushd %{buildroot}%{sdkinstdir} sed -e "s,@OO_SDK_NAME@,sdk," \ -e "s,@OO_SDK_HOME@,%{sdkinstdir}," \ -e "s,@OFFICE_HOME@,%{baseinstdir}," \ - -e "s,@OO_SDK_URE_HOME@,%{ureinstdir}," \ -e "s,@OO_SDK_MAKE_HOME@,/usr/bin," \ -e "s,@OO_SDK_ZIP_HOME@,/usr/bin," \ -e "s,@OO_SDK_CPP_HOME@,/usr/bin," \ + -e "s,@OO_SDK_CAT_HOME@,/usr/bin," \ + -e "s,@OO_SDK_SED_HOME@,/usr/bin," \ -e "s,@OO_SDK_CC_55_OR_HIGHER@,," \ -e "s,@OO_SDK_JAVA_HOME@,$JAVA_HOME," \ -e "s,@OO_SDK_OUTPUT_DIR@,\$HOME," \ -e "s,@SDK_AUTO_DEPLOYMENT@,NO," \ setsdkenv_unix.sh.in > setsdkenv_unix.sh + # ensure no unexpanded vars sneaked in + grep '@[A_Z0-9_]\+@' setsdkenv_unix.sh && exit 1 chmod 755 setsdkenv_unix.sh # we don't want to install the input file rm -f setsdkenv_unix.sh.in @@ -1537,11 +1320,6 @@ chmod a+x libreoffice ln -s %{baseinstdir}/program/soffice soffice # rhbz#499474 provide a /usr/bin/openoffice.org for backwards compat ln -s libreoffice openoffice.org -%if 0%{?rhel} && 0%{?rhel} < 7 -# rhbz#833512 provide a /usr/bin/openoffice.org-1.9, etc. for backwards compat -ln -s libreoffice openoffice.org-2.0 -ln -s libreoffice openoffice.org-1.9 -%endif popd pushd %{buildroot}%{baseinstdir}/share/xdg/ @@ -1595,13 +1373,25 @@ install -m 0644 -p vcl/unx/generic/printer/configuration/ppds/SGENPRT.PS %{build sed -i -e "s#URE_MORE_JAVA_CLASSPATH_URLS.*#& file:///usr/share/java/postgresql-jdbc.jar#" %{buildroot}%{baseinstdir}/program/fundamentalrc # move glade catalog to system glade dir +install -m 0755 -d %{buildroot}%{_datadir}/glade/catalogs +mv %{buildroot}%{baseinstdir}/share/glade/libreoffice-catalog.xml %{buildroot}%{_datadir}/glade/catalogs install -m 0755 -d %{buildroot}%{_datadir}/glade3/catalogs -mv %{buildroot}%{baseinstdir}/share/glade/libreoffice-catalog.xml %{buildroot}%{_datadir}/glade3/catalogs +ln -sr %{buildroot}%{_datadir}/glade/catalogs/libreoffice-catalog.xml %{buildroot}%{_datadir}/glade3/catalogs # rhbz#1049543 install appdata install -m 0755 -d %{buildroot}%{_datadir}/appdata install -m 0644 -p sysui/desktop/appstream-appdata/*.appdata.xml %{buildroot}%{_datadir}/appdata +# rhbz#1215800 install symbolic icons +install -m 0755 -d %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +install -m 0644 -p %{SOURCE42} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +install -m 0644 -p %{SOURCE43} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +install -m 0644 -p %{SOURCE44} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +install -m 0644 -p %{SOURCE45} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +install -m 0644 -p %{SOURCE46} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +install -m 0644 -p %{SOURCE47} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +install -m 0644 -p %{SOURCE48} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps + # install man pages install -m 0755 -d %{buildroot}%{_mandir}/man1 install -m 0644 -p sysui/desktop/man/*.1 %{buildroot}%{_mandir}/man1 @@ -1611,12 +1401,29 @@ for app in oobase oocalc oodraw ooffice ooimpress oomath ooviewdoc oowriter open done export DESTDIR=%{buildroot} -make cmd cmd="install-gdb-printers -a %{_datadir}/gdb/auto-load%{baseinstdir} -c -i %{baseinstdir} -p %{_datadir}/libreoffice/gdb" +./solenv/bin/install-gdb-printers -a %{_datadir}/gdb/auto-load%{baseinstdir} -c -i %{baseinstdir} -p %{_datadir}/libreoffice/gdb # tl.pyc is sligtly different on various platforms for some reason, breaking multilib rm -f \ %{buildroot}%{_datadir}/gdb/auto-load%{baseinstdir}/program/libtllo.so-gdb.py \ %{buildroot}%{_datadir}/libreoffice/gdb/libreoffice/tl.py +%if 0%{?fedora} +# Update the screenshot shown in the software center +# +# NOTE: It would be *awesome* if this file was pushed upstream. +# +# See http://people.freedesktop.org/~hughsient/appdata/#screenshots for more details. +# +appstream-util replace-screenshots %{buildroot}%{_datadir}/appdata/libreoffice-writer.appdata.xml \ + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/libreoffice-writer/a.png \ + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/libreoffice-writer/b.png +appstream-util replace-screenshots %{buildroot}%{_datadir}/appdata/libreoffice-calc.appdata.xml \ + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/libreoffice-calc/a.png +appstream-util replace-screenshots %{buildroot}%{_datadir}/appdata/libreoffice-draw.appdata.xml \ + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/libreoffice-draw/a.png +appstream-util replace-screenshots %{buildroot}%{_datadir}/appdata/libreoffice-impress.appdata.xml \ + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/libreoffice-impress/a.png +%endif %check ulimit -c unlimited @@ -1624,12 +1431,9 @@ unset WITH_LANG # work around flawed accessibility check export JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY="1" export OOO_TEST_SOFFICE=path:%{buildroot}%{baseinstdir}/program/soffice +# fails on ppc, but we don't need that anyway %ifnarch ppc -%if 0%{?rhel} && 0%{?rhel} < 7 -timeout 2h make smoketest.subsequentcheck -%else -timeout -k 5m 3h make smoketest.subsequentcheck -%endif +timeout -k 2m 2h make smoketest.subsequentcheck %endif # we don't need this anymore rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar @@ -1682,17 +1486,17 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/program/gengal %{baseinstdir}/program/gengal.bin %{baseinstdir}/program/gnome-open-url -%{baseinstdir}/program/gnome-open-url.bin -%{baseinstdir}/program/kde-open-url %{baseinstdir}/program/libi18nsearchlo.so %{baseinstdir}/program/libldapbe2lo.so %{baseinstdir}/program/libacclo.so %{baseinstdir}/program/libavmedia*.so +%{baseinstdir}/program/libbasebmplo.so %{baseinstdir}/program/libbasctllo.so %{baseinstdir}/program/libbiblo.so %{baseinstdir}/program/libcached1.so %{baseinstdir}/program/libcanvastoolslo.so %{baseinstdir}/program/libchart*lo.so +%{baseinstdir}/program/libclewlo.so %{baseinstdir}/program/libcollator_data.so %{baseinstdir}/program/libcppcanvaslo.so %{baseinstdir}/program/libctllo.so @@ -1748,6 +1552,8 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/program/libhelplinkerlo.so %{baseinstdir}/program/libhyphenlo.so %{baseinstdir}/program/libjdbclo.so +# TODO: move elsewhere? +%{baseinstdir}/program/liblibreofficekitgtk.so %{baseinstdir}/program/liblnglo.so %{baseinstdir}/program/libloglo.so %{baseinstdir}/program/liblocaledata_en.so @@ -1764,6 +1570,7 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/program/liboglcanvaslo.so %{baseinstdir}/program/liboffacclo.so %{baseinstdir}/program/libooxlo.so +%{baseinstdir}/program/libopencllo.so %{baseinstdir}/program/libpcrlo.so %{baseinstdir}/program/libpdffilterlo.so %{baseinstdir}/program/libpllo.so @@ -1814,14 +1621,63 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/program/libxsltdlglo.so %{baseinstdir}/program/libxsltfilterlo.so %{baseinstdir}/program/libxstor.so -%if 0%{?fedora} || 0%{?rhel} >= 7 # TODO how useful this is in Fedora? %{baseinstdir}/program/liblosessioninstalllo.so -%endif %{baseinstdir}/program/libmigrationoo2lo.so %{baseinstdir}/program/libmigrationoo3lo.so %{baseinstdir}/program/libmsformslo.so -%{baseinstdir}/program/nsplugin +%dir %{baseinstdir}/program/opengl +%{baseinstdir}/program/opengl/areaHashCRC64TFragmentShader.glsl +%{baseinstdir}/program/opengl/areaScaleFragmentShader.glsl +%{baseinstdir}/program/opengl/areaScaleFastFragmentShader.glsl +%{baseinstdir}/program/opengl/backgroundFragmentShader.glsl +%{baseinstdir}/program/opengl/backgroundVertexShader.glsl +%{baseinstdir}/program/opengl/blendedTextureFragmentShader.glsl +%{baseinstdir}/program/opengl/blendedTextureVertexShader.glsl +%{baseinstdir}/program/opengl/commonFragmentShader.glsl +%{baseinstdir}/program/opengl/commonVertexShader.glsl +%{baseinstdir}/program/opengl/convolutionFragmentShader.glsl +%{baseinstdir}/program/opengl/debugFragmentShader.glsl +%{baseinstdir}/program/opengl/debugVertexShader.glsl +%{baseinstdir}/program/opengl/diffTextureFragmentShader.glsl +%{baseinstdir}/program/opengl/dumbVertexShader.glsl +%{baseinstdir}/program/opengl/dummyVertexShader.glsl +%{baseinstdir}/program/opengl/linearGradientFragmentShader.glsl +%{baseinstdir}/program/opengl/linearMultiColorGradientFragmentShader.glsl +%{baseinstdir}/program/opengl/linearTwoColorGradientFragmentShader.glsl +%{baseinstdir}/program/opengl/maskedTextureFragmentShader.glsl +%{baseinstdir}/program/opengl/maskedTextureVertexShader.glsl +%{baseinstdir}/program/opengl/maskFragmentShader.glsl +%{baseinstdir}/program/opengl/pickingFragmentShader.glsl +%{baseinstdir}/program/opengl/pickingVertexShader.glsl +%{baseinstdir}/program/opengl/radialGradientFragmentShader.glsl +%{baseinstdir}/program/opengl/radialMultiColorGradientFragmentShader.glsl +%{baseinstdir}/program/opengl/radialTwoColorGradientFragmentShader.glsl +%{baseinstdir}/program/opengl/rectangularMultiColorGradientFragmentShader.glsl +%{baseinstdir}/program/opengl/rectangularTwoColorGradientFragmentShader.glsl +%{baseinstdir}/program/opengl/renderTextureFragmentShader.glsl +%{baseinstdir}/program/opengl/renderTextureVertexShader.glsl +%{baseinstdir}/program/opengl/replaceColorFragmentShader.glsl +%{baseinstdir}/program/opengl/screenTextFragmentShader.glsl +%{baseinstdir}/program/opengl/screenTextVertexShader.glsl +%{baseinstdir}/program/opengl/shape3DFragmentShader.glsl +%{baseinstdir}/program/opengl/shape3DFragmentShaderBatch.glsl +%{baseinstdir}/program/opengl/shape3DFragmentShaderBatchScroll.glsl +%{baseinstdir}/program/opengl/shape3DFragmentShaderV300.glsl +%{baseinstdir}/program/opengl/shape3DVertexShader.glsl +%{baseinstdir}/program/opengl/shape3DVertexShaderBatch.glsl +%{baseinstdir}/program/opengl/shape3DVertexShaderBatchScroll.glsl +%{baseinstdir}/program/opengl/shape3DVertexShaderV300.glsl +%{baseinstdir}/program/opengl/solidFragmentShader.glsl +%{baseinstdir}/program/opengl/symbolFragmentShader.glsl +%{baseinstdir}/program/opengl/symbolVertexShader.glsl +%{baseinstdir}/program/opengl/textFragmentShader.glsl +%{baseinstdir}/program/opengl/textFragmentShaderBatch.glsl +%{baseinstdir}/program/opengl/textVertexShader.glsl +%{baseinstdir}/program/opengl/textVertexShaderBatch.glsl +%{baseinstdir}/program/opengl/textureFragmentShader.glsl +%{baseinstdir}/program/opengl/textureVertexShader.glsl +%{baseinstdir}/program/opengl/transformedTextureVertexShader.glsl %{baseinstdir}/program/open-url %{baseinstdir}/program/types/offapi.rdb %{baseinstdir}/program/libpasswordcontainerlo.so @@ -1879,10 +1735,10 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/program/libucpcmis1lo.so %{baseinstdir}/program/libucpexpand1lo.so %{baseinstdir}/program/libucpextlo.so +%{baseinstdir}/program/libucpimagelo.so %{baseinstdir}/program/libucptdoc1lo.so -%{baseinstdir}/program/unorc +%{baseinstdir}/program/lounorc %{baseinstdir}/program/libupdatefeedlo.so -%{baseinstdir}/ure-link %{baseinstdir}/program/uri-encode %{baseinstdir}/program/libvbaeventslo.so %{baseinstdir}/program/libvclcanvaslo.so @@ -1894,11 +1750,12 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/share/autocorr %dir %{_datadir}/autocorr %dir %{baseinstdir}/share/autotext +%dir %{_datadir}/autocorr +%{baseinstdir}/share/autocorr %{baseinstdir}/share/autotext/en-US %{baseinstdir}/share/basic %dir %{baseinstdir}/share/config -%{baseinstdir}/share/config/images.zip -%{baseinstdir}/share/config/images_crystal.zip +%{baseinstdir}/share/config/images_breeze.zip %{baseinstdir}/share/config/images_galaxy.zip %{baseinstdir}/share/config/images_hicontrast.zip %{baseinstdir}/share/config/images_oxygen.zip @@ -1915,6 +1772,7 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar # UI translations go into langpacks %exclude %{baseinstdir}/share/config/soffice.cfg/*/ui/res %endif +%{baseinstdir}/share/palette %{baseinstdir}/share/config/webcast %{baseinstdir}/share/config/wizard %dir %{baseinstdir}/share/dtd @@ -1922,9 +1780,6 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/share/gallery %dir %{baseinstdir}/share/labels %{baseinstdir}/share/labels/labels.xml -%if 0%{?rhel} && 0%{?rhel} < 7 -%{baseinstdir}/share/liblangtag -%endif %dir %{baseinstdir}/share/psprint %config %{baseinstdir}/share/psprint/psprint.conf %{baseinstdir}/share/psprint/driver @@ -1942,6 +1797,11 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %dir %{baseinstdir}/share/template/common %{baseinstdir}/share/template/common/internal %{baseinstdir}/share/template/common/layout +%{baseinstdir}/share/template/common/officorr +%{baseinstdir}/share/template/common/offimisc +%{baseinstdir}/share/template/common/personal +%{baseinstdir}/share/template/common/presnt +%{baseinstdir}/share/template/common/styles %{baseinstdir}/share/template/common/wizard %{baseinstdir}/share/template/wizard %dir %{baseinstdir}/share/wordbook @@ -1985,7 +1845,6 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/program/libucpfile1.so %{baseinstdir}/program/libutllo.so %{baseinstdir}/program/libvcllo.so -%{baseinstdir}/program/libvclopengllo.so %{baseinstdir}/program/libwriterperfectlo.so %{baseinstdir}/program/libxmlscriptlo.so %{baseinstdir}/program/libxolo.so @@ -2010,7 +1869,6 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{baseinstdir}/program/soffice.bin %{baseinstdir}/program/sofficerc %{baseinstdir}/program/unoinfo -%{baseinstdir}/program/libnpsoplugin.so %{baseinstdir}/program/oosplash %{baseinstdir}/program/shell/ %dir %{baseinstdir}/share/filter @@ -2023,21 +1881,9 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar #launchers %{_bindir}/libreoffice %{_bindir}/openoffice.org -%if 0%{?rhel} && 0%{?rhel} < 7 -%{_bindir}/openoffice.org-1.9 -%{_bindir}/openoffice.org-2.0 -%endif %{_bindir}/soffice %{_bindir}/ooffice %{_bindir}/ooviewdoc -%if 0%{?rhel} && 0%{?rhel} < 7 -%{baseinstdir}/program/libraptor2-lo.so.0 -%{baseinstdir}/program/librasqal-lo.so.3 -%{baseinstdir}/program/librdf-lo.so.0 -%{baseinstdir}/program/libclucene.so -%{baseinstdir}/program/liblcms2.so.2 -%{baseinstdir}/share/fingerprint -%endif %{_mandir}/man1/libreoffice.1* %{_mandir}/man1/openoffice.org.1* %{_mandir}/man1/soffice.1* @@ -2071,9 +1917,7 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : %files base %{baseinstdir}/help/en-US/sdatabase.* -%if 0%{?fedora} || 0%{?rhel} >= 7 %{baseinstdir}/program/classes/hsqldb.jar -%endif %{baseinstdir}/program/classes/reportbuilder.jar %{baseinstdir}/program/classes/reportbuilderwizard.jar %{baseinstdir}/program/classes/sdbc_hsqldb.jar @@ -2129,6 +1973,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %files ogltrans %{baseinstdir}/program/libOGLTranslo.so +%{baseinstdir}/program/opengl/basicVertexShader.glsl +%{baseinstdir}/program/opengl/dissolveFragmentShader.glsl +%{baseinstdir}/program/opengl/staticFragmentShader.glsl %{baseinstdir}/share/config/soffice.cfg/simpress/transitions-ogl.xml %{baseinstdir}/share/registry/ogltrans.xcd @@ -2153,7 +2000,6 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %{baseinstdir}/program/libsclo.so %{baseinstdir}/program/libscdlo.so %{baseinstdir}/program/libscfiltlo.so -%{baseinstdir}/program/libscopencllo.so %{baseinstdir}/program/libscuilo.so %{baseinstdir}/program/libsolverlo.so %{baseinstdir}/program/libwpftcalclo.so @@ -2279,18 +2125,63 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %{baseinstdir}/share/registry/xsltfilter.xcd %{_datadir}/applications/libreoffice-xsltfilter.desktop -%if 0%{?fedora} || 0%{?rhel} >= 7 %files postgresql %{baseinstdir}/program/libpostgresql-sdbclo.so %{baseinstdir}/program/libpostgresql-sdbc-impllo.so %{baseinstdir}/program/postgresql-sdbc.ini %{baseinstdir}/program/services/postgresql-sdbc.rdb %{baseinstdir}/share/registry/postgresql.xcd -%endif %files ure -%doc instdir/LICENSE -%{ureinstdir} +%{baseinstdir}/program/classes/java_uno.jar +%{baseinstdir}/program/classes/juh.jar +%{baseinstdir}/program/classes/jurt.jar +%{baseinstdir}/program/classes/ridl.jar +%{baseinstdir}/program/classes/unoloader.jar +%{baseinstdir}/program/javaldx +%{baseinstdir}/program/javavendors.xml +%{baseinstdir}/program/jvmfwk3rc +%{baseinstdir}/program/JREProperties.class +%{baseinstdir}/program/libaffine_uno_uno.so +%{baseinstdir}/program/libbinaryurplo.so +%{baseinstdir}/program/libbootstraplo.so +%{baseinstdir}/program/libgcc3_uno.so +%{baseinstdir}/program/libintrospectionlo.so +%{baseinstdir}/program/libinvocadaptlo.so +%{baseinstdir}/program/libinvocationlo.so +%{baseinstdir}/program/libiolo.so +%{baseinstdir}/program/libjava_uno.so +%{baseinstdir}/program/libjavaloaderlo.so +%{baseinstdir}/program/libjavavmlo.so +%{baseinstdir}/program/libjpipe.so +%{baseinstdir}/program/libjuh.so +%{baseinstdir}/program/libjuhx.so +%{baseinstdir}/program/libjvmaccesslo.so +%{baseinstdir}/program/libjvmfwklo.so +%{baseinstdir}/program/liblog_uno_uno.so +%{baseinstdir}/program/libnamingservicelo.so +%{baseinstdir}/program/libproxyfaclo.so +%{baseinstdir}/program/libreflectionlo.so +%{baseinstdir}/program/libreglo.so +%{baseinstdir}/program/libsal_textenclo.so +%{baseinstdir}/program/libstocserviceslo.so +%{baseinstdir}/program/libstorelo.so +%{baseinstdir}/program/libuno_cppu.so.3 +%{baseinstdir}/program/libuno_cppuhelpergcc3.so.3 +%{baseinstdir}/program/libuno_purpenvhelpergcc3.so.3 +%{baseinstdir}/program/libuno_sal.so.3 +%{baseinstdir}/program/libuno_salhelpergcc3.so.3 +%{baseinstdir}/program/libunoidllo.so +%{baseinstdir}/program/libunsafe_uno_uno.so +%{baseinstdir}/program/libuuresolverlo.so +%{baseinstdir}/program/libxmlreaderlo.so +%{baseinstdir}/program/regmerge +%{baseinstdir}/program/regview +%{baseinstdir}/program/services.rdb +%{baseinstdir}/program/types.rdb +%{baseinstdir}/program/uno +%{baseinstdir}/program/uno.bin +%{baseinstdir}/program/unorc %files sdk %{sdkinstdir}/ @@ -2302,10 +2193,6 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %{sdkinstdir}/docs/ %{sdkinstdir}/examples/ -%files headless -%{baseinstdir}/program/libbasebmplo.so -%{baseinstdir}/program/libvclplug_svplo.so - %files pyuno %{baseinstdir}/program/libpyuno.so %{baseinstdir}/program/pythonloader.py* @@ -2334,17 +2221,42 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %files glade %{baseinstdir}/program/ui-previewer -%{_datadir}/glade3/catalogs/libreoffice-catalog.xml +%{_datadir}/glade +%{_datadir}/glade3 %if 0%{?fedora} %files kde +%{baseinstdir}/program/kde4-open-url %{baseinstdir}/program/libkde4be1lo.so %{baseinstdir}/program/libvclplug_kde4lo.so +%files gtk3 +%{baseinstdir}/program/libvclplug_gtk3lo.so + %endif %changelog +* Tue Aug 23 2016 David Tardon - 1:5.0.6.2-3 +- Resolves: rhbz#1364335 tooltips are truncated + +* Fri Jul 08 2016 David Tardon - 1:5.0.6.2-2 +- Resolves: rhbz#1353839 CVE-2016-4324 dereference of invalid STL iterator on + processing RTF file + +* Tue May 03 2016 David Tardon - 1:5.0.6.2-1 +- Related: rhbz#1290148 rebase to 5.0.6 +- Related: rhbz#1290148 include more fixes from F-23 + +* Fri Mar 04 2016 David Tardon - 1:5.0.5.2-2 +- Related: rhbz#1290148 remove unintentional dependency of libreoffice-core on + libreoffice-calc +- Related: rhbz#1290148 restore lost changelog entry +- Related: rhbz#1290148 add additional 5.0.6 patches + +* Tue Mar 01 2016 David Tardon - 1:5.0.5.2-1 +- Resolves: rhbz#1290148 rebase to 5.0.x + * Wed Dec 02 2015 David Tardon - 1:4.3.7.2-5.1 - Resolves: rhbz#1285820 various flaws - CVE-2015-4551 Arbitrary file disclosure in Calc and Writer