[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-24 Thread Caolán McNamara
 sw/source/filter/ww8/ww8graf.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 774ed96dbace22f63951e28d75a0108e24fc69f0
Author: Caolán McNamara 
Date:   Mon Apr 24 15:06:10 2017 +0100

ofz#1220 sanitize nTyp to legal values

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

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 72ee4ea7d805..eff857945ee2 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1301,7 +1301,7 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD* 
pHd, SfxAllItemSet &rSet)
 else// nein -> Nimm Linie
 SetStdAttr( rSet, aCallB.dpPolyLine.aLnt, aCallB.dptxbx.aShd );
 SetFill( rSet, aCallB.dptxbx.aFill );
-rSet.Put( SdrCaptionTypeItem( aCaptA[nTyp] ) );
+rSet.Put(SdrCaptionTypeItem(aCaptA[nTyp % SAL_N_ELEMENTS(aCaptA)]));
 
 return pObj;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-13 Thread Caolán McNamara
 sw/source/filter/ww8/ww8graf.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit ed8d18338f705fe249c88f1e735d1b45a408b2f7
Author: Caolán McNamara 
Date:   Thu Apr 13 13:01:35 2017 +0100

ofz: header has to be at least 1 pair long

Change-Id: I5725048519a2b68265e90d12b1e4bcb506c56fc2
(cherry picked from commit e72f3ce68e18ac604469ce5e856341a469af27ff)
Reviewed-on: https://gerrit.libreoffice.org/36520
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 0fe0bf5287cf..72ee4ea7d805 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1253,12 +1253,20 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD* 
pHd, SfxAllItemSet &rSet)
 return nullptr;
 
 sal_uInt16 nCount = SVBT16ToShort( aCallB.dpPolyLine.aBits1 ) >> 1 & 
0x7fff;
+if (nCount < 1)
+{
+SAL_WARN("sw.ww8", "Short CaptionBox header");
+return nullptr;
+}
+
 std::unique_ptr xP(new SVBT16[nCount * 2]);
 
 bool bCouldRead = checkRead(*m_pStrm, xP.get(), nCount * 4);  // 
Punkte einlesen
-OSL_ENSURE(bCouldRead, "Short CaptionBox header");
 if (!bCouldRead)
+{
+SAL_WARN("sw.ww8", "Short CaptionBox header");
 return nullptr;
+}
 
 sal_uInt8 nTyp = (sal_uInt8)nCount - 1;
 if( nTyp == 1 && SVBT16ToShort( xP[0] ) == SVBT16ToShort( xP[2] ) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-12 Thread Michael Stahl
 sw/source/core/crsr/crstrvl.cxx   |4 
 sw/source/uibase/uiview/view2.cxx |   25 -
 2 files changed, 4 insertions(+), 25 deletions(-)

New commits:
commit 224073a5002df33da673a63db24c19f5a43143c1
Author: Michael Stahl 
Date:   Wed Apr 5 16:54:57 2017 +0200

rhbz#1438179 sw: fix toolbar "Next Track Change" / "Previous..."

There's some confusing workarounds in SwView::Execute() that aren't
needed if the SwCursorShell just calls NormalizePam() so it always
makes progress.

(cherry picked from commit 25eb0899227830cca7f28006376962d84f8e9c7a)

Change-Id: I3b014079b19925041234fcd858526148890f560c
Reviewed-on: https://gerrit.libreoffice.org/36167
Tested-by: Jenkins 
Reviewed-by: Christian Lohmaier 

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 1fb7c8331e90..e83e68923ef0 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1982,6 +1982,8 @@ const SwRangeRedline* SwCursorShell::SelNextRedline()
 SwCallLink aLk( *this ); // watch Cursor-Moves
 SwCursorSaveState aSaveState( *m_pCurrentCursor );
 
+// ensure point is at the end so alternating SelNext/SelPrev works
+NormalizePam(false);
 pFnd = GetDoc()->getIDocumentRedlineAccess().SelNextRedline( 
*m_pCurrentCursor );
 if( pFnd && !m_pCurrentCursor->IsInProtectTable() && 
!m_pCurrentCursor->IsSelOvr() )
 UpdateCursor( 
SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY);
@@ -2000,6 +2002,8 @@ const SwRangeRedline* SwCursorShell::SelPrevRedline()
 SwCallLink aLk( *this ); // watch Cursor-Moves
 SwCursorSaveState aSaveState( *m_pCurrentCursor );
 
+// ensure point is at the start so alternating SelNext/SelPrev works
+NormalizePam(true);
 pFnd = GetDoc()->getIDocumentRedlineAccess().SelPrevRedline( 
*m_pCurrentCursor );
 if( pFnd && !m_pCurrentCursor->IsInProtectTable() && 
!m_pCurrentCursor->IsSelOvr() )
 UpdateCursor( 
SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY);
diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index edd8bccbc5b4..bdb977ec7b8f 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -702,18 +702,8 @@ void SwView::Execute(SfxRequest &rReq)
 
 case FN_REDLINE_NEXT_CHANGE:
 {
-const SwRangeRedline *pCurrent = m_pWrtShell->GetCurrRedline();
 const SwRangeRedline *pNext = m_pWrtShell->SelNextRedline();
 
-// FN_REDLINE_PREV_CHANGE leaves the selection point at the start 
of the redline.
-// In such cases, SelNextRedline (which starts searching from the 
selection point)
-// immediately finds the current redline and advances the 
selection point to its end.
-
-// This behavior means that PREV_CHANGE followed by NEXT_CHANGE 
would not change
-// the current redline, so we detect it and select the next 
redline again.
-if (pCurrent && pCurrent == pNext)
-pNext = m_pWrtShell->SelNextRedline();
-
 if (pNext)
 m_pWrtShell->SetInSelect();
 }
@@ -721,24 +711,9 @@ void SwView::Execute(SfxRequest &rReq)
 
 case FN_REDLINE_PREV_CHANGE:
 {
-const SwPaM *pCursor = m_pWrtShell->GetCursor();
-const SwPosition initialCursorStart = *pCursor->Start();
 const SwRangeRedline *pPrev = m_pWrtShell->SelPrevRedline();
 
 if (pPrev)
-{
-// FN_REDLINE_NEXT_CHANGE leaves the selection point at the 
end of the redline.
-// In such cases, SelPrevRedline (which starts searching from 
the selection point)
-// immediately finds the current redline and advances the 
selection point to its
-// start.
-
-// This behavior means that NEXT_CHANGE followed by 
PREV_CHANGE would not change
-// the current redline, so we detect it and move to the 
previous redline again.
-if (initialCursorStart == *pPrev->Start())
-pPrev = m_pWrtShell->SelPrevRedline();
-}
-
-if (pPrev)
 m_pWrtShell->SetInSelect();
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-12 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par6.cxx |  128 ---
 1 file changed, 68 insertions(+), 60 deletions(-)

New commits:
commit 3a781e193b8c1d78fe5b424e045258b45865bd83
Author: Caolán McNamara 
Date:   Wed Apr 5 14:24:09 2017 +0100

ofz: treat short properties as run end

Change-Id: I1250f74c9f4ed6679a89c7915fb704c8b8cd693f
(cherry picked from commit 5252673d686913210dd65608b7d24b0e9d51cf00)
Reviewed-on: https://gerrit.libreoffice.org/36148
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 838772bb5513..a9e6e285b88d 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -311,7 +311,7 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrameFormat 
&rFormat, const wwSection &r
 
 void SwWW8ImplReader::Read_ParaBiDi(sal_uInt16, const sal_uInt8* pData, short 
nLen)
 {
-if( nLen < 0 )
+if (nLen < 1)
 m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_FRAMEDIR);
 else
 {
@@ -2706,7 +2706,7 @@ const SfxPoolItem* SwWW8ImplReader::GetFormatAttr( 
sal_uInt16 nWhich )
 // parameters according to the table in WWScan.cxx.
 void SwWW8ImplReader::Read_Special(sal_uInt16, const sal_uInt8* pData, short 
nLen)
 {
-if( nLen < 0 )
+if (nLen < 1)
 {
 m_bSpec = false;
 return;
@@ -2717,7 +2717,7 @@ void SwWW8ImplReader::Read_Special(sal_uInt16, const 
sal_uInt8* pData, short nLe
 // Read_Obj is used for fObj and for fOle2 !
 void SwWW8ImplReader::Read_Obj(sal_uInt16 , const sal_uInt8* pData, short nLen)
 {
-if( nLen < 0 )
+if (nLen < 1)
 m_bObj = false;
 else
 {
@@ -2740,7 +2740,7 @@ void SwWW8ImplReader::Read_Obj(sal_uInt16 , const 
sal_uInt8* pData, short nLen)
 
 void SwWW8ImplReader::Read_PicLoc(sal_uInt16 , const sal_uInt8* pData, short 
nLen )
 {
-if( nLen < 0 )
+if (nLen < 4)
 {
 m_nPicLocFc = 0;
 m_bSpec = false;  // Is this always correct?
@@ -2769,7 +2769,7 @@ void SwWW8ImplReader::Read_POutLvl(sal_uInt16, const 
sal_uInt8* pData, short nLe
 if (pSI != nullptr)
 {
 pSI->mnWW8OutlineLevel =
-static_cast< sal_uInt8 >( ( pData ? *pData : 0 ) );
+static_cast< sal_uInt8 >( ( (pData && nLen >= 1) ? *pData 
: 0 ) );
 NewAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL, 
SwWW8StyInf::WW8OutlineLevelToOutlinelevel( pSI->mnWW8OutlineLevel ) ) );
 }
 }
@@ -2777,7 +2777,7 @@ void SwWW8ImplReader::Read_POutLvl(sal_uInt16, const 
sal_uInt8* pData, short nLe
 {
 const sal_uInt8 nOutlineLevel
 = SwWW8StyInf::WW8OutlineLevelToOutlinelevel(
-static_cast((pData ? *pData : 0)));
+static_cast(((pData && nLen >= 1) ? *pData : 0)));
 NewAttr(SfxUInt16Item(RES_PARATR_OUTLINELEVEL, nOutlineLevel));
 }
 }
@@ -2786,7 +2786,7 @@ void SwWW8ImplReader::Read_Symbol(sal_uInt16, const 
sal_uInt8* pData, short nLen
 {
 if( !m_bIgnoreText )
 {
-if( nLen < 0 )
+if (nLen < (m_bVer67 ? 3 : 4))
 {
 //otherwise disable after we print the char
 if (m_pPlcxMan && m_pPlcxMan->GetDoingDrawTextBox())
@@ -2871,7 +2871,7 @@ void SwWW8ImplReader::Read_BoldUsw( sal_uInt16 nId, const 
sal_uInt8* pData, shor
 
 sal_uInt16 nMask = 1 << nI;
 
-if (nLen < 0)
+if (nLen < 1)
 {
 if (nI < 2)
 {
@@ -2937,7 +2937,7 @@ void SwWW8ImplReader::Read_BoldUsw( sal_uInt16 nId, const 
sal_uInt8* pData, shor
 
 void SwWW8ImplReader::Read_Bidi(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
-if( nLen < 0 )  //Property end
+if (nLen < 1)  //Property end
 {
 m_bBidi = false;
 m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_CHRATR_BIDIRTL);
@@ -2974,7 +2974,7 @@ void SwWW8ImplReader::Read_BoldBiDiUsw(sal_uInt16 nId, 
const sal_uInt8* pData,
 
 sal_uInt16 nMask = 1 << nI;
 
-if( nLen < 0 )
+if (nLen < 1)
 {
 m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),nEndIds[nI]);
 m_pCtrlStck->SetToggleBiDiAttr(nI, false);
@@ -3142,7 +3142,8 @@ void SwWW8ImplReader::ChkToggleBiDiAttr_( sal_uInt16 
nOldStyle81Mask,
 
 void SwWW8ImplReader::Read_SubSuper( sal_uInt16, const sal_uInt8* pData, short 
nLen )
 {
-if( nLen < 0 ){
+if (nLen < 1)
+{
 m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ESCAPEMENT );
 return;
 }
@@ -3234,15 +3235,15 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement()
 
 void SwWW8ImplReader::Read_SubSuperProp( sal_uInt16, const sal_uInt8* pData, 
short nLen )
 {
-if( nLen < 0 )
+ww::WordVersion eVersion = m_pWwFib->GetFIBVersion();
+
+if (nLen < (eVersion <= ww::eWW2 ? 1 : 2))
 {
 if (!ConvertSubToGraphicPlacement())
 m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ESCAPEMENT );
 return;
 }
 
-ww::WordVersion eVersion = m_pWwFib-

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-10 Thread Caolán McNamara
 sw/source/core/frmedt/fews.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit ed4b4cf298af859c354629e0f88ad87161385175
Author: Caolán McNamara 
Date:   Fri Apr 7 16:55:37 2017 +0100

Resolves: tdf#102286 lets not crash on null pFrame

this is the FlyEmbeddedPrt case

ensure we don't end up with a null pFrame at return time

(cherry picked from commit 5ce387c4812466e6752b434cf0f5a54f98c6a147)

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

diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index c15266976511..9c1ff08b257e 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -121,12 +121,15 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType 
eType, const Point* pPt,
 
 case RECT_FLY_PRT_EMBEDDED: bFrame = false;
 SAL_FALLTHROUGH;
-case RECT_FLY_EMBEDDED: pFrame = xObj.is() ? FindFlyFrame( xObj )
+case RECT_FLY_EMBEDDED:
+{
+const SwFrame *pFlyFrame = xObj.is() ? 
FindFlyFrame(xObj) : nullptr;
+pFrame = pFlyFrame ? pFlyFrame
 : pFrame->IsFlyFrame()
 ? pFrame
 : pFrame->FindFlyFrame();
 break;
-
+}
 case RECT_OUTTABSECTION_PRT:
 case RECT_OUTTABSECTION :   if( pFrame->IsInTab() )
 pFrame = pFrame->FindTabFrame();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-06 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par6.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c759d327f46770e40e6fa0b7c5740adb4102e683
Author: Caolán McNamara 
Date:   Thu Apr 6 15:12:10 2017 +0100

ofz: treat short properties as run end

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

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 0a8e60c4ed0b..838772bb5513 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3778,7 +3778,7 @@ void SwWW8ImplReader::Read_Language( sal_uInt16 nId, 
const sal_uInt8* pData, sho
 return;
 }
 
-if( nLen < 0 )  // end of attribute
+if (nLen < 2)  // end of attribute
 m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId );
 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-2' - sw/source

2017-04-05 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par2.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit d79935cb3154ca86aca01043d7c196cc161db67b
Author: Caolán McNamara 
Date:   Tue Apr 4 19:13:12 2017 +0100

ofz: check olst sprm for valid ANLD payload len

Change-Id: Ic1b6681a3f48ef0fe3f52eda9db8b7bc003ded55
(cherry picked from commit 98151bf95bda8d647310bdba6936dc6b388b05de)
Reviewed-on: https://gerrit.libreoffice.org/36099
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index ff6bcb0ca1a7..57d5f644f2b7 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -917,6 +917,14 @@ void SwWW8ImplReader::Read_OLST( sal_uInt16, const 
sal_uInt8* pData, short nLen
 m_pNumOlst = nullptr;
 return;
 }
+
+if (static_cast(nLen) < sizeof(WW8_OLST))
+{
+SAL_WARN("sw.ww8", "WW8_OLST property is " << nLen << " long, needs to 
be at least " << sizeof(WW8_OLST));
+m_pNumOlst = nullptr;
+return;
+}
+
 m_pNumOlst = new WW8_OLST;
 if( nLen < sal::static_int_cast< sal_Int32 >(sizeof( WW8_OLST )) )   // 
fill if to short
 memset( m_pNumOlst, 0, sizeof( *m_pNumOlst ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-04 Thread Caolán McNamara
 sw/source/filter/ww8/ww8scan.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 75e7cc598fe9d61d9f6f3f96976b11e27627bc2f
Author: Caolán McNamara 
Date:   Tue Apr 4 12:31:04 2017 +0100

ofz: guard against bogus sprm len

Change-Id: I9b4074e1024753549f468f427afbfdf9cd01b674
(cherry picked from commit d30fb62f4f1022ae6294e246974d0018596cf8ec)

ofz: guard harder against bogus sprm len

Change-Id: Ic82526e1454b24f094d3deee89647e88760bc44b
(cherry picked from commit 924624b40a97d6925f66374259c2c21707805fcd)
Reviewed-on: https://gerrit.libreoffice.org/36079
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index efb5da2614ca..9aa9a603f7ea 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4896,6 +4896,11 @@ void WW8PLCFMan::GetSprmStart( short nIdx, 
WW8PLCFManResult* pRes ) const
 {
 // Length of actual sprm
 pRes->nMemLen = maSprmParser.GetSprmSize(pRes->nSprmId, pRes->pMemPos);
+if (pRes->nMemLen > p->nSprmsLen)
+{
+SAL_WARN("sw.ww8", "Short sprm, len " << pRes->nMemLen << " 
claimed, max possible is " << p->nSprmsLen);
+pRes->nSprmId = 0;
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-04 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par2.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit d9d8631d7c0142e2ddd0bec1f986cb20f339d639
Author: Caolán McNamara 
Date:   Mon Apr 3 21:22:00 2017 +0100

ofz: check anldPap sprm for valid ANLD payload len

Change-Id: Ie034e3b37e01c29cf19fe8ad78b1121f6eadecb2
Reviewed-on: https://gerrit.libreoffice.org/36053
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 29cf858a971273039fff50808082f231dbd43c92)
Reviewed-on: https://gerrit.libreoffice.org/36076
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index d9b5c091751c..ff6bcb0ca1a7 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -848,6 +848,13 @@ void SwWW8ImplReader::Read_ANLevelDesc( sal_uInt16, const 
sal_uInt8* pData, shor
 return;
 }
 
+if (static_cast(nLen) < sizeof(WW8_ANLD))
+{
+SAL_WARN("sw.ww8", "ANLevelDesc property is " << nLen << " long, needs 
to be at least " << sizeof(WW8_ANLD));
+m_nSwNumLevel = 0xff;
+return;
+}
+
 if( m_nSwNumLevel <= MAXLEVEL // Value range mapping WW:1..9 -> 
SW:0..8
 && m_nSwNumLevel <= 9 ){  // No Bullets or Numbering
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-04-04 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par.hxx   |2 +-
 sw/source/filter/ww8/ww8par2.cxx  |   29 -
 sw/source/filter/ww8/ww8struc.hxx |2 +-
 3 files changed, 26 insertions(+), 7 deletions(-)

New commits:
commit 18690fd4b7fdb3244cbc3dd4e711a9230bcef00e
Author: Caolán McNamara 
Date:   Mon Apr 3 20:36:06 2017 +0100

ofz: check anlv text bounds

Change-Id: I6288aae2d439cde6a2b95c005a2090f73e21bb7a
(cherry picked from commit 3feabd87ad8066b45b55d61cd72684e47fd79082)
Reviewed-on: https://gerrit.libreoffice.org/36052
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 8d0d0ebb9d2f..6f06bd607d22 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1554,7 +1554,7 @@ private:
 // the corresponding structures are: LSTF, LVLF, LFO LFOLVL
 
 void SetAnlvStrings(SwNumFormat &rNum, WW8_ANLV const &rAV, const 
sal_uInt8* pText,
-bool bOutline);
+size_t nStart, size_t nElements, bool bOutline);
 void SetAnld(SwNumRule* pNumR, WW8_ANLD const * pAD, sal_uInt8 nSwLevel, 
bool bOutLine);
 void SetNumOlst( SwNumRule* pNumR, WW8_OLST* pO, sal_uInt8 nSwLevel );
 SwNumRule* GetStyRule();
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 989fec47297f..d9b5c091751c 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -645,8 +645,14 @@ static void SetBaseAnlv(SwNumFormat &rNum, WW8_ANLV const 
&rAV, sal_uInt8 nSwLev
 }
 
 void SwWW8ImplReader::SetAnlvStrings(SwNumFormat &rNum, WW8_ANLV const &rAV,
-const sal_uInt8* pText, bool bOutline)
+const sal_uInt8* pText, size_t nStart, size_t nElements, bool bOutline)
 {
+if (nStart > nElements)
+return;
+
+pText += nStart;
+nElements -= nStart;
+
 bool bInsert = false;   // Default
 rtl_TextEncoding eCharSet = m_eStructCharSet;
 
@@ -654,13 +660,26 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFormat &rNum, 
WW8_ANLV const &rAV,
 bool bListSymbol = pF && ( pF->chs == 2 );  // Symbol/WingDings/...
 
 OUString sText;
+sal_uInt32 nLen = rAV.cbTextBefore + rAV.cbTextAfter;
 if (m_bVer67)
 {
-sText = OUString(reinterpret_cast(pText), 
rAV.cbTextBefore + rAV.cbTextAfter, eCharSet);
+if (nLen > nElements)
+{
+SAL_WARN("sw.ww8", "SetAnlvStrings: ignoring out of range "
+<< nLen << " vs " << nElements << " max");
+return;
+}
+sText = OUString(reinterpret_cast(pText), nLen, 
eCharSet);
 }
 else
 {
-for(sal_Int32 i = 0; i < rAV.cbTextBefore + rAV.cbTextAfter; ++i, 
pText += 2)
+if (nLen > nElements / 2)
+{
+SAL_WARN("sw.ww8", "SetAnlvStrings: ignoring out of range "
+<< nLen << " vs " << nElements / 2 << " max");
+return;
+}
+for(sal_uInt32 i = 0; i < nLen; ++i, pText += 2)
 {
 sText += 
OUString(sal_Unicode(SVBT16ToShort(*reinterpret_cast(pText;
 }
@@ -745,7 +764,7 @@ void SwWW8ImplReader::SetAnld(SwNumRule* pNumR, WW8_ANLD 
const * pAD, sal_uInt8
 m_bAktAND_fNumberAcross = 0 != pAD->fNumberAcross;
 WW8_ANLV const &rAV = pAD->eAnlv;
 SetBaseAnlv(aNF, rAV, nSwLevel);// set the base 
format
-SetAnlvStrings(aNF, rAV, pAD->rgchAnld, bOutLine ); // set the rest
+SetAnlvStrings(aNF, rAV, pAD->rgchAnld, 0, 
SAL_N_ELEMENTS(pAD->rgchAnld), bOutLine); // set the rest
 }
 pNumR->Set(nSwLevel, aNF);
 }
@@ -875,7 +894,7 @@ void SwWW8ImplReader::SetNumOlst(SwNumRule* pNumR, 
WW8_OLST* pO, sal_uInt8 nSwLe
 
 if (!m_bVer67)
 nTextOfs *= 2;
-SetAnlvStrings(aNF, rAV, pO->rgch + nTextOfs, true); // and apply
+SetAnlvStrings(aNF, rAV, pO->rgch, nTextOfs, SAL_N_ELEMENTS(pO->rgch), 
true); // and apply
 pNumR->Set(nSwLevel, aNF);
 }
 
diff --git a/sw/source/filter/ww8/ww8struc.hxx 
b/sw/source/filter/ww8/ww8struc.hxx
index fc97b2d9efd3..59bbb7b3a2dc 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -660,7 +660,7 @@ struct WW8_ANLD
 sal_uInt8 fNumberAcross;// 0x11 number across cells in table 
rows(instead of down)
 sal_uInt8 fRestartHdn;  // 0x12 restart heading number on section 
boundary
 sal_uInt8 fSpareX;  // 0x13 unused( should be 0)
-sal_uInt8  rgchAnld[32]; // 0x14 characters displayed before/after 
autonumber
+sal_uInt8 rgchAnld[32]; // 0x14 characters displayed before/after 
autonumber
 };
 
 struct WW8_OLST
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-03-31 Thread Patrick Jaap
 sw/source/core/objectpositioning/anchoredobjectposition.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit cbbe5c471cad37ab434a11b804c66e0b424af8a7
Author: Patrick Jaap 
Date:   Wed Mar 29 11:35:25 2017 +0200

tdf#101627 disable shrinking for footer textboxes

the shrinking patch a4dee94afed9ade6ac50237c8d99a6e49d3bebc1
causes problems, if the textboxes are anchored in the
footer. Therefore, disable it in this case.
For details, see comments in bug tracker.

Change-Id: I117a99041ff67c19a9de17803ff7864c62afdb50
Reviewed-on: https://gerrit.libreoffice.org/34517
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
(cherry picked from commit 80b9b6761e8cb974e0cdc0c7be0eb95f8745d86f)
Reviewed-on: https://gerrit.libreoffice.org/35845
Tested-by: Michael Stahl 

diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index afd00eb3389a..d369ac46132a 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -486,8 +486,12 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustVertRelPos( 
const SwTwips nTopOfAnch
 nAdjustedRelPosY = aPgAlignArea.Top() - nTopOfAnch;
 }
 
-// tdf#91260 - allow textboxes extending beyond the page bottom
-if ( nAdjustedRelPosY < nProposedRelPosY )
+// tdf#91260  - allow textboxes extending beyond the page bottom
+// tdf#101627 - the patch a4dee94afed9ade6ac50237c8d99a6e49d3bebc1
+//  for tdf#91260 causes problems if the textbox
+//  is anchored in the footer, so exclude this case
+if ( !( GetAnchorFrame().GetUpper() && 
GetAnchorFrame().GetUpper()->IsFooterFrame() )
+ && nAdjustedRelPosY < nProposedRelPosY )
 {
 const SwFrameFormat* pFormat = &(GetFrameFormat());
 if ( SwTextBoxHelper::isTextBox(&GetObject()) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-03-21 Thread Michael Stahl
 sw/source/filter/ww8/docxattributeoutput.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 29b783dc6844a3fed9bcf434ae3901e986b44991
Author: Michael Stahl 
Date:   Thu Mar 2 23:11:29 2017 +0100

tdf#101178 sw: DOCX export: fix crash

These conditions in DocxAttributeOutput::EndRun() are apparently not
mutually exclusive, so don't increment m_nFieldsInHyperlink twice.

Whether the m_nFieldsInHyperlink makes any sense considering there are
*2* hyperlinks then, i can't tell.

(cherry picked from commit 103efac8110be7e6f42fffcecc74abdcae4df7f9)

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index bdfaac4604fd..af9d6fd49d04 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1141,12 +1141,9 @@ void DocxAttributeOutput::EndRun()
 continue;
 }
 
-if (m_startedHyperlink)
-++m_nFieldsInHyperlink;
-
-if ( m_pHyperlinkAttrList.is() )
+if (m_startedHyperlink || m_pHyperlinkAttrList.is())
 {
-m_nFieldsInHyperlink++;
+++m_nFieldsInHyperlink;
 }
 }
 ++pIt;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-03-21 Thread Caolán McNamara
 sw/source/uibase/dbui/dbmgr.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit b816ad91b4cf6eeb30dff87859a8416cfdcbabbc
Author: Caolán McNamara 
Date:   Mon Mar 13 12:44:10 2017 +

Resolves: rhbz#1431540 crash in SwDBManager::releaseRevokeListener

Change-Id: I8e61163de7e6192bdf613ab6b58906326499d6c2
Reviewed-on: https://gerrit.libreoffice.org/35137
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 
(cherry picked from commit e1f36eddf4596901a51de42322ccbf8d1df9d139)
Reviewed-on: https://gerrit.libreoffice.org/35141
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 7be5340eb1b3..253d4e9c036b 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -3058,8 +3058,11 @@ SwDoc* SwDBManager::getDoc() const
 
 void SwDBManager::releaseRevokeListener()
 {
-pImpl->m_xDataSourceRemovedListener->Dispose();
-pImpl->m_xDataSourceRemovedListener.clear();
+if (pImpl->m_xDataSourceRemovedListener.is())
+{
+pImpl->m_xDataSourceRemovedListener->Dispose();
+pImpl->m_xDataSourceRemovedListener.clear();
+}
 }
 
 
SwConnectionDisposedListener_Impl::SwConnectionDisposedListener_Impl(SwDBManager&
 rManager)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-03-03 Thread Caolán McNamara
 sw/source/filter/ww8/wrtww8.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit c496b67a52ee4b5c7f9053cfe3dc54290e8d6392
Author: Caolán McNamara 
Date:   Wed Mar 1 17:24:21 2017 +

Resolves: tdf#106261 throw away old node map for table

when generating a new one, otherwise on exporting the same table
twice to two consecutive .doc footnotes will think the second
export of the table is a level lower because it will find it
in the map and

WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo

does pNodeInfo->setDepth(nDepth + pNodeInfo->getDepth());
using the cached pNodeInfo depth and not a new fresh pNodeInfo of
depth 0

Change-Id: I7aa7ac6a19814910c1d19d78f04cfd9886c444c5
(cherry picked from commit 6f3e24ad64dd40b3ef8def7d879ba395a16874a1)
Reviewed-on: https://gerrit.libreoffice.org/34766
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 262ee5c..85bf4ea 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1832,8 +1832,16 @@ void MSWordExportBase::WriteSpecialText( sal_uLong 
nStart, sal_uLong nEnd, sal_u
 // clear linked textboxes since old ones can't be linked to frames in this 
section
 m_aLinkedTextboxesHelper.clear();
 
+// tdf#106261 Reset table infos, otherwise the depth of the cells will be
+// incorrect, in case the header/footer had table(s) and we try to export
+// the same table second time.
+ww8::WW8TableInfo::Pointer_t pOldTableInfo = m_pTableInfo;
+m_pTableInfo = std::make_shared();
+
 WriteText();
 
+m_pTableInfo = pOldTableInfo;
+
 m_bOutPageDescs = bOldPageDescs;
 delete m_pCurPam;// delete Pam
 m_pCurPam = pOldPam;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source sw/uiconfig

2017-03-02 Thread Michael Stahl
 sw/source/ui/table/tabledlg.cxx |   63 +---
 sw/source/uibase/table/tablepg.hxx  |3 -
 sw/uiconfig/swriter/ui/tabletextflowpage.ui |   10 +++-
 3 files changed, 49 insertions(+), 27 deletions(-)

New commits:
commit e4f50efd000734c8259ed2915bf0dd1c71700ceb
Author: Michael Stahl 
Date:   Wed Mar 1 17:20:41 2017 +0100

tdf#77111 sw: fix page number offset on table dialog "Text Flow"

Commit c2ccd20c0fd92bddfff76447754541705e3eb8f3 introduced 0 as a valid
value for page number offset in sw core.

Unfortunately the table dialog was not changed then; previously
page number 0 would do automatic numbering, but since then 0 was set as
the offset, and once you have a 0 offset there's no easy way to remove
it, you have to remove the whole page break.

* change the label before the text number edit widget to a checkbox
  that disables the edit widget
* keep the id "pagenoft" so that translations still work
* set initial value to 1; 0 is a really bad default since we can't
  export it to ODF
* add a little bit of left margin so the line is indented below the
  upper line

(cherry picked from commit c1e7fc6f497d7570cb0832c43647d295f8592567)
Reviewed-on: https://gerrit.libreoffice.org/34763
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 362ff67556cca0890ca01f2de44596491c0e9bc8)

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

diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 0627784..16ec974 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1287,7 +1287,7 @@ SwTextFlowPage::SwTextFlowPage(vcl::Window* pParent, 
const SfxItemSet& rSet)
 
 get(m_pPageCollCB, "pagestyle");
 get(m_pPageCollLB, "pagestylelb");
-get(m_pPageNoFT, "pagenoft");
+get(m_pPageNoCB, "pagenoft");
 get(m_pPageNoNF, "pagenonf");
 
 get(m_pSplitCB, "split");
@@ -1318,6 +1318,8 @@ SwTextFlowPage::SwTextFlowPage(vcl::Window* pParent, 
const SfxItemSet& rSet)
 LINK( this, SwTextFlowPage, PageBreakTypeHdl_Impl ) );
 m_pPgBrkRB->SetClickHdl(
 LINK( this, SwTextFlowPage, PageBreakTypeHdl_Impl ) );
+m_pPageNoCB->SetClickHdl(
+LINK(this, SwTextFlowPage, PageNoClickHdl_Impl));
 m_pSplitCB->SetClickHdl(
 LINK( this, SwTextFlowPage, SplitHdl_Impl));
 m_pSplitRowCB->SetClickHdl(
@@ -1352,7 +1354,7 @@ void SwTextFlowPage::dispose()
 m_pPgBrkAfterRB.clear();
 m_pPageCollCB.clear();
 m_pPageCollLB.clear();
-m_pPageNoFT.clear();
+m_pPageNoCB.clear();
 m_pPageNoNF.clear();
 m_pSplitCB.clear();
 m_pSplitRowCB.clear();
@@ -1398,10 +1400,10 @@ bool  SwTextFlowPage::FillItemSet( SfxItemSet* rSet )
 
 //If we have a page style, then there's no break
 bool bPageItemPut = false;
-if ( bState != (m_pPageCollCB->GetSavedValue() == 1) ||
- ( bState &&
-   m_pPageCollLB->IsValueChangedFromSaved() )
-   || (m_pPageNoNF->IsEnabled() && m_pPageNoNF->IsValueModified()) )
+if (   bState != (m_pPageCollCB->GetSavedValue() == TRISTATE_TRUE)
+|| (bState && m_pPageCollLB->IsValueChangedFromSaved())
+|| (m_pPageNoCB->IsEnabled() && m_pPageNoCB->IsValueChangedFromSaved())
+|| (m_pPageNoNF->IsEnabled() && m_pPageNoNF->IsValueModified()))
 {
 OUString sPage;
 
@@ -1410,12 +1412,15 @@ bool  SwTextFlowPage::FillItemSet( SfxItemSet* rSet )
 sPage = m_pPageCollLB->GetSelectEntry();
 }
 sal_uInt16 nPgNum = static_cast< sal_uInt16 >(m_pPageNoNF->GetValue());
-if ( !pDesc || !pDesc->GetPageDesc() ||
-( pDesc->GetPageDesc() && ((pDesc->GetPageDesc()->GetName() != 
sPage) ||
-!comphelper::string::equals(m_pPageNoNF->GetSavedValue(), 
nPgNum
+bool const usePageNo(bState && m_pPageNoCB->IsChecked());
+boost::optional const oPageNum(
+(usePageNo) ? nPgNum : boost::optional());
+if (!pDesc || !pDesc->GetPageDesc()
+|| (pDesc->GetPageDesc()->GetName() != sPage)
+|| (pDesc->GetNumOffset() != oPageNum))
 {
 SwFormatPageDesc aFormat( pShell->FindPageDescByName( sPage, true 
) );
-aFormat.SetNumOffset(bState ? nPgNum : 0);
+aFormat.SetNumOffset(oPageNum);
 bModified |= nullptr != rSet->Put( aFormat );
 bPageItemPut = bState;
 }
@@ -1537,12 +1542,18 @@ void   SwTextFlowPage::Reset( const SfxItemSet* rSet )
 OUString sPageDesc;
 const SwPageDesc* pDesc = static_cast(pItem)->GetPageDesc();
 
-//m_pPageNoNF->SetValue(static_cast(pItem)->GetNumOffset());
 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-02-27 Thread Justin Luth
 sw/source/filter/xml/xmlimpit.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1f87318abb50e164aa4125747493c5ee02e8687c
Author: Justin Luth 
Date:   Wed Jan 18 15:52:33 2017 +0300

tdf#77111 odt import: treat PAGEDESC_PAGENUMOFFSET==0 as auto

Ever since 2010 commit 7edaf190 zeroes have been saved as XML_AUTO.
Ever since 2014 commit c2ccd20c, a numoffset of zero is no longer
considered to be auto (for MS compatibility) but is still treated
as auto during xml export. Thus, any older documents that had been
saved with a zero should still xml import as auto instead of as 0.

Change-Id: I1a0df32a8e2f1b30b2bedbf4c9bb07ebec239637
Reviewed-on: https://gerrit.libreoffice.org/33267
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Michael Stahl 
(cherry picked from commit e36f0860f00af139a8fa94d36302f7b0c56383fe)
Reviewed-on: https://gerrit.libreoffice.org/34695

diff --git a/sw/source/filter/xml/xmlimpit.cxx 
b/sw/source/filter/xml/xmlimpit.cxx
index ed7fb7c..8125c19 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -787,7 +787,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
 sal_Int32 nVal;
 bOk = ::sax::Converter::convertNumber(
 nVal, rValue, 0, USHRT_MAX);
-if( bOk )
+if( bOk && nVal > 0 )
 rPageDesc.SetNumOffset( (sal_uInt16)nVal );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-02-16 Thread Caolán McNamara
 sw/source/filter/ww8/ww8graf2.cxx |   27 ---
 1 file changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 94037ee2e6b85006373d1c4cecfcb32f4c82bb9e
Author: Caolán McNamara 
Date:   Wed Feb 15 14:28:55 2017 +

Resolves: tdf#101000 ensure unique image names in .docs

(cherry picked from commit 432f605e3287269d1a20383f4eeebf012ee3679d)

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

diff --git a/sw/source/filter/ww8/ww8graf2.cxx 
b/sw/source/filter/ww8/ww8graf2.cxx
index e4a5f38..5f8cabc 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -30,8 +30,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -454,6 +455,19 @@ void SwWW8ImplReader::PicRead(SvStream *pDataStream, 
WW8_PIC *pPic,
 pDataStream->SeekRel(2);  //cProps
 }
 
+namespace
+{
+sal_uInt8 GetNodeType(SwFrameFormat &rSource)
+{
+const SwNodeIndex* pNodeIndex = rSource.GetContent().GetContentIdx();
+if (!pNodeIndex)
+return 0;
+const SwNode& rCSttNd = pNodeIndex->GetNode();
+SwNodeRange aRg(rCSttNd, 1, *rCSttNd.EndOfSectionNode());
+return aRg.aStart.GetNode().GetNodeType();
+}
+}
+
 SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
 SwFrameFormat* pOldFlyFormat)
 {
@@ -670,12 +684,11 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* 
pTextObj,
 if (pRecord)
 SetAttributesAtGrfNode(pRecord, pRet, nullptr);
 
-// #i68101#
-// removed pObject->HasSetName() usage since always 
returned
-// true, also removed else-part and wrote an informing mail
-// to Henning Brinkmann about this to clarify.
-pRet->SetName(pObject->GetName());
-
+OUString aObjectName(pObject->GetName());
+if (aObjectName.isEmpty() || 
!m_rDoc.FindFlyByName(aObjectName, GetNodeType(*pRet)))
+pRet->SetName(aObjectName);
+else
+m_aGrfNameGenerator.SetUniqueGraphName(pRet, 
aObjectName);
 
 // determine the pointer to the new object and update
 // Z-order-list accordingly (or delete entry)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-02-13 Thread Michael Stahl
 sw/source/uibase/docvw/PostItMgr.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 3d507dbcd08e07af3ae6e7f5f0962e5422187087
Author: Michael Stahl 
Date:   Thu Feb 9 21:33:24 2017 +0100

tdf#91596 sw: make Format All Comments persistent

Change-Id: I8f9a20084d2dc8abd7699f64307b81321699498c
(cherry picked from commit bd269f902b86ecb5dde0043838be14c867ee8bec)
Reviewed-on: https://gerrit.libreoffice.org/34106
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index 1ef3524..76f20d3 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1474,6 +1474,8 @@ void SwPostItMgr::FormatAll(const SfxItemSet &rNewAttr)
 pOLV->SetAttribs(rNewAttr);
 //restore old selection
 pOLV->SetSelection(aOrigSel);
+// tdf#91596 store updated formatting in SwField
+(*i)->pPostIt->UpdateData();
 }
 
 mpWrtShell->EndUndo();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-02-10 Thread Mark Hung
 sw/source/core/text/itrcrsr.cxx  |3 ++-
 sw/source/core/text/itrpaint.cxx |3 ++-
 sw/source/core/text/porlay.hxx   |1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit e9e63fc49962270b51a4ec6aa2d6b41f5256ac02
Author: Mark Hung 
Date:   Thu Feb 2 21:15:01 2017 +0800

tdf#104270 count hanging margin only if there is hanging portion.

GetHangingMargin() also returns offset for PostItPortion, assure
there is a hanging portion before using the value.
Cherry-picked from 542421402d4e4f32bd9c499673d7a3fa98b00683

Change-Id: I750b8078fbd607d49f4bf5f76ea606fc36ea5c23
Reviewed-on: https://gerrit.libreoffice.org/33832
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
Reviewed-on: https://gerrit.libreoffice.org/34083

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index b6f9928..a55790a 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1268,7 +1268,8 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, 
const Point &rPoint,
 // x is the horizontal offset within the line.
 SwTwips x = rPoint.X();
 const SwTwips nLeftMargin  = GetLineStart();
-SwTwips nRightMargin = GetLineEnd() + GetCurr()->GetHangingMargin();
+SwTwips nRightMargin = GetLineEnd() +
+( GetCurr()->IsHanging() ? GetCurr()->GetHangingMargin() : 0 );
 if( nRightMargin == nLeftMargin )
 nRightMargin += 30;
 
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index e91428a..50b0f06 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -440,7 +440,8 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, 
SwSaveClip &rClip,
 if ( bAdjustBaseLine )
 GetInfo().Y( GetInfo().GetPos().Y()
+ AdjustBaseLine( *m_pCurr, &aEnd ) );
-GetInfo().X( GetInfo().X() + GetCurr()->GetHangingMargin() );
+GetInfo().X( GetInfo().X() +
+( GetCurr()->IsHanging() ? GetCurr()->GetHangingMargin() : 
0 ) );
 aEnd.Paint( GetInfo() );
 GetInfo().Y( nOldY );
 }
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 89b9dd7..49b0b7f 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -126,6 +126,7 @@ public:
 inline void SetForcedLeftMargin() { m_bForcedLeftMargin = true; }
 inline bool HasForcedLeftMargin() const { return m_bForcedLeftMargin; }
 inline void SetHanging( const bool bNew = true ) { m_bHanging = bNew; }
+inline bool IsHanging() const { return m_bHanging; }
 inline void SetUnderscore( const bool bNew = true ) { m_bUnderscore = 
bNew; }
 inline bool HasUnderscore() const { return m_bUnderscore; }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-02-02 Thread Caolán McNamara
 sw/source/filter/ww8/ww8atr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 398fd59c9047c49f0fe39fdd877eef610d095eaf
Author: Caolán McNamara 
Date:   Thu Feb 2 16:02:42 2017 +

bffvalidator: animated text srpm has 1 byte payload, not 2

which is why my sample document creates a .doc which triggers
word's safe mode

this has been wrong since initial impl in

commit 4d5c193b2fd38c6cab049fcb97189462fff0fddb
...
2003/07/17 14:13:17 mmaher 1.64.6.6: #110851# Added support for 
animated text effects

a mere 13+ years ago

Change-Id: I8c4d95dac8e03f6523a2a036f0100f425f787a13
(cherry picked from commit 6263d03d538f014af2e17a4ecf3d218387ba5219)
Reviewed-on: https://gerrit.libreoffice.org/33838
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index ebd51df..fb6b552 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1125,7 +1125,7 @@ void WW8AttributeOutput::CharAnimatedText( const 
SvxBlinkItem& rBlink )
 {
 m_rWW8Export.InsUInt16( NS_sprm::LN_CSfxText );
 // At the moment the only animated text effect we support is blinking
-m_rWW8Export.InsUInt16( rBlink.GetValue() ? 2 : 0 );
+m_rWW8Export.pO->push_back( rBlink.GetValue() ? 2 : 0 );
 }
 
 void WW8AttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossed )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-02-01 Thread Caolán McNamara
 sw/source/uibase/utlui/content.cxx |  127 +
 1 file changed, 61 insertions(+), 66 deletions(-)

New commits:
commit 70784f06ebd592070c85ffb93dfdbaa4322a55d4
Author: Caolán McNamara 
Date:   Wed Feb 1 10:06:53 2017 +

with navigator in sidebar, press space, crash

because root entries have UserData of type SwContentType while children have
UserData of type SwContent (both inherit from SwTypeNumber)

(cherry picked from commit dfdd01d12226cfbd9b9d2618bd9da71191bfc4b9)

turn switch with one case into if

Change-Id: I413f195bb5571eb536e948a7e9ffb982b3619e65
(cherry picked from commit 567cd9043c09e42d8521a6b81545994ae4539beb)

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 84c6f1b..bba62e8 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2629,86 +2629,81 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
 
m_pActiveShell->GetView().GetViewFrame()->GetWindow().ToTop();
 }
 
-SwContent* pCnt = 
static_cast(pEntry->GetUserData());
+SwContent* pCnt = 
dynamic_cast(static_cast(pEntry->GetUserData()));
 
-switch(pCnt->GetParent()->GetType())
+if (pCnt && pCnt->GetParent()->GetType() == 
ContentTypeId::DRAWOBJECT)
 {
-case ContentTypeId::DRAWOBJECT:
+SdrView* pDrawView = m_pActiveShell->GetDrawView();
+if (pDrawView)
 {
-SdrView* pDrawView = m_pActiveShell->GetDrawView();
-if (pDrawView)
-{
-pDrawView->SdrEndTextEdit();//Change from 
"EndTextEdit" to "SdrEndTextEdit" for acc migration
+pDrawView->SdrEndTextEdit();//Change from 
"EndTextEdit" to "SdrEndTextEdit" for acc migration
 
-SwDrawModel* pDrawModel = 
m_pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
-SdrPage* pPage = pDrawModel->GetPage(0);
-const size_t nCount = pPage->GetObjCount();
-bool hasObjectMarked = false;
+SwDrawModel* pDrawModel = 
m_pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+SdrPage* pPage = pDrawModel->GetPage(0);
+const size_t nCount = pPage->GetObjCount();
+bool hasObjectMarked = false;
 
-SdrObject* pObject = nullptr;
-pObject = GetDrawingObjectsByContent( pCnt );
-if( pObject )
+SdrObject* pObject = nullptr;
+pObject = GetDrawingObjectsByContent( pCnt );
+if( pObject )
+{
+SdrPageView* pPV = 
pDrawView->GetSdrPageView/*GetPageViewPvNum*/(/*0*/);
+if( pPV )
 {
-SdrPageView* pPV = 
pDrawView->GetSdrPageView/*GetPageViewPvNum*/(/*0*/);
-if( pPV )
-{
-bool bUnMark = 
pDrawView->IsObjMarked(pObject);
-pDrawView->MarkObj( pObject, pPV, bUnMark);
+bool bUnMark = pDrawView->IsObjMarked(pObject);
+pDrawView->MarkObj( pObject, pPV, bUnMark);
 
-}
 }
-for( size_t i=0; iGetObj(i);
+bool bMark = pDrawView->IsObjMarked(pTemp);
+switch( pTemp->GetObjIdentifier() )
 {
-SdrObject* pTemp = pPage->GetObj(i);
-bool bMark = pDrawView->IsObjMarked(pTemp);
-switch( pTemp->GetObjIdentifier() )
-{
-case OBJ_GRUP:
-case OBJ_TEXT:
-case OBJ_TEXTEXT:
-case OBJ_wegFITTEXT:
-case OBJ_LINE:
-case OBJ_RECT:
-case OBJ_CIRC:
-case OBJ_SECT:
-case OBJ_CARC:
-case OBJ_CCUT:
-case OBJ_POLY:
-

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-01-30 Thread Caolán McNamara
 sw/source/core/unocore/unostyle.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit b88b1b07e657716aa9975fee2dfc5a091c66a346
Author: Caolán McNamara 
Date:   Mon Jan 30 11:35:15 2017 +

Resolves: tdf#101664 dropcaps not set in styles on load

regression from...

commit 6766760e86b517c726204f9601b33a19cb0c5451
Date:   Thu Jan 14 21:05:59 2016 +0100

refactor out to limit scope: RES_PARATR_DROP

Change-Id: I8813b5676504e6de2af70d181fa9e905538fb05c

where MID_DROPCAP_CHAR_STYLE_NAME != nMemberId branch
in the past went to the default handler, while in
rework it ended up ignored

Change-Id: I8efa131750a064f594c1a2354d7aad19c2dc6b16
(cherry picked from commit d27aba549cdbcad6825ac6c955ee7d603aba1989)
Reviewed-on: https://gerrit.libreoffice.org/33696
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index e0d874f..7ec6ecb 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1808,10 +1808,13 @@ void 
SwXStyle::SetPropertyValue(const SfxItemPropertySimple
 SetPropertyValue(rEntry, rPropSet, rValue, o_rStyleBase);
 }
 template<>
-void SwXStyle::SetPropertyValue(const 
SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet&, const uno::Any& 
rValue, SwStyleBase_Impl& o_rStyleBase)
+void SwXStyle::SetPropertyValue(const 
SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const 
uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase)
 {
 if(MID_DROPCAP_CHAR_STYLE_NAME != rEntry.nMemberId)
+{
+SetPropertyValue(rEntry, rPropSet, rValue, o_rStyleBase);
 return;
+}
 if(!rValue.has())
 throw lang::IllegalArgumentException();
 SfxItemSet& rStyleSet(o_rStyleBase.GetItemSet());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-01-19 Thread Caolán McNamara
 sw/source/core/layout/flowfrm.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2671816be19e541941b9b3cbd3f085ea3748261d
Author: Caolán McNamara 
Date:   Thu Jan 19 10:47:56 2017 +

Related: tdf#100813 don't crash traversing table in page 43

master has...

commit 1281bd5d87361fa516cdf247b055aeb4bb5e13fb
Author: Mike Kaganski 
Date:   Wed Jan 18 09:25:55 2017 +0300

tdf#104181 related: don't throw on this document

which is more extreme, keep it minimal for the backport,
MoveFootnoteCntFwd always derefs pOldBoss so check for null
before calling into it here

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

diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index c48029a..02bed5f 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1799,7 +1799,7 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool 
bPageBreak, bool bMoveAlways )
 SwFootnoteBossFrame *pOldBoss = m_rThis.FindFootnoteBossFrame();
 if (m_rThis.IsInFootnote())
 {
-if (!m_rThis.IsContentFrame())
+if (!m_rThis.IsContentFrame() || !pOldBoss)
 {
 SAL_WARN("sw.core", "Tables in footnotes are not truly supported");
 return false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-01-17 Thread Stephan Bergmann
 sw/source/core/unocore/unoobj.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 35001a92d5e414e93e8e8bbbc3999aeb8d8efcf2
Author: Stephan Bergmann 
Date:   Tue Jan 17 10:03:49 2017 +0100

tdf#105212: BASIC sets Delimiter prop to integer value

LO's BASIC doesn't have first-class support for the UNO CHAR type, often 
uses
integer values to represent such CHAR values (cf. 
).

Since 0b07406f7147b9abbb2095d9e038b13293cb8b10 "Use C++11 char16_t for
sal_Unicode" (for non-Windows, since LO 5.1) resp.
e16fa715c43dcdf836ce8c400b6d54eae87b627d "Handle wchar_t as native C++11 
type on
windows" (for Windows, since LO 5.2), C++ css::uno::Any >>=, <<=, etc. with 
a
sal_Unicode argument no longer silently treat the argument as sal_uInt16
instead.  That means that BASIC code putting an integer value into a UNO ANY
that shall hold a value of CHAR type may no longer work.  (Arguably, such 
code
only ever happened to work by coincidence.  For example, if the ANY were
processed by Java instead of C++ code, it would never have worked.)

Luckily, the use of CHAR in the UNO API is rare (for a good reason, as a 
single
UTF-16 code unit is hardly ever the right choice to represent "a 
character").
The only documented place I could find using a CHAR property is Delimiter 
in the
css.text.TextSortDescriptor and css.text.TextSortDescriptor2 services.  And 
the
only processing of such a property that I could find across the LO code 
base is
in the file modified here, which thus just takes a one-off special effort to
take care of this problem.

The direction from C++ to BASIC is left as-is.  The value of the Delimiter
property is now reported as a CHAR value (where in the past it 
was---arguably
erroneously---reported as an UNSIGNED SHORT value), and BASIC is generally
capable of handling such CHAR values it receives well.  For example, in the
BASIC code attached to tdf#105212,

>   MsgBox("Sort: " + SortDesc(1).Name  + " = " + SortDesc(1).Value)

SortDesc(1).Value will now print a (space) character instead of its numeric
value (32).  Also, any other uses of individual CHAR values in the UNO API 
apart
from properties appear to already be handled well enough by BASIC, as the 
sample
code

> Sub Main
>  tk = createunoservice("com.sun.star.awt.Toolkit")
>  dev = tk.createScreenCompatibleDevice(100, 100)
>  descs = dev.getFontDescriptors()
>  msgbox("Font """ + descs(1).Name + )
>  font = dev.getFont(descs(1))
>  n = font.getCharWidth(97) ' 'a'
>  msgbox("Width 'a' = " + n)
>  met = font.getFontMetric()
>  msgbox("FirstChar = '" + met.FirstChar + "', LastChar = '" + 
met.LastChar + "'")
>  met.LastChar = 122 ' 'z'
>  msgbox("New LastChar = '" + met.LastChar + "'")
>
>  trans = createunoservice("com.sun.star.i18n.Transliteration")
>  c1 = trans.transliterateChar2Char(97) ' 'a'
>  c2 = trans.transliterateChar2Char(c1)
>  msgbox("Transliterate, '" + c1 + "' '" + c2 + "'")
> End Sub

demonstrates.

Change-Id: I2aec1ce374c024bfac61f6c832241dfeb561addc
(cherry picked from commit 1b835cdb5ef4cebeae729b1edf2a773f4a582c0f)
Reviewed-on: https://gerrit.libreoffice.org/33213
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/unocore/unoobj.cxx 
b/sw/source/core/unocore/unoobj.cxx
index 600c393..21561bd 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2687,10 +2687,17 @@ bool SwUnoCursorHelper::ConvertSortProperties(
 else if ( rPropName == "Delimiter" )
 {
 sal_Unicode uChar;
+sal_uInt16 nChar;
 if (aValue >>= uChar)
 {
 rSortOpt.cDeli = uChar;
 }
+else if (aValue >>= nChar)
+{
+// For compatibility with BASIC, also accept an ANY containing
+// an UNSIGNED SHORT:
+rSortOpt.cDeli = nChar;
+}
 else
 {
 bRet = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-01-17 Thread Justin Luth
 sw/source/core/edit/autofmt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 30d7ff170ee9609e5f80fd27f96aa7ea41ffa6c5
Author: Justin Luth 
Date:   Fri Jan 13 20:58:02 2017 +0300

tdf#105294 - only add spacing for the border being set

related to tdf#41542 which now allows the space-to-contents value
even if the border is not visible.

For years, LO has been resetting the spacing to zero when a line
is disabled. Setting all border distances here was a mistake that
was never caught before, and the documents created because of
this oversight will likely cause some grief to bug 41542.

Reviewed-on: https://gerrit.libreoffice.org/33055
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
(cherry picked from commit 9e7526044c8fa6b006b0cb791d15f2476c96ebf2)
Reviewed-on: https://gerrit.libreoffice.org/33062

Conflicts:

sw/source/core/edit/autofmt.cxx

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

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 816e081..abed2bc 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -584,7 +584,7 @@ bool SwAutoFormat::DoUnderline()
 aSet.Put( SwParaConnectBorderItem( false ) );
 SvxBoxItem aBox( RES_BOX );
 aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
-aBox.SetDistance( 42 ); // ~0,75 mm
+aBox.SetDistance(42, SvxBoxItemLine::BOTTOM ); // ~0,75 mm
 aSet.Put(aBox);
 m_pDoc->getIDocumentContentOperations().InsertItemSet( m_aDelPam, aSet 
);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-01-13 Thread Alex McMurchy1917
 sw/source/uibase/dbui/dbmgr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9ec13271b435dc5b2e1753507e1e470624bb93ae
Author: Alex McMurchy1917 
Date:   Thu Jan 12 11:06:52 2017 +

tdf#105071 MM no emails sent when using doc as mail body

The conditional statement exits if there is data to process and
continues if there is no data to process. Thus all records are lost.

This commit reverses this behaviour so that data is processed
by the rest of the Mail merge activities.

Change-Id: I4c92cbd7ca55be7842b07ad887813e417430ba4f
Reviewed-on: https://gerrit.libreoffice.org/32994
Reviewed-by: Jan-Marek Glogowski 
Tested-by: Jan-Marek Glogowski 
(cherry picked from commit 03ec9c397c676faff51041d992f6d715c475ff13)
Reviewed-on: https://gerrit.libreoffice.org/33013
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index c5b5123..7be5340 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1056,7 +1056,7 @@ uno::Reference< mail::XMailMessage > 
lcl_CreateMailFromDoc(
 SfxMedium aMedium( sFileURL, StreamMode::READ );
 SvStream* pInStream = aMedium.GetInStream();
 assert( pInStream && "no output file created?" );
-if( pInStream )
+if( !pInStream )
 return xMessage;
 
 pInStream->SetStreamCharSet( sMailEncoding );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-01-09 Thread Michael Stahl
 sw/source/core/access/accfrmobj.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 017991fac36433fb909de83cad63b5ed98b71acf
Author: Michael Stahl 
Date:   Fri Jan 6 22:37:17 2017 +0100

tdf#105009 sw: fix a11y crash when removing drawing object

SwFrame::RemoveDrawObj() calls SwAnchoredObject::ChgAnchorFrame(0)
so the SwAnchoredDrawObj has no anchor frame later when
SwAccessibleMap::InvalidateCursorPosition() asks for the parent.

(regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba)

Change-Id: Id55cb5fc41a4e37e863498265d1565e1621d508e
(cherry picked from commit ade1d4c36053c2a7aed959e3dd09ebc1b8430ea8)
Reviewed-on: https://gerrit.libreoffice.org/32803
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/access/accfrmobj.cxx 
b/sw/source/core/access/accfrmobj.cxx
index c6986d9..4a093bdd 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -368,10 +368,14 @@ const SwFrame* SwAccessibleChild::GetParent( const bool 
bInPagePreview ) const
 else
 {
 // In any other case the parent is the root frm
-if( bInPagePreview )
-pParent = pContact->GetAnchorFrame()->FindPageFrame();
-else
-pParent = pContact->GetAnchorFrame()->getRootFrame();
+SwFrame const*const pAnchor(pContact->GetAnchorFrame());
+if (pAnchor) // null if object removed from layout
+{
+if (bInPagePreview)
+pParent = pAnchor->FindPageFrame();
+else
+pParent = pAnchor->getRootFrame();
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2017-01-02 Thread Justin Luth
 sw/source/filter/ww8/ww8par6.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 74ce6ebe51027ecd742b651d095c455417595908
Author: Justin Luth 
Date:   Sat Dec 24 12:00:21 2016 +0300

tdf#81263 ww8par6: only use valid sal_uInt16 values for ULSpace

VerticalOrient position returns a signed SwTwips number,
but ULSpace uses unsigned int16, so negative numbers
were creating huge margins.

fixes commit 3755c87d0426a499d4755e82d8fbc77caa240764

Change-Id: I23daea9a913ef73efc42a65e0adfc393eaf4e775
Reviewed-on: https://gerrit.libreoffice.org/32400
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
(cherry picked from commit 604cf7024fce29143150ab77b2f14b59a45e61eb)
Reviewed-on: https://gerrit.libreoffice.org/32402
Tested-by: Justin Luth 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 70b3dd697cb248fb56830db691269fe9e78c57fb)
Reviewed-on: https://gerrit.libreoffice.org/32648

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 06d3ebc..0a8e60c 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2360,8 +2360,9 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo,
 if (aFlySet.HasItem(RES_VERT_ORIENT, &pItem))
 {
 const SwFormatVertOrient* pOrient = static_cast(pItem);
-if (pOrient->GetPos() != 0)
-pULSpaceItem->SetUpper(pOrient->GetPos());
+SwTwips nPos = pOrient->GetPos();
+if( 0 < nPos && nPos <= SAL_MAX_UINT16 )
+pULSpaceItem->SetUpper( sal_uInt16(nPos) );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-12-19 Thread Caolán McNamara
 sw/source/core/docnode/ndtbl.cxx |   16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit a4d4fbeb623013f6377b30711ceedb38ea4b49f8
Author: Caolán McNamara 
Date:   Tue Dec 13 10:35:36 2016 +

Resolves: tdf#103938 replace fix for tdf#78599/tdf#87977

i.e. revert

commit 162c72d64077d9e0dae820d881ce2b56a5b2040c
Author: Caolán McNamara 
Date:   Fri Jan 23 13:17:39 2015 +

and

commit ad50b9a8636e0ee2f3c80669e8dde96577b26c4e
Author: Caolán McNamara 
Date:   Fri Jan 23 15:52:58 2015 +

Related: fdo#78599 wrong method

and restore the original RegisterToFormat logic, and
instead block setting modifications of the document
until the explicit SetModified call to avoid the
original problem of trying to generate a preview
of the document during the section where it cannot be
done

Change-Id: I9dbec0a371d4d747b780aa271789d50a46eccefd
Reviewed-on: https://gerrit.libreoffice.org/31977
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 75ac47d..56a54575 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -719,6 +719,11 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions& rInsTableOpts,
 }
 }
 
+//Resolves: tdf#87977, tdf#78599, disable broadcasting modifications
+//until after RegisterToFormat is completed
+bool bEnableSetModified = getIDocumentState().IsEnableSetModified();
+getIDocumentState().SetEnableSetModified(false);
+
 SwTableNode* pTableNd = GetNodes().TextToTable(
 aRg, cCh, pTableFormat, pLineFormat, pBoxFormat,
 getIDocumentStylePoolAccess().GetTextCollFromPool( 
RES_POOLCOLL_STANDARD ), pUndo );
@@ -744,6 +749,7 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions& rInsTableOpts,
 
 // Set Orientation in the Table's Format
 pTableFormat->SetFormatAttr( SwFormatHoriOrient( 0, eAdjust ) );
+rNdTable.RegisterToFormat(*pTableFormat);
 
 if( pTAFormat || ( rInsTableOpts.mnInsMode & tabopts::DEFAULT_BORDER) )
 {
@@ -873,6 +879,7 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions& rInsTableOpts,
 GetIDocumentUndoRedo().EndUndo( UNDO_TEXTTOTABLE, nullptr );
 }
 
+getIDocumentState().SetEnableSetModified(bEnableSetModified);
 getIDocumentState().SetModified();
 getIDocumentFieldsAccess().SetFieldsDirty(true, nullptr, 0);
 return &rNdTable;
@@ -1106,7 +1113,6 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& 
rRange, sal_Unicode cCh,
 
 lcl_BalanceTable(rTable, nMaxBoxes, *pTableNd, *pBoxFormat, *pTextColl,
 pUndo, &aPosArr);
-rTable.RegisterToFormat(*pTableFormat);
 lcl_SetTableBoxWidths(rTable, nMaxBoxes, *pBoxFormat, *pDoc, &aPosArr);
 
 return pTableNd;
@@ -1236,11 +1242,17 @@ const SwTable* SwDoc::TextToTable( const std::vector< 
std::vector >
 }
 }
 
+//Resolves: tdf#87977, tdf#78599, disable broadcasting modifications
+//until after RegisterToFormat is completed
+bool bEnableSetModified = getIDocumentState().IsEnableSetModified();
+getIDocumentState().SetEnableSetModified(false);
+
 SwTableNode* pTableNd = GetNodes().TextToTable(
 rTableNodes, pTableFormat, pLineFormat, pBoxFormat,
 getIDocumentStylePoolAccess().GetTextCollFromPool( 
RES_POOLCOLL_STANDARD )/*, pUndo*/ );
 
 SwTable& rNdTable = pTableNd->GetTable();
+rNdTable.RegisterToFormat(*pTableFormat);
 
 if( !pBoxFormat->HasWriterListeners() )
 {
@@ -1253,6 +1265,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< 
std::vector >
 sal_uLong nIdx = pTableNd->GetIndex();
 aNode2Layout.RestoreUpperFrames( GetNodes(), nIdx, nIdx + 1 );
 
+getIDocumentState().SetEnableSetModified(bEnableSetModified);
 getIDocumentState().SetModified();
 getIDocumentFieldsAccess().SetFieldsDirty( true, nullptr, 0 );
 return &rNdTable;
@@ -1431,7 +1444,6 @@ SwTableNode* SwNodes::TextToTable( const 
SwNodes::TableRanges_t & rTableNodes,
 nMaxBoxes = nBoxes;
 }
 
-rTable.RegisterToFormat(*pTableFormat);
 lcl_SetTableBoxWidths2(rTable, nMaxBoxes, *pBoxFormat, *pDoc);
 
 return pTableNd;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-12-17 Thread Justin Luth
 sw/source/core/layout/frmtool.cxx |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit d253963f460e5600eb886480306b01a6fbc27ee6
Author: Justin Luth 
Date:   Sat Dec 17 08:55:34 2016 +0300

tdf#104613 revert there is a function for that: CalcLineSpace

it should have been ,m_bBorderDist instead of ,true.
In 5.3, m_bBorderDist is always true, but not in 5.2

Just revert back to the original code, since this was just
supposed to be a readability change anyway.

reverts commit feacae8571d003c60960d852e835a17ef722265c

Change-Id: I2cb16e3c05d3c028eb3f8dcecfcf112524385780
Reviewed-on: https://gerrit.libreoffice.org/32110
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index a490ba7..70c1409 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1985,28 +1985,36 @@ long SwBorderAttrs::CalcLeft( const SwFrame *pCaller ) 
const
 
 void SwBorderAttrs::CalcTopLine_()
 {
-m_nTopLine = m_rBox.CalcLineSpace( SvxBoxItemLine::TOP, 
/*bEvenIfNoLine*/true );
+m_nTopLine = (m_bBorderDist && !m_rBox.GetTop())
+? m_rBox.GetDistance  (SvxBoxItemLine::TOP)
+: m_rBox.CalcLineSpace(SvxBoxItemLine::TOP);
 m_nTopLine = m_nTopLine + 
m_rShadow.CalcShadowSpace(SvxShadowItemSide::TOP);
 m_bTopLine = false;
 }
 
 void SwBorderAttrs::CalcBottomLine_()
 {
-m_nBottomLine = m_rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM, true );
+m_nBottomLine = (m_bBorderDist && !m_rBox.GetBottom())
+? m_rBox.GetDistance  (SvxBoxItemLine::BOTTOM)
+: m_rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM);
 m_nBottomLine = m_nBottomLine + 
m_rShadow.CalcShadowSpace(SvxShadowItemSide::BOTTOM);
 m_bBottomLine = false;
 }
 
 void SwBorderAttrs::CalcLeftLine_()
 {
-m_nLeftLine = m_rBox.CalcLineSpace( SvxBoxItemLine::LEFT, true );
+m_nLeftLine = (m_bBorderDist && !m_rBox.GetLeft())
+? m_rBox.GetDistance  (SvxBoxItemLine::LEFT)
+: m_rBox.CalcLineSpace(SvxBoxItemLine::LEFT);
 m_nLeftLine = m_nLeftLine + 
m_rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT);
 m_bLeftLine = false;
 }
 
 void SwBorderAttrs::CalcRightLine_()
 {
-m_nRightLine = m_rBox.CalcLineSpace(SvxBoxItemLine::RIGHT, true );
+m_nRightLine = (m_bBorderDist && !m_rBox.GetRight())
+? m_rBox.GetDistance  (SvxBoxItemLine::RIGHT)
+: m_rBox.CalcLineSpace(SvxBoxItemLine::RIGHT);
 m_nRightLine = m_nRightLine + 
m_rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT);
 m_bRightLine = false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-12-14 Thread Justin Luth
 sw/source/uibase/shells/textsh1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 533482bbdfe4d96b69aff2e0dcc2101fcc912293
Author: Justin Luth 
Date:   Tue Dec 13 14:23:24 2016 +0300

tdf#104545 SID_PARA_DLG: use passed PaM instead of GetCursor

reverts portion of commit 7d9bb549d498d6beed2c4050c402d09643febdfa

Change-Id: Ia683c3bac786a9c2c3b13732b1cb49389074beda
Reviewed-on: https://gerrit.libreoffice.org/31953
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 
(cherry picked from commit e08355618e13a83210b746c67bb9f7a0b425e1dc)
Reviewed-on: https://gerrit.libreoffice.org/31985
Reviewed-by: Justin Luth 

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index c56621e..7501c17 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -944,7 +944,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
 0);
 
 // get also the list level indent values merged as LR-SPACE item, 
if needed.
-rWrtSh.GetCurAttr( aCoreSet, true );
+rWrtSh.GetPaMAttr( pPaM, aCoreSet, true );
 
 // create needed items for XPropertyList entries from the 
DrawModel so that
 // the Area TabPage can access them
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-12-08 Thread Caolán McNamara
 sw/source/core/doc/doc.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 509603e3763d064ec7951e7aa7978462ab6be458
Author: Caolán McNamara 
Date:   Tue Nov 15 10:22:59 2016 +

Resolves: tdf#103313 idles never get to complete postit shell formatting

Change-Id: Ic01628bca8c306c48277ffbc84d334d1922a248b
Reviewed-on: https://gerrit.libreoffice.org/30864
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
(cherry picked from commit 3690218b1f5073db8407a58f1b45a97d3d6fe7cd)
Reviewed-on: https://gerrit.libreoffice.org/31757

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 7850ffa..6a70980 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -842,6 +842,12 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
 
 // format post-it doc to get correct number of pages
 rData.m_pPostItShell->CalcLayout();
+
+SwRootFrame* pPostItRoot = rData.m_pPostItShell->GetLayout();
+//tdf#103313 print dialog maxes out cpu as Idles never get to
+//complete this postitshell's desire to complete formatting
+pPostItRoot->ResetIdleFormat();
+
 const sal_Int32 nPostItDocPageCount = 
rData.m_pPostItShell->GetPageCount();
 
 if (nPostItMode == SwPostItMode::Only || nPostItMode == 
SwPostItMode::EndDoc)
@@ -858,7 +864,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
 // now we just need to add the post-it pages to be printed to the
 // end of the vector of pages to print
 sal_Int32 nPageNum = 0;
-const SwPageFrame * pPageFrame = 
static_cast(rData.m_pPostItShell->GetLayout()->Lower());
+const SwPageFrame * pPageFrame = 
static_cast(pPostItRoot->Lower());
 while( pPageFrame && nPageNum < nPostItDocPageCount )
 {
 OSL_ENSURE( pPageFrame, "Empty page frame. How are we going to 
print this?" );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-12-01 Thread Justin Luth
 sw/source/core/layout/frmtool.cxx |   16 
 1 file changed, 4 insertions(+), 12 deletions(-)

New commits:
commit feacae8571d003c60960d852e835a17ef722265c
Author: Justin Luth 
Date:   Wed Nov 2 15:15:55 2016 +0300

there is a function for that: CalcLineSpace(xx, bEvenIfNoLine)

Change-Id: Ideeb031f20611bd9d2a01343bc75e1d0510ad6e9
Reviewed-on: https://gerrit.libreoffice.org/30513
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 
(cherry picked from commit 5d9d0f3c979732ade57b9c4c4960dd030ffdc9f9)
Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/31467
Tested-by: Jenkins 

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 70c1409..a490ba7 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1985,36 +1985,28 @@ long SwBorderAttrs::CalcLeft( const SwFrame *pCaller ) 
const
 
 void SwBorderAttrs::CalcTopLine_()
 {
-m_nTopLine = (m_bBorderDist && !m_rBox.GetTop())
-? m_rBox.GetDistance  (SvxBoxItemLine::TOP)
-: m_rBox.CalcLineSpace(SvxBoxItemLine::TOP);
+m_nTopLine = m_rBox.CalcLineSpace( SvxBoxItemLine::TOP, 
/*bEvenIfNoLine*/true );
 m_nTopLine = m_nTopLine + 
m_rShadow.CalcShadowSpace(SvxShadowItemSide::TOP);
 m_bTopLine = false;
 }
 
 void SwBorderAttrs::CalcBottomLine_()
 {
-m_nBottomLine = (m_bBorderDist && !m_rBox.GetBottom())
-? m_rBox.GetDistance  (SvxBoxItemLine::BOTTOM)
-: m_rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM);
+m_nBottomLine = m_rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM, true );
 m_nBottomLine = m_nBottomLine + 
m_rShadow.CalcShadowSpace(SvxShadowItemSide::BOTTOM);
 m_bBottomLine = false;
 }
 
 void SwBorderAttrs::CalcLeftLine_()
 {
-m_nLeftLine = (m_bBorderDist && !m_rBox.GetLeft())
-? m_rBox.GetDistance  (SvxBoxItemLine::LEFT)
-: m_rBox.CalcLineSpace(SvxBoxItemLine::LEFT);
+m_nLeftLine = m_rBox.CalcLineSpace( SvxBoxItemLine::LEFT, true );
 m_nLeftLine = m_nLeftLine + 
m_rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT);
 m_bLeftLine = false;
 }
 
 void SwBorderAttrs::CalcRightLine_()
 {
-m_nRightLine = (m_bBorderDist && !m_rBox.GetRight())
-? m_rBox.GetDistance  (SvxBoxItemLine::RIGHT)
-: m_rBox.CalcLineSpace(SvxBoxItemLine::RIGHT);
+m_nRightLine = m_rBox.CalcLineSpace(SvxBoxItemLine::RIGHT, true );
 m_nRightLine = m_nRightLine + 
m_rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT);
 m_bRightLine = false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-11-28 Thread Michael Stahl
 sw/source/uibase/inc/conttree.hxx  |1 -
 sw/source/uibase/utlui/content.cxx |   17 ++---
 2 files changed, 2 insertions(+), 16 deletions(-)

New commits:
commit 09b714195bc61773c6021a78247478e86ee90d41
Author: Michael Stahl 
Date:   Thu Nov 24 14:18:05 2016 +0100

tdf#103788 sw: fix use-after-free in navigator dialog

The problem is that if SwContentTree::HasContentChanged() returns true,
it may have deleted the SwTypeNumber instances that are referenced in
SvTreeListEntry::pUserData, but it has not reset pUserData so those
pointers are now used to acceess deleted objects.

Also it looks like the HasContentChanged() detects additional conditions
that would not cause a modified event from the document but should still
cause a repaint, such as when the user moves the cursor between
headings.

Revert the optimization, it was a stupid idea.

(regression from 329742e6c9da7cd7848d92a6846e3d1249d8d9b4)

(cherry picked from commit cbdf4e007650cfda4f7808402e8e24ae66d45792)
Reviewed-on: https://gerrit.libreoffice.org/31194
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
(cherry picked from commit dbfa3841018672d8af8e9bf1bdb4caf6cdf0ce7d)

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

diff --git a/sw/source/uibase/inc/conttree.hxx 
b/sw/source/uibase/inc/conttree.hxx
index e496137..ddaf387 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -95,7 +95,6 @@ class SwContentTree
 boolm_bIsOutlineMoveable  :1;
 boolm_bViewHasChanged :1;
 boolm_bIsImageListInitialized : 1;
-boolm_bActiveDocModified :1;
 
 static bool bIsInDrag;
 
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 309304e..84c6f1b 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -803,7 +803,6 @@ SwContentTree::SwContentTree(vcl::Window* pParent, const 
ResId& rResId)
 , m_bIsOutlineMoveable(true)
 , m_bViewHasChanged(false)
 , m_bIsImageListInitialized(false)
-, m_bActiveDocModified(false)
 , m_bIsKeySpace(false)
 {
 SetHelpId(HID_NAVIGATOR_TREELIST);
@@ -1718,8 +1717,6 @@ void SwContentTree::Display( bool bActive )
 sal_Int32 nDelta = pVScroll->GetThumbPos() - nOldScrollPos;
 ScrollOutputArea( (short)nDelta );
 }
-
-m_bActiveDocModified = false;
 }
 
 void SwContentTree::Clear()
@@ -2204,13 +2201,6 @@ void SwContentTree::SetConstantShell(SwWrtShell* pSh)
 
 void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint)
 {
-SfxSimpleHint const*const pHint(dynamic_cast(&rHint));
-if (pHint && SFX_HINT_DOCCHANGED == pHint->GetId())
-{
-m_bActiveDocModified = true;
-return;
-}
-
 SfxViewEventHint const*const pVEHint(
 dynamic_cast(&rHint));
 SwXTextView* pDyingShell = nullptr;
@@ -2423,11 +2413,8 @@ IMPL_LINK_NOARG_TYPED(SwContentTree, TimerUpdate, Timer 
*, void)
 else if( (m_bIsActive || (m_bIsConstant && pActShell == 
GetWrtShell())) &&
 HasContentChanged())
 {
-if (!m_bIsActive || m_bActiveDocModified)
-{   // don't burn cpu and redraw and flicker if not modified
-FindActiveTypeAndRemoveUserData();
-Display(true);
-}
+FindActiveTypeAndRemoveUserData();
+Display(true);
 }
 }
 else if(!pView && m_bIsActive && !m_bIsIdleClear)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-11-10 Thread Caolán McNamara
 sw/source/uibase/utlui/navipi.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 327dd016a401c96c21a0b87acf92fb6510c5d4b5
Author: Caolán McNamara 
Date:   Thu Nov 10 16:10:07 2016 +

Resolves: tdf#103809 the argument is a bool* not a VclPtr

(cherry picked from commit 8445764681bfe7bd6cd31194878e1314a8fafa3b)

Change-Id: Ia07f4ff7b243708304186c840135ec1180621fa5
Reviewed-on: https://gerrit.libreoffice.org/30760
Tested-by: Jenkins 
Reviewed-by: Maxim Monastirsky 

diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index 2a62187..365653e 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -230,7 +230,7 @@ IMPL_LINK_TYPED( SwNavigationPI, ToolBoxSelectHdl, ToolBox 
*, pBox, void )
 {
 // #i75416# move the execution of the search to an asynchronously 
called static link
 bool* pbNext = new bool( FN_DOWN == nCurrItemId );
-Application::PostUserEvent( LINK(pView, SwView, 
MoveNavigationHdl), pbNext, true );
+Application::PostUserEvent( LINK(pView, SwView, 
MoveNavigationHdl), pbNext );
 }
 break;
 case FN_SHOW_ROOT:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-10-26 Thread Michael Stahl
 sw/source/filter/ww8/wrtw8sty.cxx |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 1bfa382b4af649ff2b56b988d89bada156e29078
Author: Michael Stahl 
Date:   Tue Oct 25 17:35:59 2016 +0200

tdf#101814 sw: MSWord export: don't override first-page with heuristics

Revert commit dcea8ba3b4fc347e7b6d9e0d5ec2fd99bd77ce6f, and do the
opposite.  The added "titlePage" check makes no sense, because in that
case there is already an explicit first-page style in the PageDesc, and
overriding that cannot be right.

The test added in that commit still succeeds, which suggests that the
root cause of that bug was elsewhere and was fixed in the meantime.

Change-Id: I9b21b6dc115be28cb0ee3360615c538d4cfee3cb
(cherry picked from commit 36e390eaa55ae302dc5a64fa7098ec43e2009748)
Reviewed-on: https://gerrit.libreoffice.org/30276
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index bc52d44..d16c9fd 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1624,18 +1624,19 @@ void MSWordExportBase::SectionProperties( const 
WW8_SepInfo& rSepInfo, WW8_PdAtt
 {
 // if a Follow is set and it does not point to itself,
 // then there is a page chain.
-// Falls damit eine "Erste Seite" simuliert werden soll, so
-// koennen wir das auch als solches schreiben.
-// Anders sieht es mit Links/Rechts wechseln aus. Dafuer muss
-// erkannt werden, wo der Seitenwechsel statt findet. Hier ist
-// es aber dafuer zuspaet!
-if ( pPd->GetFollow() && pPd != pPd->GetFollow() &&
+// If this emulates a "first page", we can detect it here and write
+// it as title page.
+// With Left/Right changes it's different - we have to detect where
+// the change of pages is, but here it's too late for that!
+// tdf#101814 if there is already a explicit first-page, no point
+// in checking heuristics here.
+if ( !titlePage && pPd->GetFollow() && pPd != pPd->GetFollow() &&
  pPd->GetFollow()->GetFollow() == pPd->GetFollow() &&
  ( !rSepInfo.pPDNd || pPd->IsFollowNextPageOfNode( *rSepInfo.pPDNd 
) ) )
 {
 const SwPageDesc *pFollow = pPd->GetFollow();
 const SwFrameFormat& rFollowFormat = pFollow->GetMaster();
-if ( sw::util::IsPlausableSingleWordSection( *pPdFirstPgFormat, 
rFollowFormat ) || titlePage )
+if (sw::util::IsPlausableSingleWordSection(*pPdFirstPgFormat, 
rFollowFormat))
 {
 if (rSepInfo.pPDNd)
 pPdFirstPgFormat = pPd->GetPageFormatOfNode( 
*rSepInfo.pPDNd );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-10-25 Thread Justin Luth
 sw/source/filter/ww8/ww8par2.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 55840d90c43d0ba6db4a9cda4af648df0776749b
Author: Justin Luth 
Date:   Mon Oct 24 15:46:45 2016 +0300

tdf#89377 ww8import: table honors ParaStyle break-before-page

MS Word can page-break inside a table at any row
(using paragraph styles from the first column).
Thus a table can be split across many pages.
Writer can't because it ignores all page-breaks while inside a table,
although the entire table itself can specify starting on a new page.

This imported .doc patch checks to see if the very first paragraph style
in a table is set with a page-break, and if so, then transfers
that setting to the table itself. That at least mimics the most
common layout scenario.

Cherry pick from f5f51cb93d11731c64dfd68044144100f5fc4b28
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

Change-Id: I25d99c812281e3654c44f21c2b6030a820917890
Reviewed-on: https://gerrit.libreoffice.org/30228
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 2259939..989fec4 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3380,6 +3380,13 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp, 
SvxULSpaceItem* pULSpaceItem)
 }
 }
 }
+// if first paragraph in table has break-before-page, transfer that 
setting to the table itself.
+else if( StyleExists(m_nAktColl) )
+{
+const SwFormat* pStyleFormat = m_vColl[m_nAktColl].m_pFormat;
+if( pStyleFormat && pStyleFormat->GetBreak().GetBreak() == 
SVX_BREAK_PAGE_BEFORE )
+NewAttr( pStyleFormat->GetBreak() );
+}
 
 m_pTableDesc = new WW8TabDesc( this, nStartCp );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-10-25 Thread Caolán McNamara
 sw/source/core/layout/colfrm.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 8f6d624843fef768a159724e199459a23f3ad2bb
Author: Caolán McNamara 
Date:   Fri Oct 21 20:29:25 2016 +0100

Resolves: tdf#103359 undo of insert of multi column frame crashes

this pattern has been seen before in #i32968#, so fix the same way

Change-Id: I72ac628ee507abf23c38defede33058b34e17857
(cherry picked from commit e1dea8100b345b15705cad366d1bcc9516bb15e9)
Reviewed-on: https://gerrit.libreoffice.org/30153
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index bbd5366..07d893d 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -31,6 +31,7 @@
 #include "ftnfrm.hxx"
 #include 
 #include 
+#include 
 
 SwColumnFrame::SwColumnFrame( SwFrameFormat *pFormat, SwFrame* pSib ):
 SwFootnoteBossFrame( pFormat, pSib )
@@ -152,9 +153,12 @@ static bool lcl_AddColumns( SwLayoutFrame *pCont, 
sal_uInt16 nCount )
 else
 {
 bRet = true;
+// tdf#103359, like #i32968# Inserting columns in the section causes 
MakeFrameFormat to put
+// nCount objects of type SwUndoFrameFormat on the undo stack. We 
don't want them.
+::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
 for ( sal_uInt16 i = 0; i < nCount; ++i )
 {
-SwFrameFormat *pFormat = pDoc->MakeFrameFormat( aEmptyOUStr, 
pDoc->GetDfltFrameFormat());
+SwFrameFormat *pFormat = pDoc->MakeFrameFormat(aEmptyOUStr, 
pDoc->GetDfltFrameFormat());
 SwColumnFrame *pTmp = new SwColumnFrame( pFormat, pCont );
 pTmp->SetMaxFootnoteHeight( nMax );
 pTmp->Paste( pCont );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-10-13 Thread Caolán McNamara
 sw/source/uibase/utlui/navipi.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a357ce53723829748f3622137ae4d4e47d7b6bac
Author: Caolán McNamara 
Date:   Tue Oct 11 15:30:15 2016 +0100

Master Document toggle missing if switch to master doc from normal doc

regression since...

commit 20e2d7e7d1c518fe514e8252836c1c728fe3fc27
Author: akki95 
Date:   Sat Jan 30 09:55:41 2016 +0530

tdf#95408 -"Toggle" in Writer Navigator to be more explicit in what it 
toggles

(cherry picked from commit 045367d9ba43ec6afb003fd9117ae186c7e18e34)

Change-Id: I310eb7bfc39993ba54bbd9eca04ce721c8a68ea6
Reviewed-on: https://gerrit.libreoffice.org/29702
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index 5c70544..2a62187 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -941,7 +941,7 @@ void SwNavigationPI::StateChanged( sal_uInt16 nSID, 
SfxItemState /*eState*/,
 SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
 m_aContentTree->SetActiveShell(pWrtShell);
 bool bGlobal = IsGlobalDoc();
-m_aContentToolBox->EnableItem(FN_GLOBAL_SWITCH, bGlobal);
+m_aContentToolBox->ShowItem(FN_GLOBAL_SWITCH, bGlobal);
 if( (!bGlobal && IsGlobalMode()) ||
 (!IsGlobalMode() && m_pConfig->IsGlobalActive()) )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-10-06 Thread Caolán McNamara
 sw/source/core/unocore/unodraw.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 8da897574f0a9e40b87944750eec813c428e6a30
Author: Caolán McNamara 
Date:   Wed Sep 28 12:24:49 2016 +0100

Resolves: tdf#102358 writer cannot save 3d shape inserted from draw

because SwXShape::supportsService always returned true for
com.sun.star.drawing.Shape I surmise that getSupportedServiceNames
should always list com.sun.star.drawing.Shape as a supported service

This went awry with...

commit 2f50ce6cfab2871cd879c1429e1938d3642616ef
Author: Marcos Paulo de Souza 
Date:   Thu Dec 5 19:17:18 2013 -0200

fdo#54938: Convert sw to use cppu::supportsService

Change-Id: Ic27bf31e5eb991ccceb8b97713d1e50a736709c8
Signed-off-by: Stephan Bergmann 

Change-Id: I9821a620da8bac3b6b59da976a8c25bb2deafcf1
(cherry picked from commit 5345b1562066d61b9ed79f072f8a953c67f847ed)
Reviewed-on: https://gerrit.libreoffice.org/29360
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 1002402..47ebb0b 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -2245,18 +2245,15 @@ sal_Bool SwXShape::supportsService(const OUString& 
rServiceName) throw( uno::Run
 uno::Sequence< OUString > SwXShape::getSupportedServiceNames() throw( 
uno::RuntimeException, std::exception )
 {
 uno::Sequence< OUString > aSeq;
-if(xShapeAgg.is())
+if (xShapeAgg.is())
 {
 uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, 
uno::UNO_QUERY);
 SvxShape* pSvxShape = GetSvxShape();
 if(pSvxShape)
 aSeq = pSvxShape->getSupportedServiceNames();
 }
-else
-{
-aSeq.realloc(1);
-aSeq.getArray()[0] = "com.sun.star.drawing.Shape";
-}
+aSeq.realloc(aSeq.getLength() + 1);
+aSeq.getArray()[aSeq.getLength() - 1] = "com.sun.star.drawing.Shape";
 return aSeq;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-29 Thread Michael Stahl
 sw/source/core/text/txtftn.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit cda5c1f15f73922026992036bdaf631bad19c76f
Author: Michael Stahl 
Date:   Wed Sep 28 15:35:26 2016 +0200

tdf#102073: sw: do not create SwFootnoteNumPortion inside table

The SwTextFormatter::WhichFirstPortion() wants to create a new
SwFootnoteNumPortion for the first paragraph in every cell, because it
doesn't have mpPrev set and SwTextFrame::IsFootnoteNumFrame() is true,
and somehow this even causes an infinite loop in the bugdoc because
initially nothing more than the footnote number fits inside a line.

Just detect that it's inside a table and return false then.

Change-Id: I1f010f1242d53d9f99a4d3a4f6fc3cee65aa3958
(cherry picked from commit ebcbc970f8d0ecbba8c6d7e7c2a1b977d63bc2fb)
Reviewed-on: https://gerrit.libreoffice.org/29362
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 1eb36ef..69d4062 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -57,6 +57,8 @@ using namespace ::com::sun::star;
 
 bool SwTextFrame::IsFootnoteNumFrame_() const
 {
+if (IsInTab())
+return false; // tdf#102073 first frame in cell doesn't have mpPrev set
 const SwFootnoteFrame* pFootnote = FindFootnoteFrame()->GetMaster();
 while( pFootnote && !pFootnote->ContainsContent() )
 pFootnote = pFootnote->GetMaster();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-22 Thread Michael Stahl
 sw/source/ui/dbui/dbinsdlg.cxx |   35 +--
 1 file changed, 29 insertions(+), 6 deletions(-)

New commits:
commit 2a439e641890d81a6bb960ccc27135c040e3e991
Author: Michael Stahl 
Date:   Tue Sep 20 11:25:01 2016 +0200

tdf#101164 sw: Insert Database Columns dialog: expect selection

... as bookmarks, not raw row indexes.  Bookmarks is what
FmXGridPeer::getSelection() / FmGridControl::getSelectionBookmarks()
always produce, and it's unclear to me if there even is a case where
something other than a bookmark ends up pasted into Writer.

The only case where dbaccess creates a selection that doesn't contain
bookmarks is in SbaGridControl::implTransferSelectedRows() if no rows
are selected but i haven't figured out how to reach that state.

(regression in OOo 3.3)

Change-Id: Ib45787bc002447338df775102790843f2cb1dd3b
(cherry picked from commit bb0e9dd57e7ca0f346ac1102139edaec4e6b3790)
Reviewed-on: https://gerrit.libreoffice.org/29090
Tested-by: Jenkins 
Reviewed-by: Lionel Elie Mamane 

diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 2ccd096..c487cb1 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -989,6 +990,14 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
Sequence& rSelection,
 Reference< XColumnsSupplier > xColsSupp( xResultSet, UNO_QUERY );
 Reference  xCols = xColsSupp->getColumns();
 
+static bool isSelectionBookmarks = true; // TODO is this always true here?
+uno::Reference xRowLocate;
+if (isSelectionBookmarks)
+{
+xRowLocate.set(xResultSet, uno::UNO_QUERY);
+assert(xRowLocate.is());
+}
+
 do{ // middle checked loop!!
 if( bAsTable )  // Daten als Tabelle einfuegen
 {
@@ -1066,9 +1075,16 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
Sequence& rSelection,
 {
 if(pSelection)
 {
-sal_Int32 nPos = 0;
-pSelection[i] >>= nPos;
-bBreak = !xResultSet->absolute(nPos);
+if (isSelectionBookmarks)
+{
+bBreak = !xRowLocate->moveToBookmark(pSelection[i]);
+}
+else
+{
+sal_Int32 nPos = 0;
+pSelection[i] >>= nPos;
+bBreak = !xResultSet->absolute(nPos);
+}
 }
 else if(!i)
 bBreak = !xResultSet->first();
@@ -1259,9 +1275,16 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
Sequence& rSelection,
 {
 if(pSelection)
 {
-sal_Int32 nPos = 0;
-pSelection[i] >>= nPos;
-bBreak = !xResultSet->absolute(nPos);
+if (isSelectionBookmarks)
+{
+bBreak = 
!xRowLocate->moveToBookmark(pSelection[i]);
+}
+else
+{
+sal_Int32 nPos = 0;
+pSelection[i] >>= nPos;
+bBreak = !xResultSet->absolute(nPos);
+}
 }
 else if(!i)
 bBreak = !xResultSet->first();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-21 Thread Jan-Marek Glogowski
 sw/source/ui/misc/bookmark.cxx |   18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit a1468f50241c87ac7687128f852d6f2f2e705b93
Author: Jan-Marek Glogowski 
Date:   Tue Sep 20 17:00:44 2016 +0200

tdf#101359 Really walk the document mark list

In both functions we want to walk the current mark list and
act on the MarkType::BOOKMARK, so mimic the behaviour of
PopulateTable in HaveBookmarksChanged.

My previous commit 96454829f7dc6480f9ddd4262bc03d5ccabadea4
is broken and just works out of luck...

It also contains commit adfb650bec005a46c2192852a8f5801497a19611,
which handles the case with less bookmarks then expected.

(cherry picked from commit ccb979c53931ab3f4712d0a3f7d0f844dcfc5c5d)

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

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 1395fc1..625399a 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -249,17 +249,24 @@ bool SwInsertBookmarkDlg::HaveBookmarksChanged()
 if (pMarkAccess->getBookmarksCount() != m_nLastBookmarksCount)
 return true;
 
-IDocumentMarkAccess::const_iterator_t ppBookmark = 
pMarkAccess->getBookmarksBegin();
-for (std::pair & aTableBookmark : 
aTableBookmarks)
+std::vector>::const_iterator 
aListIter = aTableBookmarks.begin();
+for (IDocumentMarkAccess::const_iterator_t ppBookmark = 
pMarkAccess->getBookmarksBegin();
+ ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
 {
 if (IDocumentMarkAccess::MarkType::BOOKMARK == 
IDocumentMarkAccess::GetType(**ppBookmark))
 {
-if (aTableBookmark.first != ppBookmark->get() ||
-aTableBookmark.second != ppBookmark->get()->GetName())
+// more bookmarks then expected
+if (aListIter == aTableBookmarks.end())
+return true;
+if (aListIter->first != ppBookmark->get() ||
+aListIter->second != ppBookmark->get()->GetName())
 return true;
-++ppBookmark;
+++aListIter;
 }
 }
+// less bookmarks then expected
+if (aListIter != aTableBookmarks.end())
+return true;
 return false;
 }
 
@@ -267,6 +274,7 @@ void SwInsertBookmarkDlg::PopulateTable()
 {
 aTableBookmarks.clear();
 m_pBookmarksBox->Clear();
+
 IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
 for (IDocumentMarkAccess::const_iterator_t ppBookmark = 
pMarkAccess->getBookmarksBegin();
  ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-21 Thread Julien Nabet
 sw/source/core/docnode/node.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 137e42521944c0f3d7ff73891917a476f2868996
Author: Julien Nabet 
Date:   Fri Sep 16 22:32:29 2016 +0200

tdf#102233: avoid infinite loop recursion in IsProtect node method

See https://bugs.documentfoundation.org/show_bug.cgi?id=102233#c5

Change-Id: Ic985662011b33d4b20b7c60df33c9ecc97326e85
Reviewed-on: https://gerrit.libreoffice.org/28972
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit cd72269a6a2c85ae9dd4552aa4808ef4fd1f6c0e)
Reviewed-on: https://gerrit.libreoffice.org/29152
Tested-by: Jenkins 

diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 392143c..4273fd0 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -433,10 +433,14 @@ bool SwNode::IsProtect() const
 SwFrameFormat* pFlyFormat = GetFlyFormat();
 if( pFlyFormat )
 {
-if( pFlyFormat->GetProtect().IsContentProtected() )
+if (pFlyFormat->GetProtect().IsContentProtected())
 return true;
 const SwFormatAnchor& rAnchor = pFlyFormat->GetAnchor();
-return rAnchor.GetContentAnchor() && 
rAnchor.GetContentAnchor()->nNode.GetNode().IsProtect();
+const SwPosition* pAnchorPos = rAnchor.GetContentAnchor();
+if (!pAnchorPos)
+return false;
+const SwNode& rAnchorNd = pAnchorPos->nNode.GetNode();
+return &rAnchorNd != this && rAnchorNd.IsProtect();
 }
 
 if( nullptr != ( pSttNd = FindFootnoteStartNode() ) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-21 Thread Yousuf Philips
 sw/source/uibase/uiview/view2.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 16981dd39a59d77149cbe922eb3f9a8e8fd5c6a6
Author: Yousuf Philips 
Date:   Sat Sep 17 18:12:53 2016 +0400

tdf#90597 Revert "Jump to next change when accepting or rejecting a change"

This reverts commit 1deaa9d304239b2d603cc85bbcb8b8f50d8714da.

Change-Id: Id7b73d68e1dfb5fc15397af8e66574485a0bfd86
Reviewed-on: https://gerrit.libreoffice.org/28979
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 717f4aa..edd8bcc 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -697,8 +697,6 @@ void SwView::Execute(SfxRequest &rReq)
 m_pWrtShell->RejectRedline(nRedline);
 }
 }
-// Go to next change after accepting or rejecting one (fdo#83953)
-GetViewFrame()->GetDispatcher()->Execute(FN_REDLINE_NEXT_CHANGE, 
SfxCallMode::ASYNCHRON);
 }
 break;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-21 Thread Michael Stahl
 sw/source/ui/dbui/dbinsdlg.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit c7a18b2edcaeca80bac512d3018ed9cae1eb0caf
Author: Michael Stahl 
Date:   Fri Sep 16 22:45:33 2016 +0200

tdf#101164 sw: Insert Database Columns dialog: ensure one of ...

... the radio buttons is active by default, in case there's no
configuration to read the state from yet.

Change-Id: If1c0462eb5cb9ea5177f1d5a8953b34fabd0829c
(cherry picked from commit 984790f15d935f986fd0f5ed92f6a63c17eace35)
Reviewed-on: https://gerrit.libreoffice.org/29089
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index c1babe1..2ccd096 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -362,6 +362,10 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& 
rView,
 m_pIbDbcolAllFrom->Enable( false );
 }
 
+// by default, select header button
+m_pRbHeadlColnms->Check(true);
+m_pRbHeadlEmpty->Check(false);
+
 m_pRbAsTable->SetClickHdl( LINK(this, SwInsertDBColAutoPilot, PageHdl ));
 m_pRbAsField->SetClickHdl( LINK(this, SwInsertDBColAutoPilot, PageHdl ));
 m_pRbAsText->SetClickHdl( LINK(this, SwInsertDBColAutoPilot, PageHdl ));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-21 Thread Michael Stahl
 sw/source/uibase/utlui/unotools.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e91e11d091a323d13b480a8bf995e1d70a0f8e89
Author: Michael Stahl 
Date:   Tue Sep 20 17:23:27 2016 +0200

tdf#101536 sw: do load Insert Index dialog's document ReadOnly

Turns out SwOneExampleFrame is used for different things, so load doc
read-only only if it's an existing document.

(regression from 6a8407d82d71083c8bdec6a106ba9092a5196cbe)

(cherry picked from commit b7faef01678573f7b060ad26798aa841689ce3e6)

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

diff --git a/sw/source/uibase/utlui/unotools.cxx 
b/sw/source/uibase/utlui/unotools.cxx
index 77dfc9f..15ca5d1 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -137,13 +137,15 @@ void SwOneExampleFrame::CreateControl()
 sTempURL = sArgumentURL;
 aURL <<= sTempURL;
 
-uno::Sequence aSeq(2);
+uno::Sequence aSeq(3);
 beans::PropertyValue* pValues = aSeq.getArray();
 
 pValues[0].Name = "OpenFlags";
 pValues[0].Value <<= OUString("-RB");
 pValues[1].Name = "Referer";
 pValues[1].Value <<= OUString("private:user");
+pValues[2].Name = "ReadOnly";
+pValues[2].Value <<= (sTempURL != cFactory);
 uno::Any aArgs;
 aArgs.setValue(&aSeq, 
cppu::UnoType>::get());
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-19 Thread Jan-Marek Glogowski
 sw/source/ui/misc/bookmark.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 89c87ab94bb5960187c178f556f871b2c1bfde8f
Author: Jan-Marek Glogowski 
Date:   Fri Sep 16 22:13:02 2016 +0200

tdf#101359 Just advance list box for BOOKMARKs

Since the list box just contains MarkType::BOOKMARK, just advance
the list box position for marks of this type.

Change-Id: I7b8743abb1ffb2fda2242c5e7301b3ff15ae355b
(cherry picked from commit 96454829f7dc6480f9ddd4262bc03d5ccabadea4)
Reviewed-on: https://gerrit.libreoffice.org/28971
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 6798738..1395fc1 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -257,8 +257,8 @@ bool SwInsertBookmarkDlg::HaveBookmarksChanged()
 if (aTableBookmark.first != ppBookmark->get() ||
 aTableBookmark.second != ppBookmark->get()->GetName())
 return true;
+++ppBookmark;
 }
-++ppBookmark;
 }
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-13 Thread Markus Mohrhard
 sw/source/uibase/app/apphdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0dc5bbc155311d6d687e4f29620c6652b988dd0d
Author: Markus Mohrhard 
Date:   Tue Sep 13 04:34:05 2016 +0200

avoid crash with nullptr access

e.g.

http://crashreport.libreoffice.org/stats/crash_details/7d19c6e6-19cb-4ba0-a51f-7b7eef514ae1

Change-Id: Ia27780d6fa29a7e4b0665192844afbd8a7471721
Reviewed-on: https://gerrit.libreoffice.org/28854
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index ecfeb18..53db053 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -586,7 +586,7 @@ IMPL_LINK_NOARG_TYPED( SwMailMergeWizardExecutor, 
EndDialogHdl, Dialog&, void )
 default: // finish
 {
 SwMailMergeConfigItem* pMMConfig = 
m_pView->GetMailMergeConfigItem();
-SwView* pSourceView = pMMConfig->GetSourceView();
+SwView* pSourceView = pMMConfig ? pMMConfig->GetSourceView() : 
nullptr;
 if(pSourceView)
 {
 
pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().Appear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-13 Thread Michael Stahl
 sw/source/core/access/accmap.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 243ed1a3606a8b9d331e40053e36582bf1fdc9e2
Author: Michael Stahl 
Date:   Mon Sep 12 13:23:00 2016 +0200

sw: partially revert commit d0b09f41efe938e94a84e783c9ff5742edcbfba8

These still trigger sometimes in JunitTest_toolkit_unoapi_1
and i haven't had time to track that down, so back to SAL_WARN for
now...

Change-Id: I4d9f653ffddc7c704d33950d847345f4895d3f87
(cherry picked from commit 2934f6bcc75c781cdf9e614b9d7d8533eb680b3f)
Reviewed-on: https://gerrit.libreoffice.org/28862
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 4c2aaae..9baa69f 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1697,7 +1697,7 @@ SwAccessibleMap::~SwAccessibleMap()
 {
 osl::MutexGuard aGuard( maMutex );
 #if OSL_DEBUG_LEVEL > 0
-assert((!mpFrameMap || mpFrameMap->empty()) &&
+SAL_WARN_IF(!(!mpFrameMap || mpFrameMap->empty()), "sw.a11y",
 "Frame map should be empty after disposing the root frame");
 if( mpFrameMap )
 {
@@ -1714,7 +1714,7 @@ SwAccessibleMap::~SwAccessibleMap()
 ++aIter;
 }
 }
-assert((!mpShapeMap || mpShapeMap->empty()) &&
+SAL_WARN_IF(!(!mpShapeMap || mpShapeMap->empty()), "sw.a11y",
 "Object map should be empty after disposing the root frame");
 if( mpShapeMap )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source writerfilter/source

2016-09-06 Thread Caolán McNamara
 sw/source/core/unocore/unosett.cxx   |2 +-
 writerfilter/source/dmapper/NumberingManager.cxx |   11 +++
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 696f11078c3bf236f5d455fded6463f85763a6e6
Author: Caolán McNamara 
Date:   Tue Sep 6 14:49:31 2016 +0100

if we throw in sw on HoriOrientation::NONE then don't pass it in from rtf

Change-Id: Ie01cca9b7cc432fc1fe14bb600af5083d6ca6a0d
Reviewed-on: https://gerrit.libreoffice.org/28688
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/sw/source/core/unocore/unosett.cxx 
b/sw/source/core/unocore/unosett.cxx
index cd84531..81fd65d 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1674,7 +1674,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
 {
 case 0: //"Adjust"
 {
-sal_Int16 nValue = 0;
+sal_Int16 nValue = text::HoriOrientation::NONE;
 pProp->Value >>= nValue;
 if(nValue > 0 &&
 nValue <= text::HoriOrientation::LEFT &&
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 0cbd6db..aa4fc93 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -987,7 +987,7 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
 break;
 case NS_ooxml::LN_CT_Lvl_lvlJc:
 {
-sal_Int16 nValue = 0;
+sal_Int16 nValue = text::HoriOrientation::NONE;
 switch (nIntValue)
 {
 case NS_ooxml::LN_Value_ST_Jc_left:
@@ -1002,9 +1002,12 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
 nValue = text::HoriOrientation::RIGHT;
 break;
 }
-m_pCurrentDefinition->GetCurrentLevel( )->Insert(
-PROP_ADJUST, uno::makeAny( nValue ) );
-writerfilter::Reference::Pointer_t pProperties 
= rSprm.getProps();
+if (nValue != text::HoriOrientation::NONE)
+{
+m_pCurrentDefinition->GetCurrentLevel( )->Insert(
+PROP_ADJUST, uno::makeAny( nValue ) );
+writerfilter::Reference::Pointer_t 
pProperties = rSprm.getProps();
+}
 }
 break;
 case NS_ooxml::LN_CT_Lvl_pPr:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-02 Thread Caolán McNamara
 sw/source/core/crsr/crstrvl.cxx |   17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 456b1dd03f210dc725ce134bdf9344f8e6df17aa
Author: Caolán McNamara 
Date:   Fri Sep 2 15:12:12 2016 +0100

Resolves: tdf#101681 set hyperlink tooltip for the full hyperlink area

not just a single point in it.

This way gtk3 knows the successive tooltip hints for the positions
along the hyperlink are for the same tooltip

(cherry picked from commit 84e8e11dc3c73bcfe63f5e9c6cc49ee18a511a9b)

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

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 7dd29d4..1fb7c833 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1429,16 +1429,25 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
 }
 if( bRet )
 {
-rContentAtPos.sStr = pTextNd->GetExpandText(
-pTextAttr->GetStart(),
-*pTextAttr->GetEnd() - pTextAttr->GetStart() );
+const sal_Int32 nSt = pTextAttr->GetStart();
+const sal_Int32 nEnd = *pTextAttr->End();
+
+rContentAtPos.sStr = pTextNd->GetExpandText(nSt, 
nEnd-nSt);
 
 rContentAtPos.aFnd.pAttr = &pTextAttr->GetAttr();
 rContentAtPos.eContentAtPos = 
SwContentAtPos::SW_INETATTR;
 rContentAtPos.pFndTextAttr = pTextAttr;
 
 if( pFieldRect && nullptr != ( pFrame = 
pTextNd->getLayoutFrame( GetLayout(), &aPt ) ) )
-pFrame->GetCharRect( *pFieldRect, aPos, 
&aTmpState );
+{
+SwRect aStart;
+SwPosition aStartPos(*pTextNd, nSt);
+pFrame->GetCharRect(aStart, aStartPos, 
&aTmpState);
+SwRect aEnd;
+SwPosition aEndPos(*pTextNd, nEnd);
+pFrame->GetCharRect(aEnd, aEndPos, &aTmpState);
+*pFieldRect = aStart.Union(aEnd);
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-02 Thread Stephan Bergmann
 sw/source/filter/html/css1atr.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1de7b0009a09d3cc819ba86e8dd26f846656ae79
Author: Stephan Bergmann 
Date:   Thu Sep 1 13:50:06 2016 +0200

pTemplate can probably be null here

Observed with "make clean && make CppunitTest_sw_filters_test" (which 
misses a
dependency, a bug to be fixed next, so happens to not set up m_pTemplate in
SwHTMLWriter::WriteStream, so dereferences a null pTemplate here.  Don't 
know
whether there's also legitimate scenarios that can lead to a null pTemplate
here, but at least the code in SwHTMLWriter::WriteStream setting up 
m_pTemplate
takes into account that it can be set up as null, and the code in the called
SwHTMLWriter::GetTemplateFormat takes into account that the passed in 
pTemplate
(which used to be the same object as the outer pTemplate/pDoc, before 
breaking
IDocumentStylePoolAccess out of SwDoc, see below) can be null.

Regression introduced with 535971f3a166da6c0e44a6b7211c7f8c298f388f 
"Refactored
IDocumentStylePoolAccess out of SwDoc."

Change-Id: Iabb4ae2ca018ce3a19756d62b9002b245cb409cd
(cherry picked from commit bf3c6237bb110d3eb84970e44593a7880e2e8536)
Reviewed-on: https://gerrit.libreoffice.org/28589
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index 2394ed9..97cd06e 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -1561,16 +1561,16 @@ static Writer& OutCSS1_SwFormat( Writer& rWrt, const 
SwFormat& rFormat,
 switch( nDeep )
 {
 case CSS1_FMT_ISTAG:
-pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
&pTemplate->getIDocumentStylePoolAccess() );
+pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pTemplate == 
nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
 break;
 case CSS1_FMT_CMPREF:
 pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pDoc );
-pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
&pTemplate->getIDocumentStylePoolAccess() );
+pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
pTemplate == nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
 bClearSame = false;
 break;
 default:
 pRefFormat = SwHTMLWriter::GetParentFormat( rFormat, nDeep );
-pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
&pTemplate->getIDocumentStylePoolAccess() );
+pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
pTemplate == nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
 bSetDefaults = false;
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-02 Thread Khaled Hosny
 sw/source/uibase/docvw/edtwin.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 438a76a9a261b9ada7b2758a66cd935d1760da39
Author: Khaled Hosny 
Date:   Thu Sep 1 13:20:41 2016 +0200

tdf#101361: Fix cursor key movement in RTL text

Revert "tdf#32531 Fix for key movement in table cell of different
directionality"

This reverts commit a215cec969f7401b08cabb686c5b2b1d803399d0.

This seems like the wrong fix for the original issue, as it breaks how
“visual” cursor movement works in RTL text.

(cherry picked from commit 67192b3cfa54be7b0b60d450783ac2ac4c38bbc6)

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

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index a9b4c0d..913fbad 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1476,6 +1476,13 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
 else if( KEY_LEFT == nKey ) nKey = KEY_DOWN;
 else if( KEY_RIGHT == nKey ) nKey = KEY_UP;
 }
+
+if ( rSh.IsInRightToLeftText() )
+{
+if( KEY_LEFT == nKey ) nKey = KEY_RIGHT;
+else if( KEY_RIGHT == nKey ) nKey = KEY_LEFT;
+}
+
 aKeyEvent = KeyEvent( rKEvt.GetCharCode(),
   vcl::KeyCode( nKey, 
rKEvt.GetKeyCode().GetModifier() ),
   rKEvt.GetRepeat() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-09-01 Thread Caolán McNamara
 sw/source/ui/chrdlg/chardlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b9939b0642afefe96ae33cd964d6726dc405843d
Author: Caolán McNamara 
Date:   Wed Aug 31 14:07:42 2016 +0100

Resolves: tdf#100094 hyperlink tabpage put hyperlink name in wrong field

mismerge of

commit 74593273655e475017bb2bd45aba3c6b132e372d
Date:   Thu Jan 9 12:59:28 2014 +

Resolves: #i123988# assure that hyperlink attribute...

Change-Id: I45391b112666a07a0edfa49b2a8682c446a92cf4
(cherry picked from commit 98294d715c72751d9dd47fd1995865e04b2bdf5a)
Reviewed-on: https://gerrit.libreoffice.org/28548
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 860ecf1..2879815 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -213,7 +213,7 @@ void SwCharURLPage::Reset(const SfxItemSet* rSet)
 m_pURLED->SetText(INetURLObject::decode(pINetFormat->GetValue(),
 INetURLObject::DECODE_UNAMBIGUOUS));
 m_pURLED->SaveValue();
-m_pURLED->SetText(pINetFormat->GetName());
+m_pNameED->SetText(pINetFormat->GetName());
 
 OUString sEntry = pINetFormat->GetVisitedFormat();
 if (sEntry.isEmpty())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-08-31 Thread Michael Stahl
 sw/source/core/unocore/unotext.cxx |   23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 217640264a62bd78b153b131b2cd158d4f8da620
Author: Michael Stahl 
Date:   Tue Aug 30 21:17:32 2016 +0200

Revert "fftester: non-contiguous cells"

This reverts commit 9accbfa0a52433cf03fe186fc69334d387981eb9.

... and the code change of "avoid crashing on load of fdo54724-1.rtf"
commit 4ee3eabd0f058b26544c84b2b5aaf5478d921817.

It's much simpler to detect early in convertToTable that there is a
row with no cells in it, which should not be allowed.

Change-Id: Iff6d235b29514edd57cc55addeefb24242595d88
(cherry picked from commit dc83b3ae470914dbcb08fe1f0a4a4e1a1d3d8e19)
Reviewed-on: https://gerrit.libreoffice.org/28512
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index add72db..b402d86 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2230,20 +2230,23 @@ throw (lang::IllegalArgumentException, 
uno::RuntimeException, std::exception)
 pTableRanges[nRow].getConstArray();
 const sal_Int32 nCells(pTableRanges[nRow].getLength());
 
+if (0 == nCells) // this would lead to no pLastCell below
+{// and make it impossible to detect node gaps
+bExcept = true;
+break;
+}
+
 for (sal_Int32 nCell = 0; nCell < nCells; ++nCell)
 {
-SwNodeRange *pLastCell;
-if (nCell == 0 && nRow == 0)
-{
-pLastCell = nullptr;
-}
-else
-{
-std::vector& rRowOfPrevCell = nCell ? aRowNodes : 
*aTableNodes.rbegin();
-pLastCell = !rRowOfPrevCell.empty() ? 
&*rRowOfPrevCell.rbegin() : nullptr;
-}
+SwNodeRange *const pLastCell(
+(nCell == 0)
+? ((nRow == 0)
+? nullptr
+: &*aTableNodes.rbegin()->rbegin())
+: &*aRowNodes.rbegin());
 m_pImpl->ConvertCell(pRow[nCell], aRowNodes, pLastCell, bExcept);
 }
+assert(bExcept || !aRowNodes.empty());
 aTableNodes.push_back(aRowNodes);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-08-23 Thread Caolán McNamara
 sw/source/core/doc/docfld.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 2005eb1c0fb2c7170af076a0db9a4e3e1f6892ac
Author: Caolán McNamara 
Date:   Fri Aug 19 15:08:35 2016 +0100

Resolves: tdf#100901 crash pressing tab in r-o document with hyperlink

rather odd union in use here. Trying to call SwTextField::GetStart
on SwTextINetFormat blows up under visual studio.

Change-Id: Ic8145d7645bd6a68ef19e018311a4de6e6958bcb
(cherry picked from commit 3196e949bb23a33bdb8700dbe27782e0e6c8f1e6)
Reviewed-on: https://gerrit.libreoffice.org/28242
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 35e3696..56ef919 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -322,9 +322,11 @@ sal_Int32 SetGetExpField::GetCntPosFromContent() const
 switch( eSetGetExpFieldType )
 {
 case TEXTFIELD:
-case TEXTINET:
 nRet = CNTNT.pTextField->GetStart();
 break;
+case TEXTINET:
+nRet = CNTNT.pTextINet->GetStart();
+break;
 case TEXTTOXMARK:
 nRet = CNTNT.pTextTOX->GetStart();
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-08-09 Thread Caolán McNamara
 sw/source/ui/misc/bookmark.cxx|   12 +++-
 sw/source/uibase/inc/bookmark.hxx |1 +
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 11aa7278659d5f56288df620978107947aec4adc
Author: Caolán McNamara 
Date:   Mon Aug 8 15:37:10 2016 +0100

Resolves: tdf#101359 getBookmarksCount includes more than aTableBookmarks

aTableBookmarks is just "BOOKMARK"s while getBookmarksCount() includes two
extra types. So cache the result of getBookmarksCount when filling
aTableBookmarks to compare if the count from the time of filling
aTableBookmarks is unchanged.

Change-Id: I69fedab613f23e4e2b30498e4620a370d92272e0
(cherry picked from commit cdb708291b59ac89b43c24154f0edc77f237eadd)
Reviewed-on: https://gerrit.libreoffice.org/27992
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 1ab72f8..6798738 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -246,7 +246,7 @@ bool SwInsertBookmarkDlg::ValidateBookmarks()
 bool SwInsertBookmarkDlg::HaveBookmarksChanged()
 {
 IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
-if (pMarkAccess->getBookmarksCount() != 
static_cast(aTableBookmarks.size()))
+if (pMarkAccess->getBookmarksCount() != m_nLastBookmarksCount)
 return true;
 
 IDocumentMarkAccess::const_iterator_t ppBookmark = 
pMarkAccess->getBookmarksBegin();
@@ -277,16 +277,18 @@ void SwInsertBookmarkDlg::PopulateTable()
 aTableBookmarks.push_back(std::make_pair(ppBookmark->get(), 
ppBookmark->get()->GetName()));
 }
 }
+m_nLastBookmarksCount = pMarkAccess->getBookmarksCount();
 }
 
 void SwInsertBookmarkDlg::Apply()
 {
 }
 
-SwInsertBookmarkDlg::SwInsertBookmarkDlg(vcl::Window* pParent, SwWrtShell& rS, 
SfxRequest& rRequest) :
-SvxStandardDialog(pParent, "InsertBookmarkDialog", 
"modules/swriter/ui/insertbookmark.ui"),
-rSh(rS),
-rReq(rRequest)
+SwInsertBookmarkDlg::SwInsertBookmarkDlg(vcl::Window* pParent, SwWrtShell& rS, 
SfxRequest& rRequest)
+: SvxStandardDialog(pParent, "InsertBookmarkDialog", 
"modules/swriter/ui/insertbookmark.ui")
+, rSh(rS)
+, rReq(rRequest)
+, m_nLastBookmarksCount(0)
 {
 get(m_pBookmarksContainer, "bookmarks");
 get(m_pEditBox, "name");
diff --git a/sw/source/uibase/inc/bookmark.hxx 
b/sw/source/uibase/inc/bookmark.hxx
index 0754f69..472cedb 100644
--- a/sw/source/uibase/inc/bookmark.hxx
+++ b/sw/source/uibase/inc/bookmark.hxx
@@ -61,6 +61,7 @@ class SwInsertBookmarkDlg: public SvxStandardDialog
 SwWrtShell& rSh;
 SfxRequest& rReq;
 std::vector> aTableBookmarks;
+sal_Int32   m_nLastBookmarksCount;
 
 DECL_LINK_TYPED(ModifyHdl, Edit&, void);
 DECL_LINK_TYPED(InsertHdl, Button*, void);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-08-04 Thread Caolán McNamara
 sw/source/core/text/itrcrsr.cxx |1 +
 sw/source/core/text/porfly.cxx  |5 +
 sw/source/core/text/porfly.hxx  |1 +
 3 files changed, 7 insertions(+)

New commits:
commit 5703c3bdf1f4b60067207993f9f42430d9901e1c
Author: Caolán McNamara 
Date:   Thu Aug 4 08:50:57 2016 +0100

Resolves: tdf#101269 cannot click/edit text inside a frame

regression from...

commit b0c0a074a2318a231f3f635784da494f1b713c53
Date:   Mon Apr 18 11:03:43 2016 +0200

clang-tidy clang-analyzer-deadcode.DeadStores

suspect that some of these may reveal latent bugs

and restore method then removed by

commit 47f62540bd2c2f107313bb0c6f141cd4460b6379
Date:   Thu May 19 10:31:47 2016 +0200

loplugin:unusedmethods in sw

Change-Id: I14826eecadbc1a74e408f8907eea8746debe4db4
(cherry picked from commit 24c009de4d6d27233027e9bcd86ea181d230be8f)

pPos can never be null

Change-Id: Ib7b57d628fbd80a1d2214917cd439e09d4803d91
(cherry picked from commit 2702796806cae2b28ae78e78d29c3559bf97607e)

SwLinePortion::GetCursorOfst is const and its ret is ignored here

so nOfst is unnecessary

Change-Id: I27f73057b55ebdf30eb69a19ee1b0647ba25583e
(cherry picked from commit 35f4248206e844cabd83757ec57ddde1c2ef66b4)

only called if !bDraw

Change-Id: I7310b5f8cbbc4176e76d92ce2bcd49168470843c
(cherry picked from commit cc7a55450658696009fe01e94632e80bb3785d5b)

the sole caller is ok with rPoint being modified, so change to non-const arg

Change-Id: I40a24502e2e8ad312e13e0c47ee1fde3118d2251
(cherry picked from commit 2b3112b30a8dea8a009c11ddb209e12697f72e32)
Reviewed-on: https://gerrit.libreoffice.org/27865
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 3f8acaa..b6f9928 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1713,6 +1713,7 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, 
const Point &rPoint,
 if( bChgNodeInner && pTmp->Frame().IsInside( aTmpPoint ) &&
 !( pTmp->IsProtected() ) )
 {
+
static_cast(pPor)->GetFlyCursorOfst(aTmpPoint, *pPos, pCMS);
 // After a change of the frame, our font must be still
 // available for/in the OutputDevice.
 // For comparison: Paint and new SwFlyCntPortion !
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 0eca9ca..e38e99d 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -414,6 +414,11 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, 
const Point &rBase,
 }
 }
 
+void SwFlyCntPortion::GetFlyCursorOfst(Point &rPoint, SwPosition &rPos, 
SwCursorMoveState* pCMS) const
+{
+GetFlyFrame()->GetCursorOfst(&rPos, rPoint, pCMS);
+}
+
 sal_Int32 SwFlyCntPortion::GetCursorOfst( const sal_uInt16 nOfst ) const
 {
 // OSL_FAIL("SwFlyCntPortion::GetCursorOfst: use GetFlyCursorOfst()");
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 417c347..129bf39 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -79,6 +79,7 @@ public:
   long nLnAscent, long nLnDescent,
   long nFlyAscent, long nFlyDescent,
   AsCharFlags nFlags );
+void GetFlyCursorOfst(Point &rPoint, SwPosition& rPos, SwCursorMoveState* 
pCMS) const;
 virtual bool Format( SwTextFormatInfo &rInf ) override;
 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
 OUTPUT_OPERATOR_OVERRIDE
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-08-04 Thread Markus Mohrhard
 sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 4fcb04ba5a127cd960ec65fc7788a51b13d3e036
Author: Markus Mohrhard 
Date:   Wed Aug 3 20:10:05 2016 +0200

add more nullptr checks, related tdf#100820

See

http://crashreport.libreoffice.org/stats/crash_details/8569250c-b04a-43b0-b4b8-4b3a94daffe1

Change-Id: I9070be3db57e77befe70c0a32ef6aa54c6c1cf85
Reviewed-on: https://gerrit.libreoffice.org/27842
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 626a1aa960ed36f5c3370e2aab1e72d41df875cf)
Reviewed-on: https://gerrit.libreoffice.org/27859
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx 
b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
index 3a23913..3c4e2cc 100644
--- a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
+++ b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
@@ -205,7 +205,7 @@ uno::Reference 
MMCurrentEntryController::createItemWindow(const un
 IMPL_LINK_TYPED(MMCurrentEntryController, CurrentEditUpdatedHdl, Edit&, rEdit, 
void)
 {
 SwView* pView = ::GetActiveView();
-SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem();
+SwMailMergeConfigItem* pConfigItem = pView ? 
pView->GetMailMergeConfigItem() : nullptr;
 
 if (!pConfigItem)
 return;
@@ -226,7 +226,7 @@ void MMCurrentEntryController::statusChanged(const 
frame::FeatureStateEvent& rEv
 return;
 
 SwView* pView = ::GetActiveView();
-SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem();
+SwMailMergeConfigItem* pConfigItem = pView ? 
pView->GetMailMergeConfigItem() : nullptr;
 
 if (!pConfigItem || !rEvent.IsEnabled)
 {
@@ -277,7 +277,7 @@ uno::Reference 
MMExcludeEntryController::createItemWindow(const un
 IMPL_STATIC_LINK_TYPED(MMExcludeEntryController, ExcludeHdl, CheckBox&, 
rCheckbox, void)
 {
 SwView* pView = ::GetActiveView();
-SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem();
+SwMailMergeConfigItem* pConfigItem = pView ? 
pView->GetMailMergeConfigItem() : nullptr;
 
 if (pConfigItem)
 pConfigItem->ExcludeRecord(pConfigItem->GetResultSetPosition(), 
rCheckbox.IsChecked());
@@ -289,7 +289,7 @@ void MMExcludeEntryController::statusChanged(const 
frame::FeatureStateEvent& rEv
 return;
 
 SwView* pView = ::GetActiveView();
-SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem();
+SwMailMergeConfigItem* pConfigItem = pView ? 
pView->GetMailMergeConfigItem() : nullptr;
 
 if (!pConfigItem || !rEvent.IsEnabled)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-08-03 Thread Caolán McNamara
 sw/source/ui/index/swuiidxmrk.cxx |   25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

New commits:
commit c4c6ad9cacc09c40fb47ebd98450d3aad91bfb41
Author: Caolán McNamara 
Date:   Wed Jul 27 09:10:29 2016 +0100

Resolves: tdf#57978 don't show duplicate index keys in dropdown list

Change-Id: I25e25157063ea4424f770b397d879cb7bfd46bcb
(cherry picked from commit c755336853f20c7b2dd14e9c56eeb441d831be2c)
Reviewed-on: https://gerrit.libreoffice.org/27576
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index 2419980..66f152d 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -193,17 +193,24 @@ void SwIndexMarkPane::InitControls()
 m_pTypeDCB->InsertEntry( pSh->GetTOXType(TOX_USER, i)->GetTypeName() );
 
 // read keywords primary
-std::vector aArr;
-pSh->GetTOIKeys( TOI_PRIMARY, aArr );
-std::sort(aArr.begin(), aArr.end());
-for (std::vector::iterator it = aArr.begin(); it != aArr.end(); 
++it)
-m_pKey1DCB->InsertEntry( *it );
+{
+std::vector aArr;
+pSh->GetTOIKeys(TOI_PRIMARY, aArr);
+std::sort(aArr.begin(), aArr.end());
+auto last = std::unique(aArr.begin(), aArr.end());
+for (auto it = aArr.begin(); it != last; ++it)
+m_pKey1DCB->InsertEntry(*it);
+}
 
 // read keywords secondary
-pSh->GetTOIKeys( TOI_SECONDARY, aArr );
-std::sort(aArr.begin(), aArr.end());
-for (std::vector::iterator it = aArr.begin(); it != aArr.end(); 
++it)
-m_pKey2DCB->InsertEntry( *it );
+{
+std::vector aArr;
+pSh->GetTOIKeys( TOI_SECONDARY, aArr );
+std::sort(aArr.begin(), aArr.end());
+auto last = std::unique(aArr.begin(), aArr.end());
+for (auto it = aArr.begin(); it != last; ++it)
+m_pKey2DCB->InsertEntry(*it);
+}
 
 UpdateLanguageDependenciesForPhoneticReading();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-08-02 Thread Caolán McNamara
 sw/source/core/layout/paintfrm.cxx |   18 --
 1 file changed, 18 deletions(-)

New commits:
commit 832d359930c86c7bfe5547e580d1bfadd9177642
Author: Caolán McNamara 
Date:   Tue Aug 2 11:18:25 2016 +0100

Resolves: tdf#101241 Revert "fix paint table border in DOUBLE_THIN style"

because of the never-ending invalidate and paint of tdf#101241

there was no bug or route to reproduce the original problem so can't
try to solve it a different way.

This reverts commit 9a95520948de1d92c55252aa5f90606b01d6ac9e.

(cherry picked from commit 772191616a0cceebf91a9674ce7417d5cad0050f)

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 4d6c784..b973507 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2742,24 +2742,6 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, 
const SwRect& rRect) cons
 aPaintEnd.Y()   += static_cast(offsetEnd   + 0.5);
 }
 
-if( rEntryStyle.Type() == table::BorderLineStyle::DOUBLE_THIN )
-{
-long aPixel = rDev.PixelToLogic( Point(1, 1) ).getX();
-SwRect aPaintEx( aPaintStart, aPaintEnd );
-if( bHori )
-{
-aPaintEx.Pos().Y() -= aPixel;
-aPaintEx.SSize().Height() += aPixel * 2;
-}
-else
-{
-aPaintEx.Pos().X() -= aPixel;
-aPaintEx.SSize().Width() += aPixel * 2;
-}
-
-gProp.pSGlobalShell->InvalidateWindows( aPaintEx );
-}
-
 if (bHori)
 {
 mrTabFrame.ProcessPrimitives( 
svx::frame::CreateBorderPrimitives(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-28 Thread Caolán McNamara
 sw/source/core/layout/paintfrm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f834632d11bfa55654b40f9cf6fc146ee2cd70e4
Author: Caolán McNamara 
Date:   Wed Jul 27 12:28:11 2016 +0100

Resolves: tdf#63662 'Manual Column Break' always visible...

even when non-printing chars is off.

I think this began as an intermediate step for both page and
column breaks to the header/footer overlay we now have for
page breaks. Leaving this just for column breaks. It may
have been set to always on with page-breaks in mind.

Change-Id: I1617683e2bb8c1f9229e9c2313e7817e184fa5ea
(cherry picked from commit 9e63e60d6f00ee690fafb9f21f2cafb08a6ad92e)
Reviewed-on: https://gerrit.libreoffice.org/27579
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index ff9dc02..4d6c784 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3821,7 +3821,8 @@ void SwColumnFrame::PaintBreak( ) const
 //* Non-printing characters are shown, as this is more 
consistent
 //  with other formatting marks
 if ( !gProp.pSGlobalShell->IsShowHeaderFooterSeparator( Header 
) &&
- !gProp.pSGlobalShell->IsShowHeaderFooterSeparator( Footer 
) )
+ !gProp.pSGlobalShell->IsShowHeaderFooterSeparator( Footer 
) &&
+  gProp.pSGlobalShell->GetViewOptions()->IsLineBreak() )
 {
 SwRect aRect( pCnt->Prt() );
 aRect.Pos() += pCnt->Frame().Pos();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-25 Thread Caolán McNamara
 sw/source/core/inc/tabfrm.hxx|2 --
 sw/source/core/layout/tabfrm.cxx |   25 +++--
 2 files changed, 3 insertions(+), 24 deletions(-)

New commits:
commit 46494be0b4cfc472bcd8da19833bc12c6723d1b2
Author: Caolán McNamara 
Date:   Sat Jul 23 21:48:25 2016 +0100

Resolves: tdf#101058 crash on deleting certain table row

regression from...

commit 15d8b51bf82610c663f80fe552a1c0315e137ad3
Author: Caolán McNamara 
Date:   Tue Feb 5 17:33:49 2013 +

Resolves: rhbz#907933 crash on removing second last para in cell...

if (basically) the last para is on next page

so revert that and try a different fix which now works to keep the original
problem crash-free and fix this one too

(cherry picked from commit e22122e20ca69d0f2b0e8831e9ebf3afd2064329)

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

diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index bd42457..92da368 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -156,8 +156,6 @@ public:
 
 bool HasFollowFlowLine() const { return m_bHasFollowFlowLine; }
 void SetFollowFlowLine(bool bNew) { m_bHasFollowFlowLine = bNew; }
-//return the SwTabFrame (if any) that this SwTabFrame is a follow flow 
line for
-SwTabFrame* GetFollowFlowLineFor();
 
 bool IsRebuildLastLine() const { return m_bIsRebuildLastLine; }
 void SetRebuildLastLine(bool bNew) { m_bIsRebuildLastLine = bNew; }
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 422d64e..138fa1a 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -129,28 +129,8 @@ extern const SwTable   *g_pRowCacheLastTable;
 extern const SwTabFrame  *g_pRowCacheLastTabFrame;
 extern const SwFrame *g_pRowCacheLastCellFrame;
 
-//return the SwTabFrame (if any) that this SwTabFrame is a follow flow line for
-SwTabFrame* SwTabFrame::GetFollowFlowLineFor()
-{
-SwFlowFrame *pPrec = GetPrecede();
-if (pPrec && pPrec->GetFrame().IsTabFrame())
-{
-SwTabFrame *pPrevTabFrame = static_cast(pPrec);
-assert(this == pPrevTabFrame->GetFollow());
-if (pPrevTabFrame->HasFollowFlowLine() && pPrevTabFrame->GetFollow() 
== this)
-return pPrevTabFrame;
-}
-return nullptr;
-}
-
 void SwTabFrame::DestroyImpl()
 {
-//rhbz#907933, we are a follow flow line for something and have been
-//deleted, remove ourself as a follow flowline
-SwTabFrame* pFlowFrameFor = GetFollowFlowLineFor();
-if (pFlowFrameFor)
-pFlowFrameFor->RemoveFollowFlowLine();
-
 // There is some terrible code in fetab.cxx, that
 // makes use of these global pointers. Obviously
 // this code did not consider that a TabFrame can be
@@ -838,7 +818,8 @@ static long lcl_GetMaximumLayoutRowSpan( const SwRowFrame& 
rRow )
 bool SwTabFrame::RemoveFollowFlowLine()
 {
 // find FollowFlowLine
-SwRowFrame* pFollowFlowLine = 
static_cast(GetFollow()->GetFirstNonHeadlineRow());
+SwTabFrame *pFoll = GetFollow();
+SwRowFrame* pFollowFlowLine = pFoll ? pFoll->GetFirstNonHeadlineRow() : 
nullptr;
 
 // find last row in master
 SwFrame* pLastLine = GetLastLower();
@@ -1270,7 +1251,7 @@ bool SwTabFrame::Join()
 
 SwTabFrame *pFoll = GetFollow();
 
-if ( !pFoll->IsJoinLocked() )
+if (pFoll && !pFoll->IsJoinLocked())
 {
 SWRECTFN( this )
 pFoll->Cut();   //Cut out first to avoid unnecessary notifications.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-25 Thread Caolán McNamara
 sw/source/core/doc/CntntIdxStore.cxx |   19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

New commits:
commit 3583db525c118a4a2adea843698c9619cfd7f221
Author: Caolán McNamara 
Date:   Thu Jul 21 14:29:25 2016 +0100

Resolves: tdf#95340 orig lcl_ChkUnoCrsrPaM had reversed 'set' to lcl_ChkPaM

restore lcl_ChkUnoCrsrPaM

(cherry picked from commit 133ad42956ff38fe94020cd9aab316c9dfceff60)

update to new naming and casting

(cherry picked from commit dcae0b482ca78fc9cd6f8523f53aad8c8b486b0f)

bChkSelDirection is always false

(cherry picked from commit 12d9292cd948dbf78bdcab4a46694563b3cce3cf)

rename lcl_ChkUnoCrsrPaM and split it up to be like lcl_ChkPaM[Both]

(cherry picked from commit a3094a1f898b9efb765fe822fc507d3be4369361)

merge lcl_ChkUnoCrsrPaM and lcl_ChkPaM keeping the original logic,
turns out they differed in how they swapped the mark and point

(cherry picked from commit a58e46482c2af06ee9be26313db3513f906d6c0b)

Change-Id: Iab155151226f3a7f00ca649bd690c4391ade8a52
389efc2f45f3110932318882faea82ab8565f89a
1aaf2c17d76ac1d69dfcc268ae1b689c0f1c3fa2
8850031da3901fb3d828c3af20f98ca741fc2a4a
d2575c9690442494c3286a26ab099e8c4c62f884
Reviewed-on: https://gerrit.libreoffice.org/27382
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/doc/CntntIdxStore.cxx 
b/sw/source/core/doc/CntntIdxStore.cxx
index 5cb63da..d51b87a 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -187,19 +187,24 @@ namespace
 static inline void SetRightMarkPos(MarkBase* pMark, bool bOther, 
const SwPosition* const pPos)
 { bOther ? pMark->SetOtherMarkPos(*pPos) : 
pMark->SetMarkPos(*pPos); };
 };
-inline void lcl_ChkPaM( std::vector& rPaMEntries, const 
sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bPoint)
+inline void lcl_ChkPaM( std::vector& rPaMEntries, const 
sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bGetPoint, 
bool bSetMark)
 {
-const SwPosition* pPos = &rPaM.GetBound( bPoint );
+const SwPosition* pPos = &rPaM.GetBound(bGetPoint);
 if( pPos->nNode.GetIndex() == nNode && pPos->nContent.GetIndex() < 
nContent )
 {
-const PaMEntry aEntry = { &rPaM, bPoint, pPos->nContent.GetIndex() 
};
+const PaMEntry aEntry = { &rPaM, bSetMark, 
pPos->nContent.GetIndex() };
 rPaMEntries.push_back(aEntry);
 }
 }
 inline void lcl_ChkPaMBoth( std::vector& rPaMEntries, const 
sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM)
 {
-lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, true);
-lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, false);
+lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, true, true);
+lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, false, false);
+}
+inline void lcl_ChkUnoCrsrPaMBoth(std::vector& rPaMEntries, 
const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM)
+{
+lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, true, false);
+lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, false, true);
 }
 
 #if 0
@@ -386,14 +391,14 @@ void ContentIdxStoreImpl::SaveUnoCursors(SwDoc* pDoc, 
sal_uLong nNode, sal_Int32
 continue;
 for(SwPaM& rPaM : pUnoCursor.get()->GetRingContainer())
 {
-lcl_ChkPaMBoth( m_aUnoCursorEntries, nNode, nContent, rPaM);
+lcl_ChkUnoCrsrPaMBoth(m_aUnoCursorEntries, nNode, nContent, rPaM);
 }
 const SwUnoTableCursor* pUnoTableCursor = dynamic_cast(pUnoCursor.get());
 if( pUnoTableCursor )
 {
 for(SwPaM& rPaM : 
(&(const_cast(pUnoTableCursor))->GetSelRing())->GetRingContainer())
 {
-lcl_ChkPaMBoth( m_aUnoCursorEntries, nNode, nContent, rPaM);
+lcl_ChkUnoCrsrPaMBoth(m_aUnoCursorEntries, nNode, nContent, 
rPaM);
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-21 Thread Caolán McNamara
 sw/source/core/layout/flowfrm.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8f02c8042d0dd368b31b4245c1179a51c6f0b29f
Author: Caolán McNamara 
Date:   Thu Jul 21 08:57:04 2016 +0100

Related: tdf#100813 crash in this doc on scrolling past page 44

Change-Id: Ib9f1f6f43229ce29e7db7e3fcdacaa10fb692ca4
(cherry picked from commit e1b90609d50b9b8bb48e7c6548b197ed7de77253)
Reviewed-on: https://gerrit.libreoffice.org/27362
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 0f105c8..3f708e2 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -227,9 +227,9 @@ bool SwFlowFrame::IsKeep( const SwAttrSet& rAttrs, bool 
bCheckIfLastRowShouldKee
 {
 const SwAttrSet* pSet = nullptr;
 
-if ( pNxt->IsInTab() )
+SwTabFrame* pTab = pNxt->IsInTab() ? pNxt->FindTabFrame() 
: nullptr;
+if (pTab)
 {
-SwTabFrame* pTab = pNxt->FindTabFrame();
 if ( ! m_rThis.IsInTab() || m_rThis.FindTabFrame() != 
pTab )
 pSet = &pTab->GetFormat()->GetAttrSet();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-21 Thread Bjoern Michaelsen
 sw/source/uibase/app/apphdl.cxx |   66 +++-
 1 file changed, 39 insertions(+), 27 deletions(-)

New commits:
commit 56bba2d5e2de7693db3a523e951dc1852c870758
Author: Bjoern Michaelsen 
Date:   Thu Jul 21 09:52:11 2016 +0200

tdf#98798: MM Wizard should not leave MM toolbar visible when canceled

This remembers now the state of the MM toolbar before the MM wizard was
started and reset the visiblity of the toolbar to that state when
canceled.

Change-Id: I390feae3287c10d3d0c93dbfa64037229c5327e2
Reviewed-on: https://gerrit.libreoffice.org/27359
Reviewed-by: Jan Holesovsky 
Reviewed-by: Björn Michaelsen 
Tested-by: Björn Michaelsen 
(cherry picked from commit 20245ba9755e1c0199359c3462eff974f33c1bec)
Reviewed-on: https://gerrit.libreoffice.org/27370
Tested-by: Jenkins 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 3090ceb..ecfeb18 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -317,6 +317,7 @@ class SwMailMergeWizardExecutor : public 
salhelper::SimpleReferenceObject
 SwView*  m_pView;   // never owner
 SwView*  m_pView2Close; // never owner
 AbstractMailMergeWizard* m_pWizard; // always owner
+bool m_bDestroyMMToolbarOnCancel;
 
 DECL_LINK_TYPED( EndDialogHdl, Dialog&, void );
 DECL_LINK_TYPED( DestroyDialogHdl, void*, void );
@@ -337,7 +338,8 @@ public:
 SwMailMergeWizardExecutor::SwMailMergeWizardExecutor()
 : m_pView( nullptr ),
   m_pView2Close( nullptr ),
-  m_pWizard( nullptr )
+  m_pWizard( nullptr ),
+  m_bDestroyMMToolbarOnCancel( false )
 {
 }
 
@@ -443,6 +445,25 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( 
const SfxItemSet * pArgs
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
 m_pWizard = pFact->CreateMailMergeWizard(*m_pView, *pMMConfig);
 
+uno::Reference 
xPropSet(m_pView->GetViewFrame()->GetFrame().GetFrameInterface(), 
uno::UNO_QUERY);
+if (!xPropSet.is())
+return;
+
+uno::Reference xLayoutManager;
+uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
+aValue >>= xLayoutManager;
+if (!xLayoutManager.is())
+return;
+
+const OUString sResourceURL( "private:resource/toolbar/mailmerge" );
+uno::Reference xUIElement = 
xLayoutManager->getElement(sResourceURL);
+if (!xUIElement.is())
+{
+// ensure the mail-merge toolbar is displayed and remember if it was 
before
+m_bDestroyMMToolbarOnCancel = true;
+xLayoutManager->createElement(sResourceURL);
+xLayoutManager->showElement(sResourceURL);
+}
 ExecuteWizard();
 }
 
@@ -600,8 +621,23 @@ IMPL_LINK_NOARG_TYPED(SwMailMergeWizardExecutor, 
CancelHdl, void*, void)
 pMMConfig->SetTargetView(nullptr);
 }
 if (pMMConfig->GetSourceView())
-
pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().AppearWithUpdate();
-
+{
+auto pViewFrame(pMMConfig->GetSourceView()->GetViewFrame());
+pViewFrame->GetFrame().AppearWithUpdate();
+uno::Reference 
xPropSet(pViewFrame->GetFrame().GetFrameInterface(), uno::UNO_QUERY);
+if (xPropSet.is() && m_bDestroyMMToolbarOnCancel)
+{
+// hide mailmerge toolbar if it hasnt been there before
+uno::Reference xLayoutManager;
+uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
+aValue >>= xLayoutManager;
+if (xLayoutManager.is())
+{
+const OUString sResourceURL( 
"private:resource/toolbar/mailmerge" );
+xLayoutManager->destroyElement( sResourceURL );
+}
+}
+}
 pMMConfig->Commit();
 }
 
@@ -685,30 +721,6 @@ void SwModule::ExecOther(SfxRequest& rReq)
 // show the mailmerge wizard
 rtl::Reference< SwMailMergeWizardExecutor > xEx( new 
SwMailMergeWizardExecutor );
 xEx->ExecuteMailMergeWizard( pArgs );
-
-// show the mailmerge toolbar
-SwView* pView = ::GetActiveView();
-if (!pView)
-return;
-
-uno::Reference 
xPropSet(pView->GetViewFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY);
-if (!xPropSet.is())
-return;
-
-uno::Reference xLayoutManager;
-uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
-aValue >>= xLayoutManager;
-if (!xLayoutManager.is())
-return;
-
-const OUString sResourceURL( "private:resource/toolbar/mailmerge" 
);
-uno::Reference xUIElement = 
xLayoutManager->getElement(sResourceURL);
-if (!xUIElement.is())
-{
-// do the work, finally
-

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-15 Thread Caolán McNamara
 sw/source/core/crsr/findtxt.cxx |   48 +---
 1 file changed, 26 insertions(+), 22 deletions(-)

New commits:
commit e4f935f138d941f537227a344d4b93b05f951457
Author: Caolán McNamara 
Date:   Tue Jul 12 15:45:22 2016 +0100

Resolves: tdf#100538 make searching in shape text a libreoffice-kit only 
thing

This effectively reverts for the normal-app

commit bdc1824ea7acfa2fe9d71cdbe57882acce155577
Author: Miklos Vajna 
Date:   Tue May 19 17:20:10 2015 +0200

SwPaM::Find: search in shapes anchored to the range

The catches are that...

writer will use SvxSearchCmd::Find and not SvxSearchCmd::Replace when 
Replacing
text, and replacing it afterwards. So replace doesn't work. It might be 
possible
to mitigate that by passing down the m_bReplace to SwPam::Find and do a
SvxSearchCmd::Replace on the editeng SearchAndReplace in that case and then 
change
the return code to not-found/found-in-writer/found-in-drawing to figure out 
what
to do there.

regexps are disabled in the ui for draw/impress, maybe because they seem 
not be fully
implemented right wrt matching empty paragraphs, so using regexps in writer 
and
letting them into editeng via this loophole is new territory for the 
editengine

(cherry picked from commit 46b52c22bfb6b145af3c8407fd96321381e78d99)

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

diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 0011605..d37756f 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -343,33 +344,36 @@ bool SwPaM::Find( const SearchOptions2& rSearchOpt, bool 
bSearchInNotes , utl::T
 }
 }
 
-// Writer and editeng selections are not supported in parallel.
-SvxSearchItem* pSearchItem = SwView::GetSearchItem();
-// If we just finished search in shape text, don't attempt to do 
that again.
-if (!bEndedTextEdit && !(pSearchItem && pSearchItem->GetCommand() 
== SvxSearchCmd::FIND_ALL))
+if (comphelper::LibreOfficeKit::isActive())
 {
-// If there are any shapes anchored to this node, search there.
-SwPaM aPaM(pNode->GetDoc()->GetNodes().GetEndOfContent());
-aPaM.GetPoint()->nNode = rTextNode;
-
aPaM.GetPoint()->nContent.Assign(aPaM.GetPoint()->nNode.GetNode().GetTextNode(),
 nStart);
-aPaM.SetMark();
-aPaM.GetMark()->nNode = rTextNode.GetIndex() + 1;
-
aPaM.GetMark()->nContent.Assign(aPaM.GetMark()->nNode.GetNode().GetTextNode(), 
0);
-if 
(pNode->GetDoc()->getIDocumentDrawModelAccess().Search(aPaM, aSearchItem) && 
pSdrView)
+// Writer and editeng selections are not supported in parallel.
+SvxSearchItem* pSearchItem = SwView::GetSearchItem();
+// If we just finished search in shape text, don't attempt to 
do that again.
+if (!bEndedTextEdit && !(pSearchItem && 
pSearchItem->GetCommand() == SvxSearchCmd::FIND_ALL))
 {
-if (SdrObject* pObject = pSdrView->GetTextEditObject())
+// If there are any shapes anchored to this node, search 
there.
+SwPaM aPaM(pNode->GetDoc()->GetNodes().GetEndOfContent());
+aPaM.GetPoint()->nNode = rTextNode;
+
aPaM.GetPoint()->nContent.Assign(aPaM.GetPoint()->nNode.GetNode().GetTextNode(),
 nStart);
+aPaM.SetMark();
+aPaM.GetMark()->nNode = rTextNode.GetIndex() + 1;
+
aPaM.GetMark()->nContent.Assign(aPaM.GetMark()->nNode.GetNode().GetTextNode(), 
0);
+if 
(pNode->GetDoc()->getIDocumentDrawModelAccess().Search(aPaM, aSearchItem) && 
pSdrView)
 {
-if (SwFrameFormat* pFrameFormat = 
FindFrameFormat(pObject))
+if (SdrObject* pObject = pSdrView->GetTextEditObject())
 {
-const SwPosition* pPosition = 
pFrameFormat->GetAnchor().GetContentAnchor();
-if (pPosition)
+if (SwFrameFormat* pFrameFormat = 
FindFrameFormat(pObject))
 {
-// Set search position to the shape's anchor 
point.
-*GetPoint() = *pPosition;
-
GetPoint()->nContent.Assign(pPosition->nNode.GetNode().GetContentNode(), 0);
-SetMark();
-bFound = true;
-

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-15 Thread Caolán McNamara
 sw/source/core/layout/flowfrm.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit df89407a3827d5c1f0bf97490337d55660a8321d
Author: Caolán McNamara 
Date:   Fri Jul 8 16:09:36 2016 +0100

Resolves: tdf#100813 crash during pagination of particular docx

Change-Id: Id2c99cc6c5fe4c3a5bcf3c0b3f16b603cdd46239
(cherry picked from commit f374e01af32c7752b31455642e7d76f2056a2aeb)
Reviewed-on: https://gerrit.libreoffice.org/27050
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index dad6f97..0f105c8 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2017,6 +2017,9 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat )
 }
 
 SwFootnoteBossFrame * pOldBoss = m_rThis.FindFootnoteBossFrame();
+if (!pOldBoss)
+return false;
+
 SwPageFrame * const pOldPage = pOldBoss->FindPageFrame();
 SwLayoutFrame *pNewUpper = nullptr;
 bool bCheckPageDescs = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-14 Thread Justin Luth
 sw/source/filter/ww8/docxattributeoutput.cxx |   16 +++-
 sw/source/filter/ww8/docxattributeoutput.hxx |4 
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 620c00bf2279ccedf3fadefecc68186e25827b59
Author: Justin Luth 
Date:   Mon Jul 11 18:02:37 2016 +0300

tdf#99090 docx export page-break only inside a paragraph

If a paragraph hadn't been started yet, a w:r was being written directly in
the /document/body which caused MSWord to complain about a corrupt document.

Reviewed-on: https://gerrit.libreoffice.org/26771
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 07fb94655f4745eb4e80bf6e8d4cdd95371f23bb)

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1678188..9c1d832 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1065,6 +1065,16 @@ void DocxAttributeOutput::EndParagraphProperties(const 
SfxItemSet& rParagraphMar
 m_nColBreakStatus = COLBRK_NONE;
 }
 
+if ( m_bPostponedPageBreak )
+{
+m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
+m_pSerializer->singleElementNS( XML_w, XML_br,
+FSNS( XML_w, XML_type ), "page", FSEND );
+m_pSerializer->endElementNS( XML_w, XML_r );
+
+m_bPostponedPageBreak = false;
+}
+
 // merge the properties _before_ the run (strictly speaking, just
 // after the start of the paragraph)
 m_pSerializer->mergeTopMarks(Tag_StartParagraphProperties, 
sax_fastparser::MergeMarks::PREPEND);
@@ -5423,13 +5433,16 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, 
const WW8_SepInfo* pSectio
 m_pSectionInfo.reset( new WW8_SepInfo( *pSectionInfo ));
 }
 }
-else
+else if ( m_bParagraphOpened )
 {
 m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
 m_pSerializer->singleElementNS( XML_w, XML_br,
 FSNS( XML_w, XML_type ), "page", FSEND );
 m_pSerializer->endElementNS( XML_w, XML_r );
 }
+else
+m_bPostponedPageBreak = true;
+
 break;
 default:
 OSL_TRACE( "Unknown section break to write: %d", nC );
@@ -8462,6 +8475,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport 
&rExport, FSHelperPtr pSeri
   m_bAlternateContentChoiceOpen( false ),
   m_bPostponedProcessingFly( false ),
   m_nColBreakStatus( COLBRK_NONE ),
+  m_bPostponedPageBreak( false ),
   m_nTextFrameLevel( 0 ),
   m_closeHyperlinkInThisRun( false ),
   m_closeHyperlinkInPreviousRun( false ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index 1190d3a..41f9189 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -810,6 +810,10 @@ private:
 // beginning of the next paragraph
 DocxColBreakStatus m_nColBreakStatus;
 
+// Remember that a page break has to be opened at the
+// beginning of the next paragraph
+bool m_bPostponedPageBreak;
+
 std::vector m_aFramesOfParagraph;
 sal_Int32 m_nTextFrameLevel;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-07-13 Thread Justin Luth
 sw/source/core/layout/flowfrm.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 5647eb6f8ef5828ce14973a91946d5d7cdfeae30
Author: Justin Luth 
Date:   Sat Jun 11 10:30:18 2016 +0300

tdf#76349 writer: treat single-column break as page break

Writerfilter imports docx-defined column breaks that exist without
being in a column.  Word treats these as if they were a page break.
Writer basically just preserved and ignored them.

I limited the fix to only consider SVX_BREAK_COLUMN_BEFORE since
writerfilter is only given “column break” and treats it as 
column_before.

Change-Id: I0d974441d53243c4426048dd7cb60b3897b803f6
Reviewed-on: https://gerrit.libreoffice.org/26181
Tested-by: Justin Luth 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 272437706372eaac9bf1d748723196c573ac)
Reviewed-on: https://gerrit.libreoffice.org/26786
Reviewed-by: Justin Luth 
Tested-by: Jenkins 

diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 7946f5b..dad6f97 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1127,8 +1127,11 @@ bool SwFlowFrame::IsPageBreak( bool bAct ) const
 return false;
 }
 
+//for compatibility, also break at column break if no columns exist
 const SvxBreak eBreak = pSet->GetBreak().GetBreak();
-if ( eBreak == SVX_BREAK_PAGE_BEFORE || eBreak == 
SVX_BREAK_PAGE_BOTH )
+if ( eBreak == SVX_BREAK_PAGE_BEFORE ||
+ eBreak == SVX_BREAK_PAGE_BOTH ||
+ (eBreak == SVX_BREAK_COLUMN_BEFORE && 
!m_rThis.FindColFrame()) )
 return true;
 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-2' - sw/source

2016-06-29 Thread Michael Stahl
 sw/source/uibase/dbui/dbmgr.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 2d5ffa8635a2cd64b46f0f30a4adb6fb8181c08e
Author: Michael Stahl 
Date:   Mon Jun 27 17:28:05 2016 +0200

tdf#100495 sw: Exchange Database shouldn't delete the created odb file

(regression from f01f31201f9b26b3071ab25f9a5a3a0311ff7423)

Change-Id: Ie5b83a82711229bda045b7ef7a9167cfd873f616
(cherry picked from commit 5a042dad2779eefc76269e14b888bd84df590aac)
Reviewed-on: https://gerrit.libreoffice.org/26722
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index ea26ebc..be17f00 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2714,7 +2714,6 @@ OUString SwDBManager::LoadAndRegisterDataSource(const 
DBConnURITypes type, const
 // Cannot embed, as embedded data source would need the URL of 
the parent document.
 OUString sHomePath(SvtPathOptions().GetWorkPath());
 utl::TempFile aTempFile(sNewName, true, &sOutputExt, pDestDir 
? pDestDir : &sHomePath);
-aTempFile.EnableKillingFile();
 OUString sTmpName = aTempFile.GetURL();
 xStore->storeAsURL(sTmpName, 
uno::Sequence());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-24 Thread Michael Stahl
 sw/source/core/layout/pagechg.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c5320ed05f51482a37993420068e754223f08d5c
Author: Michael Stahl 
Date:   Thu Jun 23 22:17:49 2016 +0200

sw: fix STL asserts in lcl_MoveAllLowerObjs *again*

Comment added in cf91483690291272f48ff95c1aebd165da8ae4f0 evidently
insufficient.

(regression from b415494bf0468b74318b61f114e2ff4ae68c00ee)

Change-Id: I9a017aefc3a77b0760fcdc3b8e43ff7c6ac516ac
(cherry picked from commit e7d8cb3ec22906d5d45ba65e0a0cfccd68d202e8)
Reviewed-on: https://gerrit.libreoffice.org/26620
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/layout/pagechg.cxx 
b/sw/source/core/layout/pagechg.cxx
index c722da9..7ea39752 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1763,8 +1763,10 @@ static void lcl_MoveAllLowerObjs( SwFrame* pFrame, const 
Point& rOffset )
 
 // note: pSortedObj elements may be removed and inserted from
 // MoveObjectIfActive(), invalidating iterators
-for (SwAnchoredObject* pAnchoredObj : *pSortedObj)
+// DO NOT CONVERT THIS TO A C++11 FOR LOOP, IT DID NOT WORK THE LAST 2 
TIMES
+for (size_t i = 0; i < pSortedObj->size(); ++i)
 {
+SwAnchoredObject *const pAnchoredObj = (*pSortedObj)[i];
 const SwFrameFormat& rObjFormat = pAnchoredObj->GetFrameFormat();
 const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-23 Thread Miklos Vajna
 sw/source/uibase/dochdl/swdtflvr.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 91f2f71e7b936c3c9fb984aaa01d432926abb38f
Author: Miklos Vajna 
Date:   Thu Jun 16 16:50:11 2016 +0200

sw: fix crash on pasting from an already closed document

As pointed out by

.
Thanks to Michael Stahl for figuring out the list of steps to reproduce
this bug:

1) Create a new Writer document
2) Type some text
3) Select all
4) Copy it
5) Close the document
6) Create a second Writer document
7) Paste -> crash

(cherry picked from commit 1bc3c88bc9ed085bf7e173cb12f313934d92f309)

Change-Id: I8cfcad465803e37ec9d01d035428c5ca953adf14
Reviewed-on: https://gerrit.libreoffice.org/26613
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index ab8d5f4..e496d29 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3286,7 +3286,8 @@ bool SwTransferable::PrivatePaste( SwWrtShell& rShell )
 }
 
 bool bRet = true;
-if (lcl_checkClassification(m_pWrtShell->GetDoc(), rShell.GetDoc()))
+// m_pWrtShell is nullptr when the source document is closed already.
+if (!m_pWrtShell || lcl_checkClassification(m_pWrtShell->GetDoc(), 
rShell.GetDoc()))
 bRet = rShell.Paste(m_pClpDocFac->GetDoc());
 
 if( bKillPaMs )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-20 Thread Jan Holesovsky
 sw/source/core/doc/DocumentStatisticsManager.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4fabfb654bc65a564da1162f10f441efce167706
Author: Jan Holesovsky 
Date:   Mon Jun 20 10:15:23 2016 +0200

tdf#95797: Don't jump to the cursor position after auto-save.

Apparently the commit 07c7c88bc2d9d860ea92ab562ea0431ec1949b29 changed
the condition; I suppose that not deliberately.

Big thanks to raal for the bisect!

Change-Id: I775e133396ceb763e31aca101d365880652e1ac8

diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx 
b/sw/source/core/doc/DocumentStatisticsManager.cxx
index 81ed9f4..dfa6d1d 100644
--- a/sw/source/core/doc/DocumentStatisticsManager.cxx
+++ b/sw/source/core/doc/DocumentStatisticsManager.cxx
@@ -49,9 +49,9 @@ namespace
 {
 if (!m_pViewShell)
 return;
-for(SwViewShell& rShell : m_pViewShell->GetRingContainer())
+for (SwViewShell& rShell : m_pViewShell->GetRingContainer())
 {
-if(rShell.IsViewLocked())
+if (!rShell.IsViewLocked())
 {
 m_aViewWasUnLocked.push_back(&rShell);
 rShell.LockView(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-2' - sw/source

2016-06-16 Thread Caolán McNamara
 sw/source/uibase/app/apphdl.cxx |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit be42adb962f9bf66f353d16dadc984d265bf3560
Author: Caolán McNamara 
Date:   Thu Jun 16 14:17:42 2016 +0100

Resolves: tdf#100422 crash if you exit mail merge wizard...

after loading previous document or template

Change-Id: I3bdd1159e367b0297aee84763bf5c4312e9e91fa
(cherry picked from commit f04c48a7e764775bdd98715e5d17845f1786bd44)

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 8f93cdb4..9bc5ec1 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -592,16 +592,19 @@ IMPL_STATIC_LINK_TYPED(SwMailMergeWizardExecutor, 
DestroyWizardHdl, void*, pDial
 
 IMPL_LINK_NOARG_TYPED(SwMailMergeWizardExecutor, CancelHdl, void*, void)
 {
-SwMailMergeConfigItem* pMMConfig = m_pView->GetMailMergeConfigItem();
-if (pMMConfig->GetTargetView())
+if (SwMailMergeConfigItem* pMMConfig = m_pView->GetMailMergeConfigItem())
 {
-pMMConfig->GetTargetView()->GetViewFrame()->DoClose();
-pMMConfig->SetTargetView(nullptr);
+if (pMMConfig->GetTargetView())
+{
+pMMConfig->GetTargetView()->GetViewFrame()->DoClose();
+pMMConfig->SetTargetView(nullptr);
+}
+if (pMMConfig->GetSourceView())
+
pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().AppearWithUpdate();
+
+pMMConfig->Commit();
 }
-if (pMMConfig->GetSourceView())
-
pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().AppearWithUpdate();
 
-pMMConfig->Commit();
 delete m_pWizard;
 m_pWizard = nullptr;
 release();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-16 Thread Michael Stahl
 sw/source/ui/dbui/mmoutputtypepage.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0cfaabfc9457d15c819811a10deaf00eaef0e260
Author: Michael Stahl 
Date:   Wed Jun 15 23:17:50 2016 +0200

tdf#98797 sw: try to fix crash in SwMailDispatcherListener_Impl

Commit c48df7ad7d49ac093058ceb28d6d3f272f6e2e07 added a isDisposed()
call in SwMailDispatcherListener_Impl::idle() and i can't see why that
would not be necessary in the other functions that access
m_pSendMailDialog if it is necessary in idle() - it's not obvious *why*
it would be necessary in idle() in the first place but obviously i don't
understand when SwSendMailDialog::dispose() is invoked (which is what
deletes m_pStatus, dereferencing which the backtrace crashes).

There is code in SwSendMailDialog::dispose() to handle the case that the
xMailDispatcher thread is still running, and stop it without joining,
which would obviously trigger this crash if it were ever executed.

(Maybe i should actually try what happens at runtime, but these
mail-merge dialogs are all scarily confusing.)

Change-Id: I550f6107b064b0c97f3d33bed5bd3830fa2e86f4
(cherry picked from commit aa35f2981334ba2e5aed4269fe851054bbc584dc)
Reviewed-on: https://gerrit.libreoffice.org/26353
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx 
b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 5b7a4a7..0124992 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -182,7 +182,8 @@ void SwMailDispatcherListener_Impl::mailDelivered(
 uno::Reference< mail::XMailMessage> xMailMessage)
 {
 SolarMutexGuard aGuard;
-m_pSendMailDialog->DocumentSent( xMailMessage, true, nullptr );
+if (!m_pSendMailDialog->isDisposed())
+m_pSendMailDialog->DocumentSent( xMailMessage, true, nullptr );
 DeleteAttachments( xMailMessage );
 }
 
@@ -192,7 +193,8 @@ void SwMailDispatcherListener_Impl::mailDeliveryError(
 const OUString& sErrorMessage)
 {
 SolarMutexGuard aGuard;
-m_pSendMailDialog->DocumentSent( xMailMessage, false, &sErrorMessage );
+if (!m_pSendMailDialog->isDisposed())
+m_pSendMailDialog->DocumentSent( xMailMessage, false, &sErrorMessage );
 DeleteAttachments( xMailMessage );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-15 Thread Michael Stahl
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   45 +---
 1 file changed, 28 insertions(+), 17 deletions(-)

New commits:
commit 5c702a4b3a1ef14702b47c7d7c1c7129c7c97bfb
Author: Michael Stahl 
Date:   Wed Jun 15 00:09:15 2016 +0200

tdf#100275 sw: fix target node of bookmark copy

Replaces the defensive programming band-aid of
5c1a1d1c66aff497702abc20df5832fa348f1008 with a real fix.

The problem is that lcl_NonCopyCount() has some special case code
to ignore the first node in the target document, which erroneously is
executed for every bookmark, which results in the 2 bookmarks in the
bugdoc being created with nDelCount 1 and 2 so they land on the same
node, which is not allowed for cross-reference marks.

Extract the adjustment into a separate function that is called once.

(regression from 689962feae2054f965a7378c3408b0ccfad2bbd5)

Change-Id: Ie14c650f7fdb259c13cb9048226da30971d2ab3c
(cherry picked from commit bc387975b11d87868884ec770a2a42a4f7092b5f)
Reviewed-on: https://gerrit.libreoffice.org/26292
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index e5218f4..f15934d 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -122,6 +122,23 @@ namespace
 return false;
 }
 
+SwNodeIndex InitDelCount(SwPaM const& rSourcePaM, sal_uLong & rDelCount)
+{
+SwNodeIndex const& rStart(rSourcePaM.Start()->nNode);
+// Special handling for SwDoc::AppendDoc
+if (rSourcePaM.GetDoc()->GetNodes().GetEndOfExtras().GetIndex() + 1
+== rStart.GetIndex())
+{
+rDelCount = 1;
+return SwNodeIndex(rStart, +1);
+}
+else
+{
+rDelCount = 0;
+return SwNodeIndex(rStart);
+}
+}
+
 /*
 The lcl_CopyBookmarks function has to copy bookmarks from the source 
to the destination nodes
 array. It is called after a call of the CopyNodes(..) function. But 
this function does not copy
@@ -133,7 +150,6 @@ namespace
 of "non-copy" nodes between rPam.Start() and rLastIdx.
 nNewIdx is the new position of interest.
 */
-
 void lcl_NonCopyCount( const SwPaM& rPam, SwNodeIndex& rLastIdx, const 
sal_uLong nNewIdx, sal_uLong& rDelCount )
 {
 sal_uLong nStart = rPam.Start()->nNode.GetIndex();
@@ -141,18 +157,14 @@ namespace
 if( rLastIdx.GetIndex() < nNewIdx ) // Moving forward?
 {
 // We never copy the StartOfContent node
-// Special handling for SwDoc::AppendDoc
-if( rPam.GetDoc()->GetNodes().GetEndOfExtras().GetIndex() + 1 == 
nStart )
-{
-++rDelCount;
-++rLastIdx;
-}
 do // count "non-copy" nodes
 {
 SwNode& rNode = rLastIdx.GetNode();
 if( ( rNode.IsSectionNode() && rNode.EndOfSectionIndex() >= 
nEnd )
 || ( rNode.IsEndNode() && 
rNode.StartOfSectionNode()->GetIndex() < nStart ) )
+{
 ++rDelCount;
+}
 ++rLastIdx;
 }
 while( rLastIdx.GetIndex() < nNewIdx );
@@ -165,7 +177,9 @@ namespace
 SwNode& rNode = rLastIdx.GetNode();
 if( ( rNode.IsSectionNode() && rNode.EndOfSectionIndex() >= 
nEnd )
 || ( rNode.IsEndNode() && 
rNode.StartOfSectionNode()->GetIndex() < nStart ) )
+{
 --rDelCount;
+}
 rLastIdx--;
 }
 }
@@ -233,8 +247,8 @@ namespace
 }
 }
 // We have to count the "non-copied" nodes..
-SwNodeIndex aCorrIdx(rStt.nNode);
-sal_uLong nDelCount = 0;
+sal_uLong nDelCount;
+SwNodeIndex aCorrIdx(InitDelCount(rPam, nDelCount));
 for(mark_vector_t::const_iterator ppMark = vMarksToCopy.begin();
 ppMark != vMarksToCopy.end();
 ++ppMark)
@@ -254,12 +268,9 @@ namespace
 aTmpPam,
 pMark->GetName(),
 IDocumentMarkAccess::GetType(*pMark));
-if (pNewMark)
-{
-// Explicitly try to get exactly the same name as in the source
-// because NavigatorReminders, DdeBookmarks etc. ignore the 
proposed name
-pDestDoc->getIDocumentMarkAccess()->renameMark(pNewMark, 
pMark->GetName());
-}
+// Explicitly try to get exactly the same name as in the source
+// because NavigatorReminders, DdeBookmarks etc. ignore the 
proposed name
+pDestDoc->getIDocumentMarkAccess()->renameMark(pNewMark, 
pMark->GetName());
 
  

[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-14 Thread Stephan Bergmann
 sw/source/uibase/config/modcfg.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit abca482aebeb01d516816b543a07edc1dd178240
Author: Stephan Bergmann 
Date:   Wed Jun 15 08:38:46 2016 +0200

/org.openoffice.Office.Writer/FormLetter/MailingOutput/Format is xs:int

...i.e., sal_Int32.  Regression introduced with
ba9acdf799bf556c8a20b1dc27eb116e23d481db "convert TXTFORMAT constants to 
scoped
enum".  (The problem with storing a sal_uInt8 in an Any is that sal_uInt8 ==
sal_Bool, so actually a Boolean Any is constructed---and configmgr will 
throw an
exception when trying to set that value for the "Format" prop.  The problem 
with
extracting a sal_uInt8 from a sal_Int32 Any with getValue/static_cast is 
that
it doesn't even read (only) the low order bits, but on big endian machines 
reads
the high order bits.)

This is a backported version of 25a60d19d56a4bdb4f1b6ef27d842f90617fcff8
"/org.openoffice.Office.Writer/FormLetter/MailingOutput/Format is xs:int" 
which
uses o3tl::doAccess newly introduced on master.

Change-Id: I654da713bbf78b3215de7a09056a5172fc204258
Reviewed-on: https://gerrit.libreoffice.org/26285
Reviewed-by: Stephan Bergmann 
Tested-by: Stephan Bergmann 

diff --git a/sw/source/uibase/config/modcfg.cxx 
b/sw/source/uibase/config/modcfg.cxx
index 418df87..d50018b 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -1249,7 +1249,7 @@ void SwMiscConfig::ImplCommit()
 case 3 : pValues[nProp] <<= bGrfToGalleryAsLnk; break;
 case 4 : pValues[nProp] <<= bNumAlignSize; break;
 case 5 : pValues[nProp] <<= bSinglePrintJob; break;
-case 6 : pValues[nProp] <<= 
static_cast(nMailingFormats); break;
+case 6 : pValues[nProp] <<= 
static_cast(nMailingFormats); break;
 case 7 : pValues[nProp] <<= sNameFromColumn;  break;
 case 8 : pValues[nProp] <<= sMailingPath; break;
 case 9 : pValues[nProp] <<= sMailName;break;
@@ -1281,7 +1281,13 @@ void SwMiscConfig::Load()
 case 3 : bGrfToGalleryAsLnk = *static_cast(pValues[nProp].getValue()); break;
 case 4 : bNumAlignSize = *static_cast(pValues[nProp].getValue()); break;
 case 5 : bSinglePrintJob = *static_cast(pValues[nProp].getValue()); break;
-case 6 : nMailingFormats = 
static_cast(*static_cast(pValues[nProp].getValue())); break;
+case 6 :
+{
+sal_Int32 n = 0;
+pValues[nProp] >>= n;
+nMailingFormats = static_cast(n);
+break;
+}
 case 7 : pValues[nProp] >>= sTmp; sNameFromColumn = sTmp; 
break;
 case 8 : pValues[nProp] >>= sTmp; sMailingPath = sTmp;  break;
 case 9 : pValues[nProp] >>= sTmp; sMailName = sTmp; break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-09 Thread Michael Stahl
 sw/source/core/layout/frmtool.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 905e38c7c6c02ec618b9231545c45debba3a8a44
Author: Michael Stahl 
Date:   Thu Jun 9 15:52:16 2016 +0200

tdf#96089 sw: fix scope of bBreakAfter in InsertCnt_()

The problem is that bBreakAfter is passed by reference to SwLayHelper
and stored as a reference member there, so it has to live at least as
long as pPageMaker.  (Unfortunately C++ can't statically check that.)

This then somehow caused the number of pages created after initial load
to be 812 instead of the correct 396 determined from the layout-cache in
the bugdoc, and that then caused Drawing objects to move backward during
the following re-pagination, and then SwDrawContact::Changed_() calls
SetFlyFrmAttr() and that sets the document to modified, which triggers the
AutoSave that was reported in the bug.

(regression from b4b7703e4335460cf48bfd6440f116359994c8ff)

Change-Id: I14dc4644c2e127b3c3ff0e6876eedcc534e1a68e
(cherry picked from commit c488214817516c13603deb1c180fef02f4c700bf)
Reviewed-on: https://gerrit.libreoffice.org/26120
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 4cfcdf7..70c1409 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1246,6 +1246,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
 SwPageFrame *pPage = pLay->FindPageFrame();
 const SwFrameFormats *pTable = pDoc->GetSpzFrameFormats();
 SwFrame   *pFrame = nullptr;
+bool bBreakAfter = false;
 SwActualSection *pActualSection = nullptr;
 SwLayHelper *pPageMaker;
 
@@ -1256,7 +1257,6 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
 {
 // Attention: the SwLayHelper class uses references to the content-,
 // page-, layout-frame etc. and may change them!
-bool   bBreakAfter   = false;
 pPageMaker = new SwLayHelper( pDoc, pFrame, pPrv, pPage, pLay,
 pActualSection, bBreakAfter, nIndex, 0 == nEndIndex );
 if( bStartPercent )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-07 Thread Rodolfo Ribeiro Gomes
 sw/source/uibase/shells/tabsh.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 0006c15d8a496b7544beb09ba4de6bde866c13b0
Author: Rodolfo Ribeiro Gomes 
Date:   Sun May 8 12:05:58 2016 -0300

tdf#34362 Setting table border from toolbar resets "spacing to content"

Change-Id: Iec51c02ab389015d268849aa0dda870c11323f46
Signed-off-by: Rodolfo Ribeiro Gomes 
Reviewed-on: https://gerrit.libreoffice.org/24764
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
(cherry picked from commit ea7de7b2d3dc62b2ae73c2184398b227f8a85890)
Reviewed-on: https://gerrit.libreoffice.org/25982
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index ef4d98a..aee1703 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -480,10 +481,12 @@ void SwTableShell::Execute(SfxRequest &rReq)
 if ( pArgs->GetItemState(RES_BOX, true, &pBoxItem) == 
SfxItemState::SET )
 {
 aBox = *static_cast(pBoxItem);
+sal_uInt16 nDefValue = MIN_BORDER_DIST;
 if ( !rReq.IsAPI() )
-aBox.SetDistance( 
std::max(rCoreBox.GetDistance(),sal_uInt16(55)) );
-else if ( aBox.GetDistance() < MIN_BORDER_DIST )
-aBox.SetDistance( 
std::max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST)  );
+nDefValue = 55;
+if ( !rReq.IsAPI() || aBox.GetDistance() < MIN_BORDER_DIST )
+for( SvxBoxItemLine k : o3tl::enumrange() )
+aBox.SetDistance( std::max(rCoreBox.GetDistance(k), 
nDefValue) , k );
 }
 else
 OSL_ENSURE( false, "where is BoxItem?" );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-06-07 Thread Stephan Bergmann
 sw/source/core/unocore/unofield.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 69ad547bf476a54326d772f2b6b832ad78eed486
Author: Stephan Bergmann 
Date:   Mon May 30 11:19:37 2016 +0200

Fix tools/date.hxx Date vs. css::uno::Date mismatch

...that was there ever since at least 
84a3db80b4fd66c6854b3135b5f69b61fd828e62
"initial import".  None of the "make check" code appears to trigger this 
code
path.

Change-Id: Ic85b2ef4cf0a0ad06b467558e823cfa4ee31a08c
(cherry picked from commit 46a987fe08c6f7d20da437eed621d670ce44aea7)
Reviewed-on: https://gerrit.libreoffice.org/25980
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 

diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index beea48c..89e5f17 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2459,7 +2459,7 @@ throw (beans::UnknownPropertyException, 
lang::WrappedTargetException,
 aRet <<= m_pImpl->m_pProps->bBool4;
 break;
 case FIELD_PROP_DATE :
-aRet.setValue(&m_pImpl->m_pProps->aDate, 
::cppu::UnoType::get());
+aRet <<= m_pImpl->m_pProps->aDate.GetUNODate();
 break;
 case FIELD_PROP_USHORT1:
 aRet <<= static_cast(m_pImpl->m_pProps->nUSHORT1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-05-31 Thread Stephan Bergmann
 sw/source/uibase/dbui/dbmgr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f3c9fb7397715b1b6137a03ba4e4082752eb8685
Author: Stephan Bergmann 
Date:   Tue May 31 11:24:17 2016 +0200

Don't use pInsert after it has been moved

Regression introduced with 38ea2d0ecc1d59844f9371ae6da7980c4e3a9e10 "sw: 
replace
boost::ptr_vector with std::vector".

Change-Id: I15f556319693c4728812d5ffd5002d0eba58ae82
(cherry picked from commit 9d8184b34e9e4c53f93e4d44ac53590e9231c520)
Reviewed-on: https://gerrit.libreoffice.org/25709
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 74c2a72..ea26ebc 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -497,7 +497,7 @@ bool SwDBManager::Merge( const SwMergeDescriptor& 
rMergeDesc, vcl::Window* pPare
 m_DataSourceParams.push_back(std::move(pInsert));
 try
 {
-uno::Reference 
xComponent(pInsert->xConnection, uno::UNO_QUERY);
+uno::Reference 
xComponent(m_DataSourceParams.back()->xConnection, uno::UNO_QUERY);
 if(xComponent.is())
 
xComponent->addEventListener(pImpl->m_xDisposeListener.get());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-05-30 Thread Justin Luth
 sw/source/uibase/docvw/AnnotationWin.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8038cab377a5ac726cf38f5f95bc987063b95de5
Author: Justin Luth 
Date:   Mon May 30 07:10:25 2016 +0300

tdf#99870 writer: don't delete selection with delete-comment

When using the keyboard to select text and then deleting a comment,
all the text between the cursor and the comment would also be deleted.
(Not necessarily the selected text, but everything
from the point or the mark would be included in the delete.)

Change-Id: Id15a00d112d118227bc4a34b5102bb09d8d167b0
Reviewed-on: https://gerrit.libreoffice.org/25216
Reviewed-by: Justin Luth 
Tested-by: Jenkins 
(cherry picked from commit 12868914a39b0e8fb32f63d1307c1bb1c535fb9c)
Reviewed-on: https://gerrit.libreoffice.org/25652
Tested-by: Justin Luth 

diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 8c03679..17bc48e 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -158,6 +158,7 @@ void SwAnnotationWin::Delete()
 SwSidebarWin::Delete();
 // we delete the field directly, the Mgr cleans up the PostIt by 
listening
 GrabFocusToDocument();
+DocView().GetWrtShellPtr()->ClearMark();
 DocView().GetWrtShellPtr()->DelRight();
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-05-26 Thread Caolán McNamara
 sw/source/ui/dbui/createaddresslistdialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 14b709d879c5f5d602e841b0ea51e4f303f96b92
Author: Caolán McNamara 
Date:   Thu May 26 10:25:23 2016 +0100

VclPtr in container warnings

Change-Id: I653aad3a88438faa985466e091e22be1c23ca953
(cherry picked from commit 60041cb237ea73c2c1885dd6afd99d88780c2dfc)
Reviewed-on: https://gerrit.libreoffice.org/25519
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx 
b/sw/source/ui/dbui/createaddresslistdialog.cxx
index b54d9e3..af68791 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -51,7 +51,7 @@ class SwAddressControl_Impl : public Control
 
 std::vector >   m_aFixedTexts;
 std::vector >m_aEdits;
-std::mapm_aEditLines;
+std::mapm_aEditLines;
 
 SwCSVData*  m_pData;
 Sizem_aWinOutputSize;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

2016-05-26 Thread Miklos Vajna
 sw/source/uibase/inc/wrtsh.hxx   |4 ++--
 sw/source/uibase/uno/unotxvw.cxx |   12 
 sw/source/uibase/wrtsh/move.cxx  |8 
 3 files changed, 10 insertions(+), 14 deletions(-)

New commits:
commit de9ae2ffab45bf6a2ddb2dcba961591bd9b693da
Author: Miklos Vajna 
Date:   Wed May 25 14:23:55 2016 +0200

tdf#100051 Partially revert "loplugin:constantparam in sw"

This partially reverts commit 9585c8b8c8d8724cc1bad4a2060c828c15599929.
Instead of removing the nCount parameters, make use of them in
SwXTextViewCursor::go{Left,Right,Down,Up}.

For the following testcase: a document with 1000 lines, and calling
goDown(1000, true) the spent time goes from 4 secs to 1.8 secs with this
for me.

(cherry picked from commit cbe78f817da8db78d226b3ad2b1a10d0c2dcf188)

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

diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 5a36e7e..0f8ccda 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -191,8 +191,8 @@ typedef bool (SwWrtShell:: *FNSimpleMove)();
 sal_uInt16 nCount, bool bBasicCall, bool bVisual = 
false );
 bool Right  ( sal_uInt16 nMode, bool bSelect,
 sal_uInt16 nCount, bool bBasicCall, bool bVisual = 
false );
-bool Up ( bool bSelect, bool bBasicCall = false );
-bool Down   ( bool bSelect, bool bBasicCall = false );
+bool Up ( bool bSelect, sal_uInt16 nCount = 1, bool bBasicCall = 
false );
+bool Down   ( bool bSelect, sal_uInt16 nCount = 1, bool bBasicCall = 
false );
 void NxtWrd ( bool bSelect = false ) { SimpleMove( 
&SwWrtShell::NxtWrd_, bSelect ); }
 bool PrvWrd ( bool bSelect = false ) { return SimpleMove( 
&SwWrtShell::PrvWrd_, bSelect ); }
 
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 2eb2f50..ecbb9df 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -1000,8 +1000,7 @@ sal_Bool SwXTextViewCursor::goLeft(sal_Int16 nCount, 
sal_Bool bExpand)
 if (!IsTextSelection())
 throw  uno::RuntimeException("no text selection", static_cast < 
cppu::OWeakObject * > ( this ) );
 
-for( sal_uInt16 i = 0; i < nCount; i++ )
-bRet = m_pView->GetWrtShell().Left( CRSR_SKIP_CHARS, bExpand, 1, 
true );
+bRet = m_pView->GetWrtShell().Left( CRSR_SKIP_CHARS, bExpand, nCount, 
true );
 }
 else
 throw uno::RuntimeException();
@@ -1018,8 +1017,7 @@ sal_Bool SwXTextViewCursor::goRight(sal_Int16 nCount, 
sal_Bool bExpand)
 if (!IsTextSelection())
 throw  uno::RuntimeException("no text selection", static_cast < 
cppu::OWeakObject * > ( this ) );
 
-for( sal_uInt16 i = 0; i < nCount; i++ )
-bRet = m_pView->GetWrtShell().Right( CRSR_SKIP_CHARS, bExpand, 1, 
true );
+bRet = m_pView->GetWrtShell().Right( CRSR_SKIP_CHARS, bExpand, nCount, 
true );
 }
 else
 throw uno::RuntimeException();
@@ -1616,8 +1614,7 @@ sal_Bool SwXTextViewCursor::goDown(sal_Int16 nCount, 
sal_Bool bExpand)
 if (!IsTextSelection())
 throw  uno::RuntimeException("no text selection", static_cast < 
cppu::OWeakObject * > ( this ) );
 
-for( sal_uInt16 i = 0; i < nCount; i++ )
-bRet = m_pView->GetWrtShell().Down( bExpand, true );
+bRet = m_pView->GetWrtShell().Down( bExpand, nCount, true );
 }
 else
 throw uno::RuntimeException();
@@ -1634,8 +1631,7 @@ sal_Bool SwXTextViewCursor::goUp(sal_Int16 nCount, 
sal_Bool bExpand)
 if (!IsTextSelection())
 throw  uno::RuntimeException("no text selection", static_cast < 
cppu::OWeakObject * > ( this ) );
 
-for( sal_uInt16 i = 0; i < nCount; i++ )
-bRet = m_pView->GetWrtShell().Up( bExpand, true );
+bRet = m_pView->GetWrtShell().Up( bExpand, nCount, true );
 }
 else
 throw uno::RuntimeException();
diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx
index 81b9c7a..7125044 100644
--- a/sw/source/uibase/wrtsh/move.cxx
+++ b/sw/source/uibase/wrtsh/move.cxx
@@ -127,7 +127,7 @@ bool SwWrtShell::Right( sal_uInt16 nMode, bool bSelect,
 }
 }
 
-bool SwWrtShell::Up( bool bSelect, bool bBasicCall )
+bool SwWrtShell::Up( bool bSelect, sal_uInt16 nCount, bool bBasicCall )
 {
 if ( !bSelect && !bBasicCall && IsCursorReadonly()  && 
!GetViewOptions()->IsSelectionInReadonly())
 {
@@ -138,10 +138,10 @@ bool SwWrtShell::Up( bool bSelect, bool bBasicCall )
 }
 
 ShellMoveCursor aTmp( this, bSelect );
-return SwCursorShell::Up();
+return SwCursorShell::Up(nCount);
 }
 
-bool SwWrtShell::Down( bool bSelect, bool bBasicCall )
+bool SwWrtShell::Down( bool bSe