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

2016-09-08 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 0ac170beb986997d57fd14c7dcdfff8f46820699
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/28690
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/unocore/unosett.cxx 
b/sw/source/core/unocore/unosett.cxx
index b3a5571..da269dc 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1678,7 +1678,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 c927575..6648513 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -989,7 +989,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:
@@ -1004,9 +1004,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-1' - 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 94a3b4db75ca042ae0e134c8d497d1759f36270b
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/28591
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 b5690e8..551c839 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -1562,16 +1562,16 @@ static Writer& OutCSS1_SwFormat( Writer& rWrt, const 
SwFormat& rFormat,
 switch( nDeep )
 {
 case CSS1_FMT_ISTAG:
-pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
>getIDocumentStylePoolAccess() );
+pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pTemplate == 
nullptr ? nullptr : >getIDocumentStylePoolAccess() );
 break;
 case CSS1_FMT_CMPREF:
 pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pDoc );
-pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
>getIDocumentStylePoolAccess() );
+pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
pTemplate == nullptr ? nullptr : >getIDocumentStylePoolAccess() );
 bClearSame = false;
 break;
 default:
 pRefFormat = SwHTMLWriter::GetParentFormat( rFormat, nDeep );
-pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
>getIDocumentStylePoolAccess() );
+pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, 
pTemplate == nullptr ? nullptr : >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-1' - 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 a7b4f0efb90417922bfed3fc257ea7d02500c444
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/28549
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index fa8a26a..af609db 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-1' - sw/source

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

New commits:
commit 299f223295913a60fed33f9adb08a15f4f83a6d3
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/28244
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index e0c6b2b..9da5e76 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-1' - sw/source

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

New commits:
commit be1cd0aded725d307ee9b53529c1122655b2a391
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/27361
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 8420956..8773940 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -224,9 +224,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 = >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-1' - sw/source

2016-07-12 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 28ded9c98837d6b6eefff73f396353b61b6b4017
Author: Justin Luth 
Date:   Mon Jul 11 18:07:32 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/27121
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5638632..df4f658 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1045,6 +1045,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);
@@ -5395,13 +5405,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 );
@@ -8446,6 +8459,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport 
, 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 4089d29..0b2d4ad 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-1' - sw/source

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

New commits:
commit f2dcce9155ddd9444f65b26c59c3b873ac603091
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/27051
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 850fc4e303..8420956 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2010,6 +2010,9 @@ bool SwFlowFrame::MoveBwd( bool  )
 }
 
 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-1' - sw/source

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

New commits:
commit f1dc76532638a5093b878919a3c7dd3aa5d22f09
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/26723
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 bfe28a3..abcf707 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2698,7 +2698,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, , pDestDir 
? pDestDir : );
-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-1' - sw/source

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

New commits:
commit f1951c97001ea95bc22fef66ede1f771231c33d3
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)

(cherry picked from commit bc387975b11d87868884ec770a2a42a4f7092b5f)

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

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 7894515..3c80048 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -121,6 +121,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
@@ -132,7 +149,6 @@ namespace
 of "non-copy" nodes between rPam.Start() and rLastIdx.
 nNewIdx is the new position of interest.
 */
-
 static void lcl_NonCopyCount( const SwPaM& rPam, SwNodeIndex& rLastIdx, 
const sal_uLong nNewIdx, sal_uLong& rDelCount )
 {
 sal_uLong nStart = rPam.Start()->nNode.GetIndex();
@@ -140,18 +156,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 );
@@ -164,7 +176,9 @@ namespace
 SwNode& rNode = rLastIdx.GetNode();
 if( ( rNode.IsSectionNode() && rNode.EndOfSectionIndex() >= 
nEnd )
 || ( rNode.IsEndNode() && 
rNode.StartOfSectionNode()->GetIndex() < nStart ) )
+{
 --rDelCount;
+}
 rLastIdx--;
 }
 }
@@ -232,8 +246,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)
@@ -253,12 +267,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, 

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

2016-06-16 Thread Oliver Specht
 sw/source/uibase/dbui/dbmgr.cxx |   26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

New commits:
commit 00a988896755dd9066d62892d38da0efe769493c
Author: Oliver Specht 
Date:   Tue Feb 2 12:59:17 2016 +0100

tdf#97501: crash in SwDBManager fixed

copy the connections to a temp container and iterate that because
disposing connections changes the data source params container

Change-Id: I06c59a19a6bcf97a541b32481d1d2a63f5c34032
Reviewed-on: https://gerrit.libreoffice.org/22027
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 
(cherry picked from commit 4426c20cf308f3bf7a2d3b33f9996687113c22e3)
Reviewed-on: https://gerrit.libreoffice.org/26304
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 df14930..bfe28a3 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -788,20 +788,26 @@ SwDBManager::SwDBManager(SwDoc* pDoc)
 
 SwDBManager::~SwDBManager()
 {
+// copy required, m_DataSourceParams can be modifed while disposing 
components
+std::vector aCopiedConnections;
 for (auto & pParam : m_DataSourceParams)
 {
 if(pParam->xConnection.is())
 {
-try
-{
-uno::Reference xComp(pParam->xConnection, 
uno::UNO_QUERY);
-if(xComp.is())
-xComp->dispose();
-}
-catch(const uno::RuntimeException&)
-{
-//may be disposed already since multiple entries may have used 
the same connection
-}
+aCopiedConnections.push_back(pParam->xConnection);
+}
+}
+for (auto & xConnection : aCopiedConnections)
+{
+try
+{
+uno::Reference xComp(xConnection, 
uno::UNO_QUERY);
+if(xComp.is())
+xComp->dispose();
+}
+catch(const uno::RuntimeException&)
+{
+//may be disposed already since multiple entries may have used the 
same connection
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 53b97fd4d058ac36b20555b843a8194b6128e4e3
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 
(cherry picked from commit abca482aebeb01d516816b543a07edc1dd178240)
Reviewed-on: https://gerrit.libreoffice.org/26286
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/config/modcfg.cxx 
b/sw/source/uibase/config/modcfg.cxx
index 2e40ba7..f0c8185 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -1250,7 +1250,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;
@@ -1282,7 +1282,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-1' - sw/source

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

New commits:
commit 63c693a09f9fc816c8d392d82855fab6f561392c
Author: Caolán McNamara 
Date:   Fri Jun 10 14:56:54 2016 +0100

Resolves: tdf#100275 makeMark may return null under some circumstances

Change-Id: If3b83413c028c6cd1c055e632b6f050ec7f2475d
(cherry picked from commit 5c1a1d1c66aff497702abc20df5832fa348f1008)
(cherry picked from commit 61a98b7bb14986f6c7c218effacabbe4b925f6b6)
Reviewed-on: https://gerrit.libreoffice.org/26166
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 2138bf3e6..7894515 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -253,9 +253,12 @@ namespace
 aTmpPam,
 pMark->GetName(),
 IDocumentMarkAccess::GetType(*pMark));
-// 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());
+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());
+}
 
 // copying additional attributes for bookmarks or fieldmarks
 ::sw::mark::IBookmark* const pNewBookmark =
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - 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 95ed42cc9f9cd40503ca609f1bcad31c5298889b
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/26121
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 8033f04..aac8960 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1248,6 +1248,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;
 
@@ -1258,7 +1259,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-1' - sw/source

2016-06-06 Thread Caolán McNamara
 sw/source/core/text/porfld.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a7d4185bad915b51c23e8e5e40fbaa528852face
Author: Caolán McNamara 
Date:   Tue Mar 15 21:06:21 2016 +

crashtesting: Resolves: tdf#91291 crash on inserting text into footnote

(cherry picked from commit 367f13fd584d5b67cbc3a7787892f12655a65d6c)

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

diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 01026dc..63b6756 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -375,7 +375,8 @@ bool SwFieldPortion::Format( SwTextFormatInfo  )
 
 // These characters should not be contained in the follow
 // field portion. They are handled via the HookChar mechanism.
-switch( aNew[0] )
+const sal_Unicode nNew = !aNew.isEmpty() ? aNew[0] : 0;
+switch (nNew)
 {
 case CH_BREAK  : bFull = true;
 // no 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-1' - 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 1290680ae6044bc8cc9e7c25f7bb62416336a0ae
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/25710
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 f86a5ee..df14930 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -437,7 +437,7 @@ bool SwDBManager::MergeNew( const SwMergeDescriptor& 
rMergeDesc, vcl::Window* pP
 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-1' - sw/source

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

New commits:
commit 2a5fe37dfc48bfddc4fd4e47c1034fd76d53ba84
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/25651
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

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-1' - sw/source

2016-05-26 Thread Miklos Vajna
 sw/source/uibase/uno/unotxvw.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 360c8458eee259eb8ca46da395621c7ec48a49ba
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)

Conflicts:
sw/source/uibase/inc/wrtsh.hxx
sw/source/uibase/uno/unotxvw.cxx
sw/source/uibase/wrtsh/move.cxx

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

diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 1c61342..c83fd07 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -1006,8 +1006,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();
@@ -1024,8 +1023,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();
@@ -1620,8 +1618,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, 1, true );
+bRet = m_pView->GetWrtShell().Down( bExpand, nCount, true );
 }
 else
 throw uno::RuntimeException();
@@ -1638,8 +1635,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, 1, true );
+bRet = m_pView->GetWrtShell().Up( bExpand, nCount, true );
 }
 else
 throw uno::RuntimeException();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-26 Thread Caolán McNamara
 sw/source/uibase/inc/inputwin.hxx|2 +-
 sw/source/uibase/ribbar/inputwin.cxx |9 ++---
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 97d0e7be1ad95adcd13fff507885047bdcd54d82
Author: Caolán McNamara 
Date:   Wed May 25 11:53:34 2016 +0100

Resolves: tdf#96244 get the right Writer window view for Formula window

if you hit F1 and F2 together, then the help window is a writer window
too (in disguise) so asking for the "active view" on processing the F2
in the real writer will get the help window as the active view, which
doesn't match expectations.

Take the view from the bindings, where its correct from when the event
has been dispatched.

Investigating a bit further, the F2 formula window only works correctly
when its in an "active" window. So get the correct view from the dispatcher
but only accept that view if its the active one.

Change-Id: I2fd52ca6b68e887d34b07b70b830722f1d00b37a
(cherry picked from commit 77e7dc648ebb8b7d946111e2be4dfdbba72840b2)
Reviewed-on: https://gerrit.libreoffice.org/25446
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/inc/inputwin.hxx 
b/sw/source/uibase/inc/inputwin.hxx
index 97fc259..606ec48 100644
--- a/sw/source/uibase/inc/inputwin.hxx
+++ b/sw/source/uibase/inc/inputwin.hxx
@@ -79,7 +79,7 @@ protected:
 voidCancelFormula();
 
 public:
-SwInputWindow( vcl::Window* pParent );
+SwInputWindow(vcl::Window* pParent, SfxDispatcher* pDispatcher);
 virtual ~SwInputWindow();
 virtual voiddispose() override;
 
diff --git a/sw/source/uibase/ribbar/inputwin.cxx 
b/sw/source/uibase/ribbar/inputwin.cxx
index 178be93..5acc97b 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -56,7 +56,7 @@
 
 SFX_IMPL_POS_CHILDWINDOW_WITHID( SwInputChild, FN_EDIT_FORMULA, 
SFX_OBJECTBAR_OBJECT )
 
-SwInputWindow::SwInputWindow( vcl::Window* pParent )
+SwInputWindow::SwInputWindow(vcl::Window* pParent, SfxDispatcher* pDispatcher)
 : ToolBox(  pParent ,   SW_RES( RID_TBX_FORMULA )),
 aPos(   VclPtr::Create(this,   SW_RES(ED_POS))),
 aEdit(  VclPtr::Create(this, 
WB_3DLOOK|WB_TABSTOP|WB_BORDER|WB_NOHIDESELECTION)),
@@ -79,7 +79,10 @@ SwInputWindow::SwInputWindow( vcl::Window* pParent )
 SfxImageManager* pManager = SfxImageManager::GetImageManager( *SW_MOD() );
 pManager->RegisterToolBox(this);
 
-pView = ::GetActiveView();
+SwView *pDispatcherView = dynamic_cast(pDispatcher ? 
pDispatcher->GetFrame()->GetViewShell() : nullptr);
+SwView* pActiveView = ::GetActiveView();
+if (pDispatcherView == pActiveView)
+pView = pActiveView;
 pWrtShell = pView ? pView->GetWrtShellPtr() : nullptr;
 
 InsertWindow( ED_POS, aPos.get(), ToolBoxItemBits::NONE, 0);
@@ -620,7 +623,7 @@ SwInputChild::SwInputChild(vcl::Window* _pParent,
 SfxChildWindow( _pParent, nId )
 {
 pDispatch = pBindings->GetDispatcher();
-SetWindow( VclPtr::Create( _pParent ) );
+SetWindow(VclPtr::Create(_pParent, pDispatch));
 static_cast(GetWindow())->ShowWin();
 SetAlignment(SfxChildAlignment::LOWESTTOP);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-17 Thread Michael Stahl
 sw/source/core/access/accframe.hxx |3 ++-
 sw/source/core/access/accmap.cxx   |   15 +++
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit dc5ab01a75877d4f4c79b7ff734d3f41a232c31f
Author: Michael Stahl 
Date:   Fri May 13 15:46:10 2016 +0200

tdf#99722 sw: avoid buffering a11y events for not-visible frames

The problem with the bugdoc is that all pages are moved by 60 twips or
so in CheckViewLayout(), which generates a event for every SwTextFrame
but there is no SwAccessible for the SwTextFrame yet hence it is a
CHILD_POS_CHANGE on the parent, which happens to be (because SwPageFrames
are not accessible) the SwRootFrame so that's how we get an enormous number
(~90k per 500 pages) WeakReference in the buffered
SwAccessibleEvent_Impl pointing to the same object (the SwAccessible of
the root frame).

Then at a later stage the events are actually sent and
SwAccessibleContext::InvalidateChildPosOrSize() discards all but 80 or
so that are on the first page.

So check the visiblility before buffering the event, to avoid
scalability issues in the WeakReference.

This brings the cpu-time from 1:37 to 0:17 for the 500 pager, and the
full bugdoc is now just 3-4 seconds slower than with a11y disabled.

Change-Id: Ia91653fd7572f32ce3cf765a4ecd2b7077ace8f6
(cherry picked from commit 6afa142fdecc3a7f2f182bcd2c035bf3089f1ce8)
Reviewed-on: https://gerrit.libreoffice.org/24979
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/access/accframe.hxx 
b/sw/source/core/access/accframe.hxx
index 55d9e24..7685c59 100644
--- a/sw/source/core/access/accframe.hxx
+++ b/sw/source/core/access/accframe.hxx
@@ -76,16 +76,17 @@ protected:
  ::std::list< sw::access::SwAccessibleChild >& 
rChildren,
  bool bInPagePreview );
 
-protected:
 bool IsEditable( SwViewShell *pVSh ) const;
 
 bool IsOpaque( SwViewShell *pVSh ) const;
 
+public:
 bool IsShowing( const SwAccessibleMap& rAccMap,
 const sw::access::SwAccessibleChild& rFrameOrObj ) 
const;
 inline bool IsShowing( const SwRect& rFrame ) const;
 inline bool IsShowing( const SwAccessibleMap& rAccMap ) const;
 
+protected:
 inline bool IsInPagePreview() const
 {
 return mbIsInPagePreview;
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 8f6c9da..ed9ec9d 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2437,10 +2437,17 @@ void SwAccessibleMap::InvalidatePosOrSize( const 
SwFrame *pFrame,
 {
 if( GetShell()->ActionPend() )
 {
-SwAccessibleEvent_Impl aEvent(
-SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
-xParentAccImpl.get(), aFrameOrObj, rOldBox );
-AppendEvent( aEvent );
+assert(pParent);
+// tdf#99722 faster not to buffer events that won't be sent
+if (!SwAccessibleChild(pParent).IsVisibleChildrenOnly()
+|| xParentAccImpl->IsShowing(rOldBox)
+|| xParentAccImpl->IsShowing(*this, aFrameOrObj))
+{
+SwAccessibleEvent_Impl aEvent(
+SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
+xParentAccImpl.get(), aFrameOrObj, rOldBox );
+AppendEvent( aEvent );
+}
 }
 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-1' - sw/source

2016-05-15 Thread Michael Weghorn
 sw/source/filter/ww8/ww8atr.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit d19b0fd3525aefd1c7d1b8b6564c77ede4e2
Author: Michael Weghorn 
Date:   Sat May 14 17:16:12 2016 +0200

tdf#99699 Do nullptr check BEFORE calling method

This fixes a segmentation fault accidently introduced with
commit a1fb4ac1991a8da2e527b64a0a01a88a8f2959e3.

Change-Id: I244e325934db22e1bffd03486cc5e84f539101f2
Reviewed-on: https://gerrit.libreoffice.org/24994
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 
(cherry picked from commit adc0ced6533449f33473db560b8ba27d4bd326f9)
Reviewed-on: https://gerrit.libreoffice.org/25001
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 9523b92..ca7e895 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -852,9 +852,10 @@ bool MSWordExportBase::HasRefToObject( sal_uInt16 nTyp, 
const OUString* pName, s
 SwIterator aFormatFields( *pType );
 for ( SwFormatField* pFormatField = aFormatFields.First(); pFormatField; 
pFormatField = aFormatFields.Next() )
 {
-const SwTextNode* pNd = pFormatField->GetTextField()->GetpTextNode();
+const SwTextNode* pNd;
 if ( pFormatField->GetTextField() && nTyp == 
pFormatField->GetField()->GetSubType() &&
- nullptr != pNd && pNd->GetNodes().IsDocNodes() )
+ nullptr != ( pNd  = pFormatField->GetTextField()->GetpTextNode() 
) &&
+ pNd->GetNodes().IsDocNodes() )
 {
 const SwGetRefField& rRField = *static_cast< SwGetRefField* >( 
pFormatField->GetField() );
 switch ( nTyp )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 812233147c8b09b59eeb212663727a9063c7c9c6
Author: Michael Stahl 
Date:   Thu May 12 18:55:13 2016 +0200

tdf#99722 sw: silly performance issue when firing a11y events

SwAccessibleEventList_Impl::MoveInvalidXAccToEnd() pointlessly copies every
single element when iterating over the list and then deletes the copy again
(which is expensive due to the WeakReference member).

This speeds up loading the first 500 pages of the bugdoc from 4:20 to
1:37 in a Linux dbgutil build.

(regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba)

Change-Id: I7c7299e5e82095f5a51f395bc5076ca899b59f81
(cherry picked from commit e3b990a47fc4b0b1191eb15a53badfc71aebc1fc)
Reviewed-on: https://gerrit.libreoffice.org/24978
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 817bdfd..8f6c9da 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -526,17 +526,12 @@ void SwAccessibleEventList_Impl::MoveInvalidXAccToEnd()
 return;
 }
 SwAccessibleEventList_Impl lstEvent;
-iterator li = begin();
-for ( ;li != end();)
+for (iterator li = begin(); li != end(); )
 {
-SwAccessibleEvent_Impl e = *li;
-if (e.IsNoXaccParentFrame())
+if (li->IsNoXaccParentFrame())
 {
-iterator liNext = li;
-++liNext;
-erase(li);
-li = liNext;
-lstEvent.insert(lstEvent.end(),e);
+lstEvent.insert(lstEvent.end(), *li);
+li = erase(li);
 }
 else
 ++li;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-13 Thread Caolán McNamara
 sw/source/uibase/docvw/SidebarWin.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit c767b5534eaea688138a49653f51df7bc321181e
Author: Caolán McNamara 
Date:   Fri May 13 13:37:02 2016 +0100

Resolves: tdf#99692 crash in SwPostItMgr with change tracking

and annotations

presumably since the original

commit 0761f81643a6890457e9ef7d913ab5c88c2593a4
Author: Oliver-Rainer Wittmann 
Date:   Thu Dec 19 18:50:58 2013 +

- rely annotations on text ranges on new annotation marks
- support arbitrary text ranges for annotations
- fix undo/redo regarding annotations an text ranges
- support annotations on overlapping text ranges
- fix *.docx import for annotations on overlapping text ranges
- fix ODF import of annotations on text ranges

Change-Id: If2aa4ba74f03d0af11def55c2bd299211b3d5d77
(cherry picked from commit 833029e751432e9e736c4f38f23654511d26e8f9)
Reviewed-on: https://gerrit.libreoffice.org/24964
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sw/source/uibase/docvw/SidebarWin.cxx 
b/sw/source/uibase/docvw/SidebarWin.cxx
index c0ec62d1..400a464 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -891,12 +891,15 @@ void SwSidebarWin::SetPosAndSize()
 {
 const SwTextAnnotationField* pTextAnnotationField =
 dynamic_cast< const SwTextAnnotationField* >( 
mrSidebarItem.GetFormatField().GetTextField() );
-if ( pTextAnnotationField != nullptr
- && pTextAnnotationField->GetpTextNode() != nullptr )
+SwTextNode* pTextNode = pTextAnnotationField ? 
pTextAnnotationField->GetpTextNode() : nullptr;
+SwContentNode* pContentNd = nullptr;
+if (pTextNode)
 {
-SwTextNode* pTextNode = pTextAnnotationField->GetpTextNode();
 SwNodes& rNds = pTextNode->GetDoc()->GetNodes();
-SwContentNode* const pContentNd = 
rNds[mrSidebarItem.maLayoutInfo.mnStartNodeIdx]->GetContentNode();
+pContentNd = 
rNds[mrSidebarItem.maLayoutInfo.mnStartNodeIdx]->GetContentNode();
+}
+if (pContentNd)
+{
 SwPosition aStartPos( *pContentNd, 
mrSidebarItem.maLayoutInfo.mnStartContent );
 SwShellCursor* pTmpCursor = nullptr;
 const bool bTableCursorNeeded = 
pTextNode->FindTableBoxStartNode() != pContentNd->FindTableBoxStartNode();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-13 Thread Stephan Bergmann
 sw/source/core/layout/fly.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 02af67f6e43fa86e7e6faed7eaec4178396e36a3
Author: Stephan Bergmann 
Date:   Wed May 11 16:14:24 2016 +0200

Missing break in switch

caused by c2ea2e6ca99395cc6d9ea8f2edf009252dc87957 "coverity#704901 
Dereference
after null check"

Change-Id: I7e53493bcb2857ccc840429cd2fd2e802180aa19
(cherry picked from commit 838994da2af5f069654456dc86c5ffbc4322c37c)
Reviewed-on: https://gerrit.libreoffice.org/24920
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 57c7d1d..5bb29a5 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -820,8 +820,8 @@ void SwFlyFrame::_UpdateAttr( const SfxPoolItem *pOld, 
const SfxPoolItem *pNew,
 if ( FrameSizeChg( rNew ) )
 NotifyDrawObj();
 rInvFlags |= 0x1A;
-break;
 }
+break;
 
 case RES_FRM_SIZE:
 case RES_FMT_CHG:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-10 Thread Oliver Specht
 sw/source/core/crsr/swcrsr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a7435316873335b2d637abff93ffabc9451b5379
Author: Oliver Specht 
Date:   Thu Mar 3 08:56:50 2016 +0100

tdf#98224: endless loop in replace all stopped

If a drawing in the document contains the search text then the selection of 
that
object removes a selection (SwShellCursor) that marks the end of the search.
This is now fixed for that special case.
Replacing text in drawing doesn't work - as before and also not all
occurrences of the searched text are found.

Reviewed-on: https://gerrit.libreoffice.org/22851
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 
(cherry picked from commit 83dccbadc2c6caa804039199915d4a8c1f3f2d5a)

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

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index dfba8e3..6d759be 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -850,7 +850,7 @@ static sal_uLong lcl_FindSelection( SwFindParas& rParas, 
SwCursor* pCurrentCurso
 pPHdl->NextPos( ++pPHdl->nActPos );
 }
 
-} while( pTmpCursor != pSaveCursor );
+} while( pTmpCursor != pSaveCursor && pTmpCursor->GetNext() != pTmpCursor);
 
 if( nFound && !pFndRing ) // if no ring should be created
 pFndRing = pCurrentCursor->Create();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-05 Thread Michael Stahl
 sw/source/filter/html/htmlform.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit e26463e647c10a4db0612747f914a132f398dfb6
Author: Michael Stahl 
Date:   Tue May 3 14:35:32 2016 +0200

sw: HTML filter: avoid turning on Undo with ridiculous hacks

SwHTMLParser::SetControlSize() loads a "hidden document" into the same
model (!) that is currently being imported (!), just so it can get a
awt::XControl from the ViewShell; unfortunately creating the ViewShell
happens to enable Undo too, so turn that off again.

This avoids triggering the assert in SwRegHistory::InsertItems() on
kde122884-1.html

Change-Id: I3d8fcd5c43bcb8e7ed8775710acbc2d40f2ffdd0
(cherry picked from commit 2ce95e838260ed1e7e64ac8f5662aa2e2234ab9e)
Reviewed-on: https://gerrit.libreoffice.org/24665
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/html/htmlform.cxx 
b/sw/source/filter/html/htmlform.cxx
index 94794a7..9d48671 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -62,6 +62,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -665,6 +666,8 @@ void SwHTMLParser::SetControlSize( const uno::Reference< 
drawing::XShape >& rSha
 m_pTempViewFrame = SfxViewFrame::LoadHiddenDocument( *pDocSh, 0 );
 CallStartAction();
 pVSh = m_pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
+// this ridiculous hack also enables Undo, so turn it off again
+m_pDoc->GetIDocumentUndoRedo().DoUndo(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-1' - sw/source

2016-05-04 Thread Michael Stahl
 sw/source/ui/fldui/flddb.cxx   |8 
 sw/source/ui/fldui/flddb.hxx   |2 +-
 sw/source/ui/fldui/flddinf.cxx |   12 +++-
 sw/source/ui/fldui/flddinf.hxx |2 +-
 sw/source/ui/fldui/flddok.cxx  |8 
 sw/source/ui/fldui/flddok.hxx  |2 +-
 sw/source/ui/fldui/fldfunc.cxx |8 
 sw/source/ui/fldui/fldfunc.hxx |2 +-
 sw/source/ui/fldui/fldpage.cxx |5 +++--
 sw/source/ui/fldui/fldpage.hxx |2 +-
 sw/source/ui/fldui/fldref.cxx  |8 
 sw/source/ui/fldui/fldref.hxx  |2 +-
 sw/source/ui/fldui/fldtdlg.cxx |4 ++--
 sw/source/ui/fldui/fldvar.cxx  |8 
 sw/source/ui/fldui/fldvar.hxx  |2 +-
 15 files changed, 39 insertions(+), 36 deletions(-)

New commits:
commit 7c4fe800c2b4f5150ff7193a45710304bcdf25f0
Author: Michael Stahl 
Date:   Fri Apr 29 16:36:25 2016 +0200

sw: try to survive restoring a field dialog without SfxObjectShell

The SFX will apparently restore the field dialog on startup if it was
open on the last shutdown.  Since i don't know how to disable this
useless "feature", let's fudge things a bit so we don't crash
immediately.

Change-Id: I2c401440374d055774fdc8fcbd79a1262c42da0b
(cherry picked from commit bf47fef3a87d8546f18a36ade4e85f7c6ecf993b)
Reviewed-on: https://gerrit.libreoffice.org/24614
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 45fe095..f3ddc96 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -33,9 +33,9 @@
 #define USER_DATA_VERSION_1 "1"
 #define USER_DATA_VERSION USER_DATA_VERSION_1
 
-SwFieldDBPage::SwFieldDBPage(vcl::Window* pParent, const SfxItemSet& rCoreSet)
+SwFieldDBPage::SwFieldDBPage(vcl::Window* pParent, const SfxItemSet *const 
pCoreSet)
 : SwFieldPage(pParent, "FieldDbPage",
-"modules/swriter/ui/flddbpage.ui", rCoreSet)
+"modules/swriter/ui/flddbpage.ui", pCoreSet)
 , m_nOldFormat(0)
 , m_nOldSubType(0)
 {
@@ -265,9 +265,9 @@ bool SwFieldDBPage::FillItemSet(SfxItemSet* )
 }
 
 VclPtr SwFieldDBPage::Create( vcl::Window* pParent,
-const SfxItemSet* rAttrSet )
+const SfxItemSet *const pAttrSet )
 {
-return VclPtr::Create( pParent, *rAttrSet );
+return VclPtr::Create( pParent, pAttrSet );
 }
 
 sal_uInt16 SwFieldDBPage::GetGroup()
diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx
index 6fcf77e..dc63561 100644
--- a/sw/source/ui/fldui/flddb.hxx
+++ b/sw/source/ui/fldui/flddb.hxx
@@ -69,7 +69,7 @@ protected:
 virtual sal_uInt16  GetGroup() override;
 
 public:
-SwFieldDBPage(vcl::Window* pParent, const SfxItemSet& 
rSet);
+SwFieldDBPage(vcl::Window* pParent, const SfxItemSet* 
rSet);
 
 virtual ~SwFieldDBPage();
 virtual voiddispose() override;
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 58ea657..b47988f 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -47,9 +47,9 @@
 using namespace nsSwDocInfoSubType;
 using namespace com::sun::star;
 
-SwFieldDokInfPage::SwFieldDokInfPage(vcl::Window* pParent, const SfxItemSet& 
rCoreSet)
+SwFieldDokInfPage::SwFieldDokInfPage(vcl::Window* pParent, const SfxItemSet 
*const pCoreSet)
 :  SwFieldPage(pParent, "FieldDocInfoPage",
-"modules/swriter/ui/flddocinfopage.ui", rCoreSet)
+"modules/swriter/ui/flddocinfopage.ui", pCoreSet)
 , pSelEntry(nullptr)
 , nOldSel(0)
 , nOldFormat(0)
@@ -82,7 +82,9 @@ SwFieldDokInfPage::SwFieldDokInfPage(vcl::Window* pParent, 
const SfxItemSet& rCo
 //enable 'active' language selection
 m_pFormatLB->SetShowLanguageControl(true);
 
-const SfxUnoAnyItem* pItem = rCoreSet.GetItem(SID_DOCINFO, 
false);
+const SfxUnoAnyItem* pItem = (pCoreSet)
+? pCoreSet->GetItem(SID_DOCINFO, false)
+: nullptr;
 if ( pItem )
 pItem->GetValue() >>= xCustomPropertySet;
 }
@@ -459,9 +461,9 @@ bool SwFieldDokInfPage::FillItemSet(SfxItemSet* )
 }
 
 VclPtr SwFieldDokInfPage::Create( vcl::Window* pParent,
-const SfxItemSet* rAttrSet )
+const SfxItemSet *const pAttrSet)
 {
-return VclPtr::Create( pParent, *rAttrSet );
+return VclPtr::Create( pParent, pAttrSet );
 }
 
 sal_uInt16 SwFieldDokInfPage::GetGroup()
diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx
index a15fcbc..f90394c 100644
--- a/sw/source/ui/fldui/flddinf.hxx
+++ b/sw/source/ui/fldui/flddinf.hxx
@@ -59,7 +59,7 @@ protected:
 virtual sal_uInt16  GetGroup() override;
 
 public:
-SwFieldDokInfPage(vcl::Window* pWindow, const 
SfxItemSet& rSet);
+ 

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

2016-05-04 Thread Michael Stahl
 sw/source/ui/fldui/fldvar.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fbd90c27e5cfe112f0cf6f1e318fdc51410da237
Author: Michael Stahl 
Date:   Fri Apr 29 16:48:45 2016 +0200

sw: SwFieldVarPage: disable "Insert" button on "Input field"...

... if no variable name is selected.  It doesn't work in this case.

Change-Id: I36745806bcfc688b54b1ec49d0376b05bb5bbea6
(cherry picked from commit 6d81c777232f3abeb3b05f89ad37f266d65eabbb)
Reviewed-on: https://gerrit.libreoffice.org/24615
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index 81e38b8..08e9733 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -939,7 +939,7 @@ IMPL_LINK_NOARG_TYPED(SwFieldVarPage, ModifyHdl, Edit&, 
void)
 bInsert = false;
 }
 
-if( !nLen && ( nTypeId == TYP_SETFLD ||
+if (!nLen && (nTypeId == TYP_SETFLD || nTypeId == TYP_INPUTFLD ||
 (!IsFieldEdit() && nTypeId == TYP_GETFLD ) ) )
 bInsert = 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-1' - sw/source

2016-05-04 Thread Michael Stahl
 sw/source/uibase/fldui/fldmgr.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 03d46490d753bdeaaa7685c9bb01c75e090cb939
Author: Michael Stahl 
Date:   Tue May 3 11:39:37 2016 +0200

tdf#99529 sw: don't pop up input field dialog before inserting field

The dialog calls SwEditShell::UpdateFields(), so if there is already
a existing field at the current cursor position it will be "updated"
before the new field is inserted.

Change-Id: I8ddbbe00534950759781a1ce8d0dca0376663462
(cherry picked from commit 39d719a80d8c87856c84e3ecd569d45fa6f8a30e)
Reviewed-on: https://gerrit.libreoffice.org/24613
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index 1386ba2..0825bbc 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -1192,9 +1192,6 @@ bool SwFieldMgr::InsertField(
 new SwInputField( pTyp, rData.m_sPar1, rData.m_sPar2, 
nSubType|nsSwExtendedSubType::SUB_INVISIBLE, nFormatId);
 pField = pInpField;
 }
-
-// start dialog
-pCurShell->StartInputFieldDlg(pField, false, rData.m_pParent);
 break;
 }
 
@@ -1336,6 +1333,14 @@ bool SwFieldMgr::InsertField(
 
 pCurShell->Insert( *pField );
 
+if (TYP_INPUTFLD == rData.m_nTypeId)
+{
+// start dialog, not before the field is inserted tdf#99529
+pCurShell->Left(CRSR_SKIP_CHARS,
+false, (INP_VAR == (nSubType & 0xff)) ? 1 : 2, false );
+pCurShell->StartInputFieldDlg(pField, false, rData.m_pParent);
+}
+
 if(bExp && bEvalExp)
 pCurShell->UpdateExpFields(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-1' - sw/source

2016-04-28 Thread Michael Stahl
 sw/source/core/layout/frmtool.cxx |   51 +++---
 1 file changed, 37 insertions(+), 14 deletions(-)

New commits:
commit ec1a2322b862468621ce45500d74dac252bf1714
Author: Michael Stahl 
Date:   Fri Apr 22 18:09:39 2016 +0200

tdf#99460 sw: layout: don't split table before fly

First the table is formatted properly and then the following paragraph
is formatted, along with its anchored objects.
The Fly frame is aligned to the bottom of the page by
SwAnchoredObjectPosition::_AdjustVerRelPos() without checking for any
overlap, and thus overlaps the table.
Then SwFlyNotify and Notify_Background() invalidate the table's PrtArea,
and the table responds by splitting numerous times, until finally there
is a page where the table does not overlap with the fly any more.
Instead of the table splitting, the paragraph with the Fly anchored to
it should move to the next page; suppressing the table invalidation in
Notify_Background() appears to achieve that.

Change-Id: If65879f1756856bda344e0ef8fbffbc33e80f3ec
Reviewed-on: https://gerrit.libreoffice.org/24307
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
(cherry picked from commit e1fc96df40cb758399ca3b6e74660f381ef16916)
Reviewed-on: https://gerrit.libreoffice.org/24441
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 34b6af6..8033f04 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2960,37 +2960,60 @@ void Notify_Background( const SdrObject* pObj,
 }
 SwFrame *pLastTab = nullptr;
 
+bool isValidTableBeforeAnchor(false);
 while ( pCnt && pArea && pArea->IsAnLower( pCnt ) )
 {
 ::lcl_NotifyContent( pObj, pCnt, rRect, eHint );
 if ( pCnt->IsInTab() )
 {
-SwLayoutFrame* pCell = pCnt->GetUpper();
-// #i40606# - use 
-// instead of , because a recalculation
-// of the bounding rectangle isn't intended here.
-if ( pCell->IsCellFrame() &&
- ( pCell->Frame().IsOver( pObj->GetLastBoundRect() ) ||
-   pCell->Frame().IsOver( rRect ) ) )
-{
-const SwFormatVertOrient  = 
pCell->GetFormat()->GetVertOrient();
-if ( text::VertOrientation::NONE != rOri.GetVertOrient() )
-pCell->InvalidatePrt();
-}
 SwTabFrame *pTab = pCnt->FindTabFrame();
 if ( pTab != pLastTab )
 {
 pLastTab = pTab;
+isValidTableBeforeAnchor = false;
+if (PREP_FLY_ARRIVE == eHint
+&& pFlyFrame // TODO: do it for draw objects too?
+&& pTab->IsFollow() // table starts on previous page?
+// "through" means they will actually overlap anyway
+&& SURROUND_THROUGHT != 
pFlyFrame->GetFormat()->GetSurround().GetSurround()
+// if it's anchored in footer it can't move to other page
+&& !pAnchor->FindFooterOrHeader())
+{
+SwFrame * pTmp(pAnchor->GetPrev());
+while (pTmp)
+{
+if (pTmp == pTab)
+{
+// tdf#99460 the table shouldn't be moved by the 
fly
+isValidTableBeforeAnchor = true;
+break;
+}
+pTmp = pTmp->GetPrev();
+}
+}
 // #i40606# - use 
 // instead of , because a recalculation
 // of the bounding rectangle isn't intended here.
-if ( pTab->Frame().IsOver( pObj->GetLastBoundRect() ) ||
- pTab->Frame().IsOver( rRect ) )
+if (!isValidTableBeforeAnchor
+&& (pTab->Frame().IsOver(pObj->GetLastBoundRect()) ||
+pTab->Frame().IsOver(rRect)))
 {
 if ( !pFlyFrame || !pFlyFrame->IsLowerOf( pTab ) )
 pTab->InvalidatePrt();
 }
 }
+SwLayoutFrame* pCell = pCnt->GetUpper();
+// #i40606# - use 
+// instead of , because a recalculation
+// of the bounding rectangle isn't intended here.
+if (!isValidTableBeforeAnchor && pCell->IsCellFrame() &&
+ ( pCell->Frame().IsOver( pObj->GetLastBoundRect() ) ||
+   pCell->Frame().IsOver( rRect ) ) )
+{
+const SwFormatVertOrient  = 

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

2016-04-26 Thread Stephan Bergmann
 sw/source/core/edit/autofmt.cxx   |   14 ++
 sw/source/core/inc/sectfrm.hxx|   12 
 sw/source/core/text/inftxt.cxx|   12 +---
 sw/source/core/text/inftxt.hxx|6 --
 sw/source/core/text/redlnitr.cxx  |6 --
 sw/source/core/text/redlnitr.hxx  |   29 -
 sw/source/uibase/uiview/view0.cxx |3 ++-
 7 files changed, 57 insertions(+), 25 deletions(-)

New commits:
commit 0d3b42f59f7fe83ac029410555252d1be4c24897
Author: Stephan Bergmann 
Date:   Thu Jan 14 15:05:31 2016 +0100

-Werror=misleading-indentation (GCC 6)

Change-Id: I5c5f38789e7001aa04a0a5481feb9f033e53748e
(cherry picked from commit 57e0ab0c3a82ad4a957ea97c15f8672fad4a1880)
Signed-off-by: David Tardon 
Reviewed-on: https://gerrit.libreoffice.org/24412
Tested-by: Jenkins 

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 3db4de00..35ad056 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -221,10 +221,16 @@ class SwAutoFormat
 bool DoTable();
 
 void _SetRedlineText( sal_uInt16 nId );
-bool SetRedlineText( sal_uInt16 nId )
-{ if( m_aFlags.bWithRedlining )   _SetRedlineText( nId );  return 
true; }
-bool ClearRedlineText()
-{ if( m_aFlags.bWithRedlining )   
m_pDoc->GetDocumentRedlineManager().SetAutoFormatRedlineComment(nullptr);  
return true; }
+bool SetRedlineText( sal_uInt16 nId ) {
+if( m_aFlags.bWithRedlining )
+_SetRedlineText( nId );
+return true;
+}
+bool ClearRedlineText() {
+if( m_aFlags.bWithRedlining )
+
m_pDoc->GetDocumentRedlineManager().SetAutoFormatRedlineComment(nullptr);
+return true;
+}
 
 public:
 SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags& rFlags,
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index 395f18c..4184cb7 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -110,8 +110,10 @@ public:
  * if bCheckFollow is set.
  */
 bool ToMaximize( bool bCheckFollow ) const;
-inline bool _ToMaximize() const
-{ if( !m_pSection ) return false; return ToMaximize( false ); }
+inline bool _ToMaximize() const {
+if( !m_pSection ) return false;
+return ToMaximize( false );
+}
 bool MoveAllowed( const SwFrame* ) const;
 bool CalcMinDiff( SwTwips& rMinDiff ) const;
 
@@ -136,8 +138,10 @@ public:
 
 void InvalidateFootnotePos();
 void CollectEndnotes( SwLayouter* pLayouter );
-const SwSectionFormat* GetEndSectFormat() const
-{ if( IsEndnAtEnd() ) return _GetEndSectFormat(); return nullptr; }
+const SwSectionFormat* GetEndSectFormat() const {
+if( IsEndnAtEnd() ) return _GetEndSectFormat();
+return nullptr;
+}
 
 static void MoveContentAndDelete( SwSectionFrame* pDel, bool bSave );
 
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 38d1e75..9c768ae 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1258,9 +1258,15 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion 
,
 bDraw = true;
 }
 break;
-case POR_TAB:   if ( GetOpt().IsTab() ) bDraw = true; break;
-case POR_SOFTHYPH:  if ( GetOpt().IsSoftHyph() )bDraw = true; break;
-case POR_BLANK: if ( GetOpt().IsHardBlank())bDraw = true; break;
+case POR_TAB:
+if ( GetOpt().IsTab() ) bDraw = true;
+break;
+case POR_SOFTHYPH:
+if ( GetOpt().IsSoftHyph() )bDraw = true;
+break;
+case POR_BLANK:
+if ( GetOpt().IsHardBlank())bDraw = true;
+break;
 default:
 {
 OSL_ENSURE( false, "SwTextPaintInfo::DrawViewOpt: don't know 
how to draw this" );
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index e1f3666..d95dc82 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -254,8 +254,10 @@ public:
 
 inline const  SwViewOption () const { return *m_pOpt; }
 inline const OUString () const { return *m_pText; }
-inline sal_Unicode GetChar( const sal_Int32 nPos ) const
-{ if (m_pText && nPos < m_pText->getLength()) return (*m_pText)[ nPos ]; 
return 0; }
+inline sal_Unicode GetChar( const sal_Int32 nPos ) const {
+if (m_pText && nPos < m_pText->getLength()) return (*m_pText)[ nPos ];
+return 0;
+}
 
 sal_uInt16  GetTextHeight() const;
 
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index d0f798e..bc174da 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -104,9 +104,11 @@ void SwAttrIter::CtorInitAttrIter( SwTextNode& rTextNode, 

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

2016-04-19 Thread Oliver Specht
 sw/source/core/doc/doclay.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3b997090fb95957164d92d845bdb7cd7d15c5acf
Author: Oliver Specht 
Date:   Tue Dec 1 16:19:24 2015 +0100

tdf#88443:percent value fixed

Change-Id: I221f07b930fa1f152b9bf379aa966c02b936abb2
(cherry picked from commit 9ae2d9ff4be259ad60bbb10a7488e38ca4eefc11)

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 9aa4b4a..a9d6835 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -837,7 +837,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const 
pTextFormatCollTable,
 isMath = ( SotExchange::IsMath( aCLSID ) != 0 );
 }
 }
-aFrameSize.SetWidthPercent(isMath ? 0 : 1000);
+aFrameSize.SetWidthPercent(isMath ? 0 : 100);
 aFrameSize.SetHeightPercent(SwFormatFrameSize::SYNCED);
 pNewSet->Put( aFrameSize );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-19 Thread Oliver Specht
 sw/source/core/doc/doclay.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 42ddef789587c5b5bbe7314b53d82642865652ae
Author: Oliver Specht 
Date:   Tue Dec 1 10:01:32 2015 +0100

tdf#88443: set relative width to objects with captions except formulas

a fix to aoo issue 51453 switched off relative with to all objects
with captions to solve a problem related to formulas
now all objects with captions get relative width except math formulas

Change-Id: I39ccc292ff156c4c94a7a898a6a0602c72bbdd26
Reviewed-on: https://gerrit.libreoffice.org/20320
Reviewed-by: Oliver Specht 
Tested-by: Oliver Specht 
(cherry picked from commit 568029bf360e70080d71c5b73fd01464a2d3adc6)

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index e05b5b6..9aa4b4a 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -825,7 +825,19 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const 
pTextFormatCollTable,
 pNewSet->Put( SwFormatHoriOrient( 0, 
text::HoriOrientation::CENTER ) );
 
 aFrameSize = pOldFormat->GetFrameSize();
-aFrameSize.SetWidthPercent(0);
+
+SwOLENode* pOleNode = rDoc.GetNodes()[nNdIdx + 
1]->GetOLENode();
+bool isMath = false;
+if(pOleNode)
+{
+svt::EmbeddedObjectRef& xRef = 
pOleNode->GetOLEObj().GetObject();
+if(xRef.is())
+{
+SvGlobalName aCLSID( xRef->getClassID() );
+isMath = ( SotExchange::IsMath( aCLSID ) != 0 );
+}
+}
+aFrameSize.SetWidthPercent(isMath ? 0 : 1000);
 aFrameSize.SetHeightPercent(SwFormatFrameSize::SYNCED);
 pNewSet->Put( aFrameSize );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-18 Thread Caolán McNamara
 sw/source/core/layout/sectfrm.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3a91536cdaae48cfd1eb82fe2ffd1cf2bed3dcb7
Author: Caolán McNamara 
Date:   Mon Mar 7 12:16:28 2016 +

Resolves: tdf#96172 crashtesting: avoid crash in layout

sectfrm is riddled with workarounds for "half dead"
section frames. This is yet another one.

Change-Id: Ic03ad8971002d7dce308475f1497d1dda8045d15
Cherry-picked from 727ebae15e623660b9cc6f8db0e7558830bf920d
Reviewed-on: https://gerrit.libreoffice.org/24154
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index c9bf717..4b906b3 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1575,7 +1575,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType 
eMakePage )
 // We have found the suitable layout sheet. If there (in the sheet) is
 // already a Follow of our section, we take its first layout sheet,
 // otherwise it is time to create a section follow
-SwSectionFrame* pNew;
+SwSectionFrame* pNew = nullptr;
 
 // This can be omitted if existing Follows were cut short
 SwFrame* pFirst = pLayLeaf->Lower();
@@ -1586,7 +1586,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType 
eMakePage )
 pNew = pSect->GetFollow();
 else if( MAKEPAGE_NOSECTION == eMakePage )
 return pLayLeaf;
-else
+else if (pSect->GetSection())
 {
 pNew = new SwSectionFrame( *pSect, false );
 pNew->InsertBefore( pLayLeaf, pLayLeaf->Lower() );
@@ -1641,7 +1641,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType 
eMakePage )
 pNew->SimpleFormat();
 }
 // The wanted layout sheet is now the first of the determined 
SctFrames:
-pLayLeaf = FIRSTLEAF( pNew );
+pLayLeaf = pNew ? FIRSTLEAF(pNew) : nullptr;
 }
 return pLayLeaf;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-14 Thread Oliver Specht
 sw/source/core/txtnode/txtedt.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit af103f2c0425777afcb616bd1a2c582cfd256b25
Author: Oliver Specht 
Date:   Tue Mar 29 10:59:30 2016 +0200

tdf#94449: special text attributes are not removed with paragraph style

commit 3c0805e1f4f4d14e92c7e655d59c87de5c207e48 introduced removal of
all character attributes applied to the complete paragraph if a paragraph
style was applied. This should not remove special attributes like index
entries, reference marks etc.

Change-Id: I6fe92066269da2cf10c871ca319faf6fda91f4be
Reviewed-on: https://gerrit.libreoffice.org/23591
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 
(cherry picked from commit 07aa86973f4c312eac92e0d4b32b607f5f991ddb)
Reviewed-on: https://gerrit.libreoffice.org/24087
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 5064e00..01e55e4 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -606,7 +606,8 @@ void SwTextNode::RstTextAttr(
 for (i = 0; i < m_pSwpHints->Count(); ++i)
 {
 SwTextAttr* pHint = m_pSwpHints->Get(i);
-if (pHint->GetStart() != nStt)
+if ( (isTXTATR_WITHEND(pHint->Which()) && RES_TXTATR_AUTOFMT != 
pHint->Which())
+|| pHint->GetStart() != nStt)
 continue;
 
 const sal_Int32* pHintEnd = pHint->GetEnd();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-07 Thread Noel Grandin
 sw/source/ui/misc/num.cxx|   15 +++
 sw/source/uibase/inc/num.hxx |3 +++
 2 files changed, 18 insertions(+)

New commits:
commit f664089b0692c649d3a88e2a0817544f70ac271a
Author: Noel Grandin 
Date:   Tue Apr 5 09:40:43 2016 +0200

tdf#98647 fix bug in tools->outline-numbering

fallout from
commit e85b2333bce7b1dcae73861df6d90b48b9f4efe5
"convert Link<> to typed"

Change-Id: I8f98bcf6d1eff596e139f9f3a2e3d32fcce67d11
(cherry picked from commit c10d56c6c33ad27d9f4fb12e499a8b246d88da9f)
Reviewed-on: https://gerrit.libreoffice.org/23837
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 272e789..b0e4ae9 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -131,16 +131,19 @@ SwNumPositionTabPage::SwNumPositionTabPage(vcl::Window* 
pParent,
 m_pLabelFollowedByLB->SetSelectHdl( LINK(this, SwNumPositionTabPage, 
LabelFollowedByHdl_Impl) );
 
 aLk = LINK(this, SwNumPositionTabPage, ListtabPosHdl_Impl);
+aLk2 = LINK(this, SwNumPositionTabPage, ListtabPosFocusHdl_Impl);
 m_pListtabMF->SetUpHdl(aLk);
 m_pListtabMF->SetDownHdl(aLk);
 m_pListtabMF->SetLoseFocusHdl(aLk2);
 
 aLk = LINK(this, SwNumPositionTabPage, AlignAtHdl_Impl);
+aLk2 = LINK(this, SwNumPositionTabPage, AlignAtFocusHdl_Impl);
 m_pAlignedAtMF->SetUpHdl(aLk);
 m_pAlignedAtMF->SetDownHdl(aLk);
 m_pAlignedAtMF->SetLoseFocusHdl(aLk2);
 
 aLk = LINK(this, SwNumPositionTabPage, IndentAtHdl_Impl);
+aLk2 = LINK(this, SwNumPositionTabPage, IndentAtFocusHdl_Impl);
 m_pIndentAtMF->SetUpHdl(aLk);
 m_pIndentAtMF->SetDownHdl(aLk);
 m_pIndentAtMF->SetLoseFocusHdl(aLk2);
@@ -818,6 +821,10 @@ IMPL_LINK_NOARG_TYPED(SwNumPositionTabPage, 
LabelFollowedByHdl_Impl, ListBox&, v
 SetModified();
 }
 
+IMPL_LINK_TYPED( SwNumPositionTabPage, ListtabPosFocusHdl_Impl, Control&, 
rControl, void )
+{
+ListtabPosHdl_Impl(static_cast(rControl));
+}
 IMPL_LINK_TYPED( SwNumPositionTabPage, ListtabPosHdl_Impl, SpinField&, rSpin, 
void )
 {
 MetricField& rField = static_cast(rSpin);
@@ -840,6 +847,10 @@ IMPL_LINK_TYPED( SwNumPositionTabPage, ListtabPosHdl_Impl, 
SpinField&, rSpin, vo
 SetModified();
 }
 
+IMPL_LINK_TYPED( SwNumPositionTabPage, AlignAtFocusHdl_Impl, Control&, 
rControl, void )
+{
+AlignAtHdl_Impl(static_cast(rControl));
+}
 IMPL_LINK_TYPED( SwNumPositionTabPage, AlignAtHdl_Impl, SpinField&, rSpin, 
void )
 {
 MetricField& rField = static_cast(rSpin);
@@ -863,6 +874,10 @@ IMPL_LINK_TYPED( SwNumPositionTabPage, AlignAtHdl_Impl, 
SpinField&, rSpin, void
 SetModified();
 }
 
+IMPL_LINK_TYPED( SwNumPositionTabPage, IndentAtFocusHdl_Impl, Control&, 
rControl, void )
+{
+IndentAtHdl_Impl(static_cast(rControl));
+}
 IMPL_LINK_TYPED( SwNumPositionTabPage, IndentAtHdl_Impl, SpinField&, rSpin, 
void )
 {
 MetricField& rField = static_cast(rSpin);
diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx
index fb5880b..59fa929 100644
--- a/sw/source/uibase/inc/num.hxx
+++ b/sw/source/uibase/inc/num.hxx
@@ -96,8 +96,11 @@ class SwNumPositionTabPage : public SfxTabPage
 
 DECL_LINK_TYPED(LabelFollowedByHdl_Impl, ListBox&, void);
 DECL_LINK_TYPED( ListtabPosHdl_Impl, SpinField&, void );
+DECL_LINK_TYPED( ListtabPosFocusHdl_Impl, Control&, void );
 DECL_LINK_TYPED( AlignAtHdl_Impl, SpinField&, void );
+DECL_LINK_TYPED( AlignAtFocusHdl_Impl, Control&, void );
 DECL_LINK_TYPED( IndentAtHdl_Impl, SpinField&, void );
+DECL_LINK_TYPED( IndentAtFocusHdl_Impl, Control&, void );
 
 using SfxTabPage::ActivatePage;
 using SfxTabPage::DeactivatePage;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-29 Thread Bjoern Michaelsen
 sw/source/core/layout/flycnt.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ba51ea100176ec862370a559969a1e12afc7e656
Author: Bjoern Michaelsen 
Date:   Fri Mar 25 01:44:19 2016 +0100

fix another involuntary behaviour change from 0c5cbcd7

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

diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index c3740e5..00adb5b 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1217,6 +1217,8 @@ void SwFlyAtContentFrame::SetAbsPos( const Point  )
 nY = pCnt->Frame().Left() - rNew.X();
 if ( bVertL2R )
 nY = -nY;
+else
+nY += pCnt->Frame().Width() - Frame().Width();
 nY -= pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid();
 }
 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-1' - sw/source

2016-03-22 Thread Bjoern Michaelsen
 sw/source/core/layout/flycnt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 39bdff845fb4cb87958db712e6f1add0a073b38b
Author: Bjoern Michaelsen 
Date:   Tue Mar 22 15:41:04 2016 +0100

tdf#95977: fix fly positioning regression from 0c5cbcd7

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

diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 4754314..c3740e5 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1220,7 +1220,7 @@ void SwFlyAtContentFrame::SetAbsPos( const Point  )
 nY -= pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid();
 }
 else
-nY = rNew.Y() - pCnt->Frame().Top() + 
pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid();
+nY = rNew.Y() - pCnt->Frame().Top() - 
pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid();
 }
 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-1' - sw/source

2016-03-19 Thread Jan Holesovsky
 sw/source/core/crsr/findtxt.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit dc54f1b0f6ec4353b02da3a711dacc350ebc9db2
Author: Jan Holesovsky 
Date:   Thu Mar 17 15:51:42 2016 +0100

tdf#98458 sw: Fix performance problem when searching in large documents.

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

diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index abd3763..3248f11 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -244,6 +244,10 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool 
bSearchInNotes , utl::Te
   rSearchOpt.searchString == "$^" );
 const bool bChkParaEnd = bRegSearch && rSearchOpt.searchString == "$";
 
+SvxSearchItem aSearchItem(SID_SEARCH_ITEM); // this is a very expensive 
operation (calling configmgr etc.)
+aSearchItem.SetSearchOptions(rSearchOpt);
+aSearchItem.SetBackward(!bSrchForward);
+
 // LanguageType eLastLang = 0;
 while( nullptr != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly 
) ))
 {
@@ -301,10 +305,6 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool 
bSearchInNotes , utl::Te
 SwWrtShell *const pWrtShell = (pDocShell) ? 
pDocShell->GetWrtShell() : nullptr;
 SwPostItMgr *const pPostItMgr = (pWrtShell) ? 
pWrtShell->GetPostItMgr() : nullptr;
 
-SvxSearchItem aSearchItem(SID_SEARCH_ITEM);
-aSearchItem.SetSearchOptions(rSearchOpt);
-aSearchItem.SetBackward(!bSrchForward);
-
 // If there is an active text edit, then search there.
 bool bEndedTextEdit = false;
 SdrView* pSdrView = pWrtShell->GetDrawView();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-15 Thread Xisco Fauli
 sw/source/core/frmedt/fecopy.cxx |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit c0c41a27dde5779af9d2737e6871d82015aa6395
Author: Xisco Fauli 
Date:   Thu Feb 4 22:50:47 2016 +0100

tdf#97429: Fix crash on print selected area

Regression from 9eb61489ee03486a7147acdf923eaf5e3f355183
Use DelFlyInRange to iterate over nodes' range

Change-Id: I219c7ec83eaa69990340d423dc34546131bb372c
Reviewed-on: https://gerrit.libreoffice.org/22129
Tested-by: Jenkins 
Reviewed-by: Xisco Faulí 
(cherry picked from commit 3f7a0f7dba759ed3763c900112b5eeb7ccfdd84d)
Reviewed-on: https://gerrit.libreoffice.org/22426
Reviewed-by: jan iversen 

diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 55ece42..2092fe8 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -90,6 +90,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* 
pNewClpText )
 
 // delete content if ClpDocument contains content
 SwNodeIndex aSttIdx( pClpDoc->GetNodes().GetEndOfExtras(), 2 );
+SwNodeIndex aEndNdIdx( *aSttIdx.GetNode().EndOfSectionNode() );
 SwTextNode* pTextNd = aSttIdx.GetNode().GetTextNode();
 if (!pTextNd || !pTextNd->GetText().isEmpty() ||
 aSttIdx.GetIndex()+1 != 
pClpDoc->GetNodes().GetEndOfContent().GetIndex() )
@@ -102,11 +103,19 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* 
pNewClpText )
 }
 
 // also delete surrounding FlyFrames if any
-for( auto pFormat : *pClpDoc->GetSpzFrameFormats() )
+for( const auto pFly : *pClpDoc->GetSpzFrameFormats() )
 {
-SwFlyFrameFormat* pFly = static_cast(pFormat);
-pClpDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFly );
+SwFormatAnchor const*const pAnchor = >GetAnchor();
+SwPosition const*const pAPos = pAnchor->GetContentAnchor();
+if (pAPos &&
+((FLY_AT_PARA == pAnchor->GetAnchorId()) ||
+ (FLY_AT_CHAR == pAnchor->GetAnchorId())) &&
+aSttIdx <= pAPos->nNode && pAPos->nNode <= aEndNdIdx )
+{
+pClpDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFly );
+}
 }
+
 pClpDoc->GetDocumentFieldsManager().GCFieldTypes();// delete the 
FieldTypes
 
 // if a string was passed, copy it to the clipboard-
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-11 Thread Caolán McNamara
 sw/source/core/view/pagepreviewlayout.cxx |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 4dbf1e6897453b998e3f5460612f871bb2eded63
Author: Caolán McNamara 
Date:   Wed Mar 9 15:51:41 2016 +

Resolves: tdf#82781 avoid dereferencing invalid iterators

when using print preview with cursor on 2nd page which consists solely of
hidden text with show hiddle text enabled.

inner mrParentViewShell.Paint can invalidate iterators, as later
detected with the mbNewLayoutDuringPaint flag but we dereference
for the purposes of drawing the shadow before we get there.

easiest thing seems to be to just grab the bits of info we want before the
inner paint occurs.

Change-Id: I09c9b06449db440b7beba7de9e71c239ee64f6ca
(cherry picked from commit 4eb5f363ed9a3181a817f12d5ec49eede13b9c9c)
Reviewed-on: https://gerrit.libreoffice.org/23092
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/sw/source/core/view/pagepreviewlayout.cxx 
b/sw/source/core/view/pagepreviewlayout.cxx
index 05519c5..9994983 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1092,7 +1092,9 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& 
rRenderContext, const Rectan
 Rectangle aPxPaintRect = pOutputDev->LogicToPixel( aPageRect );
 if ( aPxOutRect.IsOver( aPxPaintRect) )
 {
-if ( (*aPageIter)->pPage->IsEmptyPage() )
+const SwPageFrame* pPage = (*aPageIter)->pPage;
+
+if (pPage->IsEmptyPage())
 {
 const Color aRetouche( 
mrParentViewShell.Imp()->GetRetoucheColor() );
 if( pOutputDev->GetFillColor() != aRetouche )
@@ -1120,16 +1122,20 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& 
rRenderContext, const Rectan
 }
 else
 {
+const bool bIsLeftShadowed = pPage->IsLeftShadowNeeded();
+const bool bIsRightShadowed = pPage->IsRightShadowNeeded();
+
 mrParentViewShell.maVisArea = aPageRect;
 aPxPaintRect.Intersection( aPxOutRect );
 Rectangle aPaintRect = pOutputDev->PixelToLogic( aPxPaintRect 
);
 mrParentViewShell.Paint(rRenderContext, aPaintRect);
+
 // --> OD 2007-08-15 #i80691#
 // paint page border and shadow
 {
 SwRect aPageBorderRect;
 SwPageFrame::GetBorderAndShadowBoundRect( SwRect( 
aPageRect ), , , aPageBorderRect,
-(*aPageIter)->pPage->IsLeftShadowNeeded(), 
(*aPageIter)->pPage->IsRightShadowNeeded(), true );
+bIsLeftShadowed, bIsRightShadowed, true );
 const vcl::Region aDLRegion(aPageBorderRect.SVRect());
 mrParentViewShell.DLPrePaint2(aDLRegion);
 SwPageFrame::PaintBorderAndShadow( aPageRect, 
, true, false, true );
@@ -1144,11 +1150,10 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& 
rRenderContext, const Rectan
 break;
 }
 
-if ( (*aPageIter)->pPage->GetPhyPageNum() == mnSelectedPageNum )
+if (pPage->GetPhyPageNum() == mnSelectedPageNum)
 {
 _PaintSelectMarkAtPage(rRenderContext, *aPageIter);
 }
-
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-07 Thread Caolán McNamara
 sw/source/uibase/shells/grfsh.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e013830e996cb571b0f4acebd2776ca3193b663b
Author: Caolán McNamara 
Date:   Fri Mar 4 16:45:29 2016 +

Resolves: tdf#98399 RET_USER_CANCEL is non-zero and returned on cancel

Change-Id: Id4231454dfb34cac6ee89d63beb18a83c63a44c1
(cherry picked from commit cd9a5cf4312a2dc0c1ecbf682c67ca08862cdde0)
Reviewed-on: https://gerrit.libreoffice.org/22912
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/shells/grfsh.cxx 
b/sw/source/uibase/shells/grfsh.cxx
index cbd82f1..20614a0 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -355,7 +355,7 @@ void SwGrfShell::Execute(SfxRequest )
 if (nSlot == FN_DRAW_WRAP_DLG)
 pDlg->SetCurPageId("wrap");
 
-if( pDlg->Execute() )
+if (pDlg->Execute() == RET_OK)
 {
 rSh.StartAllAction();
 rSh.StartUndo(UNDO_START);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-29 Thread Justin Luth
 sw/source/filter/ww8/wrtw8nds.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1d46afc6a7097f3265654f21ad2e01d1a8d757c0
Author: Justin Luth 
Date:   Mon Feb 29 11:51:27 2016 +0300

tdf#97960 - .doc: preserve font size in empty cells

fixes regression from commit e1b123896d5b0a96c2959b6b6768c7cffabafd4f.

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

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index dfafdde..e66e9d2 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2330,7 +2330,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& 
rNode )
 
 WriteCR( pTextNodeInfoInner );
 
-if ( bIsEndOfCell )
+if ( (0 != nEnd) && bIsEndOfCell )
 {
 AttrOutput().OutputFKP(true);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-28 Thread Oliver Specht
 sw/source/core/text/itrform2.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 05818ce01f1d4aa693235f46b6b4b922dffe648b
Author: Oliver Specht 
Date:   Tue Feb 23 12:13:21 2016 +0100

tdf#97139: prevent loop while formatting small text lines

when text is inserted at the end of a line then text formatting
starts some characters (platform and ENABLE_GRAPHITE dependent)
before the insert position. In case of small lines this might even
be the start of the line. To prevent going back to the previous
line the cursor right margin flag needs to be reset.

Change-Id: I73a62ce6c7707469fddeeffe0d7eec064c5989ea
Reviewed-on: https://gerrit.libreoffice.org/22641
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 
Reviewed-on: https://gerrit.libreoffice.org/22663
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index f232459..c6864e8 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -2686,7 +2686,7 @@ namespace {
  const sal_Int32 nOldLineEnd,
  const std::vector  )
 {
-SwTextFormatInfo txtFormatInfo = rThis.GetInfo();
+SwTextFormatInfo& txtFormatInfo = rThis.GetInfo();
 if ( txtFormatInfo.GetIdx() < txtFormatInfo.GetReformatStart() )
 // the reformat position is behind our new line, that means
 // something of our text has moved to the next line
@@ -2733,7 +2733,11 @@ namespace {
 if ( nReformat > txtFormatInfo.GetLineStart() + nMaxContext )
 nReformat = nReformat - nMaxContext;
 else
+{
 nReformat = txtFormatInfo.GetLineStart();
+//reset the margin flag - prevent loops
+SwTextCursor::SetRightMargin(false);
+}
 }
 
 // Weird situation: Our line used to end with a hole portion
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-19 Thread Michael Stahl
 sw/source/core/doc/DocumentContentOperationsManager.cxx |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 9f0e9c7c52fe2685838cfd9f71a44105a3688d1d
Author: Michael Stahl 
Date:   Fri Feb 19 17:32:48 2016 +0100

sw: tdf#63022 fix drag-and-drop of text in same paragraph

SplitNode() inserts new node before the existing one, so pEndTextNd and
aRg.aEnd point one node too far.

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

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 8fdc824..2138bf3e6 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4259,18 +4259,16 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& 
rPam, SwPosition& rPos,
 rPam.Move( fnMoveBackward, fnGoContent );
 if( bChg )
 rPam.Exchange();
-
-aRg.aEnd = pEnd->nNode;
-pEndTextNd = pEnd->nNode.GetNode().GetTextNode();
 }
 else if( rPos == *pEnd )
 {
 // The end was also moved
 pEnd->nNode--;
 pEnd->nContent.Assign( pDestTextNd, nContentEnd );
-aRg.aEnd = pEnd->nNode;
-pEndTextNd = pEnd->nNode.GetNode().GetTextNode();
 }
+// tdf#63022 always reset pEndTextNd after SplitNode
+aRg.aEnd = pEnd->nNode;
+pEndTextNd = pEnd->nNode.GetNode().GetTextNode();
 }
 
 NUMRULE_STATE
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-18 Thread Justin Luth
 sw/source/uibase/shells/grfsh.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c31afc3624224b926069e87ad13c14f8cc9d63ce
Author: Justin Luth 
Date:   Mon Feb 15 17:57:36 2016 +0300

tdf#82012 - keep flip settings when compressing image

Format - flip - Horizontal/Vertical setting was lost when compressing
an image.

Change-Id: Id39e7ce9a82174ac2248851107e398979fba56aa
Reviewed-on: https://gerrit.libreoffice.org/22385
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/shells/grfsh.cxx 
b/sw/source/uibase/shells/grfsh.cxx
index 901d9c4..cbd82f1 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -151,8 +151,9 @@ void SwGrfShell::Execute(SfxRequest )
 
convertTwipToMm100(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Width()),
 
convertTwipToMm100(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height()));
 
-SfxItemSet aSet( rSh.GetAttrPool(), RES_GRFATR_CROPGRF, 
RES_GRFATR_CROPGRF );
+SfxItemSet aSet( rSh.GetAttrPool(), RES_GRFATR_MIRRORGRF, 
RES_GRFATR_CROPGRF );
 rSh.GetCurAttr( aSet );
+SwMirrorGrf aMirror( static_cast( 
aSet.Get(RES_GRFATR_MIRRORGRF)) );
 SwCropGrf aCrop( static_cast( 
aSet.Get(RES_GRFATR_CROPGRF)) );
 
 Rectangle aCropRectangle(
@@ -179,6 +180,7 @@ void SwGrfShell::Execute(SfxRequest )
 rSh.ReRead(OUString(), OUString(), const_cast());
 
 rSh.SetAttrItem(aCrop);
+rSh.SetAttrItem(aMirror);
 
 rSh.EndUndo(UNDO_END);
 rSh.EndAllAction();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 77aa8f92aab6a66ca2186efd2e4cbfc0d1c9f0e8
Author: Michael Stahl 
Date:   Fri Feb 12 23:33:36 2016 +0100

sw: fix a STL assertion in lcl_MoveAllLowerObjs()

For OLE objects MoveObjectIfActive() ends up calling
SwSortedObjs::Update() which removes and re-inserts objects,
thus invalidating the pSortedObj iterator.

(regression from 04783fd91832fa01a5b096f395edd7ad4f9c0f6b)

Change-Id: I2628f1b4ecd1c20ebbc4e9dda4e4befc9fad4644
(cherry picked from commit cf91483690291272f48ff95c1aebd165da8ae4f0)
Reviewed-on: https://gerrit.libreoffice.org/22338
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/pagechg.cxx 
b/sw/source/core/layout/pagechg.cxx
index 42ae8ac..1c9e803 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1761,8 +1761,11 @@ static void lcl_MoveAllLowerObjs( SwFrame* pFrame, const 
Point& rOffset )
 if (pSortedObj == nullptr)
 return;
 
-for (SwAnchoredObject* pAnchoredObj : *pSortedObj)
+// note: pSortedObj elements may be removed and inserted from
+// MoveObjectIfActive(), invalidating iterators
+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-1' - sw/source

2016-02-16 Thread Justin Luth
 sw/source/filter/ww8/ww8graf.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit c0ec06b19c0e14cfc7f69500e50e6ebb17a07ec0
Author: Justin Luth 
Date:   Tue Feb 16 08:32:33 2016 +0300

tdf#56321 - .doc import image flipped status

Although LO was exporting whether an image was flipped
horizontally or vertically, it wasn't reading it in during
an import.

Reviewed-on: https://gerrit.libreoffice.org/22344
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Michael Stahl 

(cherry picked (minus unit tests)
   from commit aa03fd09c0e18ace241c9fe151f7f52c6773f403)

Change-Id: Ia85e3459d00f40d852bbcd3fcfe15e7b53d518ba
Reviewed-on: https://gerrit.libreoffice.org/22384
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: David Tardon 

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 7458609..66e0141 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2095,6 +2095,24 @@ 
SwWW8ImplReader::SetAttributesAtGrfNode(SvxMSDffImportRec const*const pRecord,
 pGrfNd->SetAttr( aCrop );
 }
 
+bool bFlipH = pRecord->nFlags & SHAPEFLAG_FLIPH;
+bool bFlipV = pRecord->nFlags & SHAPEFLAG_FLIPV;
+if ( bFlipH || bFlipV )
+{
+SwMirrorGrf aMirror = pGrfNd->GetSwAttrSet().GetMirrorGrf();
+if( bFlipH )
+{
+if( bFlipV )
+aMirror.SetValue(RES_MIRROR_GRAPH_BOTH);
+else
+aMirror.SetValue(RES_MIRROR_GRAPH_VERT);
+}
+else
+aMirror.SetValue(RES_MIRROR_GRAPH_HOR);
+
+pGrfNd->SetAttr( aMirror );
+}
+
 if (pRecord->pObj)
 {
 const SfxItemSet& rOldSet = pRecord->pObj->GetMergedItemSet();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-15 Thread Michael Stahl
 sw/source/core/ole/ndole.cxx |   35 ---
 1 file changed, 20 insertions(+), 15 deletions(-)

New commits:
commit 4d0f0654f96aafba1c88b4ffa90b7561afadabbf
Author: Michael Stahl 
Date:   Fri Feb 12 13:40:46 2016 +0100

sw: don't crash if Office.Common/Cache/Writer/OLE_Objects set to 1

(possibly regression from b717bda1f6484905aebc571c4538165a1fbfd2bb)

Change-Id: I9113fe2e769cd6ba56bdccc629ac63241b238553
(cherry picked from commit 60d4dd0a6c44b45ed424ca6a0ddcf857ec089b24)
Reviewed-on: https://gerrit.libreoffice.org/22332
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 6089e69..d7aabd1 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -84,7 +84,7 @@ public:
 void RemoveObj( SwOLEObj& rObj );
 };
 
-SwOLELRUCache* pOLELRU_Cache = nullptr;
+std::shared_ptr g_pOLELRU_Cache;
 
 class SwOLEListener_Impl : public ::cppu::WeakImplHelper< 
embed::XStateChangeListener >
 {
@@ -102,7 +102,7 @@ SwOLEListener_Impl::SwOLEListener_Impl( SwOLEObj* pObj )
 {
 if ( mpObj->IsOleRef() && mpObj->GetOleRef()->getCurrentState() == 
embed::EmbedStates::RUNNING )
 {
-pOLELRU_Cache->InsertObj( *mpObj );
+g_pOLELRU_Cache->InsertObj( *mpObj );
 }
 }
 
@@ -114,29 +114,29 @@ void SAL_CALL SwOLEListener_Impl::stateChanged( const 
lang::EventObject&, ::sal_
 {
 if ( mpObj && nOldState == embed::EmbedStates::LOADED && nNewState == 
embed::EmbedStates::RUNNING )
 {
-if( !pOLELRU_Cache )
-pOLELRU_Cache = new SwOLELRUCache;
-pOLELRU_Cache->InsertObj( *mpObj );
+if (!g_pOLELRU_Cache)
+g_pOLELRU_Cache.reset(new SwOLELRUCache);
+g_pOLELRU_Cache->InsertObj( *mpObj );
 }
 else if ( mpObj && nNewState == embed::EmbedStates::LOADED && nOldState == 
embed::EmbedStates::RUNNING )
 {
-if ( pOLELRU_Cache )
-pOLELRU_Cache->RemoveObj( *mpObj );
+if (g_pOLELRU_Cache)
+g_pOLELRU_Cache->RemoveObj( *mpObj );
 }
 }
 
 void SwOLEListener_Impl::Release()
 {
-if ( mpObj && pOLELRU_Cache )
-pOLELRU_Cache->RemoveObj( *mpObj );
+if (mpObj && g_pOLELRU_Cache)
+g_pOLELRU_Cache->RemoveObj( *mpObj );
 mpObj=nullptr;
 release();
 }
 
 void SAL_CALL SwOLEListener_Impl::disposing( const lang::EventObject& ) throw 
(uno::RuntimeException, std::exception)
 {
-if ( mpObj && pOLELRU_Cache )
-pOLELRU_Cache->RemoveObj( *mpObj );
+if (mpObj && g_pOLELRU_Cache)
+g_pOLELRU_Cache->RemoveObj( *mpObj );
 }
 
 // TODO/LATER: actually SwEmbedObjectLink should be used here, but because 
different objects are used to control
@@ -810,9 +810,9 @@ const uno::Reference < embed::XEmbeddedObject > 
SwOLEObj::GetOleRef()
 else if ( xOLERef->getCurrentState() == embed::EmbedStates::RUNNING )
 {
 // move object to first position in cache
-if( !pOLELRU_Cache )
-pOLELRU_Cache = new SwOLELRUCache;
-pOLELRU_Cache->InsertObj( *this );
+if (!g_pOLELRU_Cache)
+g_pOLELRU_Cache.reset(new SwOLELRUCache);
+g_pOLELRU_Cache->InsertObj( *this );
 }
 
 return xOLERef.GetObject();
@@ -937,6 +937,7 @@ void SwOLELRUCache::Load()
 {
 if (nVal < m_nLRU_InitSize)
 {
+std::shared_ptr tmp(g_pOLELRU_Cache); // 
prevent delete this
 // size of cache has been changed
 sal_Int32 nCount = m_OleObjects.size();
 sal_Int32 nPos = nCount;
@@ -970,6 +971,7 @@ void SwOLELRUCache::InsertObj( SwOLEObj& rObj )
 }
 if (it == m_OleObjects.end())
 {
+std::shared_ptr tmp(g_pOLELRU_Cache); // prevent delete 
this
 // try to remove objects if necessary
 sal_Int32 nCount = m_OleObjects.size();
 sal_Int32 nPos = nCount-1;
@@ -993,7 +995,10 @@ void SwOLELRUCache::RemoveObj( SwOLEObj& rObj )
 }
 if (m_OleObjects.empty())
 {
-DELETEZ( pOLELRU_Cache );
+if (g_pOLELRU_Cache.unique()) // test that we're not in InsertObj()
+{
+g_pOLELRU_Cache.reset();
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-12 Thread Oliver Specht
 sw/source/core/tox/ToxWhitespaceStripper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a6c5dfc9470c261f11efa35bcad98ef7ac632aaa
Author: Oliver Specht 
Date:   Wed Feb 10 16:57:14 2016 +0100

tdf#89505: replace tab character with space in table of contents

the ToxWhitespaceStripper now replaces also tab characters so that
they don't break the formatting

Change-Id: If66aaddcbc0f8c65461f53f07ca7031f8f1d11b4
Reviewed-on: https://gerrit.libreoffice.org/22271
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 
(cherry picked from commit 5152c43109c9a35f30fc9b0f478c1fbaf01a1143)
Reviewed-on: https://gerrit.libreoffice.org/22285
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/tox/ToxWhitespaceStripper.cxx 
b/sw/source/core/tox/ToxWhitespaceStripper.cxx
index 4918a73..c38079c 100644
--- a/sw/source/core/tox/ToxWhitespaceStripper.cxx
+++ b/sw/source/core/tox/ToxWhitespaceStripper.cxx
@@ -24,7 +24,7 @@ ToxWhitespaceStripper::ToxWhitespaceStripper(const OUString& 
inputString)
 for (sal_Int32 pos = 0; pos < inputString.getLength(); ++pos) {
 sal_Unicode cur = inputString[pos];
 
-if (cur == ' ' || cur == '\n') {
+if (cur == ' ' || cur == '\n' || cur == '\t') {
 // merge consecutive whitespaces (and translate them to spaces)
 if (!lastCharacterWasWhitespace) {
 buffer.append(' ');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-05 Thread Rishabh
 sw/source/uibase/sidebar/WrapPropertyPanel.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit dea370d7bb0ce4b8190dc98976b2691fce659952
Author: Rishabh 
Date:   Wed Feb 3 04:28:48 2016 +0530

tdf#97407: Remove duplicate custom entry

Remove custom entry before updating the spacing listbox

Change-Id: I9476e639f4d54e87a2c9049159e6abefb02a9b5e
Reviewed-on: https://gerrit.libreoffice.org/21942
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Samuel Mehrbrodt 
(cherry picked from commit 43799f9e21277e655c7ec940d266f775cada837a)
Reviewed-on: https://gerrit.libreoffice.org/22066
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx 
b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
index 8ee32d1..4185326 100644
--- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
@@ -214,7 +214,8 @@ void WrapPropertyPanel::UpdateSpacingLB()
 }
 }
 
-mpSpacingLB->InsertEntry(aCustomEntry);
+if(mpSpacingLB->GetEntryPos(aCustomEntry) == LISTBOX_ENTRY_NOTFOUND)
+mpSpacingLB->InsertEntry(aCustomEntry);
 mpSpacingLB->SelectEntry(aCustomEntry);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-01-21 Thread Justin Luth
 sw/source/core/text/itrpaint.cxx |   19 ++-
 sw/source/core/text/porlin.hxx   |1 +
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 8c564a1fd313da29088bed6453c5e16876690d24
Author: Justin Luth 
Date:   Wed Oct 28 11:12:17 2015 +0300

tdf#93637 TAB_OVER_MARGIN support for a few more cases

Extending nMaxRight when TAB_OVER_MARGIN compatibility is set and
the right tabstop goes beyond the right margin fixes PDF output
as well as certain cases of screen display.

Change-Id: Ida4b4f399f06670d9bdefdc21978adf19a81d53a
Reviewed-on: https://gerrit.libreoffice.org/19635
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
(cherry picked from commit d1bd4465be649a4078c3a2f85a64c8a6300dd65d)
Reviewed-on: https://gerrit.libreoffice.org/21561
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 79d3c5d..c5eba01 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -37,6 +37,7 @@
 #include 
 
 #include 
+#include 
 
 #include "flyfrms.hxx"
 #include "viewsh.hxx"
@@ -161,8 +162,24 @@ void SwTextPainter::DrawTextLine( const SwRect , 
SwSaveClip ,
 SwLinePortion *pPor = bEndPor ? m_pCurr->GetFirstPortion() : 
CalcPaintOfst( rPaint );
 
 // Optimization!
-const SwTwips nMaxRight = std::min( rPaint.Right(), Right() );
+SwTwips nMaxRight = std::min( rPaint.Right(), Right() );
 const SwTwips nTmpLeft = GetInfo().X();
+//compatibility setting: allow tabstop text to exceed right margin
+if( 
GetInfo().GetTextFrame()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_OVER_MARGIN)
 )
+{
+SwLinePortion* pPorIter = pPor;
+while( pPorIter )
+{
+if( pPorIter->IsTabRightPortion() )
+{
+   const SwTabRightPortion *pRightTabPor = 
static_cast(pPorIter);
+   const SwTwips nTabPos = nTmpLeft + pRightTabPor->GetTabPos();
+if( nMaxRight < nTabPos )
+nMaxRight = std::min( rPaint.Right(), nTabPos );
+}
+pPorIter = pPorIter->GetPortion();
+}
+}
 if( !bEndPor && nTmpLeft >= nMaxRight )
 return;
 
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 486827d..cf46070 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -125,6 +125,7 @@ public:
 inline bool IsErgoSumPortion() const { return nWhichPor == POR_ERGOSUM; }
 inline bool IsQuoVadisPortion() const { return nWhichPor == POR_QUOVADIS; }
 inline bool IsTabLeftPortion() const { return nWhichPor == POR_TABLEFT; }
+inline bool IsTabRightPortion() const { return nWhichPor == POR_TABRIGHT; }
 inline bool IsFootnoteNumPortion() const { return nWhichPor == POR_FTNNUM; 
}
 inline bool IsFootnotePortion() const { return nWhichPor == POR_FTN; }
 inline bool IsDropPortion() const { return nWhichPor == POR_DROP; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-01-13 Thread Oliver Specht
 sw/source/core/undo/untbl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9a4f133bc8b00ea2051e6979087b46fd0401e60f
Author: Oliver Specht 
Date:   Tue Jan 12 13:05:56 2016 +0100

tdf#96067: fix crash in undo of table row insertion

create SwIterator with SwLayoutFrame instead of SwTabFrame
the wrong usage worked with tools/rtti because of incomplete
type information above of SwLayoutFrame

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

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 116c686..2072eda 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1094,7 +1094,7 @@ void _SaveTable::NewFrameFormat( const SwTableLine* 
pTableLn, const SwTableBox*
 }
 
 // first re-assign Frames
-SwIterator aIter( *pOldFormat );
+SwIterator aIter( *pOldFormat );
 for( SwFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
 {
 if( pTableLn ? static_cast(pLast)->GetTabLine() == 
pTableLn
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-12-23 Thread Miklos Vajna
 sw/source/core/view/viewsh.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2b8d5a2d5182ee90568173e702f531a2b9279ef9
Author: Miklos Vajna 
Date:   Tue Dec 22 09:08:18 2015 +0100

tdf#93009 SwViewShell: fix printing of comments on the margin

Clipping was set not only in case of VCL-level double buffering, but
also during printing, which means comments were excluded from the
output.

(cherry picked from commit d6913850585eae90ea9179129fe7b60a2a4305ad)

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

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 1b01d6e..28ece34 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -208,8 +208,8 @@ void SwViewShell::DLPrePaint2(const vcl::Region& rRegion)
 mpBufferedOut = mpOut;
 mpOut = &(mpTargetPaintWindow->GetTargetOutputDevice());
 }
-else
-// In case mpOut is used without buffering, need to set clipping.
+else if (isOutputToWindow())
+// In case mpOut is used without buffering and we're not printing, 
need to set clipping.
 mpOut->SetClipRegion(rRegion);
 
 // remember original paint MapMode for wrapped FlyFrame paints
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-12-15 Thread Mark Hung
 sw/source/core/text/itrpaint.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a6b9d0e2f3508d8ac52f46a7aacec2e3043fec8e
Author: Mark Hung 
Date:   Fri Dec 4 13:00:00 2015 +0800

tdf#96125 Fix broken Writer paragraph text-to-text alignment feature.

Revert "Fix tdf#77514 CJK ruby text in RTL( vertical ) base line issue."

This reverts commit b14861e1dfb9f83d26d6032ae96b664845528f2a.

Conflicts:
sw/source/core/text/itrpaint.cxx

Change-Id: I61b81016631d028ca1843533d74b5ccc7d527df2
Reviewed-on: https://gerrit.libreoffice.org/20387
Reviewed-by: Christian Lohmaier 
Tested-by: Christian Lohmaier 

diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 81d1873..79d3c5d 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -236,7 +236,7 @@ void SwTextPainter::DrawTextLine( const SwRect , 
SwSaveClip ,
 // we calculate Y value for the whole line
 SwTextGridItem const*const 
pGrid(GetGridItem(GetTextFrame()->FindPageFrame()));
 const bool bAdjustBaseLine =
-( !GetTextFrame()->IsVertical() || GetLineInfo().HasSpecialAlign( true 
) ) && (! GetTextFrame()->IsInFly()) &&
+GetLineInfo().HasSpecialAlign( GetTextFrame()->IsVertical() ) ||
 ( nullptr != pGrid );
 const SwTwips nLineBaseLine = GetInfo().GetPos().Y() + nTmpAscent;
 if ( ! bAdjustBaseLine )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-12-03 Thread Caolán McNamara
 sw/source/ui/frmdlg/cption.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2365ff9f02370d63aae3d5b04b90b3c1a58d1094
Author: Caolán McNamara 
Date:   Thu Dec 3 09:30:44 2015 +

Resolves: tdf#94701 allow fully deleting illustration category in combobox

Change-Id: Iaaefbe2311e61be3b9689c693481d149aa1355f5
(cherry picked from commit 0261be7f92930952a470bc7f5e1d543b8907b1f0)

diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 4f3509e..cc176df 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -83,10 +83,10 @@ public:
 
 OUString SwCaptionDialog::our_aSepTextSave(": "); // Caption separator text
 
-//Resolves: fdo#47427 disallow typing *or* pasting content into the category 
box
+//Resolves: tdf#47427 disallow typing *or* pasting invalid content into the 
category box
 OUString TextFilterAutoConvert::filter(const OUString )
 {
-if (rText != m_sNone && !SwCalc::IsValidVarName(rText))
+if (!rText.isEmpty() && rText != m_sNone && !SwCalc::IsValidVarName(rText))
 return m_sLastGoodText;
 m_sLastGoodText = rText;
 return rText;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-11-25 Thread Michael Meeks
 sw/source/core/unocore/unotbl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3eadd8b16862ef31609d4fb12dadb19bf0a744c5
Author: Michael Meeks 
Date:   Wed Nov 25 16:50:21 2015 +

Fix obvious thinko; thanks to mst.

Change-Id: I591532d6a0dd07f8c621ecea3eaa4b92f2225493

diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 044a514..3d8c53d 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1434,7 +1434,7 @@ sal_Bool SwXTextTableCursor::supportsService(const 
OUString& rServiceName) throw
 
 void SwXTextTableCursor::acquire() throw()
 {
-SwXTextTableCursor_Base::release();
+SwXTextTableCursor_Base::acquire();
 }
 
 void SwXTextTableCursor::release() throw()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits