[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/txtnode/txtedt.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit ba86e97a55e2d6f8716681fb626a8dc3d691aa84 Author: Oliver SpechtDate: Tue Mar 29 10:59:30 2016 +0200 tdf#94449: special text attributes are not removed with paragraph style commit 3c0805e1f4f4d14e92c7e655d59c87de5c207e48 introduced removal of all character attributes applied to the complete paragraph if a paragraph style was applied. This should not remove special attributes like index entries, reference marks etc. Change-Id: I6fe92066269da2cf10c871ca319faf6fda91f4be Reviewed-on: https://gerrit.libreoffice.org/23591 Tested-by: Jenkins Reviewed-by: Oliver Specht Reviewed-on: https://gerrit.libreoffice.org/24367 Reviewed-by: Michael Stahl Reviewed-by: Miklos Vajna diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index c256228..9426aef 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -606,7 +606,8 @@ void SwTextNode::RstTextAttr( for (i = 0; i < m_pSwpHints->Count(); ++i) { SwTextAttr* pHint = m_pSwpHints->GetTextHint(i); -if (pHint->GetStart() != nStt) +if ( (isTXTATR_WITHEND(pHint->Which()) && RES_TXTATR_AUTOFMT != pHint->Which()) +|| pHint->GetStart() != nStt) continue; const sal_Int32* pHintEnd = pHint->GetEnd(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/layout/sectfrm.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 43685487f24bc2a1244922ebc04af467f0eabef6 Author: Caolán McNamaraDate: Mon Mar 7 12:16:28 2016 + Resolves: tdf#96172 crashtesting: avoid crash in layout sectfrm is riddled with workarounds for "half dead" section frames. This is yet another one. Change-Id: Ic03ad8971002d7dce308475f1497d1dda8045d15 Cherry-picked from 727ebae15e623660b9cc6f8db0e7558830bf920d Reviewed-on: https://gerrit.libreoffice.org/24155 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index bef77ba..60ff9ce 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -1574,7 +1574,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) // We have found the suitable layout sheet. If there (in the sheet) is // already a Follow of our section, we take its first layout sheet, // otherwise it is time to create a section follow -SwSectionFrm* pNew; +SwSectionFrm* pNew = nullptr; // This can be omitted if existing Follows were cut short SwFrm* pFirst = pLayLeaf->Lower(); @@ -1585,7 +1585,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) pNew = pSect->GetFollow(); else if( MAKEPAGE_NOSECTION == eMakePage ) return pLayLeaf; -else +else if (pSect->GetSection()) { pNew = new SwSectionFrm( *pSect, false ); pNew->InsertBefore( pLayLeaf, pLayLeaf->Lower() ); @@ -1640,7 +1640,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) pNew->SimpleFormat(); } // The wanted layout sheet is now the first of the determined SctFrms: -pLayLeaf = FIRSTLEAF( pNew ); +pLayLeaf = pNew ? FIRSTLEAF( pNew ) : nullptr; } return pLayLeaf; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/layout/flycnt.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 01ba19094272cb661f781c091fd11f3a01dc1ea0 Author: Bjoern MichaelsenDate: Tue Mar 22 15:41:04 2016 +0100 tdf#95977: fix fly positioning regression from 0c5cbcd7 Change-Id: I7e11c7072ba0ec82237985da79f8572fdda05778 Reviewed-on: https://gerrit.libreoffice.org/23430 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index a500fe3..0423ea7 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -1221,7 +1221,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point ) nY -= pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); } else -nY = rNew.Y() - pCnt->Frm().Top() + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); +nY = rNew.Y() - pCnt->Frm().Top() - pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/crsr/findtxt.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 80d1589229926122adad60ff4ca1b045a54a5efa Author: Jan HolesovskyDate: Thu Mar 17 15:51:42 2016 +0100 tdf#98458 sw: Fix performance problem when searching in large documents. Change-Id: I0056a411d7a3bb018401d87bdd4a0112fed31df6 Reviewed-on: https://gerrit.libreoffice.org/23340 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 741e307..e483545 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -241,6 +241,10 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te rSearchOpt.searchString == "$^" ); const bool bChkParaEnd = bRegSearch && rSearchOpt.searchString == "$"; +SvxSearchItem aSearchItem(SID_SEARCH_ITEM); // this is a very expensive operation (calling configmgr etc.) +aSearchItem.SetSearchOptions(rSearchOpt); +aSearchItem.SetBackward(!bSrchForward); + // LanguageType eLastLang = 0; while( 0 != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly ) )) { @@ -298,10 +302,6 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te SwWrtShell *const pWrtShell = (pDocShell) ? pDocShell->GetWrtShell() : 0; SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell->GetPostItMgr() : 0; -SvxSearchItem aSearchItem(SID_SEARCH_ITEM); -aSearchItem.SetSearchOptions(rSearchOpt); -aSearchItem.SetBackward(!bSrchForward); - // If there is an active text edit, then search there. bool bEndedTextEdit = false; SdrView* pSdrView = pWrtShell->GetDrawView(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/text/itrform2.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 40a304eb1f47f27e1a5c2ebda06a0726f22c36e3 Author: Oliver SpechtDate: Tue Feb 23 12:13:21 2016 +0100 tdf#97139: prevent loop while formatting small text lines when text is inserted at the end of a line then text formatting starts some characters (platform and ENABLE_GRAPHITE dependent) before the insert position. In case of small lines this might even be the start of the line. To prevent going back to the previous line the cursor right margin flag needs to be reset. Change-Id: I73a62ce6c7707469fddeeffe0d7eec064c5989ea Reviewed-on: https://gerrit.libreoffice.org/22641 Tested-by: Jenkins Reviewed-by: Oliver Specht Reviewed-on: https://gerrit.libreoffice.org/22667 Reviewed-by: Thorsten Behrens Reviewed-by: Miklos Vajna diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index a8f5ff2..f1937ca 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -2686,7 +2686,7 @@ namespace { const sal_Int32 nOldLineEnd, const std::vector ) { -SwTextFormatInfo txtFormatInfo = rThis.GetInfo(); +SwTextFormatInfo& txtFormatInfo = rThis.GetInfo(); if ( txtFormatInfo.GetIdx() < txtFormatInfo.GetReformatStart() ) // the reformat position is behind our new line, that means // something of our text has moved to the next line @@ -2733,7 +2733,11 @@ namespace { if ( nReformat > txtFormatInfo.GetLineStart() + nMaxContext ) nReformat = nReformat - nMaxContext; else +{ nReformat = txtFormatInfo.GetLineStart(); +//reset the margin flag - prevent loops +SwTextCursor::SetRightMargin(false); +} } // Weird situation: Our line used to end with a hole portion ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/view/pagepreviewlayout.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit 416843f69cf62d2f01e2a25f03bda0fdec949cb8 Author: Caolán McNamaraDate: Wed Mar 9 15:51:41 2016 + Resolves: tdf#82781 avoid dereferencing invalid iterators when using print preview with cursor on 2nd page which consists solely of hidden text with show hiddle text enabled. inner mrParentViewShell.Paint can invalidate iterators, as later detected with the mbNewLayoutDuringPaint flag but we dereference for the purposes of drawing the shadow before we get there. easiest thing seems to be to just grab the bits of info we want before the inner paint occurs. (cherry picked from commit 4eb5f363ed9a3181a817f12d5ec49eede13b9c9c) Change-Id: I09c9b06449db440b7beba7de9e71c239ee64f6ca Reviewed-on: https://gerrit.libreoffice.org/23094 Reviewed-by: David Tardon Tested-by: David Tardon diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index 26ff858..5e7f234 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -1090,7 +1090,9 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan Rectangle aPxPaintRect = pOutputDev->LogicToPixel( aPageRect ); if ( aPxOutRect.IsOver( aPxPaintRect) ) { -if ( (*aPageIter)->pPage->IsEmptyPage() ) +const SwPageFrm* pPage = (*aPageIter)->pPage; + +if (pPage->IsEmptyPage()) { const Color aRetouche( mrParentViewShell.Imp()->GetRetoucheColor() ); if( pOutputDev->GetFillColor() != aRetouche ) @@ -1118,16 +1120,20 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan } else { +const bool bIsLeftShadowed = pPage->IsLeftShadowNeeded(); +const bool bIsRightShadowed = pPage->IsRightShadowNeeded(); + mrParentViewShell.maVisArea = aPageRect; aPxPaintRect.Intersection( aPxOutRect ); Rectangle aPaintRect = pOutputDev->PixelToLogic( aPxPaintRect ); mrParentViewShell.Paint(rRenderContext, aPaintRect); + // --> OD 2007-08-15 #i80691# // paint page border and shadow { SwRect aPageBorderRect; SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), , , aPageBorderRect, -(*aPageIter)->pPage->IsLeftShadowNeeded(), (*aPageIter)->pPage->IsRightShadowNeeded(), true ); +bIsLeftShadowed, bIsRightShadowed, true ); const vcl::Region aDLRegion(aPageBorderRect.SVRect()); mrParentViewShell.DLPrePaint2(aDLRegion); SwPageFrm::PaintBorderAndShadow( aPageRect, , true, false, true ); @@ -1142,11 +1148,10 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan break; } -if ( (*aPageIter)->pPage->GetPhyPageNum() == mnSelectedPageNum ) +if (pPage->GetPhyPageNum() == mnSelectedPageNum) { _PaintSelectMarkAtPage(rRenderContext, *aPageIter); } - } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/shells/grfsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 40e7a2253a72ee490f97a604bcc94d12d0b84fc8 Author: Caolán McNamaraDate: Fri Mar 4 16:45:29 2016 + Resolves: tdf#98399 RET_USER_CANCEL is non-zero and returned on cancel Change-Id: Id4231454dfb34cac6ee89d63beb18a83c63a44c1 (cherry picked from commit cd9a5cf4312a2dc0c1ecbf682c67ca08862cdde0) Reviewed-on: https://gerrit.libreoffice.org/22913 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 39e18fd..abaa41e 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -354,7 +354,7 @@ void SwGrfShell::Execute(SfxRequest ) if (nSlot == FN_DRAW_WRAP_DLG) pDlg->SetCurPageId("wrap"); -if( pDlg->Execute() ) +if (pDlg->Execute() == RET_OK) { rSh.StartAllAction(); rSh.StartUndo(UNDO_START); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/wrtw8nds.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b51c60b8b84c6a211b1c89bfd3001cb562ba5907 Author: Justin LuthDate: Mon Feb 29 11:51:27 2016 +0300 tdf#97960 - .doc: preserve font size in empty cells fixes regression from commit e1b123896d5b0a96c2959b6b6768c7cffabafd4f. Change-Id: Iccc10cdba89cdae6a5618d29022e0eaf609c9d6f Reviewed-on: https://gerrit.libreoffice.org/22778 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 9adbbb1..832f854 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2401,7 +2401,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) WriteCR( pTextNodeInfoInner ); -if ( bIsEndOfCell ) +if ( (0 != nEnd) && bIsEndOfCell ) { AttrOutput().OutputFKP(true); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/ole/ndole.cxx | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) New commits: commit 1226da376576434c9cea3c80bf304190605edc4c Author: Michael StahlDate: Fri Feb 12 13:40:46 2016 +0100 sw: don't crash if Office.Common/Cache/Writer/OLE_Objects set to 1 (possibly regression from b717bda1f6484905aebc571c4538165a1fbfd2bb) (cherry picked from commit 60d4dd0a6c44b45ed424ca6a0ddcf857ec089b24) Change-Id: I9113fe2e769cd6ba56bdccc629ac63241b238553 Reviewed-on: https://gerrit.libreoffice.org/22335 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index ddedf77..c2bccbd 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -84,7 +84,7 @@ public: void RemoveObj( SwOLEObj& rObj ); }; -SwOLELRUCache* pOLELRU_Cache = 0; +std::shared_ptr g_pOLELRU_Cache; class SwOLEListener_Impl : public ::cppu::WeakImplHelper< embed::XStateChangeListener > { @@ -102,7 +102,7 @@ SwOLEListener_Impl::SwOLEListener_Impl( SwOLEObj* pObj ) { if ( mpObj->IsOleRef() && mpObj->GetOleRef()->getCurrentState() == embed::EmbedStates::RUNNING ) { -pOLELRU_Cache->InsertObj( *mpObj ); +g_pOLELRU_Cache->InsertObj( *mpObj ); } } @@ -114,29 +114,29 @@ void SAL_CALL SwOLEListener_Impl::stateChanged( const lang::EventObject&, ::sal_ { if ( mpObj && nOldState == embed::EmbedStates::LOADED && nNewState == embed::EmbedStates::RUNNING ) { -if( !pOLELRU_Cache ) -pOLELRU_Cache = new SwOLELRUCache; -pOLELRU_Cache->InsertObj( *mpObj ); +if (!g_pOLELRU_Cache) +g_pOLELRU_Cache.reset(new SwOLELRUCache); +g_pOLELRU_Cache->InsertObj( *mpObj ); } else if ( mpObj && nNewState == embed::EmbedStates::LOADED && nOldState == embed::EmbedStates::RUNNING ) { -if ( pOLELRU_Cache ) -pOLELRU_Cache->RemoveObj( *mpObj ); +if (g_pOLELRU_Cache) +g_pOLELRU_Cache->RemoveObj( *mpObj ); } } void SwOLEListener_Impl::Release() { -if ( mpObj && pOLELRU_Cache ) -pOLELRU_Cache->RemoveObj( *mpObj ); +if (mpObj && g_pOLELRU_Cache) +g_pOLELRU_Cache->RemoveObj( *mpObj ); mpObj=0; release(); } void SAL_CALL SwOLEListener_Impl::disposing( const lang::EventObject& ) throw (uno::RuntimeException, std::exception) { -if ( mpObj && pOLELRU_Cache ) -pOLELRU_Cache->RemoveObj( *mpObj ); +if (mpObj && g_pOLELRU_Cache) +g_pOLELRU_Cache->RemoveObj( *mpObj ); } // TODO/LATER: actually SwEmbedObjectLink should be used here, but because different objects are used to control @@ -810,9 +810,9 @@ const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef() else if ( xOLERef->getCurrentState() == embed::EmbedStates::RUNNING ) { // move object to first position in cache -if( !pOLELRU_Cache ) -pOLELRU_Cache = new SwOLELRUCache; -pOLELRU_Cache->InsertObj( *this ); +if (!g_pOLELRU_Cache) +g_pOLELRU_Cache.reset(new SwOLELRUCache); +g_pOLELRU_Cache->InsertObj( *this ); } return xOLERef.GetObject(); @@ -939,6 +939,7 @@ void SwOLELRUCache::Load() { if (nVal < m_nLRU_InitSize) { +std::shared_ptr tmp(g_pOLELRU_Cache); // prevent delete this // size of cache has been changed sal_Int32 nCount = m_OleObjects.size(); sal_Int32 nPos = nCount; @@ -972,6 +973,7 @@ void SwOLELRUCache::InsertObj( SwOLEObj& rObj ) } if (it == m_OleObjects.end()) { +std::shared_ptr tmp(g_pOLELRU_Cache); // prevent delete this // try to remove objects if necessary sal_Int32 nCount = m_OleObjects.size(); sal_Int32 nPos = nCount-1; @@ -995,7 +997,10 @@ void SwOLELRUCache::RemoveObj( SwOLEObj& rObj ) } if (m_OleObjects.empty()) { -DELETEZ( pOLELRU_Cache ); +if (g_pOLELRU_Cache.unique()) // test that we're not in InsertObj() +{ +g_pOLELRU_Cache.reset(); +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/tox/ToxWhitespaceStripper.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit eeb7c6877d47bfb0a4871734a397be96eac46663 Author: Oliver SpechtDate: Wed Feb 10 16:57:14 2016 +0100 tdf#89505: replace tab character with space in table of contents the ToxWhitespaceStripper now replaces also tab characters so that they don't break the formatting Change-Id: If66aaddcbc0f8c65461f53f07ca7031f8f1d11b4 Reviewed-on: https://gerrit.libreoffice.org/22271 Tested-by: Jenkins Reviewed-by: Oliver Specht (cherry picked from commit 5152c43109c9a35f30fc9b0f478c1fbaf01a1143) Reviewed-on: https://gerrit.libreoffice.org/22284 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens diff --git a/sw/source/core/tox/ToxWhitespaceStripper.cxx b/sw/source/core/tox/ToxWhitespaceStripper.cxx index 4918a73..c38079c 100644 --- a/sw/source/core/tox/ToxWhitespaceStripper.cxx +++ b/sw/source/core/tox/ToxWhitespaceStripper.cxx @@ -24,7 +24,7 @@ ToxWhitespaceStripper::ToxWhitespaceStripper(const OUString& inputString) for (sal_Int32 pos = 0; pos < inputString.getLength(); ++pos) { sal_Unicode cur = inputString[pos]; -if (cur == ' ' || cur == '\n') { +if (cur == ' ' || cur == '\n' || cur == '\t') { // merge consecutive whitespaces (and translate them to spaces) if (!lastCharacterWasWhitespace) { buffer.append(' '); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/text/itrpaint.cxx | 19 ++- sw/source/core/text/porlin.hxx |1 + 2 files changed, 19 insertions(+), 1 deletion(-) New commits: commit 7b644045bebcd70e7324beac793b5018da1c4de5 Author: Justin LuthDate: Wed Oct 28 11:12:17 2015 +0300 tdf#93637 TAB_OVER_MARGIN support for a few more cases Extending nMaxRight when TAB_OVER_MARGIN compatibility is set and the right tabstop goes beyond the right margin fixes PDF output as well as certain cases of screen display. Reviewed-on: https://gerrit.libreoffice.org/19635 Tested-by: Jenkins Reviewed-by: Justin Luth (cherry picked from commit d1bd4465be649a4078c3a2f85a64c8a6300dd65d) Reviewed-on: https://gerrit.libreoffice.org/21561 Reviewed-by: Miklos Vajna (cherry picked from commit 8c564a1fd313da29088bed6453c5e16876690d24) Change-Id: Ida4b4f399f06670d9bdefdc21978adf19a81d53a Reviewed-on: https://gerrit.libreoffice.org/21694 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index 2461b8b..c4b20d1 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -37,6 +37,7 @@ #include #include +#include #include "flyfrms.hxx" #include "viewsh.hxx" @@ -161,8 +162,24 @@ void SwTextPainter::DrawTextLine( const SwRect , SwSaveClip , SwLinePortion *pPor = bEndPor ? pCurr->GetFirstPortion() : CalcPaintOfst( rPaint ); // Optimization! -const SwTwips nMaxRight = std::min( rPaint.Right(), Right() ); +SwTwips nMaxRight = std::min( rPaint.Right(), Right() ); const SwTwips nTmpLeft = GetInfo().X(); +//compatibility setting: allow tabstop text to exceed right margin +if( GetInfo().GetTextFrm()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_OVER_MARGIN) ) +{ +SwLinePortion* pPorIter = pPor; +while( pPorIter ) +{ +if( pPorIter->IsTabRightPortion() ) +{ + const SwTabRightPortion *pRightTabPor = static_cast (pPorIter); + const SwTwips nTabPos = nTmpLeft + pRightTabPor->GetTabPos(); +if( nMaxRight < nTabPos ) +nMaxRight = std::min( rPaint.Right(), nTabPos ); +} +pPorIter = pPorIter->GetPortion(); +} +} if( !bEndPor && nTmpLeft >= nMaxRight ) return; diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx index 792c9ef..1a3f4f8 100644 --- a/sw/source/core/text/porlin.hxx +++ b/sw/source/core/text/porlin.hxx @@ -130,6 +130,7 @@ public: inline bool IsTabCntPortion() const { return nWhichPor == POR_TABCENTER; } inline bool IsTabDecimalPortion() const { return nWhichPor == POR_TABDECIMAL; } inline bool IsTabLeftPortion() const { return nWhichPor == POR_TABLEFT; } +inline bool IsTabRightPortion() const { return nWhichPor == POR_TABRIGHT; } inline bool IsFootnoteNumPortion() const { return nWhichPor == POR_FTNNUM; } inline bool IsFootnotePortion() const { return nWhichPor == POR_FTN; } inline bool IsTmpEndPortion() const { return nWhichPor == POR_TMPEND; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/dbui/dbmgr.cxx | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) New commits: commit 8d03d6dea84f8c0c9a83031b646e242df7ea5678 Author: Jan-Marek GlogowskiDate: Tue Jan 5 20:53:06 2016 +0100 tdf#93565 Use multiple docs for individual PDF MM There is actually a comment in the mail merge code: // convert fields to text if we are exporting to PDF // this prevents a second merge while updating the fields // in SwXTextDocument::getRendererCount() This was included to fix i#93714. But the reference to 2005-05-23 #122919# in the actual code doesn't help to understand, why the original code is needed. I would like to get rid of it, but currently don't have time for tests. So the optimization to skip ConvertFieldsToText() and use a single working document for individual document mail merge breaks for PDF, as the working document won't contain any fields after the first document is written. This uses multiple working documents for PDF export again. (cherry picked from commit d7e0d0135ba65243fab5ee038c21290b8e74e548) Conflicts: sw/inc/dbmgr.hxx sw/source/uibase/dbui/dbmgr.cxx Change-Id: I0cf1c64da27863fc5fb4bb6c7812fed90b737d13 Reviewed-on: https://gerrit.libreoffice.org/21136 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit dcae0a5dba5aadc1e89828518102947f749db10e) Reviewed-on: https://gerrit.libreoffice.org/21478 Reviewed-by: Miklos Vajna diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 69c027c..98080da 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -928,6 +928,8 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, pStoreToFilterOptions = } } +const bool bIsPDFeport = pStoreToFilter && pStoreToFilter->GetFilterName() == "writer_pdf_Export"; + bCancel = false; // in case of creating a single resulting file this has to be created here @@ -1113,7 +1115,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, // Create a copy of the source document and work with that one instead of the source. // If we're not in the single file mode (which requires modifying the document for the merging), // it is enough to do this just once. -if( 1 == nDocNo || bCreateSingleFile ) +if( 1 == nDocNo || bCreateSingleFile || bIsPDFeport ) { assert( !xWorkDocSh.Is()); // copy the source document @@ -1271,7 +1273,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, //convert fields to text if we are exporting to PDF //this prevents a second merge while updating the fields in SwXTextDocument::getRendererCount() -if( pStoreToFilter && pStoreToFilter->GetFilterName() == "writer_pdf_Export") +if( bIsPDFeport ) rWorkShell.ConvertFieldsToText(); xWorkDocSh->DoSaveAs(*pDstMed); xWorkDocSh->DoSaveCompleted(pDstMed); @@ -1360,7 +1362,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, } } } -if( bCreateSingleFile ) +if( bCreateSingleFile || bIsPDFeport ) { pWorkDoc->SetDBManager( pOldDBManager ); xWorkDocSh->DoClose(); @@ -1398,8 +1400,11 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, psp::PrinterInfoManager::get().flushBatchPrint(); #endif } -pWorkDoc->SetDBManager( pOldDBManager ); -xWorkDocSh->DoClose(); +if( !bIsPDFeport ) +{ +pWorkDoc->SetDBManager( pOldDBManager ); +xWorkDocSh->DoClose(); +} } if (bCreateSingleFile) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/view/viewsh.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit be005a7a4ec5934372d4b13b96b22d2c8659ed95 Author: Miklos VajnaDate: Tue Dec 22 09:08:18 2015 +0100 tdf#93009 SwViewShell: fix printing of comments on the margin Clipping was set not only in case of VCL-level double buffering, but also during printing, which means comments were excluded from the output. (cherry picked from commit d6913850585eae90ea9179129fe7b60a2a4305ad) Change-Id: Iffb7d91ca78c09e2b43133f5049d52bd7dc4e730 Reviewed-on: https://gerrit.libreoffice.org/20872 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index d79458f..3d565ae 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -203,8 +203,8 @@ void SwViewShell::DLPrePaint2(const vcl::Region& rRegion) mpBufferedOut = mpOut; mpOut = &(mpTargetPaintWindow->GetTargetOutputDevice()); } -else -// In case mpOut is used without buffering, need to set clipping. +else if (isOutputToWindow()) +// In case mpOut is used without buffering and we're not printing, need to set clipping. mpOut->SetClipRegion(rRegion); // remember original paint MapMode for wrapped FlyFrame paints ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/docxattributeoutput.cxx | 89 --- sw/source/filter/ww8/docxexport.cxx | 103 ++- sw/source/filter/ww8/docxexport.hxx |2 3 files changed, 105 insertions(+), 89 deletions(-) New commits: commit c8c52960f1a23e6871504f890ca33ea0d19557b2 Author: Michael StahlDate: Wed Dec 2 16:00:58 2015 +0100 sw: move ProgId parsing to DocxExport::WriteOLEObject (cherry picked from commit a7762b56c0f0605d090ed95069db16c6641f769e) (cherry picked from commit 6768b669bafa62fe94a81971285e12823c3716e6) sw: docx export: write something more specific for embedded PDF Doesn't really change anything, but looks nicer. (cherry picked from commit 6c569a2ed797aa7ad52f8a7dc6be3bfb3b4b452a) (cherry picked from commit f8e628ab3993024e5e5885f99b5e9ebb2c30d467) Change-Id: Ieb308d717aa661fa51bd1b9dd3d0a12ca61337c1 Reviewed-on: https://gerrit.libreoffice.org/20758 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 049d280..19eb879 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4670,7 +4670,7 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S OUString sObjectName = aContainer->GetEmbeddedObjectName( xObj ); // set some attributes according to the type of the embedded object -OUString sProgID, sMediaType, sRelationType, sFileExtension, sDrawAspect="Content"; +OUString sProgID, sDrawAspect = "Content"; for( sal_Int32 i=0; i < aObjectsInteropList.getLength(); ++i ) if ( aObjectsInteropList[i].Name == sObjectName ) { @@ -4690,93 +4690,8 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S } } -if( sProgID == "Excel.Sheet.12" ) -{ -sMediaType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; -sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;; -sFileExtension = "xlsx"; -} -else if(sProgID.startsWith("Excel.SheetBinaryMacroEnabled.12") ) -{ -sMediaType = "application/vnd.ms-excel.sheet.binary.macroEnabled.12"; -sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;; -sFileExtension = "xlsb"; -} -else if( sProgID.startsWith("Excel.SheetMacroEnabled.12") ) -{ -sMediaType = "application/vnd.ms-excel.sheet.macroEnabled.12"; -sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;; -sFileExtension = "xlsm"; -} -else if( sProgID.startsWith("Excel.Sheet") ) -{ -sMediaType = "application/vnd.ms-excel"; -sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject;; -sFileExtension = "xls"; -} -else if( sProgID == "PowerPoint.Show.12" ) -{ -sMediaType = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; -sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;; -sFileExtension = "pptx"; -} -else if(sProgID == "PowerPoint.ShowMacroEnabled.12") -{ -sMediaType = "application/vnd.ms-powerpoint.presentation.macroEnabled.12"; -sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;; -sFileExtension = "pptm"; -} -else if( sProgID.startsWith("PowerPoint.Show") ) -{ -sMediaType = "application/vnd.ms-powerpoint"; -sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject;; -sFileExtension = "ppt"; -} -else if (sProgID.startsWith("PowerPoint.Slide.12")) -{ -sMediaType = "application/vnd.openxmlformats-officedocument.presentationml.slide"; - sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;; - sFileExtension = "sldx"; -} -else if( sProgID == "PowerPoint.SlideMacroEnabled.12" ) -{ - sMediaType = "application/vnd.ms-powerpoint.slide.macroEnabled.12"; - sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;; - sFileExtension = "sldm"; -} -else if( sProgID == "Word.DocumentMacroEnabled.12" ) -{ -sMediaType = "application/vnd.ms-word.document.macroEnabled.12"; -sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;; -sFileExtension = "docm"; -} -else if (sProgID == "Word.Document.12") -{ -sMediaType =
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/docxattributeoutput.cxx |6 +++--- sw/source/filter/ww8/docxattributeoutput.hxx |2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) New commits: commit c7d111b5b238035360b3a866125175f9e285c289 Author: Michael StahlDate: Tue Dec 15 22:45:41 2015 +0100 sw: DOCX export: eliminate chart numbering non-determinism ... that was causing test failures on some but not all platforms. (cherry picked from commit c56e0858b081b4dfe78745cf80c829f6c3c2e7b8) (cherry picked from commit 2263a59aaf6bc1548046fdda422518a6365ffd17) Change-Id: I0d04cd6e540ea2693a3ec8511d615a9b0fecf456 Reviewed-on: https://gerrit.libreoffice.org/20757 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c728769..049d280 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4411,10 +4411,9 @@ void DocxAttributeOutput::WritePostponedChart() FSEND ); OString aRelId; -static sal_Int32 nChartCount = 0; -nChartCount++; +m_nChartCount++; uno::Reference< frame::XModel > xModel( xChartDoc, uno::UNO_QUERY ); -aRelId = m_rExport.OutputChart( xModel, nChartCount, m_pSerializer ); +aRelId = m_rExport.OutputChart( xModel, m_nChartCount, m_pSerializer ); m_pSerializer->singleElementNS( XML_c, XML_chart, FSNS( XML_xmlns, XML_c ), "http://schemas.openxmlformats.org/drawingml/2006/chart;, @@ -8410,6 +8409,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport , FSHelperPtr pSeri m_startedHyperlink( false ), m_nHyperLinkCount(0), m_nFieldsInHyperlink( 0 ), + m_nChartCount(0), m_postponedChart( NULL ), pendingPlaceholder( NULL ), m_postitFieldsMaxId( 0 ), diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index e4c68e9..1ae2835 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -861,6 +861,8 @@ private: std::unique_ptr< std::list > m_pPostponedOLEs; std::vector m_aPostponedMaths; +/// count charts consistently for unit tests +unsigned int m_nChartCount; const SdrObject* m_postponedChart; Size m_postponedChartSize; std::vector m_aPostponedFormControls; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/ui/frmdlg/cption.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 0489922093317cf55a5e12c0e4718d0c8ad7ac1a Author: Caolán McNamaraDate: Thu Dec 3 09:30:44 2015 + Resolves: tdf#94701 allow fully deleting illustration category in combobox Change-Id: Iaaefbe2311e61be3b9689c693481d149aa1355f5 (cherry picked from commit 0261be7f92930952a470bc7f5e1d543b8907b1f0) (cherry picked from commit 2365ff9f02370d63aae3d5b04b90b3c1a58d1094) Reviewed-on: https://gerrit.libreoffice.org/20372 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index e97ef56..144bc08 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -83,10 +83,10 @@ public: OUString SwCaptionDialog::our_aSepTextSave(": "); // Caption separator text -//Resolves: fdo#47427 disallow typing *or* pasting content into the category box +//Resolves: tdf#47427 disallow typing *or* pasting invalid content into the category box OUString TextFilterAutoConvert::filter(const OUString ) { -if (rText != m_sNone && !SwCalc::IsValidVarName(rText)) +if (!rText.isEmpty() && rText != m_sNone && !SwCalc::IsValidVarName(rText)) return m_sLastGoodText; m_sLastGoodText = rText; return rText; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/text/itrpaint.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 307fcbf0ad716244210b4da75bbc947f1d5e26de Author: Mark HungDate: Wed Dec 2 23:22:54 2015 +0800 tdf#96125 Fix broken Writer paragraph text-to-text alignment feature. Revert "Fix tdf#77514 CJK ruby text in RTL( vertical ) base line issue." This reverts commit f0a149fe1c3224cef17f15e574b0a818923b57f6. Change-Id: I0a5b9ec2ea0225bf2ef587549e97c9c7b0541253 Reviewed-on: https://gerrit.libreoffice.org/20356 Tested-by: Jenkins Reviewed-by: Christian Lohmaier diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index fa9716e..2461b8b 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -236,7 +236,7 @@ void SwTextPainter::DrawTextLine( const SwRect , SwSaveClip , // we calculate Y value for the whole line SwTextGridItem const*const pGrid(GetGridItem(GetTextFrm()->FindPageFrm())); const bool bAdjustBaseLine = -( !GetTextFrm()->IsVertical() || GetLineInfo().HasSpecialAlign( true ) ) && (! GetTextFrm()->IsInFly()) && +GetLineInfo().HasSpecialAlign( GetTextFrm()->IsVertical() ) || ( 0 != pGrid ); const SwTwips nLineBaseLine = GetInfo().GetPos().Y() + nTmpAscent; if ( ! bAdjustBaseLine ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/access/accpara.cxx |2 ++ sw/source/core/attr/calbck.cxx |8 sw/source/core/unocore/unodraw.cxx |3 +++ sw/source/core/unocore/unoflatpara.cxx |3 +++ sw/source/core/unocore/unoframe.cxx|3 +++ sw/source/core/unocore/unoport.cxx |5 + sw/source/core/unocore/unosett.cxx |1 + sw/source/core/unocore/unostyle.cxx|2 ++ sw/source/core/unocore/unotbl.cxx | 16 ++-- 9 files changed, 41 insertions(+), 2 deletions(-) New commits: commit 351ac4169244ca2dd89ce449d7c4cfdb02af23f9 Author: Bjoern MichaelsenDate: Mon Nov 9 18:56:17 2015 +0100 fix a set of race conditions in the writer uno wrappers - whenever SwClients are added or removed, the SolarMutex should be locked - locking the mutex there would be a performance killer - thus only DBG_TESTSOLARMUTEX() and fixing the fallout on DBG_UTL builds - also fix SwXFlatParagraphIterator - another missing SolarMutex in Writer UNO - yet another member of SwXTextPortion needs to be guarded in the dtor - another missing SolarMutex in Writer UNO: SwXCell (cherry-picked from: ffdc5db260b7c17c47109f707b3664a3f3caafaa, c20930bfec4ce4953ffdaff1971216290fab0e4d, e61465d25f5e52bf439db65ed7a641722637034a, 453cf8a4c44b7935c3029524bfd40fa9c1d87753, f019f5d6fe05b15a83a7fea40d9448de2fabb00d) Change-Id: I1c8413cd0b9baa7f38e452e94f33e29bc4cf6717 Reviewed-on: https://gerrit.libreoffice.org/19856 Reviewed-on: https://gerrit.libreoffice.org/20089 Reviewed-by: Björn Michaelsen Tested-by: Björn Michaelsen diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index fab4074..77ec692 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -564,6 +564,8 @@ SwAccessibleParagraph::~SwAccessibleParagraph() delete pPortionData; delete pHyperTextData; delete mpParaChangeTrackInfo; // #i108125# +if(GetRegisteredIn()) +GetRegisteredIn()->Remove(this); } bool SwAccessibleParagraph::HasCursor() diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index d958bd6..e1fb6ea 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -22,12 +22,15 @@ #include #include #include +#include TYPEINIT0( SwClient ); SwClient::~SwClient() { +if(GetRegisteredIn()) +DBG_TESTSOLARMUTEX(); OSL_ENSURE( !pRegisteredIn || pRegisteredIn->HasWriterListeners(), "SwModify still known, but Client already disconnected!" ); if( pRegisteredIn && pRegisteredIn->HasWriterListeners() ) pRegisteredIn->Remove( this ); @@ -35,6 +38,7 @@ SwClient::~SwClient() void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* ) { +DBG_TESTSOLARMUTEX(); // this method only handles notification about dying SwModify objects if( (!pOld || pOld->Which() != RES_OBJECTDYING) ) return; @@ -58,6 +62,7 @@ void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* ) SwModify::~SwModify() { +DBG_TESTSOLARMUTEX(); OSL_ENSURE( !IsModifyLocked(), "Modify destroyed but locked." ); if ( IsInCache() ) @@ -94,6 +99,7 @@ SwModify::~SwModify() void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) { +DBG_TESTSOLARMUTEX(); if ( IsInCache() || IsInSwFntCache() ) { const sal_uInt16 nWhich = pOldValue ? pOldValue->Which() : @@ -144,6 +150,7 @@ bool SwModify::GetInfo( SfxPoolItem& rInfo ) const void SwModify::Add( SwClient* pDepend ) { OSL_ENSURE( !bLockClientList, "Client inserted while in Modify" ); +DBG_TESTSOLARMUTEX(); if(pDepend->pRegisteredIn != this ) { @@ -187,6 +194,7 @@ SwClient* SwModify::Remove( SwClient* pDepend ) if(m_bInDocDTOR) return nullptr; +DBG_TESTSOLARMUTEX(); assert(pDepend->pRegisteredIn == this); // SwClient is my listener diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 7b04865..4001ad9 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1007,12 +1007,15 @@ void SwXShape::AddExistingShapeToFormat( SdrObject& _rObj ) SwXShape::~SwXShape() { +SolarMutexGuard aGuard; if (xShapeAgg.is()) { uno::Reference< uno::XInterface > xRef; xShapeAgg->setDelegator(xRef); } delete pImpl; +if(GetRegisteredIn()) +GetRegisteredIn()->Remove(this); } uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeException, std::exception ) diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 8bda7b7..47b8ce2 100644 ---
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/bastyp/calc.cxx | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) New commits: commit 238a02cb567768ff0d7338ddab87441ec5e5d470 Author: Julien NabetDate: Sun Nov 22 17:42:08 2015 +0100 tdf#61228: Wrong function names in Formula Writer are considered as SUM Unknown names make the formula fail PythonTest_sw_python, especially set_expression is ok Variables are taken into account Thanks to Mike Kaganski for his help on this patch. Change-Id: Ia6f9c54d90ce88138fd9c9df9422b34ce8223ca2 Reviewed-on: https://gerrit.libreoffice.org/20122 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit d667e3210b12c7ce3b3727e2a0e369a520fbaaa4) Reviewed-on: https://gerrit.libreoffice.org/20159 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 1eb97f3..4e82bb4 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -1317,16 +1317,21 @@ SwSbxValue SwCalc::Prim() break; case CALC_NAME: -if( GetToken() == CALC_ASSIGN ) +switch(SwCalcOper nOper = GetToken()) { -SwCalcExp* n = VarInsert( aVarName ); -GetToken(); -nErg = n->nValue = Expr(); -} -else -{ -nErg = VarLook( aVarName )->nValue; -bChkPow = true; +case CALC_ASSIGN: +{ +SwCalcExp* n = VarInsert(aVarName); +GetToken(); +nErg = n->nValue = Expr(); +} +break; +default: +nErg = VarLook(aVarName)->nValue; +if (nErg.IsVoidValue() && (nOper == CALC_LP)) +eError = CALC_SYNTAX; +else +bChkPow = true; } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/fields/cellfml.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 74d6d268e9a7193dcca39bbfad2830a2504dfe79 Author: Oliver SpechtDate: Fri Nov 6 13:33:58 2015 +0100 tdf#94624 calculation of power operator fixed cell values are added in parentheses to make sure negative values are handled correctly Change-Id: I7366493e3cd6c25607e311d4b610ef8aa704a8bb Reviewed-on: https://gerrit.libreoffice.org/19821 Tested-by: Jenkins Reviewed-by: Oliver Specht (cherry picked from commit 0bd2a5eedd91466f97806e198b125546d256d1f8) Reviewed-on: https://gerrit.libreoffice.org/19826 Reviewed-by: Michael Stahl diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 1010f00..6565401 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -366,8 +366,10 @@ void SwTableFormula::_MakeFormula( const SwTable& rTable, OUString& rNewStr, // calculate the value of the box if ( pSttBox->getRowSpan() >= 1 ) { +rNewStr += "("; rNewStr += pCalcPara->rCalc.GetStrResult( pSttBox->GetValue( *pCalcPara ), false ); +rNewStr += ")"; } } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/objectpositioning/anchoredobjectposition.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 98ef16db0d228ebc0e7bad0290dcc9d3f1d6469b Author: László NémethDate: Fri Nov 6 14:54:02 2015 +0100 tdf#92648 fix DOCX import regression (textbox shrinking in footers) caused by the fix for tdf#91260 (cherry picked from commit 16331514fd10d444bec89f892a106cbbba9e16c0) Change-Id: I4a5a27b51c4cb1304647b5432c06ca9c5a96590d Reviewed-on: https://gerrit.libreoffice.org/19877 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index b4e63e3..ee354ce 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -484,8 +484,10 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc SwFrameFormat* pFrameFormat = ::FindFrameFormat(()); SwFormatFrmSize aSize(pFormat->GetFrmSize()); SwTwips nShrinked = aSize.GetHeight() - (nProposedRelPosY - nAdjustedRelPosY); -aSize.SetHeight( nShrinked > 0 ? nShrinked : 0 ); -pFrameFormat->SetFormatAttr(aSize); +if (nShrinked >= 0) { +aSize.SetHeight( nShrinked ); +pFrameFormat->SetFormatAttr(aSize); +} nAdjustedRelPosY = nProposedRelPosY; } else if ( SwTextBoxHelper::findTextBox(pFormat) ) // when the shape has a textbox, use only the proposed vertical position ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/shells/textsh.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 278287256f560a21105998164e7ee055a7fa36c0 Author: Oliver SpechtDate: Mon Oct 5 16:11:45 2015 +0200 tdf#93720: Interactive frame insertion is disabled if table is selected Current implementation does not support interactive frame insertion that moves the table into the frame Change-Id: I57a69f680f1218bd3014da494d41542ad0b72dd1 Reviewed-on: https://gerrit.libreoffice.org/19157 Tested-by: Jenkins Reviewed-by: Oliver Specht Reviewed-on: https://gerrit.libreoffice.org/19675 Reviewed-by: Miklos Vajna diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index db44c79..9953023 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -769,6 +769,7 @@ void SwTextShell::StateInsert( SfxItemSet ) case FN_INSERT_FRAME_INTERACT: { if( GetShell().IsSelFrmMode() +|| rSh.IsTableMode() || GetShell().CrsrInsideInputField() || bCrsrInHidden ) rSet.DisableItem(nWhich); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/text/itratr.cxx | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) New commits: commit ae846d08b1a18d4cd8f7d59774b3f6686e383280 Author: Michael StahlDate: Wed Oct 28 14:15:01 2015 +0100 tdf#94871: sw: fix a frame formatting regression that affects help The early return must also be taken if the anchor is neither AT_CHAR nor AT_PARA. (regression from a219bbb62f974020fac0799143fbc51c385bb460) Change-Id: I4eccb1f80401ba620ef87342f40c1a896918f3d3 (cherry picked from commit 9092f96c63c05833ee5319935da1078afe216b55) Reviewed-on: https://gerrit.libreoffice.org/19649 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 3201e7f..28f8feb 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -434,15 +434,17 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, SwMinMaxNodeArgs* pIn ) { const SwFormatAnchor& rFormatA = pNd->GetAnchor(); -if ((FLY_AT_PARA == rFormatA.GetAnchorId()) || -(FLY_AT_CHAR == rFormatA.GetAnchorId())) +if ((FLY_AT_PARA != rFormatA.GetAnchorId()) && +(FLY_AT_CHAR != rFormatA.GetAnchorId())) { -const SwPosition *pPos = rFormatA.GetContentAnchor(); -OSL_ENSURE(pPos && pIn, "Unexpected NULL arguments"); -if (!pPos || !pIn || pIn->nIndx != pPos->nNode.GetIndex()) -return; +return; } +const SwPosition *pPos = rFormatA.GetContentAnchor(); +OSL_ENSURE(pPos && pIn, "Unexpected NULL arguments"); +if (!pPos || !pIn || pIn->nIndx != pPos->nNode.GetIndex()) +return; + long nMin, nMax; SwHTMLTableLayout *pLayout = 0; const bool bIsDrawFrameFormat = pNd->Which()==RES_DRAWFRMFMT; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/shells/textsh1.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 61693775969fb7c8bfadfae72405225411ce79ea Author: Stephan BergmannDate: Thu Oct 29 17:52:38 2015 +0100 tdf#93509: Commit at the right time when the change is made, not during exit (as did 4aab13f77e5dc218d067ca7efe3622f4ea780bf9 "tdf#93509: crash on storing auto correction config fixed," which caused PythonTest_sw_python to crash during exit) (cherry picked from commit fc7df6f9a6caf975867f4fcb87b5b0c86ed1ee84) Conflicts: sw/source/uibase/app/swdll.cxx Change-Id: I0e9c264ae3fee7fdb732d36f42ebbb477557a644 Reviewed-on: https://gerrit.libreoffice.org/19673 Tested-by: Jenkins Reviewed-by: Oliver Specht diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 61398c8..48e3b1b 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -666,6 +666,7 @@ void SwTextShell::Execute(SfxRequest ) if( bSet != rACfg.IsAutoFormatByInput() ) { rACfg.SetAutoFormatByInput( bSet ); +rACfg.Commit(); GetView().GetViewFrame()->GetBindings().Invalidate( nSlot ); if ( !pItem ) rReq.AppendItem( SfxBoolItem( GetPool().GetWhich(nSlot), bSet ) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/inc/redlndlg.hxx |7 +++ sw/source/uibase/misc/redlndlg.cxx | 16 2 files changed, 15 insertions(+), 8 deletions(-) New commits: commit f535211ce4687cc311a6ad6fa0ddc1054a791c4f Author: Andras TimarDate: Wed Oct 28 12:39:56 2015 -0700 tdf#91270 fix crash on exit (Windows) dynamic atexit destructor and const static variables reportedly cause crash, let's avoid this. Change-Id: I24234084f810854606dde9914bee1c98ebc2e3dd Reviewed-on: https://gerrit.libreoffice.org/19657 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx index a093230..1490b6b 100644 --- a/sw/source/uibase/inc/redlndlg.hxx +++ b/sw/source/uibase/inc/redlndlg.hxx @@ -93,6 +93,13 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg // prevent update dialog data during longer operations (cf #102657#) boolbInhibitActivate; +Image aInserted; +Image aDeleted; +Image aFormated; +Image aTableChgd; +Image aFormatCollSet; +Image aAutoFormat; + DECL_DLLPRIVATE_LINK( AcceptHdl, void* ); DECL_DLLPRIVATE_LINK( AcceptAllHdl, void* ); DECL_DLLPRIVATE_LINK( RejectHdl, void* ); diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 73acb6a..a435591 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -160,7 +160,14 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer bOnlyFormatedRedlines( false ), bHasReadonlySel ( false ), bRedlnAutoFormat (bAutoFormat), -bInhibitActivate( false ) +bInhibitActivate( false ), +aInserted (SW_RES(IMG_REDLINE_INSERTED)), +aDeleted(SW_RES(IMG_REDLINE_DELETED)), +aFormated (SW_RES(IMG_REDLINE_FORMATED)), +aTableChgd (SW_RES(IMG_REDLINE_TABLECHG)), +aFormatCollSet (SW_RES(IMG_REDLINE_FMTCOLLSET)), +aAutoFormat (SW_RES(IMG_REDLINE_AUTOFMT)) + { aTabPagesCTRL->SetHelpId(HID_REDLINE_CTRL); pTPView = aTabPagesCTRL->GetViewPage(); @@ -338,13 +345,6 @@ OUString SwRedlineAcceptDlg::GetRedlineText(const SwRangeRedline& rRedln, DateTi Image SwRedlineAcceptDlg::GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack) { -const static Image aInserted(SW_RES(IMG_REDLINE_INSERTED)); -const static Image aDeleted(SW_RES(IMG_REDLINE_DELETED)); -const static Image aFormated(SW_RES(IMG_REDLINE_FORMATED)); -const static Image aTableChgd(SW_RES(IMG_REDLINE_TABLECHG)); -const static Image aFormatCollSet(SW_RES(IMG_REDLINE_FMTCOLLSET)); -const static Image aAutoFormat(SW_RES(IMG_REDLINE_AUTOFMT)); - switch (rRedln.GetType(nStack)) { case nsRedlineType_t::REDLINE_INSERT: return aInserted; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/docvw/edtwin.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 2b766197bdf195789ac126899e1b117bc759b72a Author: Oliver SpechtDate: Thu Oct 15 18:55:55 2015 +0200 tdf#95091: enable delete and backspace in editable elements within protections when editing is enabled also delete and backspace should be possible this applies e.g. to input fields within protected sections Change-Id: Iee5ef133971a3f2967e6c92e685a16afa003cfe8 Reviewed-on: https://gerrit.libreoffice.org/19399 Tested-by: Jenkins Reviewed-by: Oliver Specht (cherry picked from commit ac427caf1069ff66b4893bb2e937c2408d7c37b3) Reviewed-on: https://gerrit.libreoffice.org/19453 Reviewed-by: Björn Michaelsen Tested-by: Björn Michaelsen diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 388ca50..a76f6875 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1822,7 +1822,7 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KEY_DELETE: -if ( !rSh.HasReadonlySel() ) +if ( !rSh.HasReadonlySel() || rSh.CrsrInsideInputField()) { if (rSh.IsInFrontOfLabel() && rSh.NumOrNoNum(false)) eKeyState = KS_NumOrNoNum; @@ -1909,7 +1909,7 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KEY_BACKSPACE: case KEY_BACKSPACE | KEY_SHIFT: -if ( !rSh.HasReadonlySel() ) +if ( !rSh.HasReadonlySel() || rSh.CrsrInsideInputField()) { bool bDone = false; // try to add comment for code snip: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/text/portxt.cxx | 53 + 1 file changed, 2 insertions(+), 51 deletions(-) New commits: commit 9c9e9e153792081a5c91516b96b3bad54c929ddc Author: Tomaž VajngerlDate: Mon Oct 12 23:28:53 2015 +0200 tdf#77014 fix input field breaking of words at new line SwTextInputFieldPortion::Format has previously tried to erase the input field special chars, which caused the words not breaking as expected or in the same way as normal text. It appears that it is actually not necessary to do this at all so just calling the super class method SwTextPortion::Format does the job and fixes the problem. After testing I could not find anything that is obviously wrong. Change-Id: Ie763f55ad55863dd224425dc481b7100deb639fa (cherry picked from commit 5e1714fd7fcb45fa5f1220d892dba597da40b500) Reviewed-on: https://gerrit.libreoffice.org/19349 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 5220493..b66ee15 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -655,58 +655,9 @@ SwTextInputFieldPortion::SwTextInputFieldPortion() SetWhichPor( POR_INPUTFLD ); } -bool SwTextInputFieldPortion::Format( SwTextFormatInfo ) +bool SwTextInputFieldPortion::Format(SwTextFormatInfo ) { -mbContainsInputFieldStart = -rInf.GetChar( rInf.GetIdx() ) == CH_TXT_ATR_INPUTFIELDSTART; -mbContainsInputFieldEnd = -rInf.GetChar( rInf.GetIdx() + rInf.GetLen() - 1 ) == CH_TXT_ATR_INPUTFIELDEND; - -bool bRet = false; -if ( rInf.GetLen() == 1 - && ( mbContainsInputFieldStart || mbContainsInputFieldEnd ) ) -{ -Width( 0 ); -} -else -{ -SwTextSlot aFormatText( , this, true, true ); -if ( rInf.GetLen() == 0 ) -{ -Width( 0 ); -} -else -{ -const sal_Int32 nFormerLineStart = rInf.GetLineStart(); -if ( !mbContainsInputFieldStart ) -{ -rInf.SetLineStart( 0 ); -} - -bRet = SwTextPortion::Format( rInf ); - -if ( mbContainsInputFieldEnd ) -{ -// adjust portion length accordingly, if complete text fits into the portion -if ( GetLen() == rInf.GetLen() ) -{ -SetLen( GetLen() + 1 ); -} -} - -if ( mbContainsInputFieldStart ) -{ -// adjust portion length accordingly -SetLen( GetLen() + 1 ); -} -else -{ -rInf.SetLineStart( nFormerLineStart ); -} -} -} - -return bRet; +return SwTextPortion::Format(rTextFormatInfo); } void SwTextInputFieldPortion::Paint( const SwTextPaintInfo ) const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8par.cxx | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) New commits: commit 00316aa39b558869544bdb08d2f5d9d63eb6718e Author: Caolán McNamaraDate: Mon Oct 12 20:56:51 2015 +0100 fix tdf#94818 while retaining the tdf#90504 fix Change-Id: Ia1c904b16d040714c8d5a0b4946bc42e6b8ac3bb (cherry picked from commit 959ac511dbebeb3983da92052ced837b39b74ed9) Reviewed-on: https://gerrit.libreoffice.org/19342 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 4a352dd..1fecce8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3534,11 +3534,24 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) } break; case 0x7: -bNewParaEnd = true; -if (m_pPlcxMan->GetPapPLCF()->Where() == nCpOfs+nPosCp+1) -TabCellEnd(); // Table cell/row end -else -bParaMark = true; +{ +bNewParaEnd = true; +WW8PLCFxDesc* pPap = m_pPlcxMan->GetPap(); +//The last paragraph of each cell is terminated by a special +//paragraph mark called a cell mark. Following the cell mark +//that ends the last cell of a table row, the table row is +//terminated by a special paragraph mark called a row mark +// +//So the 0x7 should be right at the end of the previous +//range to be a real cell-end. +if (pPap->nOrigStartPos == nCpOfs+nPosCp+1 || +pPap->nOrigStartPos == WW8_CP_MAX) +{ +TabCellEnd(); // Table cell/row end +} +else +bParaMark = true; +} break; case 0xf: if( !m_bSpec )// "Satellite" ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/sidebar/PagePropertyPanel.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit d7e0cb228545f0b2570276e12dbe21ccf1a1621a Author: Caolán McNamaraDate: Mon Oct 12 10:50:22 2015 +0100 valgrind: memory leaks Change-Id: If47170b323cb0b48b7cf2182ecbecfac575a6118 (cherry picked from commit 2445de28ad8cc1aed1302e14a2da3372a9f23c10) Reviewed-on: https://gerrit.libreoffice.org/19319 Tested-by: Jenkins Reviewed-by: David Tardon diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx index 0d0ac10..bcba92c 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx @@ -226,6 +226,11 @@ void PagePropertyPanel::dispose() m_aSwPageColControl.dispose(); m_aSwPagePgMetricControl.dispose(); +maColumnPopup.dispose(); +maSizePopup.dispose(); +maMarginPopup.dispose(); +maOrientationPopup.dispose(); + PanelLayout::dispose(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/crsr/crossrefbookmark.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6e0638338d5c587d6bbb9c349d1b25382fbdbfce Author: Oliver SpechtDate: Wed Oct 7 16:16:20 2015 +0200 tdf#94804: prefix to save cross reference bookmark fixed bookmarks as references to numbered paragraphs are now saved using the prefix '__RefNumPara__' as the import already expects Change-Id: I6f7c41e95fa9f936a7eb21d4cb7461d4575c492a Reviewed-on: https://gerrit.libreoffice.org/19229 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 85eb4d9514858c71fb22c5ed93d651ea24bc6c05) Reviewed-on: https://gerrit.libreoffice.org/19336 Tested-by: Michael Stahl diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx index 9ec38bd..f54586a 100644 --- a/sw/source/core/crsr/crossrefbookmark.cxx +++ b/sw/source/core/crsr/crossrefbookmark.cxx @@ -84,7 +84,7 @@ namespace sw { namespace mark const vcl::KeyCode& rCode, const OUString& rName, const OUString& rShortName) -: CrossRefBookmark(rPaM, rCode, rName, rShortName, IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()) +: CrossRefBookmark(rPaM, rCode, rName, rShortName, CrossRefNumItemBookmark_NamePrefix) { } bool CrossRefNumItemBookmark::IsLegalName(const OUString& rName) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/shells/textsh.cxx | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) New commits: commit f6c542f88aaae45873ba0258df16a05a12bf5968 Author: Justin LuthDate: Sat Oct 3 09:35:26 2015 +0300 tdf#94679 Writer: fix lost selection with Shift-PageDown Push/Pop-ing the cursor led to selection loss. SelectHiddenRange() immediately returns false if the current cursor hasMark(), so avoid all of the bugs and expensive push/pop routines when there is a mark already. Change-Id: I4624a3e0b2267942812d0429d527ad97962ec7fc Reviewed-on: https://gerrit.libreoffice.org/19108 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit fb62052d5ac069d700a5410db35d6949a4c4008b) Reviewed-on: https://gerrit.libreoffice.org/19277 Tested-by: Jenkins diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 6087187..db44c79 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -698,9 +698,13 @@ void SwTextShell::StateInsert( SfxItemSet ) SfxObjectCreateMode eCreateMode = GetView().GetDocShell()->GetCreateMode(); -rSh.Push(); -const bool bCrsrInHidden = rSh.SelectHiddenRange(); -rSh.Pop(); +bool bCrsrInHidden = false; +if( !rSh.HasMark() ) +{ +rSh.Push(); +bCrsrInHidden = rSh.SelectHiddenRange(); +rSh.Pop(); +} while ( nWhich ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/text/frmform.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e450bd6ebde3892850c5fcf5590122a2f10ac8ae Author: Caolán McNamaraDate: Fri Oct 2 15:29:16 2015 +0100 Related: tdf#93461 relax loop detection some more original tdf#66141 continues to not fail with this modification, but original reporter of the follow up problem has verified that relaxing this more fixes the continued misplacement of caption text in a private RH document (cherry picked from commit a6e6eb8b37ba431df575be4799114bb821f54b0d) Change-Id: Ic1a339619912127009e760aa2ade9f29a545f7ec Reviewed-on: https://gerrit.libreoffice.org/19173 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 7f863c6..09de3d8 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1919,7 +1919,7 @@ bool SwTextFrm::FormatQuick( bool bForceQuickFormat ) else nLoopProtection = 0; nStart = nNewStart; -const bool bWillEndlessInsert = nLoopProtection > 2; +const bool bWillEndlessInsert = nLoopProtection > 250; SAL_WARN_IF(bWillEndlessInsert, "sw", "loop detection triggered"); if ((!bWillEndlessInsert) // Check for special case: line is invisible, // like in too thin table cell: tdf#66141 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/text/frmform.cxx | 16 1 file changed, 12 insertions(+), 4 deletions(-) New commits: commit dabd6add51783f7b9fed502873dfa71beb936e96 Author: Caolán McNamaraDate: Mon Sep 28 13:28:13 2015 +0100 Resolves: tdf#93461 captions laid out behind images regression from... commit 8a08f68669f9acfe98dadcca4af6519164a17000 Author: Mike Date: Mon Apr 27 01:27:05 2015 +1000 tdf#66141: SwTxtFrm::FormatQuick(bool) endless loop If a line happens to be invisible (e.g. in too thin cell of a table) then aLine.FormatLine(nStart) returns nStart, and aLine.Insert( new SwLineLayout() ) is executed until OOM. keep the zero advance loop detection attempt, but allow the first insertion and disallow subsequent inserts Change-Id: I16380588220149cfd0ed0f835f08d2849180fece (cherry picked from commit f06508e2cfa7e833862b7e9ff3b2f79181672275) Reviewed-on: https://gerrit.libreoffice.org/18908 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 263c05f..7f863c6 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1909,12 +1909,20 @@ bool SwTextFrm::FormatQuick( bool bForceQuickFormat ) sal_Int32 nStart = GetOfst(); const sal_Int32 nEnd = GetFollow() ? GetFollow()->GetOfst() : aInf.GetText().getLength(); + +int nLoopProtection = 0; do { -sal_Int32 nShift = aLine.FormatLine(nStart) - nStart; -nStart += nShift; -if ((nShift != 0) // Check for special case: line is invisible, - // like in too thin table cell: tdf#66141 +sal_Int32 nNewStart = aLine.FormatLine(nStart); +if (nNewStart == nStart) +++nLoopProtection; +else +nLoopProtection = 0; +nStart = nNewStart; +const bool bWillEndlessInsert = nLoopProtection > 2; +SAL_WARN_IF(bWillEndlessInsert, "sw", "loop detection triggered"); +if ((!bWillEndlessInsert) // Check for special case: line is invisible, + // like in too thin table cell: tdf#66141 && (aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd))) aLine.Insert( new SwLineLayout() ); } while( aLine.Next() ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/utlui/navipi.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 935c1294c21db82a6b96836057cd3a2e66351e89 Author: Caolán McNamaraDate: Wed Sep 30 09:14:04 2015 +0100 Resolves: tdf#93187 gtk3 spin box element in navigator cut-off Change-Id: Ifc1f226a38328e6ce02d3181917dd0530f320914 (cherry picked from commit 1e468ed58994f4eb75519cb52111ed942fbc7377) Reviewed-on: https://gerrit.libreoffice.org/19021 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 2f19e1f..f26f871 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -699,6 +699,8 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, Rectangle aSecondRect = aContentToolBox->GetItemRect(FN_SELECT_HEADER); Size aItemWinSize( aFirstRect.Left() - aSecondRect.Left(), aFirstRect.Bottom() - aFirstRect.Top() ); +Size aOptimalSize(pEdit->get_preferred_size()); +aItemWinSize.Width() = std::max(aItemWinSize.Width(), aOptimalSize.Width()); pEdit->SetSizePixel(aItemWinSize); aContentToolBox->InsertSeparator(4); aContentToolBox->InsertWindow( FN_PAGENUMBER, pEdit, ToolBoxItemBits::NONE, 4); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/layout/trvlfrm.cxx |3 +-- sw/source/core/text/itrcrsr.cxx |2 +- sw/source/core/text/itrpaint.cxx |2 +- 3 files changed, 3 insertions(+), 4 deletions(-) New commits: commit b63dcee30b7b7138f135fffd5abb6d9fa16d4f28 Author: Mark HungDate: Sat Aug 8 00:18:20 2015 +0800 Fix tdf#82176 CJK: Cursor position, line selection and non-printing characters do not take account of hanging punctuation. Note that placing a cursor next to the hanging puncuation is still not possible, but the selection and the non-printing characters works fine now. Change-Id: I22c8c2c5044b46c325236caffec67d9f68c23eed Reviewed-on: https://gerrit.libreoffice.org/17591 Tested-by: Jenkins Reviewed-by: Norbert Thiebaud Reviewed-on: https://gerrit.libreoffice.org/19031 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index bbb4e16..65aa24f 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -2429,8 +2429,7 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr ) { lLeft = (pStartFrm->Frm().*fnRect->fnGetLeft)() + (pStartFrm->Prt().*fnRect->fnGetLeft)(); -lRight = (pStartFrm->Frm().*fnRect->fnGetLeft)() + -(pStartFrm->Prt().*fnRect->fnGetRight)(); +lRight = (aEndFrm.*fnRect->fnGetRight)(); } if( lLeft < (aStFrm.*fnRect->fnGetLeft)() ) lLeft = (aStFrm.*fnRect->fnGetLeft)(); diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index d8ea12b..65e4689 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1265,7 +1265,7 @@ sal_Int32 SwTextCursor::GetCrsrOfst( SwPosition *pPos, const Point , // x is the horizontal offset within the line. SwTwips x = rPoint.X(); const SwTwips nLeftMargin = GetLineStart(); -SwTwips nRightMargin = GetLineEnd(); +SwTwips nRightMargin = GetLineEnd() + GetCurr()->GetHangingMargin(); if( nRightMargin == nLeftMargin ) nRightMargin += 30; diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index 4608248..fa9716e 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -423,7 +423,7 @@ void SwTextPainter::DrawTextLine( const SwRect , SwSaveClip , if ( bAdjustBaseLine ) GetInfo().Y( GetInfo().GetPos().Y() + AdjustBaseLine( *pCurr, ) ); - +GetInfo().X( GetInfo().X() + GetCurr()->GetHangingMargin() ); aEnd.Paint( GetInfo() ); GetInfo().Y( nOldY ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/doc/extinput.cxx | 43 +++- 1 file changed, 25 insertions(+), 18 deletions(-) New commits: commit 2b136504538a0b32e6ca9ae8fae8c41c084f4394 Author: Mark HungDate: Tue Sep 8 07:29:38 2015 +0800 Fix tdf#87500 - Freeze with English/Japanese mixture undo. Language poolitem will be inserted after user completes editing with IME, making it refer to valid range when undo. Change-Id: Id2876aa74dba6f7d134b8e2df4d9b36a8f429bb1 Reviewed-on: https://gerrit.libreoffice.org/18392 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/18877 Tested-by: Jenkins diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx index 362842a..9e82eca 100644 --- a/sw/source/core/doc/extinput.cxx +++ b/sw/source/core/doc/extinput.cxx @@ -59,6 +59,9 @@ SwExtTextInput::~SwExtTextInput() sal_Int32 nEndCnt = GetMark()->nContent.GetIndex(); if( nEndCnt != nSttCnt ) { +// Prevent IME edited text being grouped with non-IME edited text. +bool bKeepGroupUndo = pDoc->GetIDocumentUndoRedo().DoesGroupUndo(); +pDoc->GetIDocumentUndoRedo().DoGroupUndo(false); if( nEndCnt < nSttCnt ) { std::swap(nSttCnt, nEndCnt); @@ -66,24 +69,6 @@ SwExtTextInput::~SwExtTextInput() // In order to get Undo/Redlining etc. working correctly, // we need to go through the Doc interface -if(eInputLanguage != LANGUAGE_DONTKNOW) -{ -// #i41974# Only set language attribute -// for CJK/CTL scripts. -bool bLang = true; -sal_uInt16 nWhich = RES_CHRATR_LANGUAGE; - switch(SvtLanguageOptions::GetI18NScriptTypeOfLanguage(eInputLanguage)) -{ -case i18n::ScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break; -case i18n::ScriptType::COMPLEX: nWhich = RES_CHRATR_CTL_LANGUAGE; break; -default: bLang = false; -} -if ( bLang ) -{ -SvxLanguageItem aLangItem( eInputLanguage, nWhich ); - pDoc->getIDocumentContentOperations().InsertPoolItem(*this, aLangItem ); -} -} rIdx = nSttCnt; const OUString sText( pTNd->GetText().copy(nSttCnt, nEndCnt - nSttCnt)); if( bIsOverwriteCursor && !sOverwriteText.isEmpty() ) @@ -124,6 +109,28 @@ SwExtTextInput::~SwExtTextInput() pDoc->getIDocumentContentOperations().InsertString( *this, sText ); } } +pDoc->GetIDocumentUndoRedo().DoGroupUndo(bKeepGroupUndo); +if (eInputLanguage != LANGUAGE_DONTKNOW) +{ +sal_uInt16 nWhich = RES_CHRATR_LANGUAGE; +sal_Int16 nScriptType = SvtLanguageOptions::GetI18NScriptTypeOfLanguage(eInputLanguage); +switch(nScriptType) +{ +case i18n::ScriptType::ASIAN: +nWhich = RES_CHRATR_CJK_LANGUAGE; break; +case i18n::ScriptType::COMPLEX: +nWhich = RES_CHRATR_CTL_LANGUAGE; break; +} +// #i41974# Only set language attribute for CJK/CTL scripts. +if (RES_CHRATR_LANGUAGE != nWhich && pTNd->GetLang( nSttCnt, nEndCnt-nSttCnt, nScriptType) != eInputLanguage) +{ +SvxLanguageItem aLangItem( eInputLanguage, nWhich ); +rIdx = nSttCnt; +GetMark()->nContent = nEndCnt; + pDoc->getIDocumentContentOperations().InsertPoolItem(*this, aLangItem ); +} + +} } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/doc/docbm.cxx | 12 +--- sw/source/core/inc/MarkManager.hxx |2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) New commits: commit a9670e0735b77ecc40aa8af4106af7d32ec548a0 Author: Cor NouwsDate: Wed Sep 23 00:40:06 2015 +0200 tdf#86397 Bookmark: no consecutive name numbering applied when copied this partially changes behaviour introduced with commit bb00a0097900ae054401f7758a915047cfde4065 but without the performace problems from the old code thanks to kendy for helping (cherry picked from commit 2fcf8923d2c520a5a16b1b3a45877adaadd7eab4) Change-Id: I5dab81b58262f67db1c70223c612636a8b8c90ee Reviewed-on: https://gerrit.libreoffice.org/18816 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index be4805c..9b93a37 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1108,9 +1108,13 @@ namespace sw { namespace mark OUStringBuffer sBuf; OUString sTmp; -// Try the name "XXX", where XXX is a number. Start the number at the existing count rather than 1 -// in order to increase the chance that already the first one will not exist. -sal_Int32 nCnt = m_vAllMarks.size() + 1; +// try the name "XXX" (where XXX is a number starting from 1) unless there is +// a unused name. Due to performance-reasons (especially in mailmerge-Szenarios) there +// is a map m_aMarkBasenameMapUniqueOffset which holds the next possible offset (XXX) for +// rName (so there is no need to test for nCnt-values smaller than the offset). +sal_Int32 nCnt = 1; +MarkBasenameMapUniqueOffset_t::const_iterator aIter = m_aMarkBasenameMapUniqueOffset.find(rName); +if(aIter != m_aMarkBasenameMapUniqueOffset.end()) nCnt = aIter->second; while(nCnt < SAL_MAX_INT32) { sTmp = sBuf.append(rName).append(nCnt).makeStringAndClear(); @@ -1120,6 +1124,8 @@ namespace sw { namespace mark break; } } +m_aMarkBasenameMapUniqueOffset[rName] = nCnt; + return sTmp; } diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index 50186fd..b797764 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -27,6 +27,7 @@ namespace sw { namespace mark { +typedef std::unordered_map MarkBasenameMapUniqueOffset_t; class MarkManager : private ::boost::noncopyable @@ -109,6 +110,7 @@ namespace sw { container_t m_vFieldmarks; std::unordered_set m_aMarkNamesSet; +mutable MarkBasenameMapUniqueOffset_t m_aMarkBasenameMapUniqueOffset; // container for annotation marks container_t m_vAnnotationMarks; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/ui/frmdlg/cption.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 88ca0c91484350b60c6a10a7a1ef570d83560df1 Author: Caolán McNamaraDate: Wed Sep 9 11:30:11 2015 +0100 stray debugging lines Change-Id: I525009b9d037387b236cb4605fe0b93c94858d89 (cherry picked from commit b95175cc41f96ce669d2a4d4c55034c1f80ac74b) diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index bdf1e56..e97ef56 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -318,8 +318,6 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl) SwFieldType* pType = (bCorrectFieldName && !bNone) ? rSh.GetFieldType( RES_SETEXPFLD, sFieldTypeName ) : 0; -fprintf(stderr, "pType is %p\n", pType); -fprintf(stderr, "bCorrectFieldName is %d\n", bCorrectFieldName); m_pOKButton->Enable( bCorrectFieldName && (!pType || static_cast (pType)->GetType() == nsSwGetSetExpType::GSE_SEQ) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/app/docstyle.cxx | 10 ++ 1 file changed, 10 insertions(+) New commits: commit 1805b7549cd240009bf67eba3a030e19b4f6f046 Author: Michael StahlDate: Mon Sep 7 16:18:53 2015 +0200 tdf#90991: sw: fix style preview creating undo objects SwDocStyleSheet::FillStyleSheet() already takes care to remove all temporarily created styles, so assume that works and suppress the creation of user-visible Undo objects. Change-Id: I748f0e8304c42e767b331ebd22be0290b9c0d89d (cherry picked from commit 779b547ca6271156a59965569fa44fbeb3f63ce5) Reviewed-on: https://gerrit.libreoffice.org/18382 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index bb0f62f..016b1a1 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -1727,6 +1727,9 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pCharFormat; if( bFillOnlyInfo && !bPhysical ) { +// create style (plus all needed parents) and clean it up +// later - without affecting the undo/redo stack +::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); pCharFormat = lcl_FindCharFormat(rDoc, aName, this, true ); @@ -1754,6 +1757,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pColl; if( bFillOnlyInfo && !bPhysical ) { +::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); pColl = lcl_FindParaFormat(rDoc, aName, this, true ); @@ -1777,6 +1781,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pFrameFormat; if( bFillOnlyInfo && bPhysical ) { +::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); pFrameFormat = lcl_FindFrameFormat(rDoc, aName, this, true ); @@ -1796,6 +1801,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pDesc; if( bFillOnlyInfo && !pDesc ) { +::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); pDesc = lcl_FindPageDesc( rDoc, aName, this, true ); @@ -1824,6 +1830,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pNumRule; if( bFillOnlyInfo && !pNumRule ) { +::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); pNumRule = lcl_FindNumRule( rDoc, aName, this, true ); @@ -1890,7 +1897,10 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) SetMask( _nMask ); } if( bDeleteInfo && bFillOnlyInfo ) +{ +::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); ::lcl_DeleteInfoStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); +} return bRet; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/app/docstyle.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4b9c51bd265908e8bf65cb2a462dd8fd9a88904f Author: Michael StahlDate: Mon Sep 7 16:21:53 2015 +0200 sw: fix not-quite-copypaste code in SwDocStyleSheet::FillStyleSheet() This causes the temporary creation of frame styles to fail. Change-Id: I5d148ae008660d9c0f457a4c0e9dc256e0dfc49a (cherry picked from commit 110dc43d97d559b6369bca308f9dd39fd02e751e) Reviewed-on: https://gerrit.libreoffice.org/18380 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index 016b1a1..8c0c438 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -1779,7 +1779,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) case SFX_STYLE_FAMILY_FRAME: pFrameFormat = lcl_FindFrameFormat(rDoc, aName, this, bCreate); bPhysical = 0 != pFrameFormat; -if( bFillOnlyInfo && bPhysical ) +if (bFillOnlyInfo && !bPhysical) { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/doc/tblrwcl.cxx | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) New commits: commit 969ba5fe88c2f817f2121bb26f2d472cff891399 Author: Michael StahlDate: Fri Sep 4 21:53:34 2015 +0200 sw: erroneous vector assignment in SwTable::OldMerge() +rLineBoxes = pFndBox->GetLines()[nEnd]->GetBoxes(); This actually assigns the boxes vector of the last line to the first line, which the previous code didn't do. Notably after converting the types from boost::ptr_vector to std::vector, the assignment produces a several page error message from both GCC and clang, and infuriatingly neither compiler was able to tell on which line in tblrwcl.cxx the template was instantiated, so i had to bisect that. (regression from be5e4247e2a164bd1f2eacf9a33d6d73df16d0e3) Change-Id: I646e3ca678895480d38ec48f38d720458860a985 (cherry picked from commit 8bf0e60d1da6d1ab79455dc916fd8701122812d2) Reviewed-on: https://gerrit.libreoffice.org/18379 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 08db77b..12c24a5 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -1613,17 +1613,15 @@ bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes, _InsULPara aPara( pTableNd, true, true, pLeftBox, pMergeBox, pRightBox, pInsLine ); // Move the overlapping upper/lower Lines of the selected Area -_FndBoxes& rLineBoxes = pFndBox->GetLines().front().GetBoxes(); -for (_FndBoxes::iterator it = rLineBoxes.begin(); it != rLineBoxes.end(); ++it) +for (auto & it : pFndBox->GetLines().front().GetBoxes()) { -lcl_Merge_MoveBox(*it, ); +lcl_Merge_MoveBox(it, ); } aPara.SetLower( pInsLine ); const auto nEnd = pFndBox->GetLines().size()-1; -rLineBoxes = pFndBox->GetLines()[nEnd].GetBoxes(); -for (_FndBoxes::iterator it = rLineBoxes.begin(); it != rLineBoxes.end(); ++it) +for (auto & it : pFndBox->GetLines()[nEnd].GetBoxes()) { -lcl_Merge_MoveBox(*it, ); +lcl_Merge_MoveBox(it, ); } // Move the Boxes extending into the selected Area from left/right ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/app/docstyle.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit d83fc62ada63ea784faeee72a29b414e3efa61b3 Author: Michael StahlDate: Mon Sep 7 20:41:11 2015 +0200 tdf#91383: sw: actually reset the modified status too ... when deleting the temporarily inserted styles in SwDocStyleSheet::FillStyleSheet(). Change-Id: Id4abc067ce10b41486f659350267c7e3933db472 (cherry picked from commit 66133fd8882a070674bbb3803634c5e75e8ae772) Reviewed-on: https://gerrit.libreoffice.org/18387 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index 6727cb8..08da17c 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -1779,6 +1779,7 @@ bool SwDocStyleSheet::FillStyleSheet( bool bDeleteInfo = false; bool bFillOnlyInfo = FillAllInfo == eFType || FillPreview == eFType; std::vector aDelArr; +bool const isModified(rDoc.getIDocumentState().IsModified()); switch(nFamily) { @@ -1966,6 +1967,10 @@ bool SwDocStyleSheet::FillStyleSheet( { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); ::lcl_DeleteInfoStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); +if (!isModified) +{ +rDoc.getIDocumentState().ResetModified(); +} } return bRet; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/dbui/dbmgr.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit 2dc493b2ad57573d60b66a633b6fcccdbe0a3678 Author: Juergen FunkDate: Thu Sep 3 15:18:58 2015 +0200 tdf#93246: pass on cancel state in mail merge dialog The return result was not used for the CUPS case before, leading to un-cancelled printing / document generation in the file->print mail merge case. Change-Id: I470293755c6696fca6d1b97fa1dac7854b4f7107 Reviewed-on: https://gerrit.libreoffice.org/18302 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens Reviewed-on: https://gerrit.libreoffice.org/18329 Tested-by: Jenkins Reviewed-by: Katarina Behrens diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index f116153..69c027c 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1244,12 +1244,13 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, pWorkView->StartPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync ); SfxPrinter* pDocPrt = pWorkView->GetPrinter(false); JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : SfxViewShell::GetJobSetup(); -Printer::PreparePrintJob( pWorkView->GetPrinterController(), aJobSetup ); +bCancel = !Printer::PreparePrintJob( pWorkView->GetPrinterController(), aJobSetup ); #if ENABLE_CUPS && !defined(MACOSX) - psp::PrinterInfoManager::get().startBatchPrint(); +if( !bCancel ) + psp::PrinterInfoManager::get().startBatchPrint(); #endif } -if( !Printer::ExecutePrintJob( pWorkView->GetPrinterController())) +if( !bCancel && !Printer::ExecutePrintJob( pWorkView->GetPrinterController())) bCancel = true; } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/ui/index/swuiidxmrk.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9621bd268859c4810ddd3abd631f13c794e083c9 Author: Oliver SpechtDate: Fri Sep 4 09:01:07 2015 +0200 tdf#92732: fix vclptr lifecycle for index entry editing dialog Call SwViewShell::SetCareWin() in closeHdl instead of d'tor since with care window set the d'tor is never called Reviewed-on: https://gerrit.libreoffice.org/18330 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens (cherry picked from commit 51ac2bf234a98d8f7629132b59f6961597ecea14) Change-Id: Ieb8280ab57c3bccf95ce2ce96937aab261133ce0 Reviewed-on: https://gerrit.libreoffice.org/18333 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 8af83aa..c3e0d6b 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -621,6 +621,7 @@ IMPL_LINK_NOARG(SwIndexMarkPane, CloseHdl) } else { +SwViewShell::SetCareWin( 0 ); m_rDialog.EndDialog(RET_CANCEL); } return 0; @@ -930,7 +931,6 @@ IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, ComboBox *, pBox ) SwIndexMarkPane::~SwIndexMarkPane() { delete pTOXMgr; -SwViewShell::SetCareWin( 0 ); } voidSwIndexMarkPane::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/unocore/unoftn.cxx | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) New commits: commit adf39dbade8652ceca9007484bfa20f04c5ebec0 Author: Oliver SpechtDate: Thu Sep 3 10:36:53 2015 +0200 tdf#79018: Prevent line break as footnote label footnote labels must not contain line breaks Change-Id: I00d334197b960c4ed17fdee3ea8a1c734cbfa4c1 Reviewed-on: https://gerrit.libreoffice.org/18292 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 089d7f53ea232972961c14706a54187f075fa973) Reviewed-on: https://gerrit.libreoffice.org/18297 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 535603b..7d3ff5c 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -262,7 +262,12 @@ void SAL_CALL SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - +OUString newLabel(aLabel); +//new line must not occur as footnote label +if(newLabel.indexOf('\n') >=0 ) +{ + newLabel = newLabel.replace('\n', ' '); +} SwFormatFootnote const*const pFormat = m_pImpl->GetFootnoteFormat(); if(pFormat) { @@ -271,11 +276,11 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException, std: SwTextNode& rTextNode = (SwTextNode&)pTextFootnote->GetTextNode(); SwPaM aPam(rTextNode, pTextFootnote->GetStart()); -GetDoc()->SetCurFootnote(aPam, aLabel, pFormat->GetNumber(), pFormat->IsEndNote()); +GetDoc()->SetCurFootnote(aPam, newLabel, pFormat->GetNumber(), pFormat->IsEndNote()); } else if (m_pImpl->m_bIsDescriptor) { -m_pImpl->m_sLabel = aLabel; +m_pImpl->m_sLabel = newLabel; } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8par2.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit d55c97a58442346810493f2d816c8e965a5f704c Author: Caolán McNamaraDate: Wed Sep 2 15:13:33 2015 +0100 detect if new offsets are the same as the previous ones and avoid loop Change-Id: I4c53d4bce9a69d79e34bdd634c296d9b495e1904 (cherry picked from commit 137cf76573c89ea1b0b1f716a50731419a187473) Reviewed-on: https://gerrit.libreoffice.org/18273 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 03bada1..66baa45 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -413,6 +413,8 @@ bool SwWW8ImplReader::SearchRowEnd(WW8PLCFx_Cp_FKP* pPap, WW8_CP , WW8PLCFxDesc aRes; aRes.pMemPos = 0; aRes.nEndPos = rStartCp; +bool bReadRes(false); +WW8PLCFxDesc aPrevRes; while (pPap->HasFkp() && rStartCp != WW8_CP_MAX) { @@ -445,6 +447,13 @@ bool SwWW8ImplReader::SearchRowEnd(WW8PLCFx_Cp_FKP* pPap, WW8_CP , } pPap->GetSprms(); pPap->SetDirty(false); +if (bReadRes && aRes.nEndPos == aPrevRes.nEndPos && aRes.nStartPos == aPrevRes.nStartPos) +{ +SAL_WARN("sw.ww8", "SearchRowEnd, loop in paragraph property chain"); +break; +} +bReadRes = true; +aPrevRes = aRes; //Update our aRes to get the new starting point of the next properties rStartCp = aRes.nEndPos; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/view/viewsh.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 5e2ed069da0b21ee7f0e5f52b9ace5c98c12f0f9 Author: Miklos VajnaDate: Tue Sep 1 11:41:39 2015 +0200 SwViewShell::ImplEndAction: still paint directly when non-double-buffering It turns out that in this case we miss repainting if we go via invaliation-then-paint instead of direct painting when double-buffering is not enabled. Related commits: - beb4aa21d61f0d66392d596be86fb57b4b167239 (SwViewShell::ImplEndAction: avoid direct paint, 2015-06-29) and c9175a1bd3249ad573ae6827bf19963a3ebe2fbc (SwViewShell::ImplEndAction: avoid direct PaintDesktop(), 2015-07-03) globally avoided direct paints - 222f10e773ba51a19880be1b798990260c198147 (tdf#93096 sw: fix selection with keyboard outside current view, 2015-08-18) restored direct paint when non-double-buffering for the second commit, this one does the same for the first Change-Id: Ida0c6917a8cdec74209bd64813c7876d4fa61b8a Signed-off-by: László Németh diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 1b4b80d..cd04a88 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -419,7 +419,10 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd ) if ( bPaintsFromSystem ) PaintDesktop(*GetOut(), aRect); - pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect()); +if (!isTiledRendering()) +pCurrentLayout->Paint( *mpOut, aRect ); +else + pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect()); // #i75172# end DrawingLayer paint DLPostPaint2(true); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/ui/chrdlg/numpara.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fba2fee26909ac14f6d153166dc33bc29df4 Author: Julien NabetDate: Sat Aug 22 15:43:20 2015 +0200 tdf#93351: Edit style button in Schema & Numbering should point to List styles Related to http://cgit.freedesktop.org/libreoffice/core/commit/?id=e38f63d861715fb56f41af82b897c2128ea20b38 Change-Id: I4ede777207fe42dede6e82c7399189354f182f6a Reviewed-on: https://gerrit.libreoffice.org/17924 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt (cherry picked from commit ad8e2baf68ed5edccabdf56584768fcdaabbab5c) Reviewed-on: https://gerrit.libreoffice.org/17991 Reviewed-by: Maxim Monastirsky diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index ff8f908..1c5b2ff 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -335,7 +335,7 @@ IMPL_LINK_NOARG( SwParagraphNumTabPage, EditNumStyleSelectHdl_Impl ) IMPL_LINK_NOARG(SwParagraphNumTabPage, EditNumStyleHdl_Impl) { OUString aTemplName(m_pNumberStyleLB->GetSelectEntry()); -ExecuteEditNumStyle_Impl( SID_STYLE_EDIT, aTemplName, OUString(),SFX_STYLE_FAMILY_PARA, 0 ); +ExecuteEditNumStyle_Impl( SID_STYLE_EDIT, aTemplName, OUString(),SFX_STYLE_FAMILY_PSEUDO, 0 ); return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/xml/xmlimp.cxx | 12 1 file changed, 12 insertions(+) New commits: commit c5eb0eb4537182e0c8bc3c50acf30e69c454778d Author: Michael Stahl mst...@redhat.com Date: Mon Aug 24 22:56:17 2015 +0200 sw: Flat ODF import: set the InReading and InXMLImport flags Flat ODF Import does not use SwReader but uses SwXMLImport::startDocument() and SwXMLImport::endDocument() to set up the document, so make sure those set the import relevant SwDoc flags. Change-Id: Ife3e58eeebd73ad895fe328662822b847cf9bfec (cherry picked from commit 27a02d1708be7812668a84ea956edc8ecb312246) Reviewed-on: https://gerrit.libreoffice.org/18036 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index be9ad11..38120ed 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -652,6 +652,13 @@ void SwXMLImport::startDocument() if( !pDoc ) return; +if (SvXMLImportFlags::ALL == getImportFlags()) +{ +// for flat ODF - this is done in SwReader::Read() for package ODF +pDoc-SetInReading(true); +pDoc-SetInXMLImport(true); +} + if( (getImportFlags() SvXMLImportFlags::CONTENT) !IsStylesOnlyMode() ) { pSttNdIdx = new SwNodeIndex( pDoc-GetNodes() ); @@ -876,6 +883,11 @@ void SwXMLImport::endDocument() pDoc-PrtOLENotify( false ); else if ( pDoc-IsOLEPrtNotifyPending() ) pDoc-PrtOLENotify( true ); + +assert(pDoc-IsInReading()); +assert(pDoc-IsInXMLImport()); +pDoc-SetInReading(false); +pDoc-SetInXMLImport(false); } SwDrawModel* pDrawModel = pDoc-getIDocumentDrawModelAccess().GetDrawModel(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/doc/DocumentContentOperationsManager.cxx | 17 +--- 1 file changed, 10 insertions(+), 7 deletions(-) New commits: commit 1638e2bd0da0a356826d58e277a999c5449769ea Author: Bjoern Michaelsen bjoern.michael...@canonical.com Date: Fri Aug 28 13:25:08 2015 +0200 tdf#93353: fix copy fluy in fly - prevents flys in inlcuded docs in a master doc from disappearing - fixes a regression from 3fcb0c3aa8d58a819aa21eb9743eaa6da7394819 Change-Id: If211d8dbf423e2a33a258b43ab7092e1a010206f Reviewed-on: https://gerrit.libreoffice.org/18106 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Michael Stahl mst...@redhat.com diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 4f1c396..c6c69f3 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -3201,7 +3201,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( const SwNodeRange rRg, const sal_Int32 nEndContentIndex, const SwNodeIndex rStartIdx, -bool bCopyFlyAtFly, +const bool bCopyFlyAtFly, const bool bMergedFirstNode ) const { // First collect all Flys, sort them according to their ordering number, @@ -3223,22 +3223,25 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( bool bAtContent = (pAnchor-GetAnchorId() == FLY_AT_PARA); if ( !pAPos ) continue; +sal_uLong nSkipAfter = pAPos-nNode.GetIndex(); +sal_uLong nStart = rRg.aStart.GetIndex(); switch ( pAnchor-GetAnchorId() ) { case FLY_AT_FLY: -if( bCopyFlyAtFly rRg.aStart pAPos-nNode.GetIndex() + 1 ) -continue; +if(bCopyFlyAtFly) +++nSkipAfter; +else if(m_rDoc.getIDocumentRedlineAccess().IsRedlineMove()) +++nStart; break; case FLY_AT_CHAR: case FLY_AT_PARA: -bCopyFlyAtFly = false; +if(m_rDoc.getIDocumentRedlineAccess().IsRedlineMove()) +++nStart; break; default: continue; } -if ( !bCopyFlyAtFly ( m_rDoc.getIDocumentRedlineAccess().IsRedlineMove() -? rRg.aStart = pAPos-nNode -: rRg.aStart pAPos-nNode )) +if ( nStart nSkipAfter ) continue; if ( pAPos-nNode rRg.aEnd ) continue; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8glsy.cxx | 10 -- sw/source/filter/ww8/ww8par.cxx | 27 +++ sw/source/filter/ww8/ww8par.hxx | 11 ++- 3 files changed, 25 insertions(+), 23 deletions(-) New commits: commit 16479c8d88c63f6762dd202120439b190beacaae Author: Caolán McNamara caol...@redhat.com Date: Tue Aug 25 13:30:12 2015 +0100 we only need the PaM for its Point and only to create a uno cursor so do that in the ctor and drop the arg from a bunch of places (cherry picked from commit 3d992d77d8ae319b31dca808e8c08f439a1bc9c3) Change-Id: Iaad71e9854b38d8632df057dfe9c96468d1d0098 Reviewed-on: https://gerrit.libreoffice.org/17997 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index 7a8d0f4..f125f69 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -210,8 +210,6 @@ bool WW8Glossary::Load( SwTextBlocks rBlocks, bool bSaveRelFile ) if (xDocSh-DoInitNew(0)) { SwDoc *pD = static_castSwDocShell*((xDocSh))-GetDoc(); -SwWW8ImplReader* pRdr = new SwWW8ImplReader(pGlossary-nVersion, -xStg, rStrm, *pD, rBlocks.GetBaseURL(), true, false); SwNodeIndex aIdx( *pD-GetNodes().GetEndOfContent().StartOfSectionNode(), 1); @@ -223,11 +221,11 @@ bool WW8Glossary::Load( SwTextBlocks rBlocks, bool bSaveRelFile ) SwPaM aPamo( aIdx ); aPamo.GetPoint()-nContent.Assign(aIdx.GetNode().GetContentNode(), 0); -pRdr-LoadDoc(aPamo,this); - +std::unique_ptrSwWW8ImplReader xRdr(new SwWW8ImplReader( +pGlossary-nVersion, xStg, rStrm, *pD, rBlocks.GetBaseURL(), +true, false, *aPamo.GetPoint())); +xRdr-LoadDoc(this); bRet = MakeEntries(pD, rBlocks, bSaveRelFile, aStrings, aData); - -delete pRdr; } xDocSh-DoClose(); rBlocks.EndPutMuchBlockEntries(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 583d876..464db40 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4125,7 +4125,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) } SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage, -SvStream* pSt, SwDoc rD, const OUString rBaseURL, bool bNewDoc, bool bSkipImages) +SvStream* pSt, SwDoc rD, const OUString rBaseURL, bool bNewDoc, bool bSkipImages, SwPosition rPos) : m_pDocShell(rD.GetDocShell()) , m_pStg(pStorage) , m_pStrm(pSt) @@ -4261,6 +4261,8 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage, { m_pStrm-SetEndian( SvStreamEndian::LITTLE ); m_aApos.push_back(false); + +mpCrsr.reset(m_rDoc.CreateUnoCrsr(rPos)); } void SwWW8ImplReader::DeleteStk(SwFltControlStack* pStck) @@ -4879,7 +4881,7 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString sCreatedFrom, return bRes; } -sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition rPos) +sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) { sal_uLong nErrRet = 0; @@ -4915,7 +4917,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition rPos) pDocShell-SetReadOnlyUI(true); } -m_pPaM = m_rDoc.CreateUnoCrsr(rPos); +m_pPaM = mpCrsr.get(); m_pCtrlStck = new SwWW8FltControlStack( m_rDoc, m_nFieldFlags, *this ); @@ -5359,7 +5361,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition rPos) SAL_WARN_IF(m_pTableEndPaM, sw.ww8, document ended without table ending); m_pTableEndPaM.reset(); //ensure this is deleted before pPaM -delete m_pPaM, m_pPaM = 0; +mpCrsr.reset(); +m_pPaM = nullptr; m_pLastAnchorPos.reset();//ensure this is deleted before UpdatePageDescs UpdatePageDescs(m_rDoc, nPageDescOffset); @@ -5588,7 +5591,7 @@ namespace } } -sal_uLong SwWW8ImplReader::LoadThroughDecryption(SwPaM rPaM ,WW8Glossary *pGloss) +sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) { sal_uLong nErrRet = 0; if (pGloss) @@ -5758,7 +5761,7 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(SwPaM rPaM ,WW8Glossary *pGlos } if (!nErrRet) -nErrRet = CoreLoad(pGloss, *rPaM.GetPoint()); +nErrRet = CoreLoad(pGloss); delete pTempMain; delete pTempTable; @@ -5955,7 +5958,7 @@ const OUString* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx) return pRet; } -sal_uLong SwWW8ImplReader::LoadDoc( SwPaM rPaM,WW8Glossary *pGloss) +sal_uLong SwWW8ImplReader::LoadDoc(WW8Glossary *pGloss) {
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8par.cxx |4 1 file changed, 4 insertions(+) New commits: commit 49629e96a432b6137ff82e446b18e12bcb4db417 Author: Caolán McNamara caol...@redhat.com Date: Tue Aug 25 16:36:08 2015 +0100 behave like the native format filter for non-insert mode just shove the unneeded pam into dead space Change-Id: Id0a3d550cd9d54394888e6b2d62e21eaded24a7c (cherry picked from commit d9edac5d58aa3c4f15cf4022a1faf776d3003e78) Reviewed-on: https://gerrit.libreoffice.org/17998 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 464db40..84b65d5 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -6115,6 +6115,10 @@ sal_uLong WW8Reader::Read(SwDoc rDoc, const OUString rBaseURL, SwPaM rPaM, co { // Remove Frame and offsets from Frame Template Reader::ResetFrameFormats( rDoc ); + +rPaM.GetBound().nContent.Assign(0, 0); +rPaM.GetBound(false).nContent.Assign(0, 0); + } try { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8scan.cxx | 147 --- 1 file changed, 123 insertions(+), 24 deletions(-) New commits: commit db39370e91c68910daf1f5959f6494b4891e7ba2 Author: Stephan Bergmann sberg...@redhat.com Date: Mon Aug 24 17:31:24 2015 +0200 Handle non-aligned FFNs ...as found by UBSan in CppunitTest_sw_filters_test (see below), and at the same time limit reads within the pA array to its bounds. Testing file:///.../sw/qa/core/data/ww6/pass/crash-2.doc: sw/source/filter/ww8/ww8scan.cxx:6473:32: runtime error: upcast of misaligned address 0x620e70e7 for type 'WW8_FFN_Ver6', which requires 2 byte alignment 0x620e70e7: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 00 6a 00 00 00 00 0e 00 00 6a 00 00 00 6a ^ WW8Fonts::WW8Fonts(SvStream, WW8Fib) sw/source/filter/ww8/ww8scan.cxx:6473:32 SwWW8ImplReader::CoreLoad(WW8Glossary*, SwPosition const) sw/source/filter/ww8/ww8par.cxx:4961:20 SwWW8ImplReader::LoadThroughDecryption(SwPaM, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:5767:19 SwWW8ImplReader::LoadDoc(SwPaM, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:6039:19 WW8Reader::Read(SwDoc, rtl::OUString const, SwPaM, rtl::OUString const) sw/source/filter/ww8/ww8par.cxx:6157:20 SwReader::Read(Reader const) sw/source/filter/basflt/shellio.cxx:175:18 SwDocShell::ConvertFrom(SfxMedium) sw/source/uibase/app/docsh.cxx:258:22 SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23 SwFiltersTest::filter(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) sw/qa/core/filters-test.cxx:112:20 SwFiltersTest::load(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int) sw/qa/core/filters-test.cxx:71:12 test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:129:20 test::FiltersTest::testDir(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:154:5 SwFiltersTest::testCVEs() sw/qa/core/filters-test.cxx:154:5 (cherry picked from commit 6373886870503a981b65f204f9113aebff540ab8) Change-Id: I31ac8dc11d985745785c9dda1cec8a11a41098bb Reviewed-on: https://gerrit.libreoffice.org/17985 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 1f7f526..47cdde9 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -20,10 +20,12 @@ #include ww8scan.hxx #include ww8par.hxx +#include cassert +#include cstddef +#include cstring #include functional #include algorithm -#include string.h #include i18nlangtag/mslangid.hxx #include sprmids.hxx #include rtl/tencinfo.h @@ -6357,10 +6359,15 @@ WW8_STD* WW8Style::Read1Style( short rSkip, OUString* pString, short* pcbStd ) return pStd; } -struct WW8_FFN_Ver6 : public WW8_FFN_BASE +namespace { +const sal_uInt16 maxStrSize = 65; +} + +struct WW8_FFN_Ver6 { -// ab Ver6 -sal_Char szFfn[65]; // 0x6 bzw. 0x40 ab Ver8 zero terminated string that +WW8_FFN_BASE base; +// from Ver6 +sal_Char szFfn[maxStrSize]; // 0x6 bzw. 0x40 ab Ver8 zero terminated string that // records name of font. // Maximal size of szFfn is 65 characters. // Vorsicht: Dieses Array kann auch kleiner sein!!! @@ -6439,6 +6446,50 @@ namespace } return nMax; } + +templatetypename T bool readU8( +sal_uInt8 const * p, std::size_t offset, sal_uInt8 const * pEnd, +T * value) +{ +assert(p = pEnd); +assert(value != nullptr); +if (offset = static_caststd::size_t(pEnd - p)) { +return false; +} +*value = p[offset]; +return true; +} + +bool readS16( +sal_uInt8 const * p, std::size_t offset, sal_uInt8 const * pEnd, +short * value) +{ +assert(p = pEnd); +assert(value != nullptr); +if (offset static_caststd::size_t(pEnd - p) +|| static_caststd::size_t(pEnd - p) - offset 2) +{ +return false; +} +*value = unsigned(p[offset]) + (unsigned(p[offset + 1]) 8); +return true; +} + +sal_Int32 getStringLength( +sal_uInt8 const * p, std::size_t offset, sal_uInt8 const * pEnd) +{ +assert(p = pEnd); +assert(pEnd - p = SAL_MAX_INT32); +if (offset = static_caststd::size_t(pEnd - p)) { +
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/layout/paintfrm.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 8f44345f1e3e604dae86fef438014d4941b1d298 Author: Zolnai Tamás zolnaitamas2...@gmail.com Date: Sun Aug 23 19:15:14 2015 +0200 tdf#91969: Parts of paragraph border is missing ...when border is around more than one paragraph Regression from: 16f637dab3c1b5f7ac9eacf2c57347800d3fdf09 Change-Id: Iea9455dd7cc3c301c3e2d5d7903c98d98e515595 (cherry picked from commit 8d933132ab01f0070225fae6cf704c9a1982e8f8) Reviewed-on: https://gerrit.libreoffice.org/17979 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 4a27d6f..0d8bcaa 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -477,13 +477,13 @@ static sal_uInt8 lcl_TryMergeLines( { double const fMergeGap(properties.nSPixelSzW + properties.nSHalfPixelSzW); // NOT static! // A is above/before B -if( mergeA.second = mergeB.second +if( mergeA.second = mergeB.first mergeA.second + fMergeGap = mergeB.first ) { return 1; } // B is above/before A -else if( mergeB.second = mergeA.second +else if( mergeB.second = mergeA.first mergeB.second + fMergeGap = mergeA.first ) { return 2; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8graf.cxx |2 +- sw/source/filter/ww8/ww8par.cxx |3 ++- sw/source/filter/ww8/ww8par.hxx |3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) New commits: commit 436ccb0df15c1c654e5b3eebfd3ba94ddd2341c5 Author: Caolán McNamara caol...@redhat.com Date: Mon Aug 24 20:36:58 2015 +0100 consider validity of m_nDrawCpO (cherry picked from commit 8329eb5e4a368f29501cfdf060f96e52df912dd2) Change-Id: Ifbd131440bad6d840d369c99628cb8904697ad96 Reviewed-on: https://gerrit.libreoffice.org/17971 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index d3156f3..77e9712 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2392,7 +2392,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) ::SetProgressState(m_nProgress, m_pDocShell); // Update m_nDrawCpO = 0; -m_pWwFib-GetBaseCp(m_pPlcxMan-GetManType() == MAN_HDFT ? MAN_TXBX_HDFT : MAN_TXBX, m_nDrawCpO); //TODO: check return value +m_bDrawCpOValid = m_pWwFib-GetBaseCp(m_pPlcxMan-GetManType() == MAN_HDFT ? MAN_TXBX_HDFT : MAN_TXBX, m_nDrawCpO); GrafikCtor(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 1a33e2b..583d876 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4183,6 +4183,7 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage, , m_nIniFlags1(0) , m_nFieldFlags(0) , m_bRegardHindiDigits( false ) +, m_bDrawCpOValid( false ) , m_nDrawCpO(0) , m_nPicLocFc(0) , m_nObjLocFc(0) @@ -6182,7 +6183,7 @@ bool SwMSDffManager::GetOLEStorageName(long nOLEId, OUString rStorageName, // Note: Ask MM for initialization of nStartCp and nEndCp. // Note: Ask MM about assertions in method rReader.GetTxbxTextSttEndCp(..). WW8_CP nStartCp, nEndCp; -if ( rReader.GetTxbxTextSttEndCp(nStartCp, nEndCp, +if ( rReader.m_bDrawCpOValid rReader.GetTxbxTextSttEndCp(nStartCp, nEndCp, static_castsal_uInt16((nOLEId 16) 0x), static_castsal_uInt16(nOLEId 0x)) ) { diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index e53eb76..9808af9 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1267,7 +1267,8 @@ private: sal_uInt32 m_nFieldTagBad[3]; // dito fuers Taggen von nicht importierbaren F. bool m_bRegardHindiDigits; // import digits in CTL scripts as Hindi numbers -WW8_CP m_nDrawCpO;// Anfang der Txbx-SubDocs +bool m_bDrawCpOValid; +WW8_CP m_nDrawCpO;// start of Txbx-SubDocs sal_uLong m_nPicLocFc;// Picture Location in File (FC) sal_uLong m_nObjLocFc;// Object Location in File (FC) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8scan.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit e90c874f521a9fe9f2a0f21eaf8b01aec775c16c Author: Stephan Bergmann sberg...@redhat.com Date: Mon Aug 24 17:21:48 2015 +0200 Handle zero nPLCF ...as found by ASan in CppunitTest_sw_filters_test: Testing file:///.../sw/qa/core/data/ww6/pass/crash-1.doc: ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020009382b0 at pc 0x2b1dcb5eabac bp 0x7fffe8ccbdb0 sp 0x7fffe8ccbda8 READ of size 4 at 0x6020009382b0 thread T0 WW8PLCF::SeekPos(int) sw/source/filter/ww8/ww8scan.cxx:2219:14 WW8PLCF::WW8PLCF(SvStream, int, int, int, int, int, int) sw/source/filter/ww8/ww8scan.cxx:2080:9 WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream*, SvStream*, SvStream*, WW8Fib const, ePLCFT, int) sw/source/filter/ww8/ww8scan.cxx:2883:21 WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP(SvStream*, SvStream*, SvStream*, WW8ScannerBase const, ePLCFT) sw/source/filter/ww8/ww8scan.cxx:3088:7 WW8ScannerBase::WW8ScannerBase(SvStream*, SvStream*, SvStream*, WW8Fib*) sw/source/filter/ww8/ww8scan.cxx:1588:20 SwWW8ImplReader::CoreLoad(WW8Glossary*, SwPosition const) sw/source/filter/ww8/ww8par.cxx:5022:20 SwWW8ImplReader::LoadThroughDecryption(SwPaM, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:5767:19 SwWW8ImplReader::LoadDoc(SwPaM, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:6039:19 WW8Reader::Read(SwDoc, rtl::OUString const, SwPaM, rtl::OUString const) sw/source/filter/ww8/ww8par.cxx:6157:20 SwReader::Read(Reader const) sw/source/filter/basflt/shellio.cxx:175:18 SwDocShell::ConvertFrom(SfxMedium) sw/source/uibase/app/docsh.cxx:258:22 SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23 SwFiltersTest::filter(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) sw/qa/core/filters-test.cxx:112:20 SwFiltersTest::load(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int) sw/qa/core/filters-test.cxx:71:12 test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:129:20 test::FiltersTest::testDir(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:154:5 SwFiltersTest::testCVEs() sw/qa/core/filters-test.cxx:154:5 0x6020009382b1 is located 0 bytes to the right of 1-byte region [0x6020009382b0,0x6020009382b1) allocated by thread T0 here: operator new[](unsigned long) /home/sbergman/clang/trunk/src/projects/compiler-rt/lib/asan/asan_new_delete.cc:64 WW8PLCF::ReadPLCF(SvStream, int, unsigned int) sw/source/filter/ww8/ww8scan.cxx:2091:26 WW8PLCF::WW8PLCF(SvStream, int, int, int, int, int, int) sw/source/filter/ww8/ww8scan.cxx:2075:9 WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream*, SvStream*, SvStream*, WW8Fib const, ePLCFT, int) sw/source/filter/ww8/ww8scan.cxx:2883:21 WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP(SvStream*, SvStream*, SvStream*, WW8ScannerBase const, ePLCFT) sw/source/filter/ww8/ww8scan.cxx:3088:7 WW8ScannerBase::WW8ScannerBase(SvStream*, SvStream*, SvStream*, WW8Fib*) sw/source/filter/ww8/ww8scan.cxx:1588:20 SwWW8ImplReader::CoreLoad(WW8Glossary*, SwPosition const) sw/source/filter/ww8/ww8par.cxx:5022:20 SwWW8ImplReader::LoadThroughDecryption(SwPaM, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:5767:19 SwWW8ImplReader::LoadDoc(SwPaM, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:6039:19 WW8Reader::Read(SwDoc, rtl::OUString const, SwPaM, rtl::OUString const) sw/source/filter/ww8/ww8par.cxx:6157:20 SwReader::Read(Reader const) sw/source/filter/basflt/shellio.cxx:175:18 SwDocShell::ConvertFrom(SfxMedium) sw/source/uibase/app/docsh.cxx:258:22 SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23 SwFiltersTest::filter(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) sw/qa/core/filters-test.cxx:112:20 SwFiltersTest::load(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int) sw/qa/core/filters-test.cxx:71:12 test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:129:20 test::FiltersTest::testDir(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:154:5 SwFiltersTest::testCVEs()
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8graf.cxx |6 ++- sw/source/filter/ww8/ww8scan.cxx | 73 +-- sw/source/filter/ww8/ww8scan.hxx |2 - 3 files changed, 52 insertions(+), 29 deletions(-) New commits: commit 1f3162c473c43a87b261fce83a69e44085394f45 Author: Stephan Bergmann sberg...@redhat.com Date: Mon Aug 24 19:21:48 2015 +0200 Handle GetBaseCp overflow ...as found by UBSan in CppunitTest_sw_filters_test (see below); note the TODOs how best to report the errors up the call stack. Testing file:///.../sw/qa/core/data/ww6/pass/crash-3.doc: sw/source/filter/ww8/ww8scan.cxx:5240:63: runtime error: signed integer overflow: 175948 + 1768712052 cannot be represented in type 'int' WW8Fib::GetBaseCp(ManTypes) const sw/source/filter/ww8/ww8scan.cxx:5240:63 SwWW8ImplReader::Read_GrafLayer(long) sw/source/filter/ww8/ww8graf.cxx:2393:18 SwWW8ImplReader::ReadChar(long, long) sw/source/filter/ww8/ww8par.cxx:3630:17 SwWW8ImplReader::ReadChars(int, int, long, long) sw/source/filter/ww8/ww8par.cxx:3432:27 SwWW8ImplReader::ReadText(int, int, ManTypes) sw/source/filter/ww8/ww8par.cxx:3970:22 SwWW8ImplReader::CoreLoad(WW8Glossary*, SwPosition const) sw/source/filter/ww8/ww8par.cxx:5169:9 SwWW8ImplReader::LoadThroughDecryption(SwPaM, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:5767:19 SwWW8ImplReader::LoadDoc(SwPaM, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:6039:19 WW8Reader::Read(SwDoc, rtl::OUString const, SwPaM, rtl::OUString const) sw/source/filter/ww8/ww8par.cxx:6157:20 SwReader::Read(Reader const) sw/source/filter/basflt/shellio.cxx:175:18 SwDocShell::ConvertFrom(SfxMedium) sw/source/uibase/app/docsh.cxx:258:22 SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23 SwFiltersTest::filter(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) sw/qa/core/filters-test.cxx:112:20 SwFiltersTest::load(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int) sw/qa/core/filters-test.cxx:71:12 test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:129:20 test::FiltersTest::testDir(rtl::OUString const, rtl::OUString const, rtl::OUString const, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:154:5 SwFiltersTest::testCVEs() sw/qa/core/filters-test.cxx:154:5 Change-Id: I0b14f5c1e025565eb131e64590b7d5ff0135e767 Reviewed-on: https://gerrit.libreoffice.org/17965 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com (cherry picked from commit d281b4607638231b8a3716bdc80846c24ce55cc7) Reviewed-on: https://gerrit.libreoffice.org/17969 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 6d5ee95..d3156f3 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -867,7 +867,8 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP rStartCp, WW8_CP rEndCp, // den um -2 (bzw. -1 bei Ver8) korrigierten End-Cp zurueck sal_Int32 SwWW8ImplReader::GetRangeAsDrawingString(OUString rString, long nStartCp, long nEndCp, ManTypes eType) { -WW8_CP nOffset = m_pWwFib-GetBaseCp(eType); +WW8_CP nOffset = 0; +m_pWwFib-GetBaseCp(eType, nOffset); //TODO: check return value OSL_ENSURE(nStartCp = nEndCp, +Wo ist der Grafik-Text (7) ?); if (nStartCp == nEndCp) @@ -2390,7 +2391,8 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) ::SetProgressState(m_nProgress, m_pDocShell); // Update -m_nDrawCpO = m_pWwFib-GetBaseCp(m_pPlcxMan-GetManType() == MAN_HDFT ? MAN_TXBX_HDFT : MAN_TXBX); +m_nDrawCpO = 0; +m_pWwFib-GetBaseCp(m_pPlcxMan-GetManType() == MAN_HDFT ? MAN_TXBX_HDFT : MAN_TXBX, m_nDrawCpO); //TODO: check return value GrafikCtor(); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 312abf4..1f7f526 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -4595,7 +4595,9 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, ManTypes nType, long nStartCp, break; } -nCpO = pWwFib-GetBaseCp(nType); +WW8_CP cp = 0; +pWwFib-GetBaseCp(nType, cp); //TODO: check return value +nCpO = cp; if( nStartCp || nCpO ) SeekPos( nStartCp );// PLCFe auf Text-StartPos einstellen @@ -5235,46 +5237,65 @@ namespace } } -WW8_CP WW8Fib::GetBaseCp(ManTypes nType) const +bool WW8Fib::GetBaseCp(ManTypes nType, WW8_CP * cp) const
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/text/itrpaint.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f0a149fe1c3224cef17f15e574b0a818923b57f6 Author: Mark Hung mark...@gmail.com Date: Sat Aug 1 22:48:39 2015 +0800 Fix tdf#77514 CJK ruby text in RTL( vertical ) base line issue. Change-Id: Id670e83db01efe6bcd5fb6bb374ab9cb92898f88 Reviewed-on: https://gerrit.libreoffice.org/17460 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Norbert Thiebaud nthieb...@gmail.com (cherry picked from commit b14861e1dfb9f83d26d6032ae96b664845528f2a) Reviewed-on: https://gerrit.libreoffice.org/17994 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index 1a6c3d0..4608248 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -236,7 +236,7 @@ void SwTextPainter::DrawTextLine( const SwRect rPaint, SwSaveClip rClip, // we calculate Y value for the whole line SwTextGridItem const*const pGrid(GetGridItem(GetTextFrm()-FindPageFrm())); const bool bAdjustBaseLine = -GetLineInfo().HasSpecialAlign( GetTextFrm()-IsVertical() ) || +( !GetTextFrm()-IsVertical() || GetLineInfo().HasSpecialAlign( true ) ) (! GetTextFrm()-IsInFly()) ( 0 != pGrid ); const SwTwips nLineBaseLine = GetInfo().GetPos().Y() + nTmpAscent; if ( ! bAdjustBaseLine ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8scan.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit 8578df9017ab3786f7c40929220c4db36b090a06 Author: Caolán McNamara caol...@redhat.com Date: Mon Aug 24 09:36:42 2015 +0100 fix crash with empty booknames Change-Id: Ifadb2129be53530720cb2023cdc0782b6e737f18 (cherry picked from commit 11e73a0880f64c99aec5059ff6122b831bc1de74) Reviewed-on: https://gerrit.libreoffice.org/17944 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 1595f50..857e4e2 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -4202,17 +4202,18 @@ bool WW8PLCFx_Book::MapName(OUString rName) return false; bool bFound = false; -sal_uInt16 i = 0; -do + +size_t i = 0; +while (i aBookNames.size()) { if (rName.equalsIgnoreAsciiCase(aBookNames[i])) { rName = aBookNames[i]; bFound = true; +break; } ++i; } -while (!bFound i pBook[0]-GetIMax()); return bFound; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8scan.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 2ec31453aba32d8b768be239a7c983397a7d0f6b Author: Caolán McNamara caol...@redhat.com Date: Mon Aug 24 09:37:11 2015 +0100 dismiss bad seek offsets early Change-Id: Ia88bc1833d362547f45e073028203a4de581f3e2 (cherry picked from commit 8657e3795d2e0ef0653835e2d56c53512dd43aea) Reviewed-on: https://gerrit.libreoffice.org/17945 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 857e4e2..496e81a 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -7558,7 +7558,8 @@ SEPr::SEPr() : bool checkSeek(SvStream rSt, sal_uInt32 nOffset) { -return (rSt.Seek(nOffset) == static_castsal_Size(nOffset)); +return (nOffset != SAL_MAX_UINT32 +rSt.Seek(nOffset) == static_castsal_Size(nOffset)); } bool checkRead(SvStream rSt, void *pDest, sal_uInt32 nLength) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/view/viewsh.cxx | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) New commits: commit a56cda359b45a900d0b5d017693efccf3b5b2e59 Author: Miklos Vajna vmik...@collabora.co.uk Date: Tue Aug 18 09:59:46 2015 +0200 tdf#93096 sw: fix selection with keyboard outside current view Regression from commit c9175a1bd3249ad573ae6827bf19963a3ebe2fbc (SwViewShell::ImplEndAction: avoid direct PaintDesktop(), 2015-07-03), the problem is that while going via InvalidateWindows() is fine for the double-buffering case, it has side effects when painting directly, so revert back to the old code in that case. Change-Id: Ib1e3b143f5cfe2c6ab8b102a1a2064900282f136 (cherry picked from commit 222f10e773ba51a19880be1b798990260c198147) Reviewed-on: https://gerrit.libreoffice.org/17835 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 9cb6941..1b4b80d 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -405,7 +405,25 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd ) } if ( bPaint ) { -InvalidateWindows(aRect.SVRect()); +if (GetWin() GetWin()-SupportsDoubleBuffering()) +InvalidateWindows(aRect.SVRect()); +else +{ +// #i75172# begin DrawingLayer paint +// need to do begin/end DrawingLayer preparation for each single rectangle of the +// repaint region. I already tried to prepare only once for the whole Region. This +// seems to work (and does technically) but fails with transparent objects. Since the +// region given to BeginDarwLayers() defines the clip region for DrawingLayer paint, +// transparent objects in the single rectangles will indeed be painted multiple times. +DLPrePaint2(vcl::Region(aRect.SVRect())); + +if ( bPaintsFromSystem ) +PaintDesktop(*GetOut(), aRect); + pCurrentLayout-GetCurrShell()-InvalidateWindows(aRect.SVRect()); + +// #i75172# end DrawingLayer paint +DLPostPaint2(true); +} } else lcl_PaintTransparentFormControls(*this, aRect); // i#107365 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8par.cxx | 23 +-- sw/source/filter/ww8/ww8par.hxx |4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) New commits: commit d510b85aa5e1c51f5bf4e08edf47725a7a75ce04 Author: Caolán McNamara caol...@redhat.com Date: Fri Aug 14 14:40:38 2015 +0100 skip importing properties if the desired start pos is invalid Change-Id: Iae650d63ccdb95a0a74674b8689813069b750b60 (cherry picked from commit b4a718583a3311dda7abd3010938c847b16e5f30) Reviewed-on: https://gerrit.libreoffice.org/17761 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 0f8f8d5..f07ddff75 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3729,7 +3729,7 @@ void SwWW8ImplReader::ProcessAktCollChange(WW8PLCFManResult rRes, } } -long SwWW8ImplReader::ReadTextAttr(WW8_CP rTextPos, bool rbStartLine) +long SwWW8ImplReader::ReadTextAttr(WW8_CP rTextPos, long nTextEnd, bool rbStartLine) { long nSkipChars = 0; WW8PLCFManResult aRes; @@ -3794,7 +3794,9 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP rTextPos, bool rbStartLine) } } -m_pStrm-Seek(m_pSBase-WW8Cp2Fc( m_pPlcxMan-GetCpOfs() + rTextPos, m_bIsUnicode)); +sal_Int32 nRequestedPos = m_pSBase-WW8Cp2Fc(m_pPlcxMan-GetCpOfs() + rTextPos, m_bIsUnicode); +bool bValidPos = checkSeek(*m_pStrm, nRequestedPos); +SAL_WARN_IF(!bValidPos, sw.ww8, Document claimed to have text at an invalid position, skip attributes for region); // Find next Attr position (and Skip attributes of field contents if needed) if (nSkipChars !m_bIgnoreText) @@ -3808,7 +3810,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP rTextPos, bool rbStartLine) { if( bDoPlcxManPlusPLus ) m_pPlcxMan-advance(); -nNext = m_pPlcxMan-Where(); +nNext = bValidPos ? m_pPlcxMan-Where() : nTextEnd; if (m_pPostProcessAttrsInfo m_pPostProcessAttrsInfo-mnCpStart == nNext) @@ -3818,7 +3820,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP rTextPos, bool rbStartLine) if( (0 = nNext) (nSkipPos = nNext) ) { -nNext = ReadTextAttr( rTextPos, rbStartLine ); +nNext = ReadTextAttr(rTextPos, nTextEnd, rbStartLine); bDoPlcxManPlusPLus = false; m_bIgnoreText = true; } @@ -3869,7 +3871,7 @@ void SwWW8ImplReader::ClearParaEndPosition() m_aEndParaPos.clear(); } -void SwWW8ImplReader::ReadAttrs(WW8_CP rNext, WW8_CP rTextPos, bool rbStartLine) +void SwWW8ImplReader::ReadAttrs(WW8_CP rTextPos, WW8_CP rNext, long nTextEnd, bool rbStartLine) { // Dow we have attributes? if( rTextPos = rNext ) @@ -3877,7 +3879,7 @@ void SwWW8ImplReader::ReadAttrs(WW8_CP rNext, WW8_CP rTextPos, bool rbStartLi do { m_aCurrAttrCP = rTextPos; -rNext = ReadTextAttr( rTextPos, rbStartLine ); +rNext = ReadTextAttr(rTextPos, nTextEnd, rbStartLine); if (rTextPos == rNext rTextPos == WW8_CP_MAX) break; } @@ -3953,18 +3955,19 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) SAL_WARN_IF(nTextLen nMaxPossible, sw.ww8, TextLen too long); nTextLen = nMaxPossible; } -while ( lnStartCp+nTextLen ) +WW8_CP nTextEnd = nStartCp+nTextLen; +while (l nTextEnd) { -ReadAttrs( nNext, l, bStartLine );// Takes SectionBreaks into account, too +ReadAttrs( l, nNext, nTextEnd, bStartLine );// Takes SectionBreaks into account, too OSL_ENSURE(m_pPaM-GetNode().GetTextNode(), Missing txtnode); if (m_pPostProcessAttrsInfo != NULL) PostProcessAttrs(); -if( l= nStartCp + nTextLen ) +if (l = nTextEnd) break; -bStartLine = ReadChars(l, nNext, nStartCp+nTextLen, nCpOfs); +bStartLine = ReadChars(l, nNext, nTextEnd, nCpOfs); // If the previous paragraph was a dropcap then do not // create a new txtnode and join the two paragraphs together diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 9f9160c..8a130a1 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1420,8 +1420,8 @@ private: void ProcessAktCollChange(WW8PLCFManResult rRes, bool* pStartAttr, bool bCallProcessSpecial); -long ReadTextAttr(WW8_CP rTextPos, bool rbStartLine); -void ReadAttrs(WW8_CP rNext, WW8_CP rTextPos, bool rbStartLine); +long ReadTextAttr(WW8_CP rTextPos, long nTextEnd, bool rbStartLine); +void ReadAttrs(WW8_CP rTextPos, WW8_CP rNext, long nTextEnd, bool rbStartLine); void CloseAttrEnds(); bool ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType);
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8scan.cxx | 59 +-- sw/source/filter/ww8/ww8scan.hxx |5 +-- 2 files changed, 16 insertions(+), 48 deletions(-) New commits: commit 3a03e386e04fda88c0b964ecdb8dc11e4f532b86 Author: Caolán McNamara caol...@redhat.com Date: Fri Aug 14 15:45:18 2015 +0100 convert pPieceGrpprls to vector and merge calc and load loops together we retain the max-short limit but no longer add a null terminating entry (cherry picked from commit 4466a7949af63621a2b180715de2ae3675343715) Change-Id: Ie195e0c244cc08643a9c22518c85d70a883752b7 Reviewed-on: https://gerrit.libreoffice.org/17780 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index e9243ba..5ffe258 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -941,8 +941,8 @@ const sal_uInt8* WW8SprmIter::FindSprm(sal_uInt16 nId) WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(ww::WordVersion eVersion, WW8PLCFx_PCD* pPLCFx_PCD, const WW8ScannerBase* pBase) : WW8PLCFx(eVersion, true), pPcdI(pPLCFx_PCD-GetPLCFIter()), -pPcd(pPLCFx_PCD), pGrpprls(pBase-pPieceGrpprls), -nGrpprls(pBase-nPieceGrpprls) +pPcd(pPLCFx_PCD), pGrpprls(pBase-aPieceGrpprls.data()), +nGrpprls(pBase-aPieceGrpprls.size()) { } @@ -1527,43 +1527,14 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ) return NULL; WW8_FC nClxPos = pWwF-fcClx; -sal_Int32 nClxLen = pWwF-lcbClx; -sal_Int32 nLeft = nClxLen; -sal_Int16 nGrpprl = 0; if (!checkSeek(*pStr, nClxPos)) return NULL; -while( true ) // Zaehle Zahl der Grpprls -{ -sal_uInt8 clxt(2); -pStr-ReadUChar( clxt ); -nLeft--; -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; -if( nLeft 0 ) -return NULL;// gone wrong -pStr-SeekRel( nLen ); // ueberlies grpprl -} - -if (!checkSeek(*pStr, nClxPos)) -return NULL; +sal_Int32 nClxLen = pWwF-lcbClx; +sal_Int32 nLeft = nClxLen; -nLeft = nClxLen; -pPieceGrpprls = new sal_uInt8*[nGrpprl + 1]; -memset( pPieceGrpprls, 0, ( nGrpprl + 1 ) * sizeof(sal_uInt8 *) ); -nPieceGrpprls = nGrpprl; -sal_Int16 nAktGrpprl = 0; // read Grpprls -while( true ) +while (true) { sal_uInt8 clxt(2); pStr-ReadUChar( clxt ); @@ -1577,6 +1548,8 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ) return NULL;// gone wrong if( 1 == clxt ) // clxtGrpprl ? { +if (aPieceGrpprls.size() == SHRT_MAX) +return NULL; if (nLen pStr-remainingSize()) return NULL; sal_uInt8* p = new sal_uInt8[nLen+2]; // allocate @@ -1586,12 +1559,13 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ) delete[] p; return NULL; } -pPieceGrpprls[nAktGrpprl++] = p;// trage in Array ein +aPieceGrpprls.push_back(p);// add to array } else -pStr-SeekRel( nLen ); // ueberlies nicht-Grpprl +pStr-SeekRel( nLen ); // non-Grpprl left } -// lies Piece Table PLCF ein + +// read Piece Table PLCF sal_Int32 nPLCFfLen(0); if (pWwF-GetFIBVersion() = ww::eWW2) { @@ -1607,20 +1581,15 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ) void WW8ScannerBase::DeletePieceTable() { -if( pPieceGrpprls ) -{ -for( sal_uInt8** p = pPieceGrpprls; *p; p++ ) -delete[] (*p); -delete[] pPieceGrpprls; -pPieceGrpprls = 0; -} +for (auto pGrppl : aPieceGrpprls) +delete[] pGrppl; } WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTableSt, SvStream* pDataSt, WW8Fib* pWwFib ) : pWw8Fib(pWwFib), pMainFdoa(0), pHdFtFdoa(0), pMainTxbx(0), pMainTxbxBkd(0), pHdFtTxbx(0), pHdFtTxbxBkd(0), pMagicTables(0), -pSubdocs(0), pExtendedAtrds(0), pPieceGrpprls(0) +pSubdocs(0), pExtendedAtrds(0) { pPiecePLCF = OpenPieceTable( pTableSt, pWw8Fib ); // Complex if( pPiecePLCF ) diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 57ccae3..0d6ac94 100644 ---
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/txtnode/fntcache.cxx | 10 ++ 1 file changed, 10 insertions(+) New commits: commit 294f43d78f1662139e9308120667396f10cadde5 Author: Miklos Vajna vmik...@collabora.co.uk Date: Mon Aug 10 09:14:27 2015 +0200 tdf#87922 SwDrawTextInfo::ApplyAutoColor: handle fill attributes With this, if page background is set to e.g. black, then automatic color of text is again white, not black. Change-Id: I8246fa4b7834f60872b0737f03906ccc86948cc1 (cherry picked from commit d48d0e81971266ff4625721b0f069a62ec7014e2) Reviewed-on: https://gerrit.libreoffice.org/17814 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 2aa8202..3d6b35bc 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -47,6 +47,7 @@ #include swmodule.hxx #include accessibilityoptions.hxx #include svtools/accessibilityoptions.hxx +#include svx/sdr/attribute/sdrallfillattributeshelper.hxx #include doc.hxx #include editeng/fhgtitem.hxx #include docsh.hxx @@ -2521,6 +2522,7 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont ) { // check if current background has a user defined setting const Color* pCol = GetFont() ? GetFont()-GetBackColor() : NULL; +Color aColor; if( ! pCol || COL_TRANSPARENT == pCol-GetColor() ) { const SvxBrushItem* pItem; @@ -2537,6 +2539,14 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont ) /// is a background brush and its color is *not* no fill/auto fill. if( GetFrm()-GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect, false ) ) { +if (aFillAttributes.get() aFillAttributes-isUsed()) +{ +// First see if fill atttributes provide a color. +aColor = Color(aFillAttributes-getAverageColor(aGlobalRetoucheColor.getBColor())); +pCol = aColor; +} + +// If not, then fall back to the old brush item. if ( !pCol ) { pCol = pItem-GetColor(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8scan.cxx | 18 +- sw/source/filter/ww8/ww8scan.hxx |4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) New commits: commit c23e12ebbf49a1e290440b3a044c2ac54d569aa9 Author: Caolán McNamara caol...@redhat.com Date: Thu Aug 13 10:58:06 2015 +0100 convert pStatus to vector and use at to check offsets Change-Id: I5186f6a65bb9d5ed8a0d1ab1d71f7e2c13865411 (cherry picked from commit ea70088895ed45dc60abf18319acc1b4fa3018dd) Reviewed-on: https://gerrit.libreoffice.org/17693 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 165b9df..e9243ba 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -3991,7 +3991,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream rStrm, sal_uInt32 nStart, sal_Int32 nLen } WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTableSt, 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 ) @@ -4016,14 +4016,12 @@ WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTableSt, 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]; } @@ -4141,18 +4139,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_casteBookStatus(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 678482f..57ccae3 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -724,8 +724,8 @@ class WW8PLCFx_Book : public WW8PLCFx { private: WW8PLCFspecial* pBook[2]; // Start and End Position -::std::vectorOUString aBookNames; // Name -eBookStatus* pStatus; +std::vectorOUString aBookNames; // Name +std::vectoreBookStatus aStatus; long nIMax; // Number of Booknotes sal_uInt16 nIsEnd; sal_Int32 nBookmarkId; // counter incremented by GetUniqueBookmarkName. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/ui/vba/vbatablehelper.cxx |9 - 1 file changed, 4 insertions(+), 5 deletions(-) New commits: commit 1be1d904188f83f1a996f4a741c39f0e6c14522e Author: Caolán McNamara caol...@redhat.com Date: Thu Aug 13 08:33:37 2015 +0100 wrong row/col count limits thanks to ccsheller for noticing Change-Id: Idb0f39c48173445b750e0b85ac20b3f6b43691a7 (cherry picked from commit 348cc2ce1e932f0fcaf90f9cf4d6dc9594f3f8a2) Reviewed-on: https://gerrit.libreoffice.org/17692 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx index 755ecd8..8a96054 100644 --- a/sw/source/ui/vba/vbatablehelper.cxx +++ b/sw/source/ui/vba/vbatablehelper.cxx @@ -61,7 +61,6 @@ sal_Int32 SwVbaTableHelper::getTabColumnsCount( sal_Int32 nRowIndex ) throw (uno sal_Int32 SwVbaTableHelper::getTabColumnsMaxCount( ) throw (uno::RuntimeException) { sal_Int32 nRet = 0; -//sal_Int32 nRowCount = mxTextTable-getRows()-getCount(); sal_Int32 nRowCount = pTable-GetTabLines().size(); for( sal_Int32 index = 0; index nRowCount; index++ ) { @@ -141,15 +140,15 @@ SwTableBox* SwVbaTableHelper::GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw { SwTableLines rLines = pTable-GetTabLines(); sal_Int32 nRowCount = rLines.size(); -if( nRowCount nRow ) +if (nRow 0 || nRow = nRowCount) throw uno::RuntimeException(); -SwTableBox* pStart = NULL; SwTableLine* pLine = rLines[ nRow ]; -if( (sal_Int32)pLine-GetTabBoxes().size() nCol ) +sal_Int32 nColCount = pLine-GetTabBoxes().size(); +if (nCol 0 || nCol = nColCount) throw uno::RuntimeException(); -pStart = pLine-GetTabBoxes()[ nCol ]; +SwTableBox* pStart = pLine-GetTabBoxes()[ nCol ]; if( !pStart ) throw uno::RuntimeException(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/layout/paintfrm.cxx |3 +-- sw/source/core/view/viewimp.cxx|3 +-- sw/source/core/view/viewsh.cxx |6 -- 3 files changed, 2 insertions(+), 10 deletions(-) New commits: commit ce51de70c2dfa905e105d09f4ccd72014af159ac Author: Jan Holesovsky ke...@collabora.com Date: Wed Aug 12 08:14:03 2015 +0200 tdf#92305: Revert tdf#90150 : Page numbering in the status bar ... Unfortunately the original commit caused a regression. The fix of tdf#90150 is also problematic from the UX point of view - with that, the user is never sure what page he/she is looking at. Should we do any changes there, then it should show the range of visible pages, like Pages 2-3 of 5. or Pages 1-4 of 8. etc. This reverts commit 1622b67e4b2bc8ecc5dd3ededc0a6e5adb936a6e. Change-Id: I371bb326da14b621a5116295ed1dc0de208f309d Reviewed-on: https://gerrit.libreoffice.org/17662 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 3f681f1..4a27d6f 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3257,8 +3257,7 @@ void SwRootFrm::Paint(vcl::RenderContext rRenderContext, SwRect const rRect, S const_castSwRootFrm*(this)-SetCallbackActionEnabled( false ); const SwPageFrm *pPage = pSh-Imp()-GetFirstVisPage(rRenderContext); -if ( pPage-GetPrev() ) -pPage = static_castconst SwPageFrm*(pPage-GetPrev()); + const bool bBookMode = gProp.pSGlobalShell-GetViewOptions()-IsViewLayoutBookMode(); if ( bBookMode pPage-GetPrev() static_castconst SwPageFrm*(pPage-GetPrev())-IsEmptyPage() ) pPage = static_castconst SwPageFrm*(pPage-GetPrev()); diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index b3957c4..9299d6f 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -187,8 +187,7 @@ void SwViewShellImp::SetFirstVisPage(OutputDevice* pRenderContext) SwPageFrm *pPage = static_castSwPageFrm*(pSh-GetLayout()-Lower()); SwRect aPageRect = pPage-GetBoundRect(pRenderContext); -float fAmount = pSh-VisArea().Height() * 0.43; -while ( pPage aPageRect.Bottom() pSh-VisArea().Top() + fAmount ) +while ( pPage !aPageRect.IsOver( pSh-VisArea() ) ) { pPage = static_castSwPageFrm*(pPage-GetNext()); if ( pPage ) diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index bde60ab..b934e76 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1468,12 +1468,6 @@ void SwViewShell::PaintDesktop(vcl::RenderContext rRenderContext, const SwRect else { const SwFrm *pPage = Imp()-GetFirstVisPage(rRenderContext); -//Here we have to get the previous page since -//GetFirstVisPage return the current one but -//there is a portion of the previous page -//which is still visible -if ( pPage-GetPrev() ) -pPage = pPage-GetPrev(); const SwTwips nBottom = rRect.Bottom(); while ( pPage !aRegion.empty() (pPage-Frm().Top() = nBottom) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/wrtw8nds.cxx | 11 +++ 1 file changed, 11 insertions(+) New commits: commit 15c2e6c8c6bfdb05ca0cb4f09835828123c95b49 Author: Justin Luth justin_l...@sil.org Date: Thu Apr 16 13:31:39 2015 +0300 tdf#87437 exclude CR/cell break from redline deletions The marker used in Word to identify table cell division was being included in the track-changes deletion from the following cell if the deletion was the first node in the cell. This would cause the two table cells to merge into one when changes were accepted by Word. (Problem not seen in LibreOffice itself.) Change-Id: Ia98017cbba7d3a43b67764ae0fa6447b7e90ca86 Reviewed-on: https://gerrit.libreoffice.org/15340 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Reviewed-on: https://gerrit.libreoffice.org/17142 Reviewed-by: Christian Lohmaier lohmaier+libreoff...@googlemail.com diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index ac7d9c3..9adbbb1 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2185,13 +2185,19 @@ void MSWordExportBase::OutputTextNode( const SwTextNode rNode ) sal_Int32 nAktPos = 0; sal_Int32 const nEnd = aStr.getLength(); +bool bIsEndOfCell = false; bool bIncludeEndOfParaCRInRedlineProperties = false; sal_Int32 nOpenAttrWithRange = 0; OUString aStringForImage(\001); ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner; if ( pTextNodeInfo.get() != NULL ) +{ pTextNodeInfoInner = pTextNodeInfo-getFirstInner(); +if ( pTextNodeInfoInner pTextNodeInfoInner-isEndOfCell() ) { +bIsEndOfCell = true; +} +} do { const SwRedlineData* pRedlineData = aAttrIter.GetRunLevelRedline( nAktPos ); @@ -2394,6 +2400,11 @@ void MSWordExportBase::OutputTextNode( const SwTextNode rNode ) } WriteCR( pTextNodeInfoInner ); + +if ( bIsEndOfCell ) +{ +AttrOutput().OutputFKP(true); +} } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/undo/unattr.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 183c317f01ccade1c7865e05e608ea7295c8d39e Author: Michael Stahl mst...@redhat.com Date: Wed Jul 29 23:59:43 2015 +0200 tdf#83223: sw: fix Undo of format change of conditional para style SwUndoFormatAttr was simply missing a case for RES_CONDTXTFMTCOLL. Handle it the same way as an oridnary paragraph style, which seems to work for me. Change-Id: Ib529beb1116633e4890d5b51df39da21de485db9 (cherry picked from commit 37e936996acb4a8329fad2ec73a35f66be446e90) Reviewed-on: https://gerrit.libreoffice.org/17428 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 8eec8e2..28f47fc 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -204,6 +204,7 @@ bool SwUndoFormatAttr::IsFormatInDoc( SwDoc* pDoc ) switch ( m_nFormatWhich ) { case RES_TXTFMTCOLL: +case RES_CONDTXTFMTCOLL: bFound = pDoc-GetTextFormatColls()-Contains( m_pFormat ); break; @@ -301,7 +302,9 @@ void SwUndoFormatAttr::RepeatImpl(::sw::RepeatContext rContext) } break; -case RES_TXTFMTCOLL: { +case RES_TXTFMTCOLL: +case RES_CONDTXTFMTCOLL: +{ SwTextNode *const pNd = rContext.GetRepeatPaM().GetNode().GetTextNode(); if( pNd ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/view/pagepreviewlayout.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit 540cb7302d3fd515bb6c39693c561ca62c7860a4 Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Jul 24 18:07:31 2015 +0200 tdf#92914 SwPagePreviewLayout::MarkNewSelectedPage: avoid direct paint With this, when the user select an other page in the print preview window, the selection rectangle is no longer painted directly. Change-Id: I85f1cb9d09c8545222ed49ff0acf819540d10920 (cherry picked from commit da24bd36a5213670b5636abf4dbac317c4135c07) Reviewed-on: https://gerrit.libreoffice.org/17381 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Jan Holesovsky ke...@collabora.com diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index da9f1f1..4baed4f 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -1297,7 +1297,12 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage ) // re-paint for new selected page in order to mark it. const PreviewPage* pNewSelectedPreviewPage = _GetPreviewPageByPageNum( _nSelectedPage ); if ( pNewSelectedPreviewPage pNewSelectedPreviewPage-bVisible ) -_PaintSelectMarkAtPage( *pOutputDev, pNewSelectedPreviewPage ); +{ +const PreviewPage* pSelectedPreviewPage = _GetPreviewPageByPageNum(mnSelectedPageNum); +SwRect aPageRect(pSelectedPreviewPage-aPreviewWinPos, pSelectedPreviewPage-aPageSize); +::SwAlignRect(aPageRect, mrParentViewShell, pOutputDev); +mrParentViewShell.GetWin()-Invalidate(aPageRect.SVRect()); +} } // helper methods ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/docvw/AnnotationWin.cxx |4 1 file changed, 4 insertions(+) New commits: commit 1e832328f527daee654c818eadf8ede723034d6f Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Jul 24 12:34:19 2015 +0200 tdf#92911 SwAnnotationWin rendercontext: fix missing comment contents The problem was that when inserting a post-it comment, the Paint() is triggered for SwEditWin, which then shares a RenderContext with its children, and at the end paints the buffer to the vcl::Window of SwEditWin. When painting this buffer, the contents of SwAnnotationWin was missing, as the parent SwEditWin was not allowed to paint on that area. No explicit clipping is set at the OutputDevice level, but vcl::Window::ImplClipChildren() still calculates a clip region based on the child windows for the underlying SalGraphics, and that prevented SwEditWin to paint its buffer fully. Fix the problem by explicitly disabling this clipping for SwAnnotationWin in its ctor in the rendercontext case. (cherry picked from commit dcf94ab56d9e5e9864965f56d27045e67b093fa4) Change-Id: I5eb47c20070057a79297d91242624fc2057e2dfb Reviewed-on: https://gerrit.libreoffice.org/17329 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 9ce682a..3f0c3a3 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -66,6 +66,10 @@ SwAnnotationWin::SwAnnotationWin( SwEditWin rEditWin, , mpField( static_castSwPostItField*(aField-GetField())) , mpButtonPopup(0) { +if (SupportsDoubleBuffering()) +// When double-buffering, allow parents to paint on our area. That's +// necessary when parents paint the complete buffer. +SetParentClipMode(PARENTCLIPMODE_NOCLIP); } SwAnnotationWin::~SwAnnotationWin() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/access/accnotextframe.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 96f36158e386a3b252157058bde87c644ff7398a Author: Caolán McNamara caol...@redhat.com Date: Thu Jul 16 16:16:40 2015 +0100 coverity#1311944 Logically dead code for the record its a SwFormatChg we get here at the crash time regression from commit 7de992bcc66c973bb6b247184cac38f01cd1104a Author: Caolán McNamara caol...@redhat.com Date: Mon Jul 13 12:38:18 2015 +0100 fix a11y crash seen on close of tdf#92573 its not the reported crash, which has gone away which might be a duplicate of tdf#90502 the switch only handled RES_TITLE_CHANGED and RES_DESCRIPTION_CHANGED so if its anything else, e.g. OBJ_DYING, then don't attempt GetNoTextNode Change-Id: I290d6e633811423c3acc198aba7a60943518ec4a (cherry picked from commit 34c0b8869784cb44a516c97213ef24566a4ed111) Reviewed-on: https://gerrit.libreoffice.org/17137 Reviewed-by: Eike Rathke er...@redhat.com Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index bcf5031..6153ed4 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -102,7 +102,7 @@ void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem return; // probably was deleted - avoid doing anything } -if (nWhich != RES_TITLE_CHANGED || nWhich != RES_DESCRIPTION_CHANGED) +if (nWhich != RES_TITLE_CHANGED nWhich != RES_DESCRIPTION_CHANGED) return; const SwNoTextNode *pNd = GetNoTextNode(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/doc/docnum.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit ffc3876a95f896388fcb65ff7b37b5214d24eb52 Author: Caolán McNamara caol...@redhat.com Date: Mon Jul 20 13:45:52 2015 +0100 test should check that all levels are equal regression from commit bf586debd4d8274cff2737f02beac465525328e8 Author: Matteo Casalin matteo.casa...@yahoo.com Date: Sat Feb 21 12:38:54 2015 +0100 Simplify Change-Id: I09f83b2bab053fcd48fe1a1a4184cc11a4f9d663 (cherry picked from commit 8a01693c79a24006cbe7d8642b97408eb23a1bd9) Reviewed-on: https://gerrit.libreoffice.org/17233 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Eike Rathke er...@redhat.com diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index f23053b..5340b6e 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -654,13 +654,17 @@ static SwTextNode* lcl_FindOutlineNum( const SwOutlineNodes rOutlNds, OUString const SwNodeNum rNdNum = *(pNd-GetNum()); SwNumberTree::tNumberVector aLevelVal = rNdNum.GetNumberVector(); // now compare with the one searched for +bool bEqual = true; for( int n = 0; n nLevel; ++n ) { -if ( aLevelVal[n] == nLevelVal[n] ) +if ( aLevelVal[n] != nLevelVal[n] ) { -return pNd; +bEqual = false; +break; } } +if (bEqual) +return pNd; } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/unocore/unoflatpara.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit b820d868918fbb04f16bbb1935bc98f40376309d Author: Michael Stahl mst...@redhat.com Date: Mon Jul 20 20:41:43 2015 +0200 sw: SwXFlatParagraph::isChecked() return value is inverted It was checked if the flag says it's not dirty. Thanks to Varun Dhall for pointing to this problem. (cherry picked from commit 0a91e08a46118b495f80f7901b2132b194d6d409) Change-Id: I4aa1fef8b2251f0f3e579930b39d6d5a256c1895 Reviewed-on: https://gerrit.libreoffice.org/17243 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 22fe58a..bec164a 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -218,14 +218,14 @@ sal_Bool SAL_CALL SwXFlatParagraph::isChecked( ::sal_Int32 nType ) throw (uno::R if (GetTextNode()) { if ( text::TextMarkupType::SPELLCHECK == nType ) -return GetTextNode()-IsWrongDirty(); +return !GetTextNode()-IsWrongDirty(); else if ( text::TextMarkupType::PROOFREADING == nType ) -return GetTextNode()-IsGrammarCheckDirty(); +return !GetTextNode()-IsGrammarCheckDirty(); else if ( text::TextMarkupType::SMARTTAG == nType ) -return GetTextNode()-IsSmartTagDirty(); +return !GetTextNode()-IsSmartTagDirty(); } -return sal_False; +return sal_True; } // text::XFlatParagraph: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/writerhelper.cxx | 22 +- sw/source/filter/ww8/writerhelper.hxx |4 sw/source/filter/ww8/wrtww8.cxx |3 +++ 3 files changed, 28 insertions(+), 1 deletion(-) New commits: commit 2acb668ad89a9e023561f39df7891be1ee454391 Author: Michael Stahl mst...@redhat.com Date: Fri Jun 5 15:32:32 2015 +0200 sw: WW8 export: avoid invalidated positions in sw::Frames When exporting ooo67907-1.doc we get ~SwIndexReg assert because there's a frame anchored in a redline, and the SwPosition in the sw::Frame for it is invalidated during SetRedlineMode because the node it points to is deleted. Add another horrible workaround to the redline trainwreck. Change-Id: Ia9b2393c77f42502862daaa30fd54eb3b040a214 (cherry picked from commit ab706f85bb777ba160712c072c9d2a08ebcddcc6) Reviewed-on: https://gerrit.libreoffice.org/17231 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 9a08466..cf762a6 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -126,7 +126,11 @@ namespace if (const SwPosition* pAnchor = rEntry.GetAnchor().GetContentAnchor()) { -aRet.push_back(sw::Frame(rEntry, *pAnchor)); +// the anchor position will be invalidated by SetRedlineMode +// so set a dummy position and fix it in UpdateFramePositions +SwPosition const dummy(SwNodeIndex( +const_castSwNodes(pAnchor-nNode.GetNodes(; +aRet.push_back(sw::Frame(rEntry, dummy)); } else { @@ -522,6 +526,22 @@ namespace sw return aRet; } +void UpdateFramePositions(Frames rFrames) +{ +for (Frame rFrame : rFrames) +{ +SwFormatAnchor const rAnchor = rFrame.GetFrameFormat().GetAnchor(); +if (SwPosition const*const pAnchor = rAnchor.GetContentAnchor()) +{ +rFrame.SetPosition(*pAnchor); +} +else +{ // these don't need to be corrected, they're not in redlines +assert(FLY_AT_PAGE == rAnchor.GetAnchorId()); +} +} +} + Frames GetFramesInNode(const Frames rFrames, const SwNode rNode) { Frames aRet; diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index dbd033e..bbef363 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -126,6 +126,7 @@ namespace sw The anchor position of this frame */ const SwPosition GetPosition() const { return maPos; } +void SetPosition(SwPosition const rPos) { maPos = rPos; } /** Get the node this frame is anchored into @@ -633,6 +634,9 @@ namespace sw */ Frames GetFrames(const SwDoc rDoc, SwPaM *pPaM = 0); +/** fix up frame positions, must be called after SetRedlineMode */ +void UpdateFramePositions(Frames rFrames); + /** Get the Frames anchored to a given node Given a container of frames, find the ones anchored to a given node diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 611559e..9dad99d 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3107,6 +3107,9 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) nsRedlineMode_t::REDLINE_SHOW_INSERT); } +// fix the SwPositions in m_aFrames after SetRedlineMode +UpdateFramePositions(m_aFrames); + m_aFontHelper.InitFontTable( SupportsUnicode(), *m_pDoc ); GatherChapterFields(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/access/accnotextframe.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit c7d2270f86b2bd1f3c764d8461a40c903780ee56 Author: Caolán McNamara caol...@redhat.com Date: Mon Jul 13 12:38:18 2015 +0100 fix a11y crash seen on close of tdf#92573 its not the reported crash, which has gone away which might be a duplicate of tdf#90502 the switch only handled RES_TITLE_CHANGED and RES_DESCRIPTION_CHANGED so if its anything else, e.g. OBJ_DYING, then don't attempt GetNoTextNode Change-Id: I642beb66613481cbc7ee18647f0204a67d670a84 (cherry picked from commit 7de992bcc66c973bb6b247184cac38f01cd1104a) Reviewed-on: https://gerrit.libreoffice.org/16989 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Michael Meeks michael.me...@collabora.com diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index cee5edb..bcf5031 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -102,6 +102,9 @@ void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem return; // probably was deleted - avoid doing anything } +if (nWhich != RES_TITLE_CHANGED || nWhich != RES_DESCRIPTION_CHANGED) +return; + const SwNoTextNode *pNd = GetNoTextNode(); OSL_ENSURE( pNd == aDepend.GetRegisteredIn(), invalid frame ); switch( nWhich ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/doc/DocumentStateManager.cxx |1 + sw/source/uibase/app/docsh.cxx |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit 2113ee5491fa823b14b6c25b6d9a4f170452f9d3 Author: Ashod Nakashian ashodnakash...@yahoo.com Date: Sun Jul 5 12:05:26 2015 -0400 tdf#38837 Reduce power consumption by minimizing idle timers Both the document statistics- and state-manager have their own modified flags. There is a cyclic dependency between the the two in that updating the document's statistics also marks the document as modified. Of course when a document is edited the statistics modified flag is set to trigger an update. To avoid a perpetual cycle, the statistics manager resets the document's modified state to that before setting the new statistics. However, this doesn't reset the statistics modified flag, which was set when the document was modified by setting the new statistics. Hence, the statistics thinks there are modifications in the document when there isn't. This patch is to make DocumentStateManager::ResetModified() symmetrical to DocumentStateManager::SetModified() by reseting the modified flag of the statistics manager. The idle CPU drops to nil on unmodified documents after this. However, for modified documents the statistics is recalculated perpetually until the document is saved. This will need a different patch to fix. Change-Id: Ib5936bc1acbda34fcac6a00ec46eaa31e4363885 Reviewed-on: https://gerrit.libreoffice.org/16774 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com (cherry picked from commit b0fde7a912ff3aa370496802f20895b1158b072c) Signed-off-by: Adolfo Jayme Barrientos fit...@ubuntu.com diff --git a/sw/source/core/doc/DocumentStateManager.cxx b/sw/source/core/doc/DocumentStateManager.cxx index 6015250..ede8ef9 100644 --- a/sw/source/core/doc/DocumentStateManager.cxx +++ b/sw/source/core/doc/DocumentStateManager.cxx @@ -65,6 +65,7 @@ void DocumentStateManager::ResetModified() // Bit 1: - new state sal_IntPtr nCall = mbModified ? 1 : 0; mbModified = false; +m_rDoc.GetDocumentStatisticsManager().GetDocStat().bModified = false; m_rDoc.GetIDocumentUndoRedo().SetUndoNoModifiedPosition(); if( nCall m_rDoc.GetOle2Link().IsSet() ) { diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 0b66f31..6655f04 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -458,7 +458,7 @@ bool SwDocShell::SaveAs( SfxMedium rMedium ) // Remember and preserve Modified-Flag without calling the Link // (for OLE; after Statement from MM) -bool bIsModified = m_pDoc-getIDocumentState().IsModified(); +const bool bIsModified = m_pDoc-getIDocumentState().IsModified(); m_pDoc-GetIDocumentUndoRedo().LockUndoNoModifiedPosition(); Link aOldOLELnk( m_pDoc-GetOle2Link() ); m_pDoc-SetOle2Link( Link() ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/ww8scan.cxx |4 1 file changed, 4 insertions(+) New commits: commit cd3e5ddeb4100bab2a39cf9913e14eb371edbbcc Author: Caolán McNamara caol...@redhat.com Date: Mon Jul 13 10:31:30 2015 +0100 ww8: make sure we don't wrap around Change-Id: I667bb264f92024b72f230c2ddbba3887471345f2 (cherry picked from commit 755b9320c81948358a1d4104c8875594b5700d39) diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 0446bfc..c97db22 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -1542,7 +1542,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; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/docxexport.cxx|8 ++ sw/source/filter/ww8/docxsdrexport.cxx | 91 ++--- sw/source/filter/ww8/wrtw8nds.cxx | 63 ++ sw/source/filter/ww8/wrtww8.cxx|3 + sw/source/filter/ww8/wrtww8.hxx| 12 5 files changed, 149 insertions(+), 28 deletions(-) New commits: commit 2a51dd6aca55a92d8751b67cdf7a5a6ab8c38237 Author: Justin Luth justin_l...@sil.org Date: Fri Jul 3 20:45:16 2015 +0300 tdf#87348 enable docx exporting linked textboxes that LO can import Change-Id: I1f663e1a463919fc0662c94e03b801c7c58f1f5d Reviewed-on: https://gerrit.libreoffice.org/16745 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 855be57..58d9d0b 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -453,6 +453,7 @@ void DocxExport::ExportDocument_Impl() WriteEmbeddings(); +m_aLinkedTextboxesHelper.clear(); //final cleanup delete m_pStyles, m_pStyles = NULL; delete m_pSections, m_pSections = NULL; } @@ -1314,6 +1315,10 @@ void DocxExport::WriteMainText() // setup the namespaces m_pDocumentFS-startElementNS( XML_w, XML_document, MainXmlNamespaces()); +// reset the incrementing linked-textboxes chain ID before re-saving. +m_nLinkedTextboxesChainId=0; +m_aLinkedTextboxesHelper.clear(); + // Write background page color if (boost::optionalSvxBrushItem oBrush = getBackground()) { @@ -1331,6 +1336,9 @@ void DocxExport::WriteMainText() // the text WriteText(); +// clear linked textboxes since old ones can't be linked to frames in a different section (correct?) +m_aLinkedTextboxesHelper.clear(); + // the last section info m_pAttrOutput-EndParaSdtBlock(); const WW8_SepInfo *pSectionInfo = m_pSections? m_pSections-CurrentSectionInfo(): NULL; diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 13c7bd0..c6207a5 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -144,8 +144,6 @@ struct DocxSdrExport::Impl sax_fastparser::FastAttributeList* m_pFlyWrapAttrList; sax_fastparser::FastAttributeList* m_pBodyPrAttrList; std::unique_ptrsax_fastparser::FastAttributeList m_pDashLineStyleAttr; -sal_Int32 m_nId ; -sal_Int32 m_nSeq ; bool m_bDMLAndVMLDrawingOpen; /// List of TextBoxes in this document: they are exported as part of their shape, never alone. std::setconst SwFrameFormat* m_aTextBoxes; @@ -167,8 +165,6 @@ struct DocxSdrExport::Impl m_bFlyFrameGraphic(false), m_pFlyWrapAttrList(0), m_pBodyPrAttrList(0), - m_nId(0), - m_nSeq(0), m_bDMLAndVMLDrawingOpen(false), m_aTextBoxes(SwTextBoxHelper::findTextBoxes(m_rExport.m_pDoc)), m_nDMLandVMLTextFrameRotation(0) @@ -1476,48 +1472,87 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId, bo pFS-endElementNS(XML_wps, XML_spPr); } +//first, loop through ALL of the chained textboxes to identify a unique ID for each chain, and sequence number for each textbox in that chain. +std::mapOUString, MSWordExportBase::LinkedTextboxInfo::iterator linkedTextboxesIter; +if( !m_pImpl-m_rExport.m_bLinkedTextboxesHelperInitialized ) +{ +sal_Int32 nSeq=0; +linkedTextboxesIter = m_pImpl-m_rExport.m_aLinkedTextboxesHelper.begin(); +while ( linkedTextboxesIter != m_pImpl-m_rExport.m_aLinkedTextboxesHelper.end() ) +{ +//find the start of a textbox chain: has no PREVIOUS link, but does have NEXT link +if ( linkedTextboxesIter-second.sPrevChain.isEmpty() !linkedTextboxesIter-second.sNextChain.isEmpty() ) +{ +//assign this chain a unique ID and start a new sequence +nSeq = 0; +linkedTextboxesIter-second.nId = ++m_pImpl-m_rExport.m_nLinkedTextboxesChainId; +linkedTextboxesIter-second.nSeq = nSeq; + +OUString sCheckForBrokenChains = linkedTextboxesIter-first; + +//follow the chain and assign the same id, and incremental sequence numbers. +std::mapOUString, MSWordExportBase::LinkedTextboxInfo::iterator followChainIter; +followChainIter = m_pImpl-m_rExport.m_aLinkedTextboxesHelper.find(linkedTextboxesIter-second.sNextChain); +while ( followChainIter != m_pImpl-m_rExport.m_aLinkedTextboxesHelper.end() ) +{ +//verify that the NEXT textbox also points to me as the PREVIOUS. +// A broken link indicates a leftover remnant that can be ignored. +if(
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/ww8/wrtww8.cxx |2 ++ sw/source/filter/ww8/wrtww8.hxx |4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit 14b96e611d0618df6b8e85d394e8aa6350845cc4 Author: Thorsten Behrens thorsten.behr...@cib.de Date: Tue Jul 7 10:29:37 2015 +0200 gcc4.6: remove c++11-isms on -5-0 branch This is a fixup for 2a51dd6aca55a92d8751b67cdf7a5a6ab8c38237 Change-Id: I4fba62f944747cbb39013d4b0005a6b4a31f5222 diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index bbf819a..611559e 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3529,6 +3529,8 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM , m_pAtn(0) , m_pTextBxs(0) , m_pHFTextBxs(0) +, m_bLinkedTextboxesHelperInitialized(false) +, m_nLinkedTextboxesChainId(0) , m_pParentFrame(0) , m_pFlyOffset(0) , m_eNewAnchorType(FLY_AS_CHAR) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index d2cb89d..c0bddbb 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -506,8 +506,8 @@ public: LinkedTextboxInfo(): nId(0), nSeq(0) {} }; std::mapOUString,LinkedTextboxInfo m_aLinkedTextboxesHelper; -bool m_bLinkedTextboxesHelperInitialized = false; -sal_Int32 m_nLinkedTextboxesChainId=0; +bool m_bLinkedTextboxesHelperInitialized; +sal_Int32 m_nLinkedTextboxesChainId; const sw::Frame *m_pParentFrame; // If set we are exporting content inside // a frame, e.g. a graphic node ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/ui/dbui/mailmergewizard.cxx |1 sw/source/uibase/dbui/mmconfigitem.cxx | 70 +++-- sw/source/uibase/inc/mmconfigitem.hxx |6 +- 3 files changed, 30 insertions(+), 47 deletions(-) New commits: commit faf32bcd27b4a1e53cccb03de51a691152a75c6d Author: Bjoern Michaelsen bjoern.michael...@canonical.com Date: Sat Jul 4 23:22:53 2015 +0200 tdf#90377: fix exclude recipient in mail merge - first, actually use the selection in MergeNew() - secoond, bring back GetSelection() for that - third, throw away lots of the old (dead) code that mostly just stumbled over itself - e.g. ExcludeRecord() wouldnt work on the last element due to a off-by-one error Change-Id: I07d07e086b748b393f2ada7cb22fdb2ce285ad65 Reviewed-on: https://gerrit.libreoffice.org/16762 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 341bede..04bd7f8 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -276,6 +276,7 @@ void SwMailMergeWizard::CreateTargetDocument() aDescriptor[ svx::daCursor ] = m_rConfigItem.GetResultSet(); aDescriptor[ svx::daCommand ] = m_rConfigItem.GetCurrentDBData().sCommand; aDescriptor[ svx::daCommandType ] = m_rConfigItem.GetCurrentDBData().nCommandType; +aDescriptor[ svx::daSelection ] = m_rConfigItem.GetSelection(); SwMergeDescriptor aMergeDesc( DBMGR_MERGE_SHELL, GetSwView()-GetWrtShell(), aDescriptor); diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx index cec51c7..85f6735 100644 --- a/sw/source/uibase/dbui/mmconfigitem.cxx +++ b/sw/source/uibase/dbui/mmconfigitem.cxx @@ -17,7 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + #include mmconfigitem.hxx +#include vector #include swtypes.hxx #include osl/diagnose.h #include com/sun/star/uno/Any.hxx @@ -34,6 +36,7 @@ #include comphelper/processfactory.hxx #include comphelper/types.hxx #include com/sun/star/sdb/CommandType.hpp +#include comphelper/sequence.hxx #include rtl/instance.hxx #include unotools/configitem.hxx #include mailmergehelper.hxx @@ -1021,57 +1024,34 @@ sal_Int32 SwMailMergeConfigItem::GetResultSetPosition() const return m_pImpl-nResultSetCursorPos; } -bool SwMailMergeConfigItem::IsRecordExcluded(sal_Int32 nRecord) -{ -bool bRet = false; -if(nRecord 0 nRecord m_aSelection.getLength()) -{ -sal_Int32 nTemp = 0; -m_aSelection[nRecord - 1] = nTemp; -bRet = nTemp 1; -} -return bRet; -} +bool SwMailMergeConfigItem::IsRecordExcluded(sal_Int32 nRecord) const +{ return m_aExcludedRecords.find(nRecord) != m_aExcludedRecords.end(); } void SwMailMergeConfigItem::ExcludeRecord(sal_Int32 nRecord, bool bExclude) { -//nRecord is based on 1 -//the selection array contains Anys for all records -//excluded records contain a '-1' -if(!m_aSelection.getLength() || nRecord m_aSelection.getLength()) -{ -if(bExclude) -{ -//if no selection array is available we need to create one containing the -//entries for all available records -if(!m_pImpl-xResultSet.is()) -GetResultSet(); -if(m_pImpl-xResultSet.is()) -{ -m_pImpl-xResultSet-last(); -sal_Int32 nEnd = m_pImpl-xResultSet-getRow(); -sal_Int32 nStart = m_aSelection.getLength(); -m_aSelection.realloc(nEnd); -Any* pSelection = m_aSelection.getArray(); -for(sal_Int32 nIndex = nStart; nIndex nEnd; ++nIndex) -{ -if((nRecord - 1) != nIndex) -pSelection[nIndex] = nIndex + 1; -else -pSelection[nIndex] = (sal_Int32) -1; -} -} -} -} +if(bExclude) +m_aExcludedRecords.insert(nRecord); else -{ -if(nRecord 0 m_aSelection.getLength() nRecord) -{ -m_aSelection[nRecord - 1] = bExclude ? -1 : nRecord; -} -} +m_aExcludedRecords.erase(nRecord); } +uno::Sequenceuno::Any SwMailMergeConfigItem::GetSelection() const +{ +if(!m_pImpl-xResultSet.is()) +GetResultSet(); +if(!m_pImpl-xResultSet.is()) +return {}; +m_pImpl-xResultSet-last(); +sal_Int32 nResultSetSize = m_pImpl-xResultSet-getRow()+1; +std::vectoruno::Any vResult; +vResult.reserve(nResultSetSize); +for(sal_Int32 nIdx=1; nIdxnResultSetSize;++nIdx) +if(!IsRecordExcluded(nIdx)) +vResult.push_back(uno::makeAnysal_Int32(nIdx)); +return comphelper::containerToSequence(vResult); +} + + const uno::Sequence OUString
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/app/docsh.cxx |4 1 file changed, 4 insertions(+) New commits: commit 41c328a982bce85b83f2644b49412db4be64ce29 Author: Julien Nabet serval2...@yahoo.fr Date: Sun Jun 28 12:43:19 2015 +0200 tdf#92386: Writer crashes in print preview if document in 2 windows 2 changes for the 2 following bts First bt: see https://bugs.documentfoundation.org/attachment.cgi?id=116883 Second bt: see https://bugs.documentfoundation.org/attachment.cgi?id=116888 Change-Id: I92ed3b7305bb5b714532f2dcffd615a8337db8b6 Reviewed-on: https://gerrit.libreoffice.org/16557 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com (cherry picked from commit cb813b392d1f59ad8927b87e899d8a33d1db2504) diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 1d275dd..0b66f31 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -1239,11 +1239,15 @@ const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const bool SwDocShell::IsChangeRecording() const { +if (!m_pWrtShell) +return false; return (m_pWrtShell-GetRedlineMode() nsRedlineMode_t::REDLINE_ON) != 0; } bool SwDocShell::HasChangeRecordProtection() const { +if (!m_pWrtShell) +return false; return m_pWrtShell-getIDocumentRedlineAccess()-GetRedlinePassword().getLength() 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/filter/html/swhtml.cxx | 97 --- 1 file changed, 52 insertions(+), 45 deletions(-) New commits: commit 5e5025a3c76e8a27ec3541c6c160e3b0fd2b8474 Author: Matteo Casalin matteo.casa...@yahoo.com Date: Mon Jun 8 23:17:50 2015 +0200 sw: HTML import: Do not mix normal, CTL or CJK attributes The original code used 15 elements for positions, the 'repaired' one lost 10 of them. Also, do not try to be too smart and be verbose, letting the compiler perform optimizations (regression from 1b0f7ee1e04d7b0fe81f7458ae2116615e0f6889) Reviewed-on: https://gerrit.libreoffice.org/16169 Reviewed-by: Michael Stahl mst...@redhat.com Tested-by: Michael Stahl mst...@redhat.com (cherry picked from commit 492ff21d6543d800b0cd424eafbcd409bc19f695) Signed-off-by: Michael Stahl mst...@redhat.com Conflicts: sw/source/filter/html/swhtml.cxx Change-Id: I0a1bc22d1abab083292de17b091c8be872fcee24 diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 4ab6dee..2ef6256 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2294,58 +2294,65 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum ) SwTextAttr *pHt = rHints.GetTextHint( i ); sal_uInt16 nWhich = pHt-Which(); sal_Int16 nIdx = -1; -//In 'hintids.hxx', the following five attributes don't follow -//each other in the Latin attributes as they do among CJK and -//CTL attributes, so the old code just made a mess, IMHO. -//E.g. 29-22=7, which should be LANGUAGE, but it's FONT. -//Moreover, it should occur between 0 and 4. -//Since it would be too risky to change the attribute codes, -//I repaired the following source code the 'brute force' way. - -//Old code: -/* -if( RES_CHRATR_CJK_FONT = nWhich -nWhich = RES_CHRATR_CTL_WEIGHT ) +bool bFont = false; +switch( nWhich ) { -nIdx = static_cast sal_uInt16 (nWhich - RES_CHRATR_CJK_FONT + 5); -} -else switch... -*/ - -if( RES_CHRATR_CJK_FONT == nWhich || RES_CHRATR_CTL_FONT == nWhich ) -{ -nIdx = static_cast sal_uInt16 (0); -} -else if( RES_CHRATR_CJK_FONTSIZE == nWhich || RES_CHRATR_CTL_FONTSIZE == nWhich ) -{ -nIdx = static_cast sal_uInt16 (1); -} -else if( RES_CHRATR_CJK_LANGUAGE == nWhich || RES_CHRATR_CTL_LANGUAGE == nWhich ) -{ -nIdx = static_cast sal_uInt16 (2); -} -else if( RES_CHRATR_CJK_POSTURE == nWhich || RES_CHRATR_CTL_POSTURE == nWhich ) -{ -nIdx = static_cast sal_uInt16 (3); -} -else if( RES_CHRATR_CJK_WEIGHT == nWhich || RES_CHRATR_CTL_WEIGHT == nWhich ) -{ -nIdx = static_cast sal_uInt16 (4); -} -else switch( nWhich ) -{ -case RES_CHRATR_FONT: nIdx = 0; break; -case RES_CHRATR_FONTSIZE: nIdx = 1; break; -case RES_CHRATR_LANGUAGE: nIdx = 2; break; -case RES_CHRATR_POSTURE:nIdx = 3; break; -case RES_CHRATR_WEIGHT: nIdx = 4; break; +case RES_CHRATR_FONT: +nIdx = 0; +bFont = true; +break; +case RES_CHRATR_FONTSIZE: +nIdx = 1; +break; +case RES_CHRATR_LANGUAGE: +nIdx = 2; +break; +case RES_CHRATR_POSTURE: +nIdx = 3; +break; +case RES_CHRATR_WEIGHT: +nIdx = 4; +break; +case RES_CHRATR_CJK_FONT: +nIdx = 5; +bFont = true; +break; +case RES_CHRATR_CJK_FONTSIZE: +nIdx = 6; +break; +case RES_CHRATR_CJK_LANGUAGE: +nIdx = 7; +break; +case RES_CHRATR_CJK_POSTURE: +nIdx = 8; +break; +case RES_CHRATR_CJK_WEIGHT: +nIdx = 9; +break; +case RES_CHRATR_CTL_FONT: +nIdx = 10; +bFont = true; +break; +case RES_CHRATR_CTL_FONTSIZE: +nIdx = 11; +break; +case RES_CHRATR_CTL_LANGUAGE: +nIdx = 12; +break; +case
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/ui/chrdlg/drpcps.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit cc78917935f976ec243a0cd47418d05c9254ee76 Author: László Németh laszlo.nem...@collabora.com Date: Fri Jun 19 21:22:27 2015 +0200 fix DropCap preview rendering Change-Id: I15ccbfe5df8965f9ffb395343fcf6a5ee5b6595b Reviewed-on: https://gerrit.libreoffice.org/16380 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Christian Lohmaier lohmaier+libreoff...@googlemail.com diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 2401be7..a7f4c1a 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -355,7 +355,7 @@ void SwDropCapsPict::Paint(vcl::RenderContext rRenderContext, const Rectangle Size aOutputSizePixel(rRenderContext.GetOutputSizePixel()); -DrawRect(Rectangle(Point(0, 0), aOutputSizePixel)); +rRenderContext.DrawRect(Rectangle(Point(0, 0), aOutputSizePixel)); rRenderContext.SetClipRegion(vcl::Region(Rectangle(Point(BORDER, BORDER), Size(aOutputSizePixel.Width () - 2 * BORDER, aOutputSizePixel.Height() - 2 * BORDER; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/docvw/srcedtw.cxx | 17 + sw/source/uibase/uiview/srcview.cxx |2 ++ 2 files changed, 15 insertions(+), 4 deletions(-) New commits: commit ffc08eac223211d3ca2d4ebadb9ccb8e26d22a5e Author: Michael Meeks michael.me...@collabora.com Date: Sat Jun 20 12:46:31 2015 +0100 tdf#92166 - dispose the SwSrcEditWindow properly. Also improve dispose method to cleanup various pointers. Also avoid crash on post dispose MouseUp event. Change-Id: Ic337a8306566d5b5c81b939be6f89f34fbcc5847 diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index eb9dbf4..c15e72d 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -283,13 +283,18 @@ void SwSrcEditWindow::dispose() n-removePropertiesChangeListener(listener_.get()); } aSyntaxIdle.Stop(); +if ( pOutWin ) +pOutWin-SetTextView( NULL ); + if ( pTextEngine ) { EndListening( *pTextEngine ); pTextEngine-RemoveView( pTextView ); delete pTextView; +pTextView = NULL; delete pTextEngine; +pTextEngine = NULL; } pHScrollbar.disposeAndClear(); pVScrollbar.disposeAndClear(); @@ -399,10 +404,14 @@ void TextViewOutWin::MouseButtonUp( const MouseEvent rEvt ) if ( pTextView ) { pTextView-MouseButtonUp( rEvt ); -SfxBindings rBindings = static_castSwSrcEditWindow*(GetParent())-GetSrcView()-GetViewFrame()-GetBindings(); -rBindings.Invalidate( SID_TABLE_CELL ); -rBindings.Invalidate( SID_CUT ); -rBindings.Invalidate( SID_COPY ); +SfxViewFrame *pFrame = static_castSwSrcEditWindow*(GetParent())-GetSrcView()-GetViewFrame(); +if ( pFrame ) +{ +SfxBindings rBindings = pFrame-GetBindings(); +rBindings.Invalidate( SID_TABLE_CELL ); +rBindings.Invalidate( SID_CUT ); +rBindings.Invalidate( SID_COPY ); +} } } diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index b29c897..db8aeba 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -243,6 +243,8 @@ SwSrcView::~SwSrcView() (delay != 0) || !url.isEmpty()); EndListening(*pDocShell); delete pSearchItem; + +aEditWin.disposeAndClear(); } void SwSrcView::SaveContentTo(SfxMedium rMed) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/layout/layact.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit cb011e8f4059c2969d13a2322565dcaae3962253 Author: Jan Holesovsky ke...@collabora.com Date: Fri Jun 19 10:59:03 2015 +0200 rendercontext: Don't direct paint the SHOW_IDLE when double-buffering. Change-Id: I279187a80b4c6d1fe9e34e38451abeb496e53b37 diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 35a2fd2..4c61de4 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -2102,7 +2102,7 @@ void SwLayIdle::ShowIdle( ColorData eColorData ) { m_bIndicator = true; vcl::Window *pWin = pImp-GetShell()-GetWin(); -if ( pWin ) +if (pWin !pWin-SupportsDoubleBuffering()) // FIXME make this work with double-buffering { Rectangle aRect( 0, 0, 5, 5 ); aRect = pWin-PixelToLogic( aRect ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/doc/docedt.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit bcc96bd249cb122968ac35222a0fbc46f5d4a304 Author: Michael Stahl mst...@redhat.com Date: Wed Jun 17 14:00:05 2015 +0200 sw: fix assert on exporting ooo75410-1.doc to WW8 Apparently it may happen that some fly does get a different anchor node than before, which means the RemoveAnchoredFly() will be called twice. Prevent the problem differently by clearing the anchor in _SaveFlyInRange(). (regression from a624cf52ab08b18b08711567799a08f47c48f89b) Change-Id: Id796d2e230de065113bcf1e6164d6b8a01ab933c (cherry picked from commit 8a1f55365ca609c1f2a79e9067b4857fae19b202) diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index dafbb2a..1326422 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -77,9 +77,8 @@ void _RestFlyInRange( _SaveFlyArr rArr, const SwNodeIndex rSttIdx, SwFormatAnchor aAnchor( pFormat-GetAnchor() ); aAnchor.SetAnchor( aPos ); pFormat-GetDoc()-GetSpzFrameFormats()-push_back( pFormat ); +// SetFormatAttr should call Modify() and add it to the node pFormat-SetFormatAttr( aAnchor ); -// SetFormatAttr will not call Modify() because the node is the same :-/ -aPos.nNode.GetNode().AddAnchoredFly(pFormat); SwContentNode* pCNd = aPos.nNode.GetNode().GetContentNode(); if( pCNd pCNd-getLayoutFrm( pFormat-GetDoc()-getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false ) ) pFormat-MakeFrms(); @@ -104,7 +103,10 @@ void _SaveFlyInRange( const SwNodeRange rRg, _SaveFlyArr rArr ) pFormat, false ); rArr.push_back( aSave ); pFormat-DelFrms(); -pAPos-nNode.GetNode().RemoveAnchoredFly(pFormat); +// set a dummy anchor position to maintain anchoring invariants +SwFormatAnchor aAnchor( pFormat-GetAnchor() ); +aAnchor.SetAnchor(nullptr); +pFormat-SetFormatAttr(aAnchor); rFormats.erase( rFormats.begin() + n-- ); } } @@ -168,7 +170,10 @@ void _SaveFlyInRange( const SwPaM rPam, const SwNodeIndex rInsPos, pFormat, bInsPos ); rArr.push_back( aSave ); pFormat-DelFrms(); -pAPos-nNode.GetNode().RemoveAnchoredFly(pFormat); +// set a dummy anchor position to maintain anchoring invariants +SwFormatAnchor aAnchor( pFormat-GetAnchor() ); +aAnchor.SetAnchor(nullptr); +pFormat-SetFormatAttr(aAnchor); rFormats.erase( rFormats.begin() + n-- ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/docvw/FrameControlsManager.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7657db1f7970f66fe5f03af54195bc812d7bdfaa Author: Michael Stahl mst...@redhat.com Date: Sat Jun 13 00:11:01 2015 +0200 sw: overloading in C++ fail episode 6234 Change-Id: Ida670ac9c6687314d8b425c3ac1f9896f54f2a15 (cherry picked from commit a9286c302e96258f32d13fb66aced25750e82cd3) diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx b/sw/source/uibase/docvw/FrameControlsManager.cxx index 262388c..2ea7de4 100644 --- a/sw/source/uibase/docvw/FrameControlsManager.cxx +++ b/sw/source/uibase/docvw/FrameControlsManager.cxx @@ -187,7 +187,7 @@ void SwFrameMenuButtonBase::dispose() SwFrameControl::SwFrameControl( const VclPtrvcl::Window pWindow ) { -assert( pWindow != NULL ); +assert(static_castbool(pWindow)); mxWindow.reset( pWindow ); mpIFace = dynamic_castISwFrameControl *( pWindow.get() ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/dochdl/swdtflvr.cxx |8 1 file changed, 8 insertions(+) New commits: commit 799eef80581f2b39025ab1f388d6f4d741eabeac Author: Caolán McNamara caol...@redhat.com Date: Wed Jun 17 10:43:44 2015 +0100 Resolves: tdf#86017 calc has more rows than writer tables can support as things stand right now in writer if the table doesn't fit it doesn't fit and don't try for back-ports reuse same bogus error used for 0 rows/cells (cherry picked from commit 550cff762d816c336adaf015f481443af1c6edab) Change-Id: I90cea4c8566460f614d9a1143a638597d5ab8ce6 diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 765ab0f..70dbd74 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2172,6 +2172,14 @@ bool SwTransferable::_PasteDDE( TransferableDataHelper rData, sTmp = sTmp.getToken( 0, '\n' ); sal_Int32 nCols = comphelper::string::getTokenCount(sTmp, '\t'); +if (nRows USHRT_MAX || nCols USHRT_MAX) +{ +if( bMsg ) +ScopedVclPtrInstanceMessageDialog::Create(nullptr, SW_RESSTR(STR_NO_TABLE), VCL_MESSAGE_INFO)-Execute(); +pDDETyp = 0; +break; +} + // at least one column row must be there if( !nRows || !nCols ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/frmedt/fecopy.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit 5fbf5b10ca45528a075aba5d5f8e3f6af08c287f Author: Caolán McNamara caol...@redhat.com Date: Tue Jun 16 19:57:15 2015 +0100 Resolves: tdf#81806 crash on certain table paste+undo+page cycles Undo of a delete always leaves a pam that points to the start of the undone area and a mark to the end of the undone area, even if that area is empty. (In the normal where there is a selection this can be seen by selecting something, deleting it, and undoing and the newly undeleted stuff is again selected) The table overwrite/paste thing looks to see if a mark is set and goes off to do something very complex if its set. So if after each undo cycle, you physically click at the point where the cursor is flashing (which clears the mark) and then paste, undo, *click*, paste you get a wonderfully stable experience. It seems reasonable to me to do the simple thing if there is no mark, or if the mark and point are the same, i.e. there is nothing actually selected by the PaM. Change-Id: Ib451090f3863fde41209cc1fc9cfa0c747d0be58 (cherry picked from commit e06905df15ff03c6d3c84f61bd67860a91416c2d) diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index ef1a64a..987625d 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -667,6 +667,11 @@ namespace { typedef boost::shared_ptrSwPaM PaMPtr; typedef boost::shared_ptrSwPosition PositionPtr; typedef std::pair PaMPtr, PositionPtr Insertion; + +bool PamHasSelection(const SwPaM rPaM) +{ +return rPaM.HasMark() *rPaM.GetPoint() != *rPaM.GetMark(); +} } bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) @@ -839,7 +844,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) ParkTableCrsr(); bParkTableCrsr = true; } -else if( !rPaM.HasMark() rPaM.GetNext() == rPaM +else if( !PamHasSelection(rPaM) rPaM.GetNext() == rPaM ( !pSrcNd-GetTable().IsTableComplex() || pDestNd-GetTable().IsNewModel() ) ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source sw/uiconfig
sw/source/ui/fmtui/tmpdlg.cxx | 10 +- sw/uiconfig/swriter/ui/templatedialog2.ui | 13 + 2 files changed, 18 insertions(+), 5 deletions(-) New commits: commit 343f992816ab594c608537fd32fb4bf412f5fabb Author: Zolnai Tamás zolnaitamas2...@gmail.com Date: Wed Jun 17 00:00:27 2015 +0200 tdf#90072: No character background (highlight) tab in paragraph styles dialog Background Tab was replaced with Area Tab on Paragraph Style Dialog. With that we lost the opportunity to set character background color. So bring back the Background tab as Highlighting. (cherry picked from commit 9874db206eed84616e4e232b1b56c7b7532166a0) Change-Id: I29925f72816fbd27243060231d551e6590f1b9d9 Reviewed-on: https://gerrit.libreoffice.org/16324 Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com Tested-by: Adolfo Jayme Barrientos fit...@ubuntu.com diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index f0ad083..cbb4c1d 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -187,6 +187,10 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, OSL_ENSURE(pFact-GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , GetTabPageRangesFunc fail!); m_nAsianLayoutId = AddTabPage(asianlayout, pFact-GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact-GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) ); +OSL_ENSURE(pFact-GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), GetTabPageCreatorFunc fail!); +OSL_ENSURE(pFact-GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , GetTabPageRangesFunc fail!); +m_nBackgroundId = AddTabPage(highlighting, pFact-GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact-GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND )); + OSL_ENSURE(pFact-GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), GetTabPageCreatorFunc fail!); OSL_ENSURE(pFact-GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), GetTabPageRangesFunc fail!); m_nTabId = AddTabPage(tabs, pFact-GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), pFact-GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) ); @@ -480,13 +484,9 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage rPage ) else if (nId == m_nBackgroundId) { SvxBackgroundTabFlags nFlagType = SvxBackgroundTabFlags::NONE; -if( SFX_STYLE_FAMILY_PARA == nType ) -nFlagType |= SvxBackgroundTabFlags::SHOW_PARACTL; -if( SFX_STYLE_FAMILY_CHAR != nType ) -nFlagType |= SvxBackgroundTabFlags::SHOW_SELECTOR; if( SFX_STYLE_FAMILY_FRAME == nType ) nFlagType |= SvxBackgroundTabFlags::ENABLE_TRANSPARENCY; -if( SFX_STYLE_FAMILY_CHAR == nType ) +if( SFX_STYLE_FAMILY_CHAR == nType || SFX_STYLE_FAMILY_PARA == nType ) nFlagType |= SvxBackgroundTabFlags::SHOW_HIGHLIGHTING; aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_castsal_uInt32(nFlagType))); rPage.PageCreated(aSet); diff --git a/sw/uiconfig/swriter/ui/templatedialog2.ui b/sw/uiconfig/swriter/ui/templatedialog2.ui index 6b9f61b..017cbd3 100644 --- a/sw/uiconfig/swriter/ui/templatedialog2.ui +++ b/sw/uiconfig/swriter/ui/templatedialog2.ui @@ -249,6 +249,19 @@ placeholder/ /child child type=tab + object class=GtkLabel id=highlighting +property name=visibleTrue/property +property name=can_focusFalse/property +property name=label translatable=yesHighlighting/property + /object + packing +property name=tab_fillFalse/property + /packing +/child +child + placeholder/ +/child +child type=tab object class=GtkLabel id=outline property name=visibleTrue/property property name=can_focusFalse/property ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/dbui/dbmgr.cxx | 78 1 file changed, 39 insertions(+), 39 deletions(-) New commits: commit b6a2f00e8db0dab8d3b9eead6f8a4d2eee845a80 Author: Caolán McNamara caol...@redhat.com Date: Mon Jun 15 12:58:57 2015 +0100 Resolves: tdf#92057 crash on mail-merge to printer this appears to be a mismerge of commit e0ad036eed6b151ea81311fcf9ba46f1726b103c Author: LuboÅ¡ LuÅák l.lu...@collabora.com Date: Thu Feb 19 16:39:06 2015 +0100 mailmerge doesn't need to use the singlefile technique for printing It should be sufficient for every record to just update the fields and print the document. The printing code apparently rather expects to do the printing in one go, so split the functions up there. Conflicts: include/sfx2/viewsh.hxx include/vcl/print.hxx sfx2/source/view/viewprn.cxx sw/source/uibase/dbui/dbmgr.cxx sw/source/uibase/uno/unomailmerge.cxx vcl/source/gdi/print3.cxx where the else if block is positioned at a nutty location Change-Id: Ia22e9e53c27256131283babaf779e57f157ba6b8 (cherry picked from commit af8f938531909122ff7a056c2206af857324fdf3) Reviewed-on: https://gerrit.libreoffice.org/16292 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index a3ab6d9..922006d 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1186,45 +1186,6 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, lcl_CopyFollowPageDesc( *pTargetShell, *pWorkPageDesc, *pTargetPageDesc, nDocNo ); } } -else if( rMergeDescriptor.nMergeType == DBMGR_MERGE_PRINTER ) -{ -assert(!bCreateSingleFile); -if( 1 == nDocNo ) // set up printing only once at the beginning -{ -// printing should be done synchronously otherwise the document -// might already become invalid during the process -uno::Sequence beans::PropertyValue aOptions( rMergeDescriptor.aPrintOptions ); - -aOptions.realloc( 2 ); -aOptions[ 0 ].Name = Wait; -aOptions[ 0 ].Value = sal_True; -aOptions[ 1 ].Name = MonitorVisible; -aOptions[ 1 ].Value = sal_False; -// move print options -const beans::PropertyValue* pPrintOptions = rMergeDescriptor.aPrintOptions.getConstArray(); -for( sal_Int32 nOption = 0, nIndex = 1 ; nOption rMergeDescriptor.aPrintOptions.getLength(); ++nOption) -{ -if( pPrintOptions[nOption].Name == CopyCount || pPrintOptions[nOption].Name == FileName -|| pPrintOptions[nOption].Name == Collate || pPrintOptions[nOption].Name == Pages -|| pPrintOptions[nOption].Name == Wait || pPrintOptions[nOption].Name == PrinterName ) -{ -// add an option -aOptions.realloc( nIndex + 1 ); -aOptions[ nIndex ].Name = pPrintOptions[nOption].Name; -aOptions[ nIndex++ ].Value = pPrintOptions[nOption].Value ; -} -} -pWorkView-StartPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync ); -SfxPrinter* pDocPrt = pWorkView-GetPrinter(false); -JobSetup aJobSetup = pDocPrt ? pDocPrt-GetJobSetup() : SfxViewShell::GetJobSetup(); -Printer::PreparePrintJob( pWorkView-GetPrinterController(), aJobSetup ); -#if ENABLE_CUPS !defined(MACOSX) - psp::PrinterInfoManager::get().startBatchPrint(); -#endif -} -if( !Printer::ExecutePrintJob( pWorkView-GetPrinterController())) -bCancel = true; -} else pTargetPageDesc =
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/doc/docedt.cxx |8 1 file changed, 8 insertions(+) New commits: commit d0a6b46a293197d293ffa86d94877805e620959c Author: Michael Stahl mst...@redhat.com Date: Mon Jun 15 21:15:54 2015 +0200 sw: fix assert on exporting ooo24533-1.sxw to WW8 There's a fly anchored at a paragraph inside of a table inside of a redline, and for some reason MoveRange() calls SwTableNode::MakeFrms(), which asserts in frmtool.cxx AppendObjs(). The problem is that _SaveFlyInRange() removes the frame format from the SpzFrmFmts but it is still reachable from the SwNode::m_pAnchoredFlys. Change-Id: I3853c0072662bfb4f71f78451d3604ed567cd584 (cherry picked from commit a624cf52ab08b18b08711567799a08f47c48f89b) diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 8bc9e08..dafbb2a 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -44,6 +44,7 @@ #include unoflatpara.hxx #include SwGrammarMarkUp.hxx #include docedt.hxx +#include atrfrm.hxx #include vector @@ -77,10 +78,13 @@ void _RestFlyInRange( _SaveFlyArr rArr, const SwNodeIndex rSttIdx, aAnchor.SetAnchor( aPos ); pFormat-GetDoc()-GetSpzFrameFormats()-push_back( pFormat ); pFormat-SetFormatAttr( aAnchor ); +// SetFormatAttr will not call Modify() because the node is the same :-/ +aPos.nNode.GetNode().AddAnchoredFly(pFormat); SwContentNode* pCNd = aPos.nNode.GetNode().GetContentNode(); if( pCNd pCNd-getLayoutFrm( pFormat-GetDoc()-getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false ) ) pFormat-MakeFrms(); } +sw::CheckAnchoredFlyConsistency(*rSttIdx.GetNode().GetDoc()); } void _SaveFlyInRange( const SwNodeRange rRg, _SaveFlyArr rArr ) @@ -100,9 +104,11 @@ void _SaveFlyInRange( const SwNodeRange rRg, _SaveFlyArr rArr ) pFormat, false ); rArr.push_back( aSave ); pFormat-DelFrms(); +pAPos-nNode.GetNode().RemoveAnchoredFly(pFormat); rFormats.erase( rFormats.begin() + n-- ); } } +sw::CheckAnchoredFlyConsistency(*rRg.aStart.GetNode().GetDoc()); } void _SaveFlyInRange( const SwPaM rPam, const SwNodeIndex rInsPos, @@ -162,10 +168,12 @@ void _SaveFlyInRange( const SwPaM rPam, const SwNodeIndex rInsPos, pFormat, bInsPos ); rArr.push_back( aSave ); pFormat-DelFrms(); +pAPos-nNode.GetNode().RemoveAnchoredFly(pFormat); rFormats.erase( rFormats.begin() + n-- ); } } } + sw::CheckAnchoredFlyConsistency(*rPam.GetPoint()-nNode.GetNode().GetDoc()); } /// Delete and move all Flys at the paragraph, that are within the selection. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/ui/envelp/labprt.cxx |2 sw/source/uibase/docvw/FrameControlsManager.cxx | 59 --- sw/source/uibase/docvw/HeaderFooterWin.cxx | 13 +--- sw/source/uibase/docvw/PageBreakWin.cxx | 12 +--- sw/source/uibase/inc/FrameControl.hxx | 71 +++- sw/source/uibase/inc/HeaderFooterWin.hxx|5 - sw/source/uibase/inc/PageBreakWin.hxx |8 +- 7 files changed, 107 insertions(+), 63 deletions(-) New commits: commit c9be3ebba438d202906ddb9da05a27a7fb5c1ab6 Author: Michael Meeks michael.me...@collabora.com Date: Mon Jun 8 15:34:12 2015 +0100 Writer FrameControl lifecycle and management cleanup. We can't derive from a VclPtr base-class, and also another base, and then use boost::shared_ptr for that; re-factor to use a boost_ptr to hold a VclPtr for now. Also fix leaking envelope dialog. Change-Id: I2e1efbfaee3b6051e38ff7a14903a83ccd75136b Reviewed-on: https://gerrit.libreoffice.org/16160 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Michael Meeks michael.me...@collabora.com Tested-by: Michael Meeks michael.me...@collabora.com diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index ae81bbe..59e3e06 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -91,7 +91,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) VclPtrInstance PrinterSetupDialog pDlg(this); pDlg-SetPrinter(pPrinter); pDlg-Execute(); -pDlg.reset(); +pDlg.disposeAndClear(); GrabFocus(); m_pPrinterInfo-SetText(pPrinter-GetName()); return 0; diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx b/sw/source/uibase/docvw/FrameControlsManager.cxx index e168096..262388c 100644 --- a/sw/source/uibase/docvw/FrameControlsManager.cxx +++ b/sw/source/uibase/docvw/FrameControlsManager.cxx @@ -117,7 +117,9 @@ void SwFrameControlsManager::SetHeaderFooterControl( const SwPageFrm* pPageFrm, pControl = lb-second; else { -SwFrameControlPtr pNewControl( new SwHeaderFooterWin( m_pEditWin, pPageFrm, bHeader ) ); +SwFrameControlPtr pNewControl( +new SwFrameControl( VclPtrSwHeaderFooterWin::Create( +m_pEditWin, pPageFrm, bHeader ).get() ) ); const SwViewOption* pViewOpt = m_pEditWin-GetView().GetWrtShell().GetViewOptions(); pNewControl-SetReadonly( pViewOpt-IsReadonly() ); rControls.insert(lb, make_pair(pPageFrm, pNewControl)); @@ -126,11 +128,12 @@ void SwFrameControlsManager::SetHeaderFooterControl( const SwPageFrm* pPageFrm, Rectangle aPageRect = m_pEditWin-LogicToPixel( pPageFrm-Frm().SVRect() ); -SwHeaderFooterWin rHFWin = dynamic_castSwHeaderFooterWin(*pControl.get()); -assert(rHFWin.IsHeader() == bHeader); -rHFWin.SetOffset( aOffset, aPageRect.Left(), aPageRect.Right() ); +SwHeaderFooterWin* pWin = dynamic_castSwHeaderFooterWin *(pControl-GetWindow()); +assert( pWin != NULL) ; +assert( pWin-IsHeader() == bHeader ); +pWin-SetOffset( aOffset, aPageRect.Left(), aPageRect.Right() ); -if (!rHFWin.IsVisible()) +if (!pWin-IsVisible()) pControl-ShowAll( true ); } @@ -146,7 +149,8 @@ void SwFrameControlsManager::SetPageBreakControl( const SwPageFrm* pPageFrm ) pControl = lb-second; else { -SwFrameControlPtr pNewControl( new SwPageBreakWin( m_pEditWin, pPageFrm ) ); +SwFrameControlPtr pNewControl( new SwFrameControl( +VclPtrSwPageBreakWin::Create( m_pEditWin, pPageFrm ).get() ) ); const SwViewOption* pViewOpt = m_pEditWin-GetView().GetWrtShell().GetViewOptions(); pNewControl-SetReadonly( pViewOpt-IsReadonly() ); @@ -155,10 +159,47 @@ void SwFrameControlsManager::SetPageBreakControl( const SwPageFrm* pPageFrm ) pControl.swap( pNewControl ); } -SwPageBreakWin rWin = dynamic_castSwPageBreakWin(*pControl.get()); -rWin.UpdatePosition(); -if (!rWin.IsVisible()) +SwPageBreakWin* pWin = dynamic_castSwPageBreakWin *(pControl-GetWindow()); +assert (pWin != NULL); +pWin-UpdatePosition(); +if (!pWin-IsVisible()) pControl-ShowAll( true ); } +SwFrameMenuButtonBase::SwFrameMenuButtonBase( SwEditWin* pEditWin, const SwFrm* pFrm ) : +MenuButton( pEditWin, WB_DIALOGCONTROL ), +m_pEditWin( pEditWin ), +m_pFrm( pFrm ) +{ +} + +const SwPageFrm* SwFrameMenuButtonBase::GetPageFrame() +{ +return static_cast const SwPageFrm * ( m_pFrm ); +} + +void SwFrameMenuButtonBase::dispose() +{ +m_pEditWin.clear(); +m_pFrm = NULL; +MenuButton::dispose(); +} + +SwFrameControl::SwFrameControl( const VclPtrvcl::Window pWindow ) +{ +assert( pWindow != NULL ); +mxWindow.reset( pWindow ); +mpIFace = dynamic_castISwFrameControl *( pWindow.get() ); +} +
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source vcl/source
sw/source/uibase/docvw/edtwin.cxx |4 +++- sw/source/uibase/uno/unotxdoc.cxx |1 + vcl/source/window/paint.cxx |9 + 3 files changed, 9 insertions(+), 5 deletions(-) New commits: commit ae8176d72bd86107ef2c93d9b0f1c91f60cf8823 Author: Henry Castro hcas...@collabora.com Date: Tue Jun 9 23:19:40 2015 -0400 sw tiled rendering: Ignore window size check. In the tiled rendering case it does not need to check if the window size is (0,0). But it still has to trigger LOKit LOK_CALLBACK_INVALIDATE_TILES Change-Id: I4c458edfd6e44599b8c8148e0f8543fb0563e627 (cherry picked from commit 2281a4922f2209511f79b961ca2140c112bc41eb) (cherry picked from commit a6f4fde8baf3eeb36820d18ffad84192e995145f) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 773b141..d89de19 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -6203,7 +6203,9 @@ void SwEditWin::LogicInvalidate(const Rectangle* pRectangle) sRectangle = EMPTY; else sRectangle = pRectangle-toString(); - m_rView.GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); + +if ( m_rView.GetWrtShellPtr() ) + m_rView.GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } void SwEditWin::LogicMouseButtonDown(const MouseEvent rMouseEvent) diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index a066c6f..b2cdfac 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3165,6 +3165,7 @@ void SwXTextDocument::initializeForTiledRendering() SwView* pView = pDocShell-GetView(); if (!pView) return; + pView-SetViewLayout(nColumns, bBookMode, true); // Tiled rendering defaults. diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 743b3b8..0adb3ee 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -31,6 +31,7 @@ #include salgdi.hxx #include salframe.hxx #include svdata.hxx +#include comphelper/lok.hxx #define IMPL_PAINT_PAINT((sal_uInt16)0x0001) #define IMPL_PAINT_PAINTALL ((sal_uInt16)0x0002) @@ -1132,7 +1133,7 @@ vcl::Region Window::GetPaintRegion() const void Window::Invalidate( sal_uInt16 nFlags ) { -if ( !IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight ) +if ( !comphelper::LibreOfficeKit::isActive() (!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) ) return; ImplInvalidate( NULL, nFlags ); @@ -1141,7 +1142,7 @@ void Window::Invalidate( sal_uInt16 nFlags ) void Window::Invalidate( const Rectangle rRect, sal_uInt16 nFlags ) { -if ( !IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight ) +if ( !comphelper::LibreOfficeKit::isActive() (!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) ) return; OutputDevice *pOutDev = GetOutDev(); @@ -1157,7 +1158,7 @@ void Window::Invalidate( const Rectangle rRect, sal_uInt16 nFlags ) void Window::Invalidate( const vcl::Region rRegion, sal_uInt16 nFlags ) { -if ( !IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight ) +if ( !comphelper::LibreOfficeKit::isActive() (!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) ) return; if ( rRegion.IsNull() ) @@ -1180,7 +1181,7 @@ void Window::Invalidate( const vcl::Region rRegion, sal_uInt16 nFlags ) void Window::Validate( sal_uInt16 nFlags ) { -if ( !IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight ) +if ( !comphelper::LibreOfficeKit::isActive() (!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) ) return; ImplValidate( NULL, nFlags ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/uibase/uiview/view2.cxx | 53 ++ 1 file changed, 53 insertions(+) New commits: commit 9940e12730a7179cd62e02faa41dc3a81d3ad721 Author: Andras Timar andras.ti...@collabora.com Date: Thu Jun 11 00:01:38 2015 +0200 tdf#91613 restore functionality of clicking to .uno:Size status bar element ... in Writer. This (partially) reverts commit ebabf6d1fa648d62dd63529e9fe64dcb631caee8. I did not see the point to open Fields dialog by default, but other uses are fully valid. Change-Id: Ia06803fbb956266fb40c53f51099f9a32ddd6548 Reviewed-on: https://gerrit.libreoffice.org/16221 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Andras Timar andras.ti...@collabora.com (cherry picked from commit a2716e53c140b09d886591a3d6611ee8f166e417) diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 02b58fb..498a262 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1487,6 +1487,26 @@ void SwView::StateStatusLine(SfxItemSet rSet) rSet.DisableItem( SID_ATTR_ZOOMSLIDER ); } break; +case SID_ATTR_POSITION: +case SID_ATTR_SIZE: +{ +if( !rShell.IsFrmSelected() !rShell.IsObjSelected() ) +SwBaseShell::_SetFrmMode( FLY_DRAG_END ); +else +{ +FlyMode eFrameMode = SwBaseShell::GetFrmMode(); +if ( eFrameMode == FLY_DRAG_START || eFrameMode == FLY_DRAG ) +{ +if ( nWhich == SID_ATTR_POSITION ) +rSet.Put( SfxPointItem( SID_ATTR_POSITION, + rShell.GetAnchorObjDiff())); +else +rSet.Put( SvxSizeItem( SID_ATTR_SIZE, + rShell.GetObjSize())); +} +} +} +break; case SID_TABLE_CELL: if( rShell.IsFrmSelected() || rShell.IsObjSelected() ) @@ -1777,6 +1797,39 @@ void SwView::ExecuteStatusLine(SfxRequest rReq) } break; +case SID_ATTR_SIZE: +{ +sal_uInt16 nId = 0; +if( rSh.IsCrsrInTable() ) +nId = FN_FORMAT_TABLE_DLG; +else if( rSh.GetCurTOX() ) +nId = FN_INSERT_MULTI_TOX; +else if( rSh.GetCurrSection() ) +nId = FN_EDIT_REGION; +else +{ +const SwNumRule* pNumRule = rSh.GetNumRuleAtCurrCrsrPos(); +if( pNumRule ) // cursor in numbering +{ +if( pNumRule-IsAutoRule() ) +nId = FN_NUMBER_BULLETS; +else +{ +// start dialog of the painter +nId = 0; +} +} +else if( rSh.IsFrmSelected() ) +nId = FN_FORMAT_FRAME_DLG; +else if( rSh.IsObjSelected() ) +nId = SID_ATTR_TRANSFORM; +} +if( nId ) +GetViewFrame()-GetDispatcher()-Execute(nId, +SfxCallMode::SYNCHRON | SfxCallMode::RECORD ); +} +break; + case FN_STAT_SELMODE: { if ( pArgs ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/layout/layact.cxx |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) New commits: commit 64dc505ce180a168798b725423a308207de42c63 Author: Caolán McNamara caol...@redhat.com Date: Tue Jun 9 10:47:29 2015 +0100 Resolves: tdf#91695 partially Revert crash on layout of novell622972-2.html This reverts commit 9857c6390212e16dd9f26b47b4afc5d33b5242ef. Change-Id: Id47e982eb346c092991f07964c0146daefccb031 diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 26f43ee..35a2fd2 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1239,12 +1239,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) aOldRect = static_castSwPageFrm*(pLay)-GetBoundRect(); } -{ -//JoinLock pParent for the lifetime of the Calc call to avoid -//SwSectionFrm::MergeNext removing the pLay we're trying to Format -FlowFrmJoinLockGuard aJoinGuard(pLay); -pLay-Calc(); -} +pLay-Calc(); if ( aOldFrame != pLay-Frm() ) bChanged = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/objectpositioning/anchoredobjectposition.cxx |5 + 1 file changed, 1 insertion(+), 4 deletions(-) New commits: commit 062256ba6810fb1cbed54246dde7570ed5430aa4 Author: László Németh laszlo.nem...@collabora.com Date: Thu Jun 4 18:15:12 2015 +0200 tdf#91260: cleanup - textboxes extending beyond the page Storing Undo data is unnecessary here, because shrinking is applied only on the text frame of the textbox. The shape component of the textbox isn't modified. (cherry-picked from 2f779fc046c9afec04b4a4500b213e77aee51ae1) Change-Id: Iaff64ff4953adbfa830832da146343cef2734547 Reviewed-on: https://gerrit.libreoffice.org/16088 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Christian Lohmaier lohmaier+libreoff...@googlemail.com diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 2957aa0..b4e63e3 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -482,13 +482,10 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc { // shrink textboxes to extend beyond the page bottom SwFrameFormat* pFrameFormat = ::FindFrameFormat(GetObject()); -SfxItemSet aTextBoxSet(pFrameFormat-GetDoc()-GetAttrPool(), aFrameFormatSetRange); SwFormatFrmSize aSize(pFormat-GetFrmSize()); SwTwips nShrinked = aSize.GetHeight() - (nProposedRelPosY - nAdjustedRelPosY); aSize.SetHeight( nShrinked 0 ? nShrinked : 0 ); -aTextBoxSet.Put(aSize); -if (aTextBoxSet.Count()) -pFrameFormat-GetDoc()-SetFlyFrmAttr(*pFrameFormat, aTextBoxSet); +pFrameFormat-SetFormatAttr(aSize); nAdjustedRelPosY = nProposedRelPosY; } else if ( SwTextBoxHelper::findTextBox(pFormat) ) // when the shape has a textbox, use only the proposed vertical position ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/crsr/crsrsh.cxx |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) New commits: commit 73b303fc3693e7cdf457e617c252c10ef4620bd9 Author: Michael Stahl mst...@redhat.com Date: Mon Jun 8 23:28:11 2015 +0200 tdf#91917 tdf#91602: avoid layout recursion differently (regression from 587006cac508616f486aea45e265a170bcccdc87) Change-Id: I38e00a7469243088e25aa1a91e3581240b3bbdea (cherry picked from commit 238e07ddca879e0951bef6391fdc5c3fc26bded5) diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 2742a2c..ee223b5 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -285,10 +285,6 @@ void SwCrsrShell::EndAction( const bool bIdleEnd, const bool DoSetPosX ) } return; } -else -{ -eFlags |= SwCrsrShell::NOCALRECT; // tdf#91602 prevent recursive Action! -} if ( !bIdleEnd ) eFlags |= SwCrsrShell::SCROLLWIN; @@ -1745,12 +1741,14 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool bIdleEnd ) aTmpState.pSpecialPos = aSpecialPos; } +++mnStartAction; // tdf#91602 prevent recursive Action! if( !pFrm-GetCharRect( m_aCharRect, *pShellCrsr-GetPoint(), aTmpState ) ) { Point rPt = pShellCrsr-GetPtPos(); rPt = m_aCharRect.Center(); pFrm-GetCrsrOfst( pShellCrsr-GetPoint(), rPt, aTmpState ); } +--mnStartAction; if( !pShellCrsr-HasMark() ) m_aCrsrHeight = aTmpState.aRealHeight; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
sw/source/core/crsr/crsrsh.cxx |4 1 file changed, 4 insertions(+) New commits: commit 4ae19cf8435d78bec75e1c4ea95da9f0aaf35b62 Author: Michael Stahl mst...@redhat.com Date: Fri Jun 5 23:56:07 2015 +0200 tdf#91602: sw: prevent recursive layout crash SwCrsrShell::UpdateCrsr() calls SwTextFrm::GetCharRect(), which does layout. It happens that a SdrObject is moved around during layout, which calls SwDrawContact::Changed(), which believes that there is no layout active because there is no SwLayAction and ViewShell::EndAction() has already been called, so we get recursive layout-in-layout action. Change-Id: Iad8df4910e3c661150bdf5ac7d92e69a8f71 (cherry picked from commit 587006cac508616f486aea45e265a170bcccdc87) diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index a815866..2742a2c 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -285,6 +285,10 @@ void SwCrsrShell::EndAction( const bool bIdleEnd, const bool DoSetPosX ) } return; } +else +{ +eFlags |= SwCrsrShell::NOCALRECT; // tdf#91602 prevent recursive Action! +} if ( !bIdleEnd ) eFlags |= SwCrsrShell::SCROLLWIN; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits