[Libreoffice-commits] core.git: 4 commits - sw/source

2018-05-11 Thread Michael Stahl
 sw/source/core/doc/docedt.cxx|7 +
 sw/source/core/text/itrtxt.cxx   |2 
 sw/source/core/text/redlnitr.cxx |  152 ---
 sw/source/core/text/redlnitr.hxx |   47 ++--
 sw/source/core/text/txtdrop.cxx  |2 
 5 files changed, 109 insertions(+), 101 deletions(-)

New commits:
commit caeda2233e648fb7537baee522410416dada39ea
Author: Michael Stahl 
Date:   Wed May 9 17:29:33 2018 +0200

sw: fix invalid 16-bit downcast in SwTextIter::TruncLines()

Change-Id: I0a19e730d58c01b55a9de926db8ef4022317

diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index 11dd062e0cfd..15e2762b7323 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -351,7 +351,7 @@ void SwTextIter::TruncLines( bool bNoteFollow )
 if( RES_TXTATR_FLYCNT == pHt->Which() )
 {
 // check, if hint is in our range
-const sal_uInt16 nTmpPos = pHt->GetStart();
+const sal_Int32 nTmpPos = pHt->GetStart();
 if ( nEnd <= nTmpPos && nTmpPos < nRangeEnd )
 pFollow->InvalidateRange_(
 SwCharRange( nTmpPos, nTmpPos ) );
commit 5bc362cb9619617cdc347ee7a3475d8e78b3a109
Author: Michael Stahl 
Date:   Thu May 3 13:40:10 2018 +0200

sw: remove pointless indirection to SwTextSizeInfo::HasHint_

Change-Id: I0a6f329c2bc2d10fb993d42e07e71a7b5c5fd5e2

diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 61160582db45..31b3eac7654c 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -162,7 +162,7 @@ sal_Int32 SwTextNode::GetDropLen( sal_Int32 nWishLen ) const
 sal_Unicode const cChar = GetText()[i];
 if( CH_TAB == cChar || CH_BREAK == cChar ||
 (( CH_TXTATR_BREAKWORD == cChar || CH_TXTATR_INWORD == cChar )
-&& SwTextSizeInfo::HasHint_( this, i ) ) )
+&& GetTextAttrForCharAt(i)) )
 break;
 }
 return i;
commit bb7700d844152c7ba219ee7cfeee39ef1f6ca8d8
Author: Michael Stahl 
Date:   Fri Apr 27 18:40:09 2018 +0200

sw: cosmetics

Change-Id: Ieed3c8251ab61d7c47314137f5f67cb736b1b158

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 4c0b7e885148..a139293fec7c 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -348,7 +348,7 @@ bool sw_JoinText( SwPaM& rPam, bool bJoinPrev )
 if( bJoinPrev )
 {
 // We do not need to handle xmlids in this case, because
-// it is only invoked if one paragraph is completely empty
+// it is only invoked if one paragraph is/becomes completely empty
 // (see sw_GetJoinFlags)
 {
 // If PageBreaks are deleted/set, it must not be added to the 
Undo history!
@@ -360,8 +360,9 @@ bool sw_JoinText( SwPaM& rPam, bool bJoinPrev )
 // PageDesc, etc. we also have to change SwUndoDelete.
 // There, we copy the AUTO PageBreak from the GetMarkNode!
 
-/* The GetMarkNode */
-if( ( pTextNd = aIdx.GetNode().GetTextNode())->HasSwAttrSet() )
+/* The MarkNode */
+pTextNd = aIdx.GetNode().GetTextNode();
+if (pTextNd->HasSwAttrSet())
 {
 const SfxPoolItem* pItem;
 if( SfxItemState::SET == 
pTextNd->GetpSwAttrSet()->GetItemState(
commit 37c21f3cc49e262d20bbc592dbbeefcd9ba1597d
Author: Michael Stahl 
Date:   Mon Apr 23 14:14:01 2018 +0200

SwRedlineItr: prefix members

Change-Id: If4e0dde34004766862240c10c41643c2919a6b18

diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index acd4584054b2..89f981bf9734 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -153,34 +153,38 @@ void SwAttrIter::CtorInitAttrIter( SwTextNode& rTextNode, 
SwScriptInfo& rScrInf,
 // The Redline-Iterator
 // The following information/states exist in RedlineIterator:
 //
-// nFirst is the first index of RedlineTable, which overlaps with the 
paragraph.
+// m_nFirst is the first index of RedlineTable, which overlaps with the 
paragraph.
 //
-// nAct is the currently active (if bOn is set) or the next possible index.
-// nStart and nEnd give you the borders of the object within the paragraph.
+// m_nAct is the currently active (if m_bOn is set) or the next possible index.
+// m_nStart and m_nEnd give you the borders of the object within the paragraph.
 //
-// If bOn is set, the font has been manipulated according to it.
+// If m_bOn is set, the font has been manipulated according to it.
 //
-// If nAct is set to COMPLETE_STRING (via Reset()), 

[Libreoffice-commits] core.git: 4 commits - sw/source

2017-12-15 Thread Michael Stahl
 sw/source/core/inc/txtfrm.hxx |   13 +
 sw/source/core/layout/trvlfrm.cxx |5 -
 sw/source/core/text/txtfrm.cxx|   14 +++---
 sw/source/core/text/txtinit.cxx   |4 ++--
 sw/source/uibase/index/toxmgr.cxx |   12 ++--
 5 files changed, 32 insertions(+), 16 deletions(-)

New commits:
commit b77881366b17230908f441dfa27afcafc4374708
Author: Michael Stahl 
Date:   Fri Dec 15 17:07:01 2017 +0100

tdf#100635 sw: fix layout crash caused by field expansion ...

... triggering recursive layout-in-layout where a SwTextFrame
that's being formatted is deleted inside some other frame's
SwTextNode::GetFormatted().

The offending field is a SwAuthorityField that's located in a
fly-frame with FLY_AT_PAGE anchor.

SwPageFrame::GetContentPosition() is only called by field expansion
code, so this shouldn't have an effect on layout.

It already has a fall-back for the case when the frame has invalid
flags, so handle the situation when the SwLineLayout has been
deleted from the SwCache due to overflow the same way,
which prevents the recursive formatting.

Change-Id: I90437edb5692dc2bdec7ad03964588942bde05be

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index df410a56ceb2..dfaa27bf2a03 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1433,9 +1433,12 @@ void SwPageFrame::GetContentPosition( const Point , 
SwPosition  ) const
 else if ( aAct.X() > aRect.Right() )
 aAct.X() = aRect.Right();
 
-if( !pAct->isFrameAreaDefinitionValid() )
+if (!pAct->isFrameAreaDefinitionValid() ||
+(pAct->IsTextFrame() && !static_cast(pAct)->HasPara()))
 {
 // ContentFrame not formatted -> always on node-beginning
+// tdf#100635 also if the SwTextFrame would require reformatting,
+// which is unwanted in case this is called from text formatting code
 SwContentNode* pCNd = const_cast(pAct->GetNode());
 OSL_ENSURE( pCNd, "Where is my ContentNode?" );
 rPos.nNode = *pCNd;
commit aa07f2892e581dd31f1b8861499e29c96dddbac0
Author: Michael Stahl 
Date:   Fri Dec 15 17:18:39 2017 +0100

sw: prefix SwTextFrame::pTextCache member

Change-Id: Ibfbc59c9df89a3cde6226bd49cf33c2ac865d4a8

diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 36016aaca196..6a22cff6f059 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -60,7 +60,7 @@ class SW_DLLPUBLIC SwTextFrame: public SwContentFrame
 /// if there are too many of them, but the "valid" flags of the frame
 /// will still be set; GetFormatted() is the function that forces
 /// recreation of the SwLineLayout by Format() if necessary.
-static SwCache *pTextCache;
+static SwCache *s_pTextCache;
 static long nMinPrtLine;// This Line must not be underrun when printing
 // Hack for table cells stretching multiple 
pages
 
@@ -451,7 +451,7 @@ public:
 SwTextFrame *FindQuoVadisFrame();
 
 /**
- * In case the SwLineLayout was cleared out of the pTextCache, recreate it.
+ * In case the SwLineLayout was cleared out of the s_pTextCache, recreate 
it
  *
  * #i29062# GetFormatted() can trigger a full formatting
  * of the paragraph, causing other layout frames to become invalid. This
@@ -472,8 +472,8 @@ public:
 bool GetDropRect( SwRect  ) const
 { return HasPara() && GetDropRect_( rRect ); }
 
-static SwCache *GetTextCache() { return pTextCache; }
-static void SetTextCache( SwCache *pNew ) { pTextCache = pNew; }
+static SwCache *GetTextCache() { return s_pTextCache; }
+static void SetTextCache( SwCache *pNew ) { s_pTextCache = pNew; }
 
 static long GetMinPrtLine() { return nMinPrtLine; }
 
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index a93fcb77fc50..65dbf5193ce5 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -398,7 +398,7 @@ SwTextFrame::SwTextFrame(SwTextNode * const pNode, SwFrame* 
pSib )
 
 void SwTextFrame::DestroyImpl()
 {
-// Remove associated SwParaPortion from pTextCache
+// Remove associated SwParaPortion from s_pTextCache
 ClearPara();
 
 const SwContentNode* pCNd;
@@ -2123,7 +2123,7 @@ SwTextFrame* SwTextFrame::GetFormatted( bool 
bForceQuickFormat )
 vcl::RenderContext* pRenderContext = 
getRootFrame()->GetCurrShell()->GetOut();
 SwSwapIfSwapped swap( this );
 
-// In case the SwLineLayout was cleared out of the pTextCache, recreate it.
+// In case the SwLineLayout was cleared out of the s_pTextCache, recreate 
it
 // Not for empty paragraphs
 if( !HasPara() && !(isFrameAreaDefinitionValid() && IsEmpty()) )
 {
@@ -2134,7 +2134,7 @@ SwTextFrame* SwTextFrame::GetFormatted( bool 

[Libreoffice-commits] core.git: 4 commits - sw/source

2017-06-22 Thread Michael Stahl
 sw/source/core/layout/calcmove.cxx  |   20 +
 sw/source/core/layout/flowfrm.cxx   |   14 ++--
 sw/source/core/layout/ftnfrm.cxx|3 +-
 sw/source/core/layout/objectformattertxtfrm.cxx |   27 +++-
 sw/source/core/text/xmldump.cxx |   10 
 5 files changed, 70 insertions(+), 4 deletions(-)

New commits:
commit 9ec1ccb23af0de56f141d906f2eb60bab40aefb8
Author: Michael Stahl 
Date:   Wed Jun 21 16:44:45 2017 +0200

sw: dump more connections of those obnoxious footnotes in layout.xml

Change-Id: I62caffcacb710aa079ddc9c81fb49f702cdc84af

diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 9358e922de50..7a28ceed4862 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -9,6 +9,7 @@
 
 #include "frame.hxx"
 #include "frmfmt.hxx"
+#include "ftnfrm.hxx"
 #include "sectfrm.hxx"
 #include "tabfrm.hxx"
 #include "txtfrm.hxx"
@@ -386,6 +387,15 @@ void SwFrame::dumpAsXmlAttributes( xmlTextWriterPtr writer 
) const
 xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "upper" ), "%" 
SAL_PRIuUINT32, GetUpper()->GetFrameId() );
 if ( GetLower( ) )
 xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "lower" ), "%" 
SAL_PRIuUINT32, GetLower()->GetFrameId() );
+if (IsFootnoteFrame())
+{
+SwFootnoteFrame const*const pFF(static_cast(this));
+xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("ref"), "%" 
SAL_PRIuUINT32, pFF->GetRef()->GetFrameId() );
+if (pFF->GetMaster())
+xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("master"), "%" 
SAL_PRIuUINT32, pFF->GetMaster()->GetFrameId() );
+if (pFF->GetFollow())
+xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("follow"), "%" 
SAL_PRIuUINT32, pFF->GetFollow()->GetFrameId() );
+}
 if ( IsTextFrame(  ) )
 {
 const SwTextFrame *pTextFrame = static_cast(this);
commit c83a443eb106e426901d0ba8a809eedcd24c42c5
Author: Michael Stahl 
Date:   Wed Jun 21 15:26:01 2017 +0200

tdf#101821 sw: fix another layout footnote use-after-free

In SwContentFrame::MakeAll() the pPre (previous frame) is deleted in a
call to MoveFwd().  This SwTextFrame is inside of a footnote, and
the SwFlowFrame::CutTree() for whatever reason wants to format all
of the SwTextFrames inside the same SwFootnoteFrame, which causes
the pPre to be joined with another one.

Let's try to avoid that by checking that it's still in the layout after
the call to MoveFwd(); on the one hand it's not obvious that this frame
is important enough that it should be kept alive with ForbidDelete(),
on the other hand i have no idea if simply removing the ValidateSz()
call would introduce new loops or whatever.

Invalid read of size 4
 at 0x414E8D14: SwFrame::IsSctFrame() const (frame.hxx:1018)
 by 0x41A85A29: SwContentFrame::MakeAll(OutputDevice*) (calcmove.cxx:1713)
 by 0x41A7F499: SwFrame::OptPrepareMake() (calcmove.cxx:368)
 by 0x41ADF0CF: SwFrame::OptCalc() const (frame.hxx:892)
 by 0x41ADCC07: SwLayAction::FormatContent_(SwContentFrame const*, 
SwPageFrame const*) (layact.cxx:1789)
 by 0x41ADC195: SwLayAction::FormatContent(SwPageFrame const*) 
(layact.cxx:1620)
 by 0x41AD88DE: SwLayAction::InternalAction(OutputDevice*) (layact.cxx:760)
 by 0x41AD7080: SwLayAction::Action(OutputDevice*) (layact.cxx:351)
 by 0x41ADE32E: SwLayIdle::SwLayIdle(SwRootFrame*, SwViewShellImp*) 
(layact.cxx:2133)
 by 0x41FFC97E: SwViewShell::LayoutIdle() (viewsh.cxx:711)
Address 0x530ccf80 is 160 bytes inside a block of size 264 free'd
 at 0x4C2ED4A: free (vg_replace_malloc.c:530)
 by 0x4E5BCD0: rtl_freeMemory_SYSTEM(void*) (alloc_global.cxx:271)
 by 0x4E5C00A: rtl_freeMemory (alloc_global.cxx:341)
 by 0x4E5AAA0: rtl_cache_free (alloc_cache.cxx:1231)
 by 0xEFC9A6F: FixedMemPool::Free(void*) (mempool.cxx:49)
 by 0x41CA7DFA: SwTextFrame::operator delete(void*, unsigned long) 
(txtfrm.hxx:377)
 by 0x41C9F7B6: SwTextFrame::~SwTextFrame() (txtfrm.cxx:415)
 by 0x41B5B74C: SwFrame::DestroyFrame(SwFrame*) (ssfrm.cxx:391)
 by 0x41C1589A: SwTextFrame::JoinFrame() (frmform.cxx:656)
 by 0x41C153B1: SwTextFrame::AdjustFollow_(SwTextFormatter&, int, int, 
unsigned char) (frmform.cxx:555)
 by 0x41C172E1: SwTextFrame::FormatAdjust(SwTextFormatter&, 
WidowsAndOrphans&, int, bool) (frmform.cxx:1108)
 by 0x41C18D5E: SwTextFrame::Format_(SwTextFormatter&, SwTextFormatInfo&, 
bool) (frmform.cxx:1550)
 by 0x41C19340: SwTextFrame::Format_(OutputDevice*, SwParaPortion*) 
(frmform.cxx:1660)
 by 0x41C19CD8: SwTextFrame::Format(OutputDevice*, SwBorderAttrs const*) 
(frmform.cxx:1807)
 by 0x41A847A1: SwContentFrame::MakeAll(OutputDevice*) (calcmove.cxx:1393)
 by 0x41A7F211: 

[Libreoffice-commits] core.git: 4 commits - sw/source

2017-04-12 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par2.cxx |   16 
 sw/source/filter/ww8/ww8scan.cxx |   23 ++-
 sw/source/filter/ww8/ww8scan.hxx |4 ++--
 3 files changed, 24 insertions(+), 19 deletions(-)

New commits:
commit 9c946e83cb773a0d0f05d27dab43cf6f934c7a56
Author: Caolán McNamara 
Date:   Wed Apr 12 12:56:27 2017 +0100

use std::unique_ptr

Change-Id: I74ab04b58c848961b1c4d30b68e8dd5ff5dd1f0d

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 19b75d2662c1..3aada795060c 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4079,17 +4079,17 @@ void WW8RStyle::ScanStyles()// investigate 
style dependencies
 
 rSI.m_nFilePos = pStStrm->Tell();// remember FilePos
 sal_uInt16 nSkip;
-WW8_STD* pStd = Read1Style(nSkip, nullptr);  // read STD
-rSI.m_bValid = (nullptr != pStd);
+std::unique_ptr xStd(Read1Style(nSkip, nullptr));  // read STD
+rSI.m_bValid = xStd.get() != nullptr;
 if (rSI.m_bValid)
 {
-rSI.m_nBase = pStd->istdBase;// remember Basis
-rSI.m_bColl = ( pStd->sgc == 1 );// Para-Style
+rSI.m_nBase = xStd->istdBase; // remember Basis
+rSI.m_bColl = xStd->sgc == 1; // Para-Style
 }
 else
 rSI = SwWW8StyInf();
 
-delete pStd;
+xStd.reset();
 pStStrm->SeekRel( nSkip );  // skip Names and Sprms
 }
 }
commit ce577c94e7c4c53930a43ab0fd78fcacbf2eb01c
Author: Caolán McNamara 
Date:   Wed Apr 12 12:54:08 2017 +0100

drop unused argument

Change-Id: Ibbf3d6cbf694b1ca693d53c9ac92076a85df125f

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 9787ad27cfaa..19b75d2662c1 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3983,10 +3983,10 @@ void WW8RStyle::Import1Style( sal_uInt16 nNr )
 
 pStStrm->Seek( rSI.m_nFilePos );
 
-sal_uInt16 nSkip, cbStd;
+sal_uInt16 nSkip;
 OUString sName;
 
-std::unique_ptr xStd(Read1Style(nSkip, , ));// read 
Style
+std::unique_ptr xStd(Read1Style(nSkip, ));// read Style
 
 if (xStd)
 rSI.SetOrgWWIdent( sName, xStd->sti );
@@ -4079,7 +4079,7 @@ void WW8RStyle::ScanStyles()// investigate style 
dependencies
 
 rSI.m_nFilePos = pStStrm->Tell();// remember FilePos
 sal_uInt16 nSkip;
-WW8_STD* pStd = Read1Style( nSkip, nullptr, nullptr );  // read STD
+WW8_STD* pStd = Read1Style(nSkip, nullptr);  // read STD
 rSI.m_bValid = (nullptr != pStd);
 if (rSI.m_bValid)
 {
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 322f16c89876..4ce475c18952 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -6563,7 +6563,7 @@ WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara)
 // so it has no empty slot, we should allocate memory and a pointer should
 // reference to STD (perhaps filled with 0). If the slot is empty,
 // it will return a null pointer.
-WW8_STD* WW8Style::Read1STDFixed(sal_uInt16& rSkip, sal_uInt16* pcbStd)
+WW8_STD* WW8Style::Read1STDFixed(sal_uInt16& rSkip)
 {
 WW8_STD* pStd = nullptr;
 
@@ -6630,17 +6630,15 @@ WW8_STD* WW8Style::Read1STDFixed(sal_uInt16& rSkip, 
sal_uInt16* pcbStd)
 rSt.SeekRel( cbStd );   // skip leftovers
 rSkip = 0;
 }
-if( pcbStd )
-*pcbStd = cbStd;
 return pStd;
 }
 
-WW8_STD* WW8Style::Read1Style(sal_uInt16& rSkip, OUString* pString, 
sal_uInt16* pcbStd)
+WW8_STD* WW8Style::Read1Style(sal_uInt16& rSkip, OUString* pString)
 {
 // Attention: MacWord-Documents have their Stylenames
 // always in ANSI, even if eStructCharSet == CHARSET_MAC !!
 
-WW8_STD* pStd = Read1STDFixed(rSkip, pcbStd); // read STD
+WW8_STD* pStd = Read1STDFixed(rSkip); // read STD
 
 // string desired?
 if( pString )
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index c0ead8a7936e..c3b9cd284e0b 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -1563,8 +1563,8 @@ protected:
 
 public:
 WW8Style( SvStream& rSt, WW8Fib& rFibPara );
-WW8_STD* Read1STDFixed(sal_uInt16& rSkip, sal_uInt16* pcbStd);
-WW8_STD* Read1Style(sal_uInt16& rSkip, OUString* pString, sal_uInt16* 
pcbStd);
+WW8_STD* Read1STDFixed(sal_uInt16& rSkip);
+WW8_STD* Read1Style(sal_uInt16& rSkip, OUString* pString);
 sal_uInt16 GetCount() const { return cstd; }
 };
 
commit 13ca751a69f1aed666eade43d464b357dbe3c1af
Author: Caolán McNamara 
Date:   Wed Apr 12 12:52:40 2017 +0100

ofz: timeout, guard against going backwards

Change-Id: Ib91ae165147582bdb44690215a1df6f01ede796b

diff --git 

[Libreoffice-commits] core.git: 4 commits - sw/source ucb/source

2016-09-07 Thread Noel Grandin
 sw/source/filter/html/htmlcss1.cxx   |   10 +++---
 sw/source/filter/html/htmlctxt.cxx   |   20 ++--
 sw/source/filter/html/htmlgrin.cxx   |2 -
 sw/source/filter/html/htmlsect.cxx   |   16 -
 sw/source/filter/html/swhtml.hxx |   44 +--
 sw/source/filter/xml/xmlexpit.cxx|4 +-
 sw/source/filter/xml/xmlexpit.hxx|3 -
 sw/source/filter/xml/xmlfmt.cxx  |6 ---
 sw/source/filter/xml/xmlfmte.cxx |3 -
 sw/source/filter/xml/xmlimp.cxx  |2 -
 sw/source/filter/xml/xmlimp.hxx  |3 -
 sw/source/filter/xml/xmlimpit.cxx|5 +--
 sw/source/filter/xml/xmlimpit.hxx|3 -
 sw/source/filter/xml/xmlitemi.cxx|2 -
 sw/source/filter/xml/xmltexti.cxx|4 +-
 sw/source/filter/xml/xmltexti.hxx|2 -
 sw/source/ui/chrdlg/drpcps.cxx   |6 +--
 sw/source/ui/config/optpage.cxx  |4 +-
 sw/source/ui/dbui/mmresultdialogs.cxx|   12 +++
 sw/source/ui/dbui/selectdbtabledialog.cxx|   10 +++---
 sw/source/ui/inc/mmresultdialogs.hxx |6 +--
 sw/source/uibase/app/appopt.cxx  |   12 +++
 sw/source/uibase/config/cfgitems.cxx |   32 +--
 sw/source/uibase/dbui/dbtree.cxx |6 +--
 sw/source/uibase/dialog/swwrtshitem.cxx  |6 ++-
 sw/source/uibase/dochdl/swdtflvr.cxx |6 +--
 sw/source/uibase/frmdlg/colmgr.cxx   |   20 
 sw/source/uibase/inc/cfgitems.hxx|   20 +---
 sw/source/uibase/inc/colmgr.hxx  |2 -
 sw/source/uibase/inc/numfmtlb.hxx|2 -
 sw/source/uibase/inc/swwrtshitem.hxx |2 -
 sw/source/uibase/inc/uiitems.hxx |4 +-
 sw/source/uibase/inc/wrtsh.hxx   |2 -
 sw/source/uibase/uiview/viewprt.cxx  |2 -
 sw/source/uibase/uno/SwXDocumentSettings.cxx |2 -
 sw/source/uibase/utlui/numfmtlb.cxx  |6 +--
 sw/source/uibase/utlui/uiitems.cxx   |8 ++--
 sw/source/uibase/utlui/uitool.cxx|2 -
 sw/source/uibase/wrtsh/wrtsh3.cxx|4 +-
 ucb/source/regexp/regexp.cxx |8 
 40 files changed, 151 insertions(+), 162 deletions(-)

New commits:
commit bcbbf987771793030c7377f065f01f53c8f23ee3
Author: Noel Grandin 
Date:   Wed Sep 7 11:47:56 2016 +0200

-Werror=unused-but-set-variable

Change-Id: I1a7ed38a95b06029d821b000324b2cc880df1ebb

diff --git a/ucb/source/regexp/regexp.cxx b/ucb/source/regexp/regexp.cxx
index 11ee8fa..94ca028 100644
--- a/ucb/source/regexp/regexp.cxx
+++ b/ucb/source/regexp/regexp.cxx
@@ -87,11 +87,6 @@ bool Regexp::matches(OUString const & rString) const
 sal_Unicode const * p = pBegin;
 if (matchStringIgnoreCase(, pEnd, m_aPrefix))
 {
-sal_Unicode const * pBlock1End = pEnd;
-
-sal_Unicode const * pBlock2Begin = nullptr;
-sal_Unicode const * pBlock2End = nullptr;
-
 switch (m_eKind)
 {
 case KIND_PREFIX:
@@ -116,9 +111,6 @@ bool Regexp::matches(OUString const & rString) const
 && (q == pEnd || *q == '/' || *q == '?' || *q == '#'))
 {
 bMatches = true;
-pBlock1End = p;
-pBlock2Begin = q;
-pBlock2End = pEnd;
 break;
 }
 
commit 21cbf3a33dbf06c119cc3c1f377b953fd97af94b
Author: Noel Grandin 
Date:   Wed Sep 7 11:46:23 2016 +0200

convert HTML_CNTXT constants to typed_flags

Change-Id: I94197bd40e4eca751452494d41abba05f69c8b8c

diff --git a/sw/source/filter/html/htmlctxt.cxx 
b/sw/source/filter/html/htmlctxt.cxx
index 780cd6c..feb4938 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -224,14 +224,14 @@ void SwHTMLParser::SplitAttrTab( const SwPosition& 
rNewPos )
 }
 
 void SwHTMLParser::SaveDocContext( HTMLAttrContext *pCntxt,
-   sal_uInt16 nFlags,
+   HtmlContextFlags nFlags,
const SwPosition *pNewPos )
 {
 HTMLAttrContext_SaveDoc *pSave = pCntxt->GetSaveDocContext( true );
-pSave->SetStripTrailingPara( (HTML_CNTXT_STRIP_PARA & nFlags) != 0 );
-pSave->SetKeepNumRules( (HTML_CNTXT_KEEP_NUMRULE & nFlags) != 0 );
-pSave->SetFixHeaderDist( (HTML_CNTXT_HEADER_DIST & nFlags) != 0 );
-pSave->SetFixFooterDist( (HTML_CNTXT_FOOTER_DIST & nFlags) != 0 );
+pSave->SetStripTrailingPara( bool(HtmlContextFlags::StripPara & nFlags) );
+pSave->SetKeepNumRules( bool(HtmlContextFlags::KeepNumrule & nFlags) );
+pSave->SetFixHeaderDist( bool(HtmlContextFlags::HeaderDist & nFlags) );
+pSave->SetFixFooterDist( 

[Libreoffice-commits] core.git: 4 commits - sw/source

2016-04-29 Thread Michael Stahl
 sw/source/core/inc/rolbck.hxx |   20 --
 sw/source/core/txtnode/ndtxt.cxx  |3 
 sw/source/core/txtnode/thints.cxx |1 
 sw/source/core/undo/rolbck.cxx|  117 +++---
 sw/source/core/undo/unattr.cxx|   16 -
 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 |   10 +--
 sw/source/ui/fldui/fldvar.hxx |2 
 20 files changed, 66 insertions(+), 168 deletions(-)

New commits:
commit 17f4fc71164a1440e6805221fee19fae322129b9
Author: Michael Stahl 
Date:   Sat Apr 30 00:19:13 2016 +0200

sw: SwHistoryResetAttrSet now unused, remove it

Change-Id: I6b87b82cb359298e768dd4eb90a788cafe6b8b1c

diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index 7f660c1..a756779 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -70,7 +70,6 @@ enum HISTORY_HINT {
 HSTRY_FLYCNT,
 HSTRY_BOOKMARK,
 HSTRY_SETATTRSET,
-HSTRY_RESETATTRSET,
 HSTRY_CHGFLYANCHOR,
 HSTRY_CHGFLYCHAIN,
 HSTRY_CHGCHARFMT,
@@ -276,25 +275,6 @@ public:
 
 };
 
-class SwHistoryResetAttrSet : public SwHistoryHint
-{
-const sal_uLong m_nNodeIndex;
-const sal_Int32 m_nStart;
-const sal_Int32 m_nEnd;
-std::vector m_Array;
-
-public:
-SwHistoryResetAttrSet( const SfxItemSet& rSet, sal_uLong nNode,
-sal_Int32 nStt,
-sal_Int32 nEnd);
-virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ) override;
-
-const std::vector& GetArr() const { return m_Array; }
-sal_uLong GetNode() const   { return m_nNodeIndex; }
-sal_Int32 GetContent() const { return m_nStart; }
-
-};
-
 class SwHistoryChangeFlyAnchor : public SwHistoryHint
 {
 SwFrameFormat & m_rFormat;
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 4b62d49..a8ea84e 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -773,90 +773,6 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
 }
 }
 
-SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
-sal_uLong nNodePos, sal_Int32 nAttrStt, sal_Int32 nAttrEnd 
)
-: SwHistoryHint( HSTRY_RESETATTRSET )
-, m_nNodeIndex( nNodePos ), m_nStart( nAttrStt ), m_nEnd( nAttrEnd )
-, m_Array( (sal_uInt8)rSet.Count() )
-{
-SfxItemIter aIter( rSet );
-bool bAutoStyle = false;
-
-while( true )
-{
-const sal_uInt16 nWhich = aIter.GetCurItem()->Which();
-
-#ifdef DBG_UTIL
-switch (nWhich)
-{
-case RES_TXTATR_REFMARK:
-case RES_TXTATR_TOXMARK:
-if (m_nStart != m_nEnd) break; // else: fall through!
-case RES_TXTATR_FIELD:
-case RES_TXTATR_ANNOTATION:
-case RES_TXTATR_FLYCNT:
-case RES_TXTATR_FTN:
-case RES_TXTATR_META:
-case RES_TXTATR_METAFIELD:
-OSL_ENSURE(rSet.Count() == 1,
-"text attribute with CH_TXTATR, but not the only one:"
-"\nnot such a good idea");
-break;
-}
-#endif // DBG_UTIL
-
-// Character attribute cannot be inserted into the hints array
-// anymore. Therefore we have to treat them as one RES_TXTATR_AUTOFMT:
-if (isCHRATR(nWhich))
-{
-bAutoStyle = true;
-}
-else
-{
-m_Array.push_back( aIter.GetCurItem()->Which() );
-}
-
-if( aIter.IsAtEnd() )
-break;
-
-aIter.NextItem();
-}
-
-if ( bAutoStyle )
-{
-m_Array.push_back( RES_TXTATR_AUTOFMT );
-}
-}
-
-void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
-{
-::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
-
-SwContentNode * pContentNd = pDoc->GetNodes()[ m_nNodeIndex 
]->GetContentNode();
-OSL_ENSURE( pContentNd, "SwHistoryResetAttrSet: no ContentNode" );
-
-if (pContentNd)
-{
-std::vector::iterator it;
-if ( USHRT_MAX == m_nEnd && USHRT_MAX == m_nStart )
-{
-// no area: use ContentNode
-for ( it = m_Array.begin(); it != m_Array.end(); ++it )
-{
-pContentNd->ResetAttr( *it );
-}
-}
-else
-{
-// area: use TextNode
-for ( it = m_Array.begin(); it != 

[Libreoffice-commits] core.git: 4 commits - sw/source

2016-03-24 Thread Miklos Vajna
 sw/source/ui/dbui/mmgreetingspage.hxx |3 ++-
 sw/source/ui/dbui/mmresultdialogs.cxx |3 ++-
 sw/source/uibase/app/apphdl.cxx   |1 +
 sw/source/uibase/dbui/dbmgr.cxx   |3 ++-
 4 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit e7fb8dc9a3c2f40823b2b0c12c7962dc408092cc
Author: Miklos Vajna 
Date:   Thu Mar 24 21:09:22 2016 +0100

cid#1357166 null pointer dereference

Change-Id: Id1db85f7f52c2b35e069a0252457959b16a2fd02

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index f69fcc2..703e3c6 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1265,7 +1265,8 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
 // sub-document, to get the correct PageDesc.
 if(!bFreezedLayouts && bCreateSingleFile)
 {
-FreezeLayouts(pTargetShell, true);
+if (pTargetShell)
+FreezeLayouts(pTargetShell, true);
 bFreezedLayouts = true;
 }
 } while( !bCancel && bNoError &&
commit 80e3a7a671858f31133cf1fabfb5a3ca0b9a4680
Author: Miklos Vajna 
Date:   Thu Mar 24 21:05:35 2016 +0100

cid#1357167 missing break

Change-Id: I847106a409035b6432c74008cd2dc7c05de0

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index e721abc..1add22a 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -793,6 +793,7 @@ void SwModule::ExecOther(SfxRequest& rReq)
 if (pConfigItem && pConfigItem->GetTargetView())
 
pConfigItem->GetTargetView()->GetViewFrame()->GetFrame().Appear();
 }
+break;
 case FN_MAILMERGE_SAVE_DOCUMENTS:
 case FN_MAILMERGE_PRINT_DOCUMENTS:
 case FN_MAILMERGE_EMAIL_DOCUMENTS:
commit db7811852b7dcb662d24cad9fc4fe8a1d6519a80
Author: Miklos Vajna 
Date:   Thu Mar 24 21:04:14 2016 +0100

cid#1357171 uninitialized members

Change-Id: I8be96ed9ff66c9790b75e59fba17dd54eb12b7a2

diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx 
b/sw/source/ui/dbui/mmgreetingspage.hxx
index 2510b75..f81090a 100644
--- a/sw/source/ui/dbui/mmgreetingspage.hxx
+++ b/sw/source/ui/dbui/mmgreetingspage.hxx
@@ -61,7 +61,8 @@ protected:
 SwMailMergeConfigItem& m_rConfigItem;
 
 SwGreetingsHandler(SwMailMergeConfigItem& rConfigItem)
-: m_rConfigItem(rConfigItem)
+: m_bIsTabPage(false),
+m_rConfigItem(rConfigItem)
 {
 }
 
commit 9ef1c79e670fce2a3203d2a372e23b39fb290443
Author: Miklos Vajna 
Date:   Thu Mar 24 21:03:59 2016 +0100

cid#1357170 uninitialized members

Change-Id: Iccf20a4889c1b7598ef83f927844b9a0ddef7ee4

diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index fd8f128..44b3679 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -219,7 +219,8 @@ public:
 };
 
 SwMMResultSaveDialog::SwMMResultSaveDialog(vcl::Window* pParent)
-: SfxModalDialog(pParent, "MMResultSaveDialog", 
"modules/swriter/ui/mmresultsavedialog.ui")
+: SfxModalDialog(pParent, "MMResultSaveDialog", 
"modules/swriter/ui/mmresultsavedialog.ui"),
+m_bCancelSaving(false)
 {
 get(m_pSaveAsOneRB, "singlerb");
 get(m_pSaveIndividualRB, "individualrb");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 4 commits - sw/source vcl/source

2015-11-24 Thread Miklos Vajna
 sw/source/core/view/viewsh.cxx  |2 ++
 sw/source/uibase/docvw/SidebarScrollBar.cxx |   10 ++
 sw/source/uibase/docvw/SidebarScrollBar.hxx |2 ++
 sw/source/uibase/docvw/SidebarWin.cxx   |   10 +-
 vcl/source/control/scrbar.cxx   |   14 +-
 5 files changed, 32 insertions(+), 6 deletions(-)

New commits:
commit de2a6897876976d769504a36abf54eced626b01c
Author: Miklos Vajna 
Date:   Tue Nov 24 15:37:29 2015 +0100

sw lok comments: fix map mode state after changing zoom levels

Zoom level of SwEditWin is kept in sync with the client, so that the
pixel-based comment widgets can be positioned correctly. But that does
not mean in general the SwEditWin map mode should not be disabled: so
that we don't have to tweak the map mode for each and every
postMouseEvent() call and still be able to send them using logic
coordinates.

Change-Id: I6f686b93d2509d52fdd34e84a502cf04e1ce6e59

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index c45fd29..229b7a5 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1888,6 +1888,8 @@ void SwViewShell::PaintTile(VirtualDevice , int 
contextWidth, int contex
 SwViewOption aOption(*GetViewOptions());
 aOption.SetZoom(fScale * 100);
 ApplyViewOptions(aOption);
+// Make sure the map mode (disabled in 
SwXTextDocument::initializeForTiledRendering()) is still disabled.
+GetWin()->EnableMapMode(false);
 }
 
 Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY),
commit 7c654ee9d51a752e02c0a972de27d699ab5b649a
Author: Miklos Vajna 
Date:   Tue Nov 24 15:20:22 2015 +0100

sw lok comments: avoid crash an exit after clicking the scrollbar

Without this, vcl::Window::ImplTrackTimerHdl() will be called on a
deleted vcl::Window.

Can be reproduced with a comment having a scrollbar in a LOK client,
then clicking on the down button of the scrollbar a number of times ->
crash on exit.

Change-Id: I5d67f96e8baa199f65ec5cf39cb5d39c8162ff33

diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx 
b/sw/source/uibase/docvw/SidebarScrollBar.cxx
index ede4610..9e2c299 100644
--- a/sw/source/uibase/docvw/SidebarScrollBar.cxx
+++ b/sw/source/uibase/docvw/SidebarScrollBar.cxx
@@ -60,6 +60,11 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* 
pRectangle)
 rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, 
sRectangle.getStr());
 }
 
+void SidebarScrollBar::MouseButtonUp(const MouseEvent& /*rMouseEvent*/)
+{
+EndTracking();
+}
+
 void SidebarScrollBar::MouseMove(const MouseEvent& rMouseEvent)
 {
 TrackingEvent aEvent(rMouseEvent);
diff --git a/sw/source/uibase/docvw/SidebarScrollBar.hxx 
b/sw/source/uibase/docvw/SidebarScrollBar.hxx
index ea5639e..0de225b 100644
--- a/sw/source/uibase/docvw/SidebarScrollBar.hxx
+++ b/sw/source/uibase/docvw/SidebarScrollBar.hxx
@@ -31,6 +31,7 @@ protected:
 /// @see OutputDevice::LogicInvalidate().
 void LogicInvalidate(const Rectangle* pRectangle) override;
 void MouseMove(const MouseEvent& rMouseEvent) override;
+void MouseButtonUp(const MouseEvent& rMouseEvent) override;
 public:
 SidebarScrollBar(SwSidebarWin& rSidebarWin, WinBits nStyle, SwView& rView);
 virtual ~SidebarScrollBar();
commit d562df03098ecb91a89e91ccf69dd6a1eeb98c89
Author: Miklos Vajna 
Date:   Tue Nov 24 15:04:33 2015 +0100

sw lok comments: implement drag of the scrollbar

With this, if a comment has a vertical scrollbar, then not only the
buttons of the scrollbar can be clicked on, but also the slider of the
scrollbar can be dragged.

Change-Id: I2e39e18bf60c42a878bb8bfd808f1d47be27eecb

diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx 
b/sw/source/uibase/docvw/SidebarScrollBar.cxx
index 909aa76..ede4610 100644
--- a/sw/source/uibase/docvw/SidebarScrollBar.cxx
+++ b/sw/source/uibase/docvw/SidebarScrollBar.cxx
@@ -60,6 +60,11 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* 
pRectangle)
 rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, 
sRectangle.getStr());
 }
 
+void SidebarScrollBar::MouseMove(const MouseEvent& rMouseEvent)
+{
+TrackingEvent aEvent(rMouseEvent);
+Tracking(aEvent);
+}
 
 SidebarScrollBar::~SidebarScrollBar()
 {
diff --git a/sw/source/uibase/docvw/SidebarScrollBar.hxx 
b/sw/source/uibase/docvw/SidebarScrollBar.hxx
index 9543205..ea5639e 100644
--- a/sw/source/uibase/docvw/SidebarScrollBar.hxx
+++ b/sw/source/uibase/docvw/SidebarScrollBar.hxx
@@ -30,6 +30,7 @@ class SidebarScrollBar : public ScrollBar
 protected:
 /// @see OutputDevice::LogicInvalidate().
 void LogicInvalidate(const Rectangle* pRectangle) override;
+void MouseMove(const MouseEvent& rMouseEvent) override;
 public:
 SidebarScrollBar(SwSidebarWin& 

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-11-16 Thread Jan Holesovsky
 sw/source/core/crsr/findattr.cxx |   10 +-
 sw/source/core/crsr/findcoll.cxx |8 --
 sw/source/core/draw/dflyobj.cxx  |   24 +++---
 sw/source/core/inc/dflyobj.hxx   |6 -
 sw/source/core/text/widorp.cxx   |  136 +++
 sw/source/core/text/widorp.hxx   |   14 ++--
 6 files changed, 98 insertions(+), 100 deletions(-)

New commits:
commit f5c11ad18106f100b0fa3fc215540a037fb5d338
Author: Jan Holesovsky 
Date:   Mon Nov 16 10:55:38 2015 +0100

sw: Prefix a member in SwVirtFlyDrawObj.

Change-Id: I5514bf16446fa4e4c498a6bc1df77e4f59565ee1

diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 3b9cf03..d03ca01 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -374,9 +374,9 @@ sdr::contact::ViewContact* 
SwVirtFlyDrawObj::CreateObjectSpecificViewContact()
 
 SwVirtFlyDrawObj::SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly) :
 SdrVirtObj( rNew ),
-pFlyFrm( pFly )
+m_pFlyFrm( pFly )
 {
-const SvxProtectItem  = pFlyFrm->GetFormat()->GetProtect();
+const SvxProtectItem  = m_pFlyFrm->GetFormat()->GetProtect();
 bMovProt = rP.IsPosProtected();
 bSizProt = rP.IsSizeProtected();
 }
@@ -444,7 +444,7 @@ namespace
 void SwVirtFlyDrawObj::wrap_DoPaintObject(
 drawinglayer::geometry::ViewInformation2D const& rViewInformation) const
 {
-SwViewShell* pShell = pFlyFrm->getRootFrm()->GetCurrShell();
+SwViewShell* pShell = m_pFlyFrm->getRootFrm()->GetCurrShell();
 
 // Only paint when we have a current shell and a DrawingLayer paint is in 
progress.
 // This avoids evtl. problems with renderers which do processing stuff,
@@ -466,7 +466,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject(
 // which is slow, wastes memory, and can cause other trouble.
 (void) rViewInformation; // suppress "unused parameter" warning
 assert(comphelper::LibreOfficeKit::isActive() || 
!rViewInformation.getViewport().isEmpty());
-if ( !pFlyFrm->IsFlyInCntFrm() )
+if ( !m_pFlyFrm->IsFlyInCntFrm() )
 {
 // it is also necessary to restore the VCL MapMode from 
ViewInformation since e.g.
 // the VCL PixelRenderer resets it at the used OutputDevice. 
Unfortunately, this
@@ -477,7 +477,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject(
 RestoreMapMode aRestoreMapModeIfNeeded( pShell );
 
 // paint the FlyFrame (use standard VCL-Paint)
-pFlyFrm->Paint( *pShell->GetOut(), GetFlyFrm()->Frm() );
+m_pFlyFrm->Paint( *pShell->GetOut(), GetFlyFrm()->Frm() );
 }
 }
 }
@@ -961,23 +961,23 @@ Pointer  SwVirtFlyDrawObj::GetMacroPointer(
 
 bool SwVirtFlyDrawObj::HasMacro() const
 {
-const SwFormatURL  = pFlyFrm->GetFormat()->GetURL();
+const SwFormatURL  = m_pFlyFrm->GetFormat()->GetURL();
 return rURL.GetMap() || !rURL.GetURL().isEmpty();
 }
 
 SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const SdrObjMacroHitRec& rRec ) 
const
 {
-const SwFormatURL  = pFlyFrm->GetFormat()->GetURL();
+const SwFormatURL  = m_pFlyFrm->GetFormat()->GetURL();
 if( rURL.GetMap() || !rURL.GetURL().isEmpty() )
 {
 SwRect aRect;
-if ( pFlyFrm->Lower() && pFlyFrm->Lower()->IsNoTextFrm() )
+if ( m_pFlyFrm->Lower() && m_pFlyFrm->Lower()->IsNoTextFrm() )
 {
-aRect = pFlyFrm->Prt();
-aRect += pFlyFrm->Frm().Pos();
+aRect = m_pFlyFrm->Prt();
+aRect += m_pFlyFrm->Frm().Pos();
 }
 else
-aRect = pFlyFrm->Frm();
+aRect = m_pFlyFrm->Frm();
 
 if( aRect.IsInside( rRec.aPos ) )
 {
@@ -989,7 +989,7 @@ SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const 
SdrObjMacroHitRec& rRec ) cons
 if( aRect.IsInside( rRec.aPos ) )
 {
 if( !rURL.GetMap() ||
-pFlyFrm->GetFormat()->GetIMapObject( rRec.aPos, pFlyFrm ))
+m_pFlyFrm->GetFormat()->GetIMapObject( rRec.aPos, 
m_pFlyFrm ))
 return const_cast(static_cast(this));
 
 return nullptr;
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index c21fa1a..40eba19 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -60,7 +60,7 @@ public:
 class SwVirtFlyDrawObj : public SdrVirtObj
 {
 private:
-SwFlyFrm *pFlyFrm;
+SwFlyFrm *m_pFlyFrm;
 
 protected:
 // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
@@ -110,8 +110,8 @@ public:
   SwFrameFormat *GetFormat();
 
 // methods to get pointers for the Fly
-  SwFlyFrm* GetFlyFrm() { return pFlyFrm; }
-const SwFlyFrm* GetFlyFrm() const   { return pFlyFrm; }
+  SwFlyFrm* GetFlyFrm() { return m_pFlyFrm; }
+const SwFlyFrm* GetFlyFrm() const   { 

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-11-13 Thread Miklos Vajna
 sw/source/core/text/porlay.cxx   |   16 -
 sw/source/core/text/porlay.hxx   |  106 +-
 sw/source/filter/xml/xmltbli.cxx |  400 +++
 sw/source/filter/xml/xmltbli.hxx |   58 ++---
 sw/source/ui/envelp/labfmt.cxx   |  116 +--
 sw/source/ui/envelp/labfmt.hxx   |   52 ++---
 sw/source/uibase/inc/formedt.hxx |   42 ++--
 7 files changed, 395 insertions(+), 395 deletions(-)

New commits:
commit 617c72c1516417da0134859e0a8818ce1e0bf60a
Author: Miklos Vajna 
Date:   Fri Nov 13 09:09:46 2015 +0100

sw: prefix members of SwIdxFormDlg

Change-Id: I8da7fbf28b115d809ebdb8b10532455f0fc871d7

diff --git a/sw/source/uibase/inc/formedt.hxx b/sw/source/uibase/inc/formedt.hxx
index cd74b45..9439c4a 100644
--- a/sw/source/uibase/inc/formedt.hxx
+++ b/sw/source/uibase/inc/formedt.hxx
@@ -39,28 +39,28 @@ class SwIdxFormDlg : public SvxStandardDialog
 {
 voidApply() override;
 
-VclPtr aEntryLB;
-VclPtraOKBtn;
-VclPtraCancelBT;
-VclPtr   aLevelFT;
-VclPtraEntryED;
-VclPtr  aEntryBT;
-VclPtr  aTabBT;
-VclPtr  aPageBT;
-VclPtr  aJumpBT;
-VclPtr   aEntryFL;
-VclPtr   aLevelFT2;
-VclPtr aLevelLB;
-VclPtr   aTemplateFT;
-VclPtr aParaLayLB;
-VclPtr  aStdBT;
-VclPtr  aAssignBT;
-VclPtr   aFormatFL;
+VclPtr m_aEntryLB;
+VclPtrm_aOKBtn;
+VclPtrm_aCancelBT;
+VclPtr   m_aLevelFT;
+VclPtrm_aEntryED;
+VclPtr  m_aEntryBT;
+VclPtr  m_aTabBT;
+VclPtr  m_aPageBT;
+VclPtr  m_aJumpBT;
+VclPtr   m_aEntryFL;
+VclPtr   m_aLevelFT2;
+VclPtr m_aLevelLB;
+VclPtr   m_aTemplateFT;
+VclPtr m_aParaLayLB;
+VclPtr  m_aStdBT;
+VclPtr  m_aAssignBT;
+VclPtr   m_aFormatFL;
 
-SwWrtShell 
-SwForm *pForm;
-sal_uInt16  nAktLevel;
-boolbLastLinkIsEnd;
+SwWrtShell _rSh;
+SwForm *m_pForm;
+sal_uInt16  m_nAktLevel;
+boolm_bLastLinkIsEnd;
 
 public:
 SwIdxFormDlg( vcl::Window* pParent, SwWrtShell , const SwForm& 
rForm );
commit 158eeaec807182af47aeadcf794c571c19a84b30
Author: Miklos Vajna 
Date:   Fri Nov 13 09:08:28 2015 +0100

sw: prefix members of SwXMLTableContext

Change-Id: I3c6bf5f4e56a60f2d869844b7c006eb8d6948e73

diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index d8808ab..8cb7e49 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1277,22 +1277,22 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& 
rImport,
 const OUString& rLName,
 const Reference< xml::sax::XAttributeList > & xAttrList ) :
 XMLTextTableContext( rImport, nPrfx, rLName ),
-pColumnDefaultCellStyleNames( nullptr ),
+m_pColumnDefaultCellStyleNames( nullptr ),
 m_pRows( new SwXMLTableRows_Impl ),
-pTableNode( nullptr ),
-pBox1( nullptr ),
-pSttNd1( nullptr ),
-pBoxFormat( nullptr ),
-pLineFormat( nullptr ),
-pSharedBoxFormats(nullptr),
-pDDESource(nullptr),
-bFirstSection( true ),
-bRelWidth( true ),
-bHasSubTables( false ),
-nHeaderRows( 0 ),
-nCurRow( 0UL ),
-nCurCol( 0UL ),
-nWidth( 0UL )
+m_pTableNode( nullptr ),
+m_pBox1( nullptr ),
+m_pSttNd1( nullptr ),
+m_pBoxFormat( nullptr ),
+m_pLineFormat( nullptr ),
+m_pSharedBoxFormats(nullptr),
+m_pDDESource(nullptr),
+m_bFirstSection( true ),
+m_bRelWidth( true ),
+m_bHasSubTables( false ),
+m_nHeaderRows( 0 ),
+m_nCurRow( 0UL ),
+m_nCurCol( 0UL ),
+m_nWidth( 0UL )
 {
 OUString aName;
 OUString sXmlId;
@@ -1313,11 +1313,11 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& 
rImport,
 if( XML_NAMESPACE_TABLE == nPrefix )
 {
 if( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
-aStyleName = rValue;
+m_aStyleName = rValue;
 else if( IsXMLToken( aLocalName, XML_NAME ) )
 aName = rValue;
 else if( IsXMLToken( aLocalName, XML_DEFAULT_CELL_STYLE_NAME ) )
-aDfltCellStyleName = rValue;
+m_aDfltCellStyleName = rValue;
 }
 else if ( (XML_NAMESPACE_XML == nPrefix) &&
  IsXMLToken( aLocalName, XML_ID ) )
@@ -1362,8 +1362,8 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& 
rImport,
 
 try
 {
-xTextContent = xTable;
-GetImport().GetTextImport()->InsertTextContent( xTextContent );
+m_xTextContent = xTable;
+GetImport().GetTextImport()->InsertTextContent( m_xTextContent );
 }
 catch( IllegalArgumentException& )
 {
@@ -1388,7 +1388,7 @@ 

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-11-10 Thread Michael Stahl
 sw/source/filter/html/htmltab.cxx |  181 +++---
 sw/source/filter/html/svxcss1.cxx |   14 +-
 sw/source/filter/html/svxcss1.hxx |7 -
 3 files changed, 105 insertions(+), 97 deletions(-)

New commits:
commit 35854bc3ade4875f801da907d69b168b97a56101
Author: Michael Stahl 
Date:   Tue Nov 10 21:24:08 2015 +0100

sw: replace boost::ptr_vector with std::vector

Change-Id: I6d4c9877b4fd0147d75260570cbca6b9a6333762

diff --git a/sw/source/filter/html/htmltab.cxx 
b/sw/source/filter/html/htmltab.cxx
index 987340c..5e1fc09 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -57,8 +57,6 @@
 #include "swcss1.hxx"
 #include 
 
-#include 
-
 #define NETSCAPE_DFLT_BORDER 1
 #define NETSCAPE_DFLT_CELLSPACING 2
 
@@ -362,7 +360,7 @@ public:
 // HTML table
 typedef std::vector HTMLTableRows;
 
-typedef boost::ptr_vector HTMLTableColumns;
+typedef std::vector HTMLTableColumns;
 
 typedef std::vector SdrObjects;
 
@@ -377,7 +375,7 @@ class HTMLTable
 std::vector *pDrawObjPrcWidths;   // column of draw object and 
its rel. width
 
 HTMLTableRows *m_pRows; ///< table rows
-HTMLTableColumns *pColumns; // table columns
+HTMLTableColumns *m_pColumns;   ///< table columns
 
 sal_uInt16 nRows;   // number of rows
 sal_uInt16 nCols;   // number of columns
@@ -929,7 +927,7 @@ void HTMLTable::InitCtor( const HTMLTableOptions *pOptions )
 pDrawObjPrcWidths = nullptr;
 
 m_pRows = new HTMLTableRows;
-pColumns = new HTMLTableColumns;
+m_pColumns = new HTMLTableColumns;
 nRows = 0;
 nCurRow = 0; nCurCol = 0;
 
@@ -1080,7 +1078,7 @@ HTMLTable::HTMLTable( SwHTMLParser* pPars, HTMLTable 
*pTopTab,
 InitCtor( pOptions );
 
 for( sal_uInt16 i=0; ipush_back( new HTMLTableColumn );
+m_pColumns->push_back(o3tl::make_unique());
 }
 
 HTMLTable::~HTMLTable()
@@ -1089,7 +1087,7 @@ HTMLTable::~HTMLTable()
 delete pDrawObjPrcWidths;
 
 delete m_pRows;
-delete pColumns;
+delete m_pColumns;
 delete pBGBrush;
 delete pInhBGBrush;
 
@@ -1105,7 +1103,7 @@ SwHTMLTableLayout *HTMLTable::CreateLayoutInfo()
 
 sal_uInt16 nBorderWidth = GetBorderWidth( aBorderLine, true );
 sal_uInt16 nLeftBorderWidth =
-((*pColumns)[0]).bLeftBorder ? GetBorderWidth( aLeftBorderLine, true ) 
: 0;
+(*m_pColumns)[0]->bLeftBorder ? GetBorderWidth(aLeftBorderLine, true) 
: 0;
 sal_uInt16 nRightBorderWidth =
 bRightBorder ? GetBorderWidth( aRightBorderLine, true ) : 0;
 sal_uInt16 nInhLeftBorderWidth = 0;
@@ -1146,7 +1144,7 @@ SwHTMLTableLayout *HTMLTable::CreateLayoutInfo()
 pLayoutInfo->SetExportable( bExportable );
 
 for( i=0; iSetColumn( ((*pColumns)[i]).CreateLayoutInfo(), i );
+pLayoutInfo->SetColumn( ((*m_pColumns)[i])->CreateLayoutInfo(), i );
 
 return pLayoutInfo;
 }
@@ -1345,7 +1343,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
 sal_uInt32 nNumFormat = 0;
 double nValue = 0.0;
 
-HTMLTableColumn *pColumn = &(*pColumns)[nCol];
+HTMLTableColumn *const pColumn = (*m_pColumns)[nCol].get();
 
 if( pBox->GetSttNd() )
 {
@@ -1450,7 +1448,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
 }
 bSet = true;
 }
-if( ((*pColumns)[nCol]).bLeftBorder )
+if (((*m_pColumns)[nCol])->bLeftBorder)
 {
 const SvxBorderLine& rBorderLine =
 0==nCol ? aLeftBorderLine : aBorderLine;
@@ -1934,7 +1932,7 @@ void HTMLTable::InheritVertBorders( const HTMLTable 
*pParent,
 GetBorderWidth( aInhRightBorderLine, true ) + MIN_BORDER_DIST;
 }
 
-if( ((*pParent->pColumns)[nCol]).bLeftBorder )
+if (((*pParent->m_pColumns)[nCol])->bLeftBorder)
 {
 bInhLeftBorder = true;  // erstmal nur merken
 aInhLeftBorderLine = 0==nCol ? pParent->aLeftBorderLine
@@ -1952,7 +1950,7 @@ void HTMLTable::InheritVertBorders( const HTMLTable 
*pParent,
 
 bRightAlwd = ( pParent->bRightAlwd &&
   (nCol+nColSpan==pParent->nCols ||
-   !((*pParent->pColumns)[nCol+nColSpan]).bLeftBorder) );
+   !((*pParent->m_pColumns)[nCol+nColSpan])->bLeftBorder) );
 }
 
 void HTMLTable::SetBorders()
@@ -1961,8 +1959,10 @@ void HTMLTable::SetBorders()
 for( i=1; iIsEndOfGroup()))
+{
+((*m_pColumns)[i])->bLeftBorder = true;
+}
 
 for( i=0; i

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-11-10 Thread Miklos Vajna
 sw/source/filter/ww8/ww8graf.cxx   |4 
 sw/source/filter/ww8/ww8par.cxx|   32 +--
 sw/source/filter/ww8/ww8par.hxx|  114 +--
 sw/source/filter/ww8/ww8par2.cxx   |  136 ++---
 sw/source/filter/ww8/ww8par3.cxx   |   44 ++--
 sw/source/filter/ww8/ww8par6.cxx   |   68 +++---
 sw/source/ui/frmdlg/frmpage.cxx|  280 +--
 sw/source/uibase/inc/frmpage.hxx   |   54 ++---
 sw/source/uibase/inc/redlndlg.hxx  |   58 ++---
 sw/source/uibase/inc/toxmgr.hxx|  182 +-
 sw/source/uibase/index/toxmgr.cxx  |   10 
 sw/source/uibase/misc/redlndlg.cxx |  372 ++---
 12 files changed, 677 insertions(+), 677 deletions(-)

New commits:
commit fdeaa040059647f7bd1d103f2971e945bbe18659
Author: Miklos Vajna 
Date:   Wed Nov 11 08:56:22 2015 +0100

sw: prefix members of SwFrmAddPage

Change-Id: Id4a5a5794ff03a88922df7fd1dcba75ed601dd59

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 81d391b..514be1b 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2864,34 +2864,34 @@ IMPL_LINK_NOARG_TYPED(SwFrmURLPage, InsertFileHdl, 
Button*, void)
 
 SwFrmAddPage::SwFrmAddPage(vcl::Window *pParent, const SfxItemSet )
 : SfxTabPage(pParent, "FrmAddPage" , "modules/swriter/ui/frmaddpage.ui", 
)
-, pWrtSh(nullptr)
-, bHtmlMode(false)
-, bFormat(false)
-, bNew(false)
-{
-get(pNameFrame, "nameframe");
-get(pNameFT,"name_label");
-get(pNameED,"name");
-get(pAltNameFT,"altname_label");
-get(pAltNameED,"altname");
-get(pPrevFT,"prev_label");
-get(pPrevLB,"prev");
-get(pNextFT,"next_label");
-get(pNextLB,"next");
-
-get(pProtectFrame,"protect");
-get(pProtectContentCB,"protectcontent");
-get(pProtectFrameCB,"protectframe");
-get(pProtectSizeCB,"protectsize");
+, m_pWrtSh(nullptr)
+, m_bHtmlMode(false)
+, m_bFormat(false)
+, m_bNew(false)
+{
+get(m_pNameFrame, "nameframe");
+get(m_pNameFT,"name_label");
+get(m_pNameED,"name");
+get(m_pAltNameFT,"altname_label");
+get(m_pAltNameED,"altname");
+get(m_pPrevFT,"prev_label");
+get(m_pPrevLB,"prev");
+get(m_pNextFT,"next_label");
+get(m_pNextLB,"next");
+
+get(m_pProtectFrame,"protect");
+get(m_pProtectContentCB,"protectcontent");
+get(m_pProtectFrameCB,"protectframe");
+get(m_pProtectSizeCB,"protectsize");
 
 get(m_pContentAlignFrame, "contentalign");
 get(m_pVertAlignLB,"vertalign");
 
-get(pPropertiesFrame,"properties");
-get(pEditInReadonlyCB,"editinreadonly");
-get(pPrintFrameCB,"printframe");
-get(pTextFlowFT,"textflow_label");
-get(pTextFlowLB,"textflow");
+get(m_pPropertiesFrame,"properties");
+get(m_pEditInReadonlyCB,"editinreadonly");
+get(m_pPrintFrameCB,"printframe");
+get(m_pTextFlowFT,"textflow_label");
+get(m_pTextFlowLB,"textflow");
 
 }
 
@@ -2902,26 +2902,26 @@ SwFrmAddPage::~SwFrmAddPage()
 
 void SwFrmAddPage::dispose()
 {
-pNameFrame.clear();
-pNameFT.clear();
-pNameED.clear();
-pAltNameFT.clear();
-pAltNameED.clear();
-pPrevFT.clear();
-pPrevLB.clear();
-pNextFT.clear();
-pNextLB.clear();
-pProtectFrame.clear();
-pProtectContentCB.clear();
-pProtectFrameCB.clear();
-pProtectSizeCB.clear();
+m_pNameFrame.clear();
+m_pNameFT.clear();
+m_pNameED.clear();
+m_pAltNameFT.clear();
+m_pAltNameED.clear();
+m_pPrevFT.clear();
+m_pPrevLB.clear();
+m_pNextFT.clear();
+m_pNextLB.clear();
+m_pProtectFrame.clear();
+m_pProtectContentCB.clear();
+m_pProtectFrameCB.clear();
+m_pProtectSizeCB.clear();
 m_pContentAlignFrame.clear();
 m_pVertAlignLB.clear();
-pPropertiesFrame.clear();
-pEditInReadonlyCB.clear();
-pPrintFrameCB.clear();
-pTextFlowFT.clear();
-pTextFlowLB.clear();
+m_pPropertiesFrame.clear();
+m_pEditInReadonlyCB.clear();
+m_pPrintFrameCB.clear();
+m_pTextFlowFT.clear();
+m_pTextFlowLB.clear();
 SfxTabPage::dispose();
 }
 
@@ -2935,30 +2935,30 @@ void SwFrmAddPage::Reset(const SfxItemSet *rSet )
 {
 const SfxPoolItem* pItem;
 sal_uInt16 nHtmlMode = ::GetHtmlMode(static_cast(SfxObjectShell::Current()));
-bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
-if (bHtmlMode)
+m_bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0;
+if (m_bHtmlMode)
 {
-pProtectFrame->Hide();
-pEditInReadonlyCB->Hide();
-pPrintFrameCB->Hide();
+m_pProtectFrame->Hide();
+m_pEditInReadonlyCB->Hide();
+m_pPrintFrameCB->Hide();
 }
-if (sDlgType == "PictureDialog" || sDlgType == "ObjectDialog")
+if (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog")
 {
-pEditInReadonlyCB->Hide();
-if (bHtmlMode)
+m_pEditInReadonlyCB->Hide();
+if (m_bHtmlMode)
 {
-   

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-10-21 Thread Michael Stahl
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   27 ++
 sw/source/core/fields/reffld.cxx|   12 +++---
 sw/source/ui/index/cnttab.cxx   |   29 
 sw/source/uibase/dochdl/gloshdl.cxx |   12 ++
 4 files changed, 36 insertions(+), 44 deletions(-)

New commits:
commit fcc2415ade6ae93710bbbda9f7e163045e323105
Author: Michael Stahl 
Date:   Wed Oct 21 17:38:29 2015 +0200

sw: replace boost::ptr_vector with std::vector

Change-Id: I5c011939ec492e0ae2cf136554b8b1f42e1253e9

diff --git a/sw/source/uibase/dochdl/gloshdl.cxx 
b/sw/source/uibase/dochdl/gloshdl.cxx
index 6050cf6..4ac121b 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -59,8 +59,6 @@
 
 #include 
 
-#include 
-
 #include 
 
 using namespace ::com::sun::star;
@@ -72,6 +70,8 @@ struct TextBlockInfo_Impl
 OUString sTitle;
 OUString sLongName;
 OUString sGroupName;
+TextBlockInfo_Impl(OUString const& rTitle, OUString const& rLongName, 
OUString const& rGroupName)
+: sTitle(rTitle), sLongName(rLongName), sGroupName(rGroupName) {}
 };
 
 // Dialog for edit templates
@@ -395,7 +395,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName,
 SwGlossaries *pGlossaries,
 SwTextBlocks *pGlossary  )
 {
-boost::ptr_vector aFoundArr;
+std::vector aFoundArr;
 OUString aShortName( rShortName );
 bool bCancel = false;
 // search for text block
@@ -424,11 +424,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName,
 const OUString 
sShortName(pGlossaryList->GetBlockShortName(i, j));
 if( rSCmp.isEqual( rShortName, sShortName ))
 {
-TextBlockInfo_Impl* pData = new TextBlockInfo_Impl;
-pData->sTitle = sTitle;
-pData->sLongName = sLongName;
-pData->sGroupName = sGroupName;
-aFoundArr.push_back(pData);
+aFoundArr.push_back(TextBlockInfo_Impl(sTitle, 
sLongName, sGroupName));
 }
 }
 }
commit 2f5748afa7841ef65476d3656009cff4bc8e1150
Author: Michael Stahl 
Date:   Wed Oct 21 17:12:37 2015 +0200

sw: replace boost::ptr_vector with std::vector

Change-Id: If476381b05b046443facc9dd220d273133bda651

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 529d04b..b779796 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -79,7 +79,8 @@
 
 #include 
 
-#include 
+#include 
+#include 
 #include 
 
 
@@ -157,7 +158,7 @@ class SwEntryBrowseBox : public SwEntryBrowseBox_Base
 OUString  sYes;
 OUString  sNo;
 
-boost::ptr_vector aEntryArr;
+std::vector m_Entries;
 
 ::svt::CellControllerRefxController;
 ::svt::CellControllerRefxCheckController;
@@ -3964,9 +3965,9 @@ bool SwEntryBrowseBox::SeekRow( long nRow )
 OUString SwEntryBrowseBox::GetCellText(long nRow, sal_uInt16 nColumn) const
 {
 const OUString* pRet = 
-if (aEntryArr.size() > static_cast(nRow))
+if (static_cast(nRow) < m_Entries.size())
 {
-const AutoMarkEntry* pEntry = [ nRow ];
+const AutoMarkEntry* pEntry = m_Entries[ nRow ].get();
 switch(nColumn)
 {
 case  ITEM_SEARCH   :pRet = >sSearch; break;
@@ -4012,8 +4013,8 @@ bool SwEntryBrowseBox::SaveModified()
 pController = xCheckController;
 bVal = static_cast< 
::svt::CheckBoxCellController*>(pController)->GetCheckBox().IsChecked();
 }
-AutoMarkEntry* pEntry = nRow >= aEntryArr.size() ? new AutoMarkEntry
-  : [nRow];
+AutoMarkEntry* pEntry = (nRow >= m_Entries.size()) ? new AutoMarkEntry
+   : m_Entries[nRow].get();
 switch(nCol)
 {
 case  ITEM_SEARCH   : pEntry->sSearch = sNew; break;
@@ -4024,9 +4025,9 @@ bool SwEntryBrowseBox::SaveModified()
 case  ITEM_CASE : pEntry->bCase = bVal; break;
 case  ITEM_WORDONLY : pEntry->bWord = bVal; break;
 }
-if(nRow >= aEntryArr.size())
+if (nRow >= m_Entries.size())
 {
-aEntryArr.push_back( pEntry );
+m_Entries.push_back(std::unique_ptr(pEntry));
 RowInserted(nRow, 1, true, true);
 if(nCol < ITEM_WORDONLY)
 {
@@ -4090,21 +4091,21 @@ void SwEntryBrowseBox::ReadEntries(SvStream& rInStr)
 sStr = sLine.getToken(0, ';', nSttPos );
 pToInsert->bWord = !sStr.isEmpty() && sStr != "0";
 
-aEntryArr.push_back( pToInsert );
+m_Entries.push_back(std::unique_ptr(pToInsert));
 pToInsert = 0;
 }
   

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-10-12 Thread Michael Stahl
 sw/source/core/inc/UndoTable.hxx |   10 ++--
 sw/source/core/undo/untbl.cxx|   89 +++
 2 files changed, 50 insertions(+), 49 deletions(-)

New commits:
commit da8e85f55445ab2bb204fc3b44ce8793aeeef9d5
Author: Michael Stahl 
Date:   Mon Oct 12 13:41:04 2015 +0200

sw: replace boost::ptr_vector with std::vector

Change-Id: I72ec77d4226c98abbe849a03dc009f46f695923b

diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index ddd9673..fbd5f05 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -174,7 +174,7 @@ class SwUndoTableNdsChg : public SwUndo, private 
boost::noncopyable
 bool operator<(const _BoxMove& other) const { return index < 
other.index; };
 };
 std::unique_ptr< std::set<_BoxMove> > pNewSttNds;
-std::unique_ptr< SwUndoSaveSections > pDelSects;
+std::unique_ptr m_pDelSects;
 long nMin, nMax;// for redo of delete column
 sal_uLong nSttNode, nCurrBox;
 sal_uInt16 nCount, nRelDiff, nAbsDiff, nSetColType;
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 3ecead8..34ff5ca 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -64,8 +64,6 @@
 #include 
 #include 
 
-#include 
-
 #include 
 #include 
 
@@ -83,10 +81,7 @@
 
 typedef std::vector SfxItemSets;
 
-class SwUndoSaveSections : public boost::ptr_vector {
-public:
-explicit SwUndoSaveSections(size_type n) : 
boost::ptr_vector(n) {}
-};
+class SwUndoSaveSections : public 
std::vector {};
 
 class SwUndoMoves : public std::vector {};
 
@@ -1662,14 +1657,14 @@ void SwUndoTableNdsChg::SaveNewBoxes( const 
SwTableNode& rTableNd,
 void SwUndoTableNdsChg::SaveSection( SwStartNode* pSttNd )
 {
 OSL_ENSURE( IsDelBox(), "wrong Action" );
-if( pDelSects.get() == NULL )
-pDelSects.reset( new SwUndoSaveSections( 10 ) );
+if (m_pDelSects.get() == nullptr)
+m_pDelSects.reset(new SwUndoSaveSections);
 
 SwTableNode* pTableNd = pSttNd->FindTableNode();
-SwUndoSaveSection* pSave = new SwUndoSaveSection;
+std::unique_ptr pSave(new SwUndoSaveSection);
 pSave->SaveSection( SwNodeIndex( *pSttNd ));
 
-pDelSects->push_back( pSave );
+m_pDelSects->push_back(std::move(pSave));
 nSttNode = pTableNd->GetIndex();
 }
 
@@ -1701,9 +1696,9 @@ void SwUndoTableNdsChg::UndoImpl(::sw::UndoRedoContext & 
rContext)
 SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes();
 
 // restore sections
-for( size_t n = pDelSects->size(); n; )
+for (size_t n = m_pDelSects->size(); n; )
 {
-SwUndoSaveSection* pSave = &(*pDelSects)[ --n ];
+SwUndoSaveSection *const pSave = (*m_pDelSects)[ --n ].get();
 pSave->RestoreSection( , , SwTableBoxStartNode );
 if( pSave->GetHistory() )
 pSave->GetHistory()->Rollback(  );
@@ -1711,7 +1706,7 @@ void SwUndoTableNdsChg::UndoImpl(::sw::UndoRedoContext & 
rContext)
 pCpyBox->GetUpper() );
 rLnBoxes.push_back( pBox );
 }
-pDelSects->clear();
+m_pDelSects->clear();
 }
 else if( !pNewSttNds->empty() )
 {
@@ -1909,7 +1904,12 @@ void SwUndoTableNdsChg::RedoImpl(::sw::UndoRedoContext & 
rContext)
 
 if( pUndo )
 {
-pDelSects->transfer( pDelSects->begin(), 
*static_cast(pUndo)->pDelSects.get() );
+m_pDelSects->insert(m_pDelSects->begin(),
+std::make_move_iterator(
+static_cast(pUndo)->m_pDelSects->begin()),
+std::make_move_iterator(
+static_cast(pUndo)->m_pDelSects->end()));
+static_cast(pUndo)->m_pDelSects->clear();
 delete pUndo;
 }
 rDoc.GetIDocumentUndoRedo().DoUndo( false );
commit cc47088d8733603b351259d3a4b5bf1b4270e8f0
Author: Michael Stahl 
Date:   Mon Oct 12 12:45:37 2015 +0200

sw: replace boost::ptr_vector with std::vector

Change-Id: I35063a241937137c4ebf4393dd880fa7cb7c8546

diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 58a320d..ddd9673 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -103,7 +103,7 @@ class SwUndoTableToText : public SwUndo
 OUString sTableNm;
 SwDDEFieldType* pDDEFieldType;
 _SaveTable* pTableSave;
-SwTableToTextSaves* pBoxSaves;
+SwTableToTextSaves* m_pBoxSaves;
 SwHistory* pHistory;
 sal_uLong nSttNd, nEndNd;
 sal_Unicode cTrenner;
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index b69f7a3..3ecead8 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -91,10 +91,7 @@ public:
 class SwUndoMoves : 

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-10-01 Thread Michael Stahl
 sw/source/core/doc/tblrwcl.cxx   |   29 
 sw/source/core/inc/UndoSort.hxx  |8 ---
 sw/source/core/inc/tblrwcl.hxx   |8 ++-
 sw/source/core/undo/unsort.cxx   |   40 +--
 sw/source/core/undo/untbl.cxx|3 ++
 sw/source/filter/xml/xmltbli.cxx |   28 ++-
 6 files changed, 65 insertions(+), 51 deletions(-)

New commits:
commit 1bda8ef1b0d532339db02cd932da275b00fb3f91
Author: Michael Stahl 
Date:   Thu Oct 1 11:00:10 2015 +0200

sw: convert this sal_uLong

Although, why not just use the pointer?

Change-Id: I1781a04bb97dba2ac6c769973345bb3c66f28904

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index f9d9198..d12e012 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -4519,7 +4519,7 @@ void SwShareBoxFormats::RemoveFormat( const 
SwFrameFormat& rFormat )
 
 bool SwShareBoxFormats::Seek_Entry( const SwFrameFormat& rFormat, sal_uInt16* 
pPos ) const
 {
-sal_uLong nIdx = reinterpret_cast();
+sal_uIntPtr nIdx = reinterpret_cast();
 auto nO = m_ShareArr.size();
 decltype(nO) nU = 0;
 if( nO > 0 )
@@ -4528,7 +4528,7 @@ bool SwShareBoxFormats::Seek_Entry( const SwFrameFormat& 
rFormat, sal_uInt16* pP
 while( nU <= nO )
 {
 const auto nM = nU + ( nO - nU ) / 2;
-sal_uLong nFormat = reinterpret_cast(_ShareArr[ nM 
]->GetOldFormat());
+sal_uIntPtr nFormat = reinterpret_cast(_ShareArr[ 
nM ]->GetOldFormat());
 if( nFormat == nIdx )
 {
 if( pPos )
commit 277bf2338b313317e70db0cf9d09342558ae0792
Author: Michael Stahl 
Date:   Wed Sep 30 23:22:11 2015 +0200

sw: replace boost::ptr_vector with std::vector

Change-Id: I821a853a0e4776d2b5ba2ca69d421ec0af8e865e

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index b4abdb8..f9d9198 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -4411,16 +4411,16 @@ SwFrameFormat* SwShareBoxFormats::GetFormat( const 
SwFrameFormat& rFormat, long
 {
 sal_uInt16 nPos;
 return Seek_Entry( rFormat,  )
-? aShareArr[ nPos ].GetFormat( nWidth )
-: 0;
+? m_ShareArr[ nPos ]->GetFormat(nWidth)
+: nullptr;
 }
 SwFrameFormat* SwShareBoxFormats::GetFormat( const SwFrameFormat& rFormat,
  const SfxPoolItem& rItem ) const
 {
 sal_uInt16 nPos;
 return Seek_Entry( rFormat,  )
-? aShareArr[ nPos ].GetFormat( rItem )
-: 0;
+? m_ShareArr[ nPos ]->GetFormat(rItem)
+: nullptr;
 }
 
 void SwShareBoxFormats::AddFormat( const SwFrameFormat& rOld, SwFrameFormat& 
rNew )
@@ -4431,10 +4431,10 @@ void SwShareBoxFormats::AddFormat( const SwFrameFormat& 
rOld, SwFrameFormat& rNe
 if( !Seek_Entry( rOld,  ))
 {
 pEntry = new SwShareBoxFormat( rOld );
-aShareArr.insert( aShareArr.begin() + nPos, pEntry );
+m_ShareArr.insert(m_ShareArr.begin() + nPos, 
std::unique_ptr(pEntry));
 }
 else
-pEntry = [ nPos ];
+pEntry = m_ShareArr[ nPos ].get();
 
 pEntry->AddFormat( rNew );
 }
@@ -4508,22 +4508,27 @@ void SwShareBoxFormats::SetAttr( SwTableLine& rLine, 
const SfxPoolItem& rItem )
 
 void SwShareBoxFormats::RemoveFormat( const SwFrameFormat& rFormat )
 {
-for( auto i = aShareArr.size(); i; )
-if( aShareArr[ --i ].RemoveFormat( rFormat ))
-aShareArr.erase( aShareArr.begin() + i );
+for (auto i = m_ShareArr.size(); i; )
+{
+if (m_ShareArr[ --i ]->RemoveFormat(rFormat))
+{
+m_ShareArr.erase( m_ShareArr.begin() + i );
+}
+}
 }
 
 bool SwShareBoxFormats::Seek_Entry( const SwFrameFormat& rFormat, sal_uInt16* 
pPos ) const
 {
 sal_uLong nIdx = reinterpret_cast();
-_SwShareBoxFormats::size_type nO = aShareArr.size(), nU = 0;
+auto nO = m_ShareArr.size();
+decltype(nO) nU = 0;
 if( nO > 0 )
 {
 nO--;
 while( nU <= nO )
 {
 const auto nM = nU + ( nO - nU ) / 2;
-sal_uLong nFormat = reinterpret_cast([ nM 
].GetOldFormat());
+sal_uLong nFormat = reinterpret_cast(_ShareArr[ nM 
]->GetOldFormat());
 if( nFormat == nIdx )
 {
 if( pPos )
diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx
index 46c50cc..96d064c 100644
--- a/sw/source/core/inc/tblrwcl.hxx
+++ b/sw/source/core/inc/tblrwcl.hxx
@@ -20,10 +20,9 @@
 #define INCLUDED_SW_SOURCE_CORE_INC_TBLRWCL_HXX
 
 #include 
+#include 
 #include 
 
-#include 
-
 #include 
 #include 
 #include 
@@ -174,11 +173,10 @@ public:
 bool RemoveFormat( const 

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-05-30 Thread Matteo Casalin
 sw/source/uibase/inc/content.hxx   |6 
 sw/source/uibase/utlui/content.cxx |  230 +
 2 files changed, 112 insertions(+), 124 deletions(-)

New commits:
commit 4618d15cb73d0f0c15e0f4d2a6ce9cdbe6eeef24
Author: Matteo Casalin matteo.casa...@yahoo.com
Date:   Sat May 30 23:25:51 2015 +0200

Simplify

Change-Id: Iafeed40abb3228c00c5490692c9f2f4d526c1dee

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index c13e95c..5e3ca2b 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1480,14 +1480,13 @@ bool  SwContentTree::Expand( SvTreeListEntry* pParent )
 
 bool  SwContentTree::Collapse( SvTreeListEntry* pParent )
 {
-bool bRet(false);
 if(!bIsRoot || 
(static_castSwContentType*(pParent-GetUserData())-GetType() == 
CONTENT_TYPE_OUTLINE) ||
 (nRootType == CONTENT_TYPE_OUTLINE))
 {
 if(lcl_IsContentType(pParent))
 {
 if(bIsRoot)
-return bRet = false;
+return false;
 SwContentType* pCntType = 
static_castSwContentType*(pParent-GetUserData());
 const sal_Int32 nAnd = ~(1  pCntType-GetType());
 if(bIsActive || bIsConstant)
@@ -1505,11 +1504,9 @@ bool  SwContentTree::Collapse( SvTreeListEntry* pParent )
 void* key = 
(void*)pShell-getIDocumentOutlineNodesAccess()-getOutlineNode( nPos );
 mOutLineNodeMap[key] = false;
 }
-bRet = SvTreeListBox::Collapse(pParent);
 }
-else
-bRet = SvTreeListBox::Collapse(pParent);
-return bRet;
+
+return SvTreeListBox::Collapse(pParent);
 }
 
 // Also on double click will be initially opened only.
commit 824cda403206b61af20ed86aead59cfaddb6ac83
Author: Matteo Casalin matteo.casa...@yahoo.com
Date:   Sat May 30 23:19:48 2015 +0200

Fix indentation

Change-Id: I5a2d05d476b81ad610ddf470b4e9a176f41a8c82

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 1c7d45a..c13e95c 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1259,11 +1259,11 @@ PopupMenu* SwContentTree::CreateContextMenu()
 SwContentType* pType = 
static_castSwContentType*(pEntry-GetUserData());
 if ( (pType-GetType() == CONTENT_TYPE_POSTIT)   
(!pActiveShell-GetView().GetDocShell()-IsReadOnly())  ( 
pType-GetMemberCount()  0) )
 {
-pSubPop4-InsertItem(600, sPostItShow );
-pSubPop4-InsertItem(601, sPostItHide );
-pSubPop4-InsertItem(602, sPostItDelete );
-pPop-InsertItem(4, pType-GetSingleName());
-pPop-SetPopupMenu(4, pSubPop4);
+pSubPop4-InsertItem(600, sPostItShow );
+pSubPop4-InsertItem(601, sPostItHide );
+pSubPop4-InsertItem(602, sPostItDelete );
+pPop-InsertItem(4, pType-GetSingleName());
+pPop-SetPopupMenu(4, pSubPop4);
 }
 }
 
@@ -1308,50 +1308,48 @@ void  SwContentTree::RequestingChildren( 
SvTreeListEntry* pParent )
 SwContentType* pCntType = 
static_castSwContentType*(pParent-GetUserData());
 
 const size_t nCount = pCntType-GetMemberCount();
- // Add for outline plus/minus
- if(pCntType-GetType() == CONTENT_TYPE_OUTLINE)
- {
- SvTreeListEntry* pChild = 0;
- for(size_t i = 0; i  nCount; ++i)
- {
- const SwContent* pCnt = pCntType-GetMember(i);
- if(pCnt)
- {
- const auto nLevel = static_castconst 
SwOutlineContent*(pCnt)-GetOutlineLevel();
- OUString sEntry = pCnt-GetName();
- if(sEntry.isEmpty())
- sEntry = sSpace;
- if(!pChild || (nLevel == 0))
- pChild = InsertEntry(sEntry, pParent,
- false, TREELIST_APPEND,(void*)pCnt);
- else
- {
- //back search parent.
- if(static_castconst 
SwOutlineContent*(pCntType-GetMember(i-1))-GetOutlineLevel()  nLevel)
- pChild = InsertEntry(sEntry, pChild,
- false, TREELIST_APPEND, (void*)pCnt);
- else
- {
- pChild = Prev(pChild);
- while(pChild 
- lcl_IsContent(pChild) 
- 
!(static_castSwOutlineContent*(pChild-GetUserData())-GetOutlineLevel()  
nLevel)
-  )
- {
- pChild = Prev(pChild);
-  

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-05-12 Thread Michael Stahl
 sw/source/core/text/porlay.cxx   |6 +++---
 sw/source/core/text/pormulti.cxx |2 +-
 sw/source/core/text/portxt.cxx   |8 +---
 sw/source/core/text/portxt.hxx   |2 +-
 sw/source/core/text/txthyph.cxx  |   17 -
 5 files changed, 18 insertions(+), 17 deletions(-)

New commits:
commit 21ab418859d5f8fc16730dc26f1dda149ee132fc
Author: Michael Stahl mst...@redhat.com
Date:   Tue May 12 19:02:06 2015 +0200

sw: replace that awful constructor that overloads SwTxtPortion copy-ctor

... with a CopyLinePortion function; how can you even...

Change-Id: Ie7d459ee317522e35fdbbd3974afabe7a136fe62

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 78572be..72845e8 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -139,7 +139,7 @@ SwLinePortion *SwLineLayout::Insert( SwLinePortion *pIns )
 {
 if( GetLen() )
 {
-pPortion = new SwTxtPortion(*static_castSwLinePortion*(this));
+pPortion = SwTxtPortion::CopyLinePortion(*this);
 if( IsBlinking()  pBlink )
 {
 SetBlinking( false );
@@ -161,7 +161,7 @@ SwLinePortion *SwLineLayout::Append( SwLinePortion *pIns )
 // First attribute change: copy mass and length from *pIns into the first
 // text portion
 if( !pPortion )
-pPortion = new SwTxtPortion(*static_castSwLinePortion*(this));
+pPortion = SwTxtPortion::CopyLinePortion(*this);
 // Call with scope or we'll end up with recursion!
 return pPortion-SwLinePortion::Append( pIns );
 }
@@ -184,7 +184,7 @@ SwMarginPortion *SwLineLayout::CalcLeftMargin()
 SwMarginPortion *pLeft = (GetPortion()  GetPortion()-IsMarginPortion()) 
?
 static_castSwMarginPortion *(GetPortion()) : 0;
 if( !GetPortion() )
- SetPortion(new SwTxtPortion(*static_castSwLinePortion*(this)));
+ SetPortion(SwTxtPortion::CopyLinePortion(*this));
 if( !pLeft )
 {
 pLeft = new SwMarginPortion( 0 );
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 6b24834..755869f 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -678,7 +678,7 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo rInf )
 if( nLeft || nRight )
 {
 if( !pCurr-GetPortion() )
-pCurr-SetPortion(new 
SwTxtPortion(*static_castSwLinePortion*(pCurr)));
+pCurr-SetPortion(SwTxtPortion::CopyLinePortion(*pCurr));
 if( nLeft )
 {
 SwMarginPortion *pMarg = new SwMarginPortion( 0 );
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 691a716..4b78981 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -208,10 +208,12 @@ static sal_Int32 lcl_AddSpace( const SwTxtSizeInfo rInf, 
const OUString* pStr,
 return nCnt;
 }
 
-SwTxtPortion::SwTxtPortion( const SwLinePortion rPortion )
-  : SwLinePortion( rPortion )
+SwTxtPortion * SwTxtPortion::CopyLinePortion(const SwLinePortion rPortion)
 {
-SetWhichPor( POR_TXT );
+SwTxtPortion *const pNew(new SwTxtPortion);
+static_castSwLinePortion(*pNew) = rPortion;
+pNew-SetWhichPor( POR_TXT ); // overwrite that!
+return pNew;
 }
 
 void SwTxtPortion::BreakCut( SwTxtFormatInfo rInf, const SwTxtGuess rGuess )
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index 51ed3f1..3f30ba7 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -34,7 +34,7 @@ class SwTxtPortion : public SwLinePortion
 
 public:
 inline SwTxtPortion(){ SetWhichPor( POR_TXT ); }
-SwTxtPortion( const SwLinePortion rPortion );
+static SwTxtPortion * CopyLinePortion(const SwLinePortion rPortion);
 virtual void Paint( const SwTxtPaintInfo rInf ) const SAL_OVERRIDE;
 virtual bool Format( SwTxtFormatInfo rInf ) SAL_OVERRIDE;
 virtual void FormatEOL( SwTxtFormatInfo rInf ) SAL_OVERRIDE;
commit ba587924b14d3e03f5c2bddf66d1da18089fc580
Author: Michael Stahl mst...@redhat.com
Date:   Tue May 12 18:44:08 2015 +0200

sw: let's try without a SwHyphPortion copy ctor

It looks like it can be easily avoided.

Change-Id: Ied8a047871c431b809569e1bbf232ce769d498ec

diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 9d73441..54316b9 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -296,8 +296,8 @@ bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo rInf, 
SwTxtGuess rGuess )
 else
 {
 // second case: no alternative spelling
-SwHyphPortion aHyphPor;
-aHyphPor.SetLen( 1 );
+pHyphPor = new SwHyphPortion;
+pHyphPor-SetLen( 1 );
 
 static const void* pLastMagicNo = 0;
 static sal_uInt16 aMiniCacheH = 0, aMiniCacheW = 0;
@@ -306,15 +306,14 @@ bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo rInf, 
SwTxtGuess 

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-05-05 Thread Matteo Casalin
 sw/source/core/unocore/unostyle.cxx |   23 +++--
 sw/source/core/unocore/unotbl.cxx   |   38 ++--
 sw/source/core/view/viewsh.cxx  |6 ++---
 sw/source/core/view/vprint.cxx  |2 -
 sw/source/filter/basflt/fltini.cxx  |6 ++---
 sw/source/filter/basflt/shellio.cxx |4 +--
 6 files changed, 40 insertions(+), 39 deletions(-)

New commits:
commit 1848430d614e0f2f52e288363d0367c9207b0802
Author: Matteo Casalin matteo.casa...@yahoo.com
Date:   Tue May 5 22:45:29 2015 +0200

Use more proper integer types

Change-Id: If1515df57cd90451f2c912bf5c268fec8688c063

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 4911902..cde2dcf 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -438,14 +438,15 @@ static bool lcl_GetHeaderFooterItem(
 }
 
 static sal_Int32 lcl_GetCountOrName(const SwDoc rDoc,
-SfxStyleFamily eFamily, OUString *pString, sal_uInt16 nIndex = USHRT_MAX)
+SfxStyleFamily eFamily, OUString *pString, sal_Int32 nIndex = 
SAL_MAX_INT32)
 {
 sal_Int32 nCount = 0;
 switch( eFamily )
 {
 case SFX_STYLE_FAMILY_CHAR:
 {
-sal_uInt16 nBaseCount =  RES_POOLCHR_HTML_END - 
RES_POOLCHR_HTML_BEGIN  +
+const sal_Int32 nBaseCount =
+ RES_POOLCHR_HTML_END - 
RES_POOLCHR_HTML_BEGIN  +
  RES_POOLCHR_NORMAL_END - 
RES_POOLCHR_NORMAL_BEGIN;
 nIndex = nIndex - nBaseCount;
 const size_t nArrLen = rDoc.GetCharFmts()-size();
@@ -474,7 +475,8 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc rDoc,
 break;
 case SFX_STYLE_FAMILY_PARA:
 {
-sal_uInt16 nBaseCount = RES_POOLCOLL_HTML_END - 
RES_POOLCOLL_HTML_BEGIN +
+const sal_Int32 nBaseCount =
+RES_POOLCOLL_HTML_END - 
RES_POOLCOLL_HTML_BEGIN +
 RES_POOLCOLL_DOC_END - 
RES_POOLCOLL_DOC_BEGIN +
 RES_POOLCOLL_REGISTER_END - 
RES_POOLCOLL_REGISTER_BEGIN +
 RES_POOLCOLL_EXTRA_END - 
RES_POOLCOLL_EXTRA_BEGIN +
@@ -502,7 +504,7 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc rDoc,
 break;
 case SFX_STYLE_FAMILY_FRAME:
 {
-sal_uInt16 nBaseCount = RES_POOLFRM_END - RES_POOLFRM_BEGIN;
+const sal_Int32 nBaseCount = RES_POOLFRM_END - RES_POOLFRM_BEGIN;
 nIndex = nIndex - nBaseCount;
 const size_t nArrLen = rDoc.GetFrmFmts()-size();
 for( size_t i = 0; i  nArrLen; ++i )
@@ -525,7 +527,7 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc rDoc,
 break;
 case SFX_STYLE_FAMILY_PAGE:
 {
-sal_uInt16 nBaseCount = RES_POOLPAGE_END - RES_POOLPAGE_BEGIN;
+const sal_Int32 nBaseCount = RES_POOLPAGE_END - RES_POOLPAGE_BEGIN;
 nIndex = nIndex - nBaseCount;
 const sal_uInt16 nArrLen = rDoc.GetPageDescCnt();
 for(sal_uInt16 i = 0; i  nArrLen; ++i)
@@ -547,7 +549,7 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc rDoc,
 break;
 case SFX_STYLE_FAMILY_PSEUDO:
 {
-sal_uInt16 nBaseCount = RES_POOLNUMRULE_END - 
RES_POOLNUMRULE_BEGIN;
+const sal_Int32 nBaseCount = RES_POOLNUMRULE_END - 
RES_POOLNUMRULE_BEGIN;
 nIndex = nIndex - nBaseCount;
 const SwNumRuleTbl rNumTbl = rDoc.GetNumRuleTbl();
 for(size_t i = 0; i  rNumTbl.size(); ++i)
@@ -581,14 +583,13 @@ sal_Int32 SwXStyleFamily::getCount() throw( 
uno::RuntimeException, std::exceptio
 return lcl_GetCountOrName ( *pDocShell-GetDoc(), eFamily, NULL );
 }
 
-uno::Any SwXStyleFamily::getByIndex(sal_Int32 nTempIndex)
+uno::Any SwXStyleFamily::getByIndex(sal_Int32 nIndex)
 throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, 
uno::RuntimeException, std::exception )
 {
 SolarMutexGuard aGuard;
 uno::Any aRet;
-if ( nTempIndex = 0  nTempIndex  USHRT_MAX )
+if ( nIndex = 0 )
 {
-sal_uInt16 nIndex = static_cast  sal_uInt16  ( nTempIndex );
 if(pBasePool)
 {
 OUString sStyleName;
@@ -1065,7 +1066,7 @@ SwStyleProperties_Impl::~SwStyleProperties_Impl()
 
 bool SwStyleProperties_Impl::SetProperty(const OUString rName, const 
uno::Any rVal)
 {
-sal_uInt16 nPos = 0;
+sal_uInt32 nPos = 0;
 bool bRet = false;
 PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin();
 while( aIt != aPropertyEntries.end() )
@@ -2250,7 +2251,7 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl(
 throw uno::RuntimeException();
 }
 
-for(sal_Int16 nProp = 0; nProp  rPropertyNames.getLength(); nProp++)
+for(sal_Int32 nProp = 0; nProp  rPropertyNames.getLength(); ++nProp)
 {
 const 

[Libreoffice-commits] core.git: 4 commits - sw/source

2015-02-26 Thread Bjoern Michaelsen
 sw/source/core/frmedt/fetab.cxx |   34 +++---
 1 file changed, 15 insertions(+), 19 deletions(-)

New commits:
commit 530d3c92bd79f3c0e8d646e48a2eff1dae2921da
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Thu Feb 26 13:05:53 2015 +0100

make arbitrary number a constant and add comment on fishiness

Change-Id: I65baf9e4583c78ca3128352112fdeeffce3b3225

diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index f38502c..3d94e39 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -84,8 +84,10 @@ const SwFrm *pRowCacheLastCellFrm = 0;
 class TblWait
 {
 const ::std::unique_ptrSwWait m_pWait;
+// this seems really fishy: do some locking, if an arbitrary number of 
lines is exceeded
+static const size_t our_kLineLimit = 20;
 bool ShouldWait(size_t nCnt, SwFrm *pFrm, size_t nCnt2)
-{ return 20  nCnt || 20  nCnt2 || (pFrm  20  
pFrm-ImplFindTabFrm()-GetTable()-GetTabLines().size()); }
+{ return our_kLineLimit  nCnt || our_kLineLimit  nCnt2 || (pFrm  
our_kLineLimit  pFrm-ImplFindTabFrm()-GetTable()-GetTabLines().size()); }
 public:
 TblWait(size_t nCnt, SwFrm *pFrm, SwDocShell rDocShell, size_t nCnt2 = 0)
 : m_pWait( ShouldWait(nCnt, pFrm, nCnt2) ? 
::std::unique_ptrSwWait(new SwWait( rDocShell, true )) : nullptr )
commit 6ee7900b587d4cba6f6a07548f96adcc42f64eaf
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Thu Feb 26 13:00:57 2015 +0100

more constness

Change-Id: I5bbddaebb6cf820afced89e634814f485ec38859

diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 73d0862..f38502c 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -83,20 +83,15 @@ const SwFrm *pRowCacheLastCellFrm = 0;
 
 class TblWait
 {
-::std::unique_ptrSwWait m_pWait;
+const ::std::unique_ptrSwWait m_pWait;
+bool ShouldWait(size_t nCnt, SwFrm *pFrm, size_t nCnt2)
+{ return 20  nCnt || 20  nCnt2 || (pFrm  20  
pFrm-ImplFindTabFrm()-GetTable()-GetTabLines().size()); }
 public:
-TblWait(size_t nCnt, SwFrm *pFrm, SwDocShell rDocShell, size_t nCnt2 = 0);
+TblWait(size_t nCnt, SwFrm *pFrm, SwDocShell rDocShell, size_t nCnt2 = 0)
+: m_pWait( ShouldWait(nCnt, pFrm, nCnt2) ? 
::std::unique_ptrSwWait(new SwWait( rDocShell, true )) : nullptr )
+{ }
 };
 
-TblWait::TblWait(size_t const nCnt, SwFrm *pFrm, SwDocShell rDocShell, size_t 
const nCnt2):
-m_pWait( nullptr )
-{
-const bool bWait = 20  nCnt || 20  nCnt2 || (pFrm 
- 20  
pFrm-ImplFindTabFrm()-GetTable()-GetTabLines().size());
-if( bWait )
-m_pWait = ::std::unique_ptrSwWait(new SwWait( rDocShell, true ));
-}
-
 void SwFEShell::ParkCursorInTab()
 {
 SwCursor * pSwCrsr = GetSwCrsr();
commit 6ce7808d586bcfb442160d58f4ce5b55d53067b2
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Thu Feb 26 12:47:05 2015 +0100

unique_ptr, constness, naming conventions

Change-Id: I37cbfbcc887ec82e750ba1bc614f4eda77be933b

diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 729de30..73d0862 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -83,19 +83,18 @@ const SwFrm *pRowCacheLastCellFrm = 0;
 
 class TblWait
 {
-SwWait *pWait;
+::std::unique_ptrSwWait m_pWait;
 public:
 TblWait(size_t nCnt, SwFrm *pFrm, SwDocShell rDocShell, size_t nCnt2 = 0);
-~TblWait() { delete pWait; }
 };
 
 TblWait::TblWait(size_t const nCnt, SwFrm *pFrm, SwDocShell rDocShell, size_t 
const nCnt2):
-pWait( 0 )
+m_pWait( nullptr )
 {
-bool bWait = 20  nCnt || 20  nCnt2 || (pFrm 
+const bool bWait = 20  nCnt || 20  nCnt2 || (pFrm 
  20  
pFrm-ImplFindTabFrm()-GetTable()-GetTabLines().size());
 if( bWait )
-pWait = new SwWait( rDocShell, true );
+m_pWait = ::std::unique_ptrSwWait(new SwWait( rDocShell, true ));
 }
 
 void SwFEShell::ParkCursorInTab()
commit 7deb4c93a804b2f17d102f2f24448a5c638a96ea
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Thu Feb 26 12:34:34 2015 +0100

cppcheck: assuming these to be intended to actually have a scope

Change-Id: Id1af6eb4064a524b12113b5b52b15f2ea4d6ada4

diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index cef2cee..729de30 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -211,7 +211,7 @@ bool SwFEShell::InsertRow( sal_uInt16 nCnt, bool bBehind )
 }
 GetTblSel( *this, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW );
 
-TblWait( nCnt, pFrm, *GetDoc()-GetDocShell(), aBoxes.size() );
+TblWait aWait( nCnt, pFrm, *GetDoc()-GetDocShell(), aBoxes.size() );
 
 bool bRet = false;
 if ( aBoxes.size() )
@@ -249,7 +249,7 @@ bool SwFEShell::InsertCol( sal_uInt16 nCnt, bool bBehind )
 

[Libreoffice-commits] core.git: 4 commits - sw/source writerfilter/source

2015-02-07 Thread Miklos Vajna
 sw/source/filter/ww8/docxattributeoutput.cxx   |   27 -
 sw/source/filter/ww8/rtfexport.cxx |   11 ++
 sw/source/filter/ww8/rtfsdrexport.cxx  |4 +--
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |6 +++--
 4 files changed, 22 insertions(+), 26 deletions(-)

New commits:
commit 1eb67b0d7ea8e428a576184156b8be3ad0f2b752
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Feb 7 17:06:42 2015 +0100

ww8 export: indentation fixes

Change-Id: I0416b782ff04e060a03b4e0494513f16bda14d6b

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6b191ea..16770ae 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4285,19 +4285,19 @@ bool DocxAttributeOutput::WriteOLEChart( const 
SdrObject* pSdrObj, const Size r
  */
 void DocxAttributeOutput::WritePostponedChart()
 {
-   if(m_postponedChart == NULL)
-return;
-   uno::Reference chart2::XChartDocument  xChartDoc;
-   uno::Reference drawing::XShape  xShape( 
const_castSdrObject*(m_postponedChart)-getUnoShape(), uno::UNO_QUERY );
-   if( xShape.is() )
-   {
-uno::Reference beans::XPropertySet  xPropSet( xShape, 
uno::UNO_QUERY );
-if( xPropSet.is() )
-xChartDoc.set( xPropSet-getPropertyValue( Model ), 
uno::UNO_QUERY );
-   }
+if(m_postponedChart == NULL)
+return;
+uno::Reference chart2::XChartDocument  xChartDoc;
+uno::Reference drawing::XShape  xShape( 
const_castSdrObject*(m_postponedChart)-getUnoShape(), uno::UNO_QUERY );
+if( xShape.is() )
+{
+uno::Reference beans::XPropertySet  xPropSet( xShape, uno::UNO_QUERY 
);
+if( xPropSet.is() )
+xChartDoc.set( xPropSet-getPropertyValue( Model ), 
uno::UNO_QUERY );
+}
 
-   if( xChartDoc.is() )
-   {
+if( xChartDoc.is() )
+{
 OSL_TRACE(DocxAttributeOutput::WriteOLE2Obj: export chart );
 m_pSerializer-startElementNS( XML_w, XML_drawing,
 FSEND );
@@ -4360,8 +4360,7 @@ void DocxAttributeOutput::WritePostponedChart()
 m_pSerializer-endElementNS( XML_w, XML_drawing );
 
 }
-m_postponedChart = NULL;
-return;
+m_postponedChart = NULL;
 }
 
 bool DocxAttributeOutput::WriteOLEMath( const SdrObject*, const SwOLENode 
rOLENode, const Size )
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx 
b/sw/source/filter/ww8/rtfsdrexport.cxx
index 574215e..49fb111 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -259,8 +259,8 @@ void RtfSdrExport::Commit(EscherPropertyContainer rProps, 
const Rectangle rRec
 EscherPropSortStruct aSegments;
 
 if (rProps.GetOpt(ESCHER_Prop_pVertices, aVertices) 
-rProps.GetOpt(ESCHER_Prop_pSegmentInfo, aSegments) 
-aVertices.nPropSize = 6  aSegments.nPropSize = 6)
+rProps.GetOpt(ESCHER_Prop_pSegmentInfo, aSegments) 
+aVertices.nPropSize = 6  aSegments.nPropSize = 6)
 {
 const sal_uInt8* pVerticesIt = aVertices.pBuf + 6;
 sal_Size nVerticesPos = 6;
commit 105ebb9c0adcf421b0b89600216aa18041c179e3
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Feb 7 16:15:34 2015 +0100

Use std::initializer_list ctor

Change-Id: Ib04460fe7bd33cb9b6c4fef4fc285e93c71e57c3

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b937b5d..73287ce 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4628,8 +4628,10 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword 
nKeyword, int nParam)
 rDrawingObject.nPolyLineCount--;
 if (rDrawingObject.nPolyLineCount == 0)
 {
-uno::Sequence uno::Sequenceawt::Point 
aPointSequenceSequence(1);
-aPointSequenceSequence[0] = 
comphelper::containerToSequence(rDrawingObject.aPolyLinePoints);
+uno::Sequence uno::Sequenceawt::Point 
aPointSequenceSequence =
+{
+
comphelper::containerToSequence(rDrawingObject.aPolyLinePoints)
+};
 rDrawingObject.xPropertySet-setPropertyValue(PolyPolygon, 
uno::Any(aPointSequenceSequence));
 }
 }
commit 6158c9a899db83e04c78a1c949418434a89d4fdc
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Feb 7 16:07:03 2015 +0100

Unused 'using namespace ::comphelper'

Change-Id: I5605c26fe0abd4c064b20562bf52b5e400bc7f33

diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 01931bc..068e59d 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -46,12 +46,8 @@
 #endif
 #include svx/xflclit.hxx
 

[Libreoffice-commits] core.git: 4 commits - sw/source unusedcode.easy writerfilter/source

2015-02-02 Thread Caolán McNamara
 sw/source/core/table/swnewtable.cxx   |8 +-
 sw/source/filter/html/htmlflywriter.cxx   |3 -
 sw/source/filter/html/htmlforw.cxx|   49 +-
 sw/source/filter/html/wrthtml.hxx |3 -
 sw/source/filter/ww8/wrtw8esh.cxx |   23 ++--
 sw/source/filter/ww8/wrtw8sty.cxx |5 +
 sw/source/filter/ww8/wrtww8.hxx   |3 -
 sw/source/filter/ww8/ww8par.hxx   |3 -
 unusedcode.easy   |1 
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |9 +--
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|8 +-
 11 files changed, 43 insertions(+), 72 deletions(-)

New commits:
commit 04e52fd93098acb604c28a315aa3578e5010039b
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 2 17:35:28 2015 +

drop now fixed OOoEmbeddedObjectFactory::createInstanceLinkUserInit from 
list

Change-Id: Ic9480340e2a9255aae6d0f97e180e3e68cf97e42

diff --git a/unusedcode.easy b/unusedcode.easy
index c288793..17cdc31 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -5,7 +5,6 @@ FontCharMap::GetDefaultMap(bool)
 LineListBox::Clear()
 LineListBox::InsertEntry(rtl::OUString const, int)
 LineListBox::RemoveEntry(int)
-OOoEmbeddedObjectFactory::createInstanceLinkUserInit(com::sun::star::uno::Sequencesigned
 char const, rtl::OUString const, 
com::sun::star::uno::Referencecom::sun::star::embed::XStorage const, 
rtl::OUString const, 
com::sun::star::uno::Sequencecom::sun::star::beans::PropertyValue const, 
com::sun::star::uno::Sequencecom::sun::star::beans::PropertyValue const)
 OpenGLContext::init(_XDisplay*, unsigned long, unsigned int, unsigned int, int)
 OpenGLContext::renderToFile()
 OpenGLContext::requestSingleBufferedRendering()
commit 012607dc600d85553f5a1db68ae9c36797000474
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 2 16:49:39 2015 +

unwind the casts to initial entry points

Change-Id: Id8d90569c079a753314ba88b419de9a08b0b6a8b

diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index dfbb5d0..4a3c7d2 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -32,6 +32,7 @@
 #include svtools/imap.hxx
 #include svtools/imapobj.hxx
 #include svtools/htmlcfg.hxx
+#include svx/svdouno.hxx
 #include svx/xoutbmp.hxx
 #include editeng/boxitem.hxx
 #include editeng/lrspitem.hxx
@@ -490,7 +491,7 @@ void SwHTMLWriter::OutFrmFmt( sal_uInt8 nMode, const 
SwFrmFmt rFrmFmt,
 break;
 case HTML_OUT_CONTROL:  // OK
 OutHTML_DrawFrmFmtAsControl( *this,
-static_castconst SwDrawFrmFmt 
(rFrmFmt), *pSdrObject,
+static_castconst SwDrawFrmFmt 
(rFrmFmt), dynamic_castconst SdrUnoObj(*pSdrObject),
 pCntnrStr != 0 );
 break;
 case HTML_OUT_AMARQUEE:
diff --git a/sw/source/filter/html/htmlforw.cxx 
b/sw/source/filter/html/htmlforw.cxx
index 2e95323..a73b92e 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -641,12 +641,9 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const 
SwDrawFrmFmt rFmt )
 if( !pObj || FmFormInventor != pObj-GetObjInventor() )
 return 0;
 
-const SdrUnoObj *pFormObj = PTR_CAST( SdrUnoObj, pObj );
-assert(pFormObj);
-if (!pFormObj)
-return 0;
+const SdrUnoObj rFormObj = dynamic_castconst SdrUnoObj(*pObj);
 uno::Reference awt::XControlModel   xControlModel =
-pFormObj-GetUnoControlModel();
+rFormObj.GetUnoControlModel();
 
 OSL_ENSURE( xControlModel.is(), UNO-Control ohne Model );
 if( !xControlModel.is() )
@@ -668,22 +665,17 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const 
SwDrawFrmFmt rFmt )
 return 0;
 }
 
-static void GetControlSize( const SdrObject rSdrObj, Size rSz,
-SwDoc *pDoc )
+static void GetControlSize(const SdrUnoObj rFormObj, Size rSz, SwDoc *pDoc)
 {
 SwViewShell *pVSh = pDoc-getIDocumentLayoutAccess().GetCurrentViewShell();
 if( !pVSh )
 return;
 
-const SdrUnoObj *pFormObj = PTR_CAST( SdrUnoObj, rSdrObj );
-assert(pFormObj);
-if (!pFormObj)
-return;
 uno::Reference awt::XControl   xControl;
 SdrView* pDrawView = pVSh-GetDrawView();
 OSL_ENSURE( pDrawView  pVSh-GetWin(), no DrawView or window! );
 if ( pDrawView  pVSh-GetWin() )
-xControl = pFormObj-GetUnoControl( *pDrawView, *pVSh-GetWin() );
+xControl = rFormObj.GetUnoControl( *pDrawView, *pVSh-GetWin() );
 uno::Reference awt::XTextLayoutConstrains  xLC( xControl, uno::UNO_QUERY 
);
 OSL_ENSURE( xLC.is(), kein XTextLayoutConstrains );
 if( !xLC.is() )
@@ -697,17 +689,11 @@ static void GetControlSize( const SdrObject rSdrObj, 
Size rSz,
 

[Libreoffice-commits] core.git: 4 commits - sw/source

2014-11-03 Thread Michael Stahl
 sw/source/core/crsr/bookmrk.cxx   |8 
 sw/source/core/crsr/crossrefbookmark.cxx  |   16 
 sw/source/core/doc/DocumentChartDataProviderManager.cxx   |   10 
 sw/source/core/doc/DocumentContentOperationsManager.cxx   |  468 +++---
 sw/source/core/doc/DocumentDeviceManager.cxx  |   80 +-
 sw/source/core/doc/DocumentDrawModelManager.cxx   |   36 -
 sw/source/core/doc/DocumentFieldsManager.cxx  |  186 ++---
 sw/source/core/doc/DocumentLayoutManager.cxx  |   86 +-
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx |   56 -
 sw/source/core/doc/DocumentListsManager.cxx   |8 
 sw/source/core/doc/DocumentOutlineNodesManager.cxx|   12 
 sw/source/core/doc/DocumentRedlineManager.cxx |  104 +--
 sw/source/core/doc/DocumentStateManager.cxx   |   20 
 sw/source/core/doc/DocumentStatisticsManager.cxx  |   26 
 sw/source/core/doc/DocumentStylePoolManager.cxx   |  270 
 sw/source/core/doc/DocumentTimerManager.cxx   |   34 -
 sw/source/core/doc/docbm.cxx  |   25 
 sw/source/core/inc/DocumentChartDataProviderManager.hxx   |2 
 sw/source/core/inc/DocumentContentOperationsManager.hxx   |2 
 sw/source/core/inc/DocumentDeviceManager.hxx  |2 
 sw/source/core/inc/DocumentDrawModelManager.hxx   |2 
 sw/source/core/inc/DocumentFieldsManager.hxx  |2 
 sw/source/core/inc/DocumentLayoutManager.hxx  |2 
 sw/source/core/inc/DocumentLinksAdministrationManager.hxx |2 
 sw/source/core/inc/DocumentListsManager.hxx   |2 
 sw/source/core/inc/DocumentOutlineNodesManager.hxx|2 
 sw/source/core/inc/DocumentRedlineManager.hxx |2 
 sw/source/core/inc/DocumentStateManager.hxx   |2 
 sw/source/core/inc/DocumentStatisticsManager.hxx  |2 
 sw/source/core/inc/DocumentStylePoolManager.hxx   |2 
 sw/source/core/inc/DocumentTimerManager.hxx   |2 
 sw/source/core/inc/crossrefbookmark.hxx   |4 
 32 files changed, 741 insertions(+), 736 deletions(-)

New commits:
commit 093d54326f94467bc1601c14a38454efcc888017
Author: Michael Stahl mst...@redhat.com
Date:   Mon Nov 3 17:37:56 2014 +0100

sw: s/m_rSwdoc/m_rDoc/g

... because i can type m_rDoc but m_rSwdoc always comes out m_rSwDoc.

Change-Id: Id50888012da6cf3cf7aebc52e8c70fc359c6e073

diff --git a/sw/source/core/doc/DocumentChartDataProviderManager.cxx 
b/sw/source/core/doc/DocumentChartDataProviderManager.cxx
index c243eb3..cd8d0e3 100644
--- a/sw/source/core/doc/DocumentChartDataProviderManager.cxx
+++ b/sw/source/core/doc/DocumentChartDataProviderManager.cxx
@@ -34,7 +34,7 @@ using namespace com::sun::star::uno;
 
 namespace sw {
 
-DocumentChartDataProviderManager::DocumentChartDataProviderManager( SwDoc 
i_rSwdoc ) : m_rSwdoc( i_rSwdoc ),
+DocumentChartDataProviderManager::DocumentChartDataProviderManager( SwDoc 
i_rSwdoc ) : m_rDoc( i_rSwdoc ),

 maChartDataProviderImplRef(),

 mpChartControllerHelper( 0 )
 {
@@ -49,7 +49,7 @@ SwChartDataProvider * 
DocumentChartDataProviderManager::GetChartDataProvider( bo
 
 if (bCreate  !maChartDataProviderImplRef.is())
 {
-maChartDataProviderImplRef = new SwChartDataProvider(  m_rSwdoc );
+maChartDataProviderImplRef = new SwChartDataProvider(  m_rDoc );
 }
 return maChartDataProviderImplRef.get();
 }
@@ -61,13 +61,13 @@ void 
DocumentChartDataProviderManager::CreateChartInternalDataProviders( const S
 OUString aName( pTable-GetFrmFmt()-GetName() );
 SwOLENode *pONd;
 SwStartNode *pStNd;
-SwNodeIndex aIdx( 
*m_rSwdoc.GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
+SwNodeIndex aIdx( 
*m_rDoc.GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
 while (0 != (pStNd = aIdx.GetNode().GetStartNode()))
 {
 ++aIdx;
 if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) 
 aName == pONd-GetChartTblName() /* OLE node is chart? */ 
-0 != (pONd-getLayoutFrm( 
m_rSwdoc.getIDocumentLayoutAccess().GetCurrentLayout() )) /* chart frame is not 
hidden */ )
+0 != (pONd-getLayoutFrm( 
m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout() )) /* chart frame is not 
hidden */ )
 {
 uno::Reference  embed::XEmbeddedObject  xIP = 
pONd-GetOLEObj().GetOleRef();
 if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
@@ -88,7 +88,7 @@ SwChartLockController_Helper  
DocumentChartDataProviderManager::GetChartControl
 {
 if (!mpChartControllerHelper)
 {
-mpChartControllerHelper = new 

[Libreoffice-commits] core.git: 4 commits - sw/source

2014-08-27 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par.cxx |  136 +---
 sw/source/filter/ww8/ww8par.hxx |2 
 2 files changed, 88 insertions(+), 50 deletions(-)

New commits:
commit 47b84f7e5143f445a087fc9ccc4fb29bbd88ff64
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Aug 27 15:03:45 2014 +0100

Resolves: fdo#82904 non-Japanese ww95 documents claiming ms932 encoding

Change-Id: I62f8d5c3cac71f83f5cdde114f66e8554a780538

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 4fc41eb..54cfbcc 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3037,8 +3037,51 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP rPos, 
sal_Int32 nEnd, sal_Int32 nCp
 // the correct FilePos has already been reached.
 const sal_Int32 nStrLen = std::min(nValidStrLen, SAL_MAX_INT32-1);
 
-const rtl_TextEncoding eSrcCharSet = bVer67 ? GetCurrentCharSet() :
+rtl_TextEncoding eSrcCharSet = bVer67 ? GetCurrentCharSet() :
 RTL_TEXTENCODING_MS_1252;
+if (bVer67  eSrcCharSet == RTL_TEXTENCODING_MS_932)
+{
+/*
+ fdo#82904
+
+ Older documents exported as word 95 that use unicode aware fonts will
+ have the charset of those fonts set to RTL_TEXTENCODING_MS_932 on
+ export as the conversion from RTL_TEXTENCODING_UNICODE. This is a 
serious
+ pain.
+
+ We will try and use a fallback encoding if the conversion from
+ RTL_TEXTENCODING_MS_932 fails, but you can get unlucky and get a 
document
+ which isn't really in RTL_TEXTENCODING_MS_932 but parts of it form
+ valid RTL_TEXTENCODING_MS_932 by chance :-(
+
+ We're not the only ones that struggle with this: Here's the help from
+ MSOffice 2003 on the topic:
+
+ 
+  Earlier versions of Microsoft Word were sometimes used in 
conjunction with
+  third-party language-processing add-in programs designed to support 
Chinese or
+  Korean on English versions of Microsoft Windows. Use of these 
add-ins sometimes
+  results in incorrect text display in more recent versions of Word.
+
+  However, you can set options to convert these documents so that text 
is
+  displayed correctly. On the Tools menu, click Options, and then 
click the
+  General tab. In the English Word 6.0/95 documents list, select 
Contain Asian
+  text (to have Word interpret the text as Asian code page data, 
regardless of
+  its font) or Automatically detect Asian text (to have Word attempt 
to determine
+  which parts of the text are meant to be Asian).
+
+
+What we can try here is to ignore a RTL_TEXTENCODING_MS_932 codepage if
+the language is not Japanese
+*/
+
+const SfxPoolItem * pItem = GetFmtAttr(RES_CHRATR_CJK_LANGUAGE);
+if (pItem != NULL  LANGUAGE_JAPANESE != static_castconst 
SvxLanguageItem *(pItem)-GetLanguage())
+{
+SAL_WARN(sw.ww8, discarding word95 RTL_TEXTENCODING_MS_932 
encoding);
+eSrcCharSet = GetCharSetFromLanguage();
+}
+}
 const rtl_TextEncoding eSrcCJKCharSet = bVer67 ? GetCurrentCJKCharSet() :
 RTL_TEXTENCODING_MS_1252;
 
commit 4143d7bc7078fb367130e092a354b20da57585cc
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Aug 27 15:00:15 2014 +0100

sync GetCurrentCJKCharSet with GetCurrentCharSet

Change-Id: Ibcf1fa35617ee8d7fab6b66e3e8c8881ad55c3e5

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 53a2a02..4fc41eb 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2809,6 +2809,24 @@ rtl_TextEncoding 
SwWW8ImplReader::GetCharSetFromLanguage()
 return msfilter::util::getBestTextEncodingFromLocale(aLocale);
 }
 
+rtl_TextEncoding SwWW8ImplReader::GetCJKCharSetFromLanguage()
+{
+/*
+ #i22206#/#i52786#
+ The (default) character set used for a run of text is the default
+ character set for the version of Word that last saved the document.
+
+ This is a bit tentative, more might be required if the concept is correct.
+ When later version of word write older 6/95 documents the charset is
+ correctly set in the character runs involved, so its hard to reproduce
+ documents that require this to be sure of the process involved.
+*/
+const SvxLanguageItem *pLang = (const 
SvxLanguageItem*)GetFmtAttr(RES_CHRATR_CJK_LANGUAGE);
+LanguageType eLang = pLang ? pLang-GetLanguage() : LANGUAGE_SYSTEM;
+::com::sun::star::lang::Locale 
aLocale(LanguageTag::convertToLocale(eLang));
+return msfilter::util::getBestTextEncodingFromLocale(aLocale);
+}
+
 rtl_TextEncoding SwWW8ImplReader::GetCurrentCharSet()
 {
 /*
@@ -2846,33 +2864,12 @@ rtl_TextEncoding SwWW8ImplReader::GetCurrentCJKCharSet()
 {
 if (!maFontSrcCJKCharSets.empty())
 eSrcCharSet = 

[Libreoffice-commits] core.git: 4 commits - sw/source xmlsecurity/source

2014-08-22 Thread Caolán McNamara
 sw/source/ui/dialog/uiregionsw.cxx |5 ++---
 sw/source/ui/misc/glossary.cxx |9 +
 sw/source/ui/misc/glossary.src |6 ++
 sw/source/uibase/dialog/regionsw.hrc   |2 +-
 sw/source/uibase/dialog/regionsw.src   |6 ++
 sw/source/uibase/inc/misc.hrc  |4 ++--
 sw/source/uibase/uiview/view.hrc   |4 +---
 sw/source/uibase/uiview/view.src   |6 ++
 sw/source/uibase/uiview/viewling.cxx   |2 +-
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |5 ++---
 xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc |2 +-
 xmlsecurity/source/dialogs/digitalsignaturesdialog.src |6 ++
 12 files changed, 23 insertions(+), 34 deletions(-)

New commits:
commit c70f22b9a56d19efa58329dcd5095804d1864513
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Aug 22 09:33:44 2014 +0100

QueryBox STR_QUERY_DELETE - MessageDialog + string

Change-Id: I570fe82f3207e8b40a0e4727c6641fdf59113978

diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 0e83851..33d8984 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -20,7 +20,7 @@
 #include hintids.hxx
 
 #include vcl/menu.hxx
-#include vcl/msgbox.hxx
+#include vcl/layout.hxx
 #include vcl/help.hxx
 #include svl/stritem.hxx
 #include unotools/pathoptions.hxx
@@ -488,8 +488,8 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
 }
 else if (sItemIdent == delete)
 {
-QueryBox aQuery(this, SW_RES(MSG_QUERY_DELETE));
-if(RET_YES == aQuery.Execute())
+MessageDialog aQuery(this, SW_RES(STR_QUERY_DELETE), 
VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+if (RET_YES == aQuery.Execute())
 {
 const OUString aShortName(m_pShortNameEdit-GetText());
 const OUString aTitle(m_pNameED-GetText());
@@ -646,7 +646,8 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
 }
 else
 {
-QueryBox aBox(this, WB_YES_NO, sReadonlyPath);
+MessageDialog aBox(this, sReadonlyPath, VCL_MESSAGE_QUESTION, 
VCL_BUTTONS_YES_NO);
+
 if(RET_YES == aBox.Execute())
 PathHdl(m_pPathBtn);
 }
diff --git a/sw/source/ui/misc/glossary.src b/sw/source/ui/misc/glossary.src
index 28d8f5b..7d44cdf 100644
--- a/sw/source/ui/misc/glossary.src
+++ b/sw/source/ui/misc/glossary.src
@@ -26,11 +26,9 @@ String STR_DOUBLE_SHORTNAME
 {
 Text [ en-US ] = Shortcut name already exists. Please choose another 
name. ;
 };
-QueryBox MSG_QUERY_DELETE
+String STR_QUERY_DELETE
 {
-BUTTONS = WB_YES_NO ;
-DEFBUTTON = WB_DEF_NO ;
-Message [ en-US ] = Delete AutoText? ;
+Text[ en-US ] = Delete AutoText? ;
 };
 String STR_QUERY_DELETE_GROUP1
 {
diff --git a/sw/source/uibase/inc/misc.hrc b/sw/source/uibase/inc/misc.hrc
index 01e1e3d..03f944f 100644
--- a/sw/source/uibase/inc/misc.hrc
+++ b/sw/source/uibase/inc/misc.hrc
@@ -26,10 +26,10 @@
 
 #define DLG_SORTING (RC_MISC_BEGIN + 19)
 
-#define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31)
+#define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 29)
 
 #define STR_DOUBLE_SHORTNAME(RC_MISC_BEGIN + 30)
-#define MSG_QUERY_DELETE(RC_MISC_BEGIN + 31)
+#define STR_QUERY_DELETE(RC_MISC_BEGIN + 31)
 #define STR_QUERY_DELETE_GROUP1 (RC_MISC_BEGIN + 32)
 #define STR_QUERY_DELETE_GROUP2 (RC_MISC_BEGIN + 33)
 #define STR_NO_GLOSSARIES   (RC_MISC_BEGIN + 34)
commit f10e4157ce6c134bb9561b7b48254c2c566726eb
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Aug 22 09:20:01 2014 +0100

QueryBox QB_CONNECT - MessageDialog + string

Change-Id: I593527c365ad6925229a3dd7d9e1c589fc4e34a5

diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index 31b53da..14e078f 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -23,7 +23,6 @@
 #include svl/PasswordHelper.hxx
 #include vcl/svapp.hxx
 #include vcl/layout.hxx
-#include vcl/msgbox.hxx
 #include svl/stritem.hxx
 #include svl/eitem.hxx
 #include sfx2/passwd.hxx
@@ -961,7 +960,7 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox )
 bool bContent = pSectRepr-IsContent();
 if( pBox-IsChecked()  bContent  rSh.HasSelection() )
 {
-if( RET_NO == QueryBox( this, SW_RES(QB_CONNECT) ).Execute() )
+if (RET_NO == MessageDialog(this, SW_RES(STR_QUERY_CONNECT), 
VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute())
 pBox-Check( false );
 }
 if( bFile )
@@ -1709,7 +1708,7 @@ IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox 
*, pBox )
 if( pBox-IsChecked() )
 {
 if( m_pWrtSh-HasSelection() 
-RET_NO == QueryBox( this, 

[Libreoffice-commits] core.git: 4 commits - sw/source writerfilter/source

2014-08-08 Thread Miklos Vajna
 sw/source/core/docnode/nodedump.cxx  |   23 +++
 writerfilter/source/dmapper/DomainMapper.cxx |   43 +
 writerfilter/source/ooxml/model.xml  |  194 ++-
 3 files changed, 102 insertions(+), 158 deletions(-)

New commits:
commit 3820a1611b399a318c86a41c3355d6887a4dd1b4
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Aug 8 15:18:01 2014 +0200

DOCX import: handle date SDT in headers/footers

Turns out form controls are not allowed in headers/footers (see the
comment in the patch), so if that happens, then just fall back to what
we already do for other SDT types.

Change-Id: Icc79c2a825e9eb2a85980489812a4178fde37576

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 40c3afa..0da5178 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -944,7 +944,10 @@ void DomainMapper::lcl_attribute(Id nName, Value  val)
 m_pImpl-m_pSdtHelper-getDropDownItems().push_back(sStringValue);
 break;
 case NS_ooxml::LN_CT_SdtDate_fullDate:
-m_pImpl-m_pSdtHelper-getDate().append(sStringValue);
+if (!IsInHeaderFooter())
+m_pImpl-m_pSdtHelper-getDate().append(sStringValue);
+else
+m_pImpl-appendGrabBag(m_pImpl-m_aInteropGrabBag, 
ooxml:CT_SdtDate_fullDate, sStringValue);
 break;
 case NS_ooxml::LN_CT_Background_color:
 m_pImpl-m_oBackgroundColor.reset(nIntValue);
@@ -2351,19 +2354,44 @@ void DomainMapper::sprmWithProps( Sprm rSprm, 
PropertyMapPtr rContext )
 break;
 case NS_ooxml::LN_CT_SdtPr_date:
 {
-writerfilter::ReferenceProperties::Pointer_t pProperties = 
rSprm.getProps();
-if (pProperties.get() != NULL)
-pProperties-resolve(*this);
+if (!IsInHeaderFooter())
+resourcemodel::resolveSprmProps(*this, rSprm);
+else
+{
+OUString sName = ooxml::CT_SdtPr_date;
+enableInteropGrabBag(sName);
+resourcemodel::resolveSprmProps(*this, rSprm);
+m_pImpl-m_pSdtHelper-appendToInteropGrabBag(getInteropGrabBag());
+m_pImpl-disableInteropGrabBag();
+}
 }
 break;
 case NS_ooxml::LN_CT_SdtDate_dateFormat:
 {
-m_pImpl-m_pSdtHelper-getDateFormat().append(sStringValue);
+if (!IsInHeaderFooter())
+m_pImpl-m_pSdtHelper-getDateFormat().append(sStringValue);
+else
+m_pImpl-appendGrabBag(m_pImpl-m_aInteropGrabBag, 
ooxml:CT_SdtDate_dateFormat, sStringValue);
+}
+break;
+case NS_ooxml::LN_CT_SdtDate_storeMappedDataAs:
+{
+if (IsInHeaderFooter())
+m_pImpl-appendGrabBag(m_pImpl-m_aInteropGrabBag, 
ooxml:CT_SdtDate_storeMappedDataAs, sStringValue);
+}
+break;
+case NS_ooxml::LN_CT_SdtDate_calendar:
+{
+if (IsInHeaderFooter())
+m_pImpl-appendGrabBag(m_pImpl-m_aInteropGrabBag, 
ooxml:CT_SdtDate_calendar, sStringValue);
 }
 break;
 case NS_ooxml::LN_CT_SdtDate_lid:
 {
-m_pImpl-m_pSdtHelper-getLocale().append(sStringValue);
+if (!IsInHeaderFooter())
+m_pImpl-m_pSdtHelper-getLocale().append(sStringValue);
+else
+m_pImpl-appendGrabBag(m_pImpl-m_aInteropGrabBag, 
ooxml:CT_SdtDate_lid, sStringValue);
 }
 break;
 case NS_ooxml::LN_CT_SdtPr_dataBinding:
@@ -2914,7 +2942,8 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, 
size_t len)
 m_pImpl-m_pSdtHelper-getSdtTexts().append(sText);
 return;
 }
-else if (!m_pImpl-m_pSdtHelper-getDateFormat().isEmpty())
+// Form controls are not allowed in headers / footers; see 
sw::DocumentContentOperationsManager::InsertDrawObj()
+else if (!m_pImpl-m_pSdtHelper-getDateFormat().isEmpty()  
!IsInHeaderFooter())
 {
 /*
  * Here we assume w:sdt only contains a single text token. We need to
commit d1ebad2077d2b2b9edbaec090f38468393874a07
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Aug 8 14:55:35 2014 +0200

DOCX import: tokenize CT_SdtDate / storeMappedDataAs and calendar

Change-Id: I7d47e7db08637488975b834f7cc72fe1251a14d3

diff --git a/writerfilter/source/ooxml/model.xml 
b/writerfilter/source/ooxml/model.xml
index 0c84d0f..9083de0 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -22866,6 +22866,8 @@
   attribute name=fullDate tokenid=ooxml:CT_SdtDate_fullDate/
   element name=dateFormat tokenid=ooxml:CT_SdtDate_dateFormat/
   element name=lid tokenid=ooxml:CT_SdtDate_lid/
+  element name=storeMappedDataAs 
tokenid=ooxml:CT_SdtDate_storeMappedDataAs/
+  element name=calendar tokenid=ooxml:CT_SdtDate_calendar/
 /resource
 resource name=CT_SdtDocPart resource=Properties
   element name=docPartGallery 

[Libreoffice-commits] core.git: 4 commits - sw/source

2014-07-12 Thread Bjoern Michaelsen
 sw/source/core/doc/docbm.cxx |  292 ++-
 1 file changed, 183 insertions(+), 109 deletions(-)

New commits:
commit 6708edc8952108f4bfb3bbac3e3e50afa64e1539
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Sun Jul 13 01:13:16 2014 +0200

typo

Change-Id: Ia400c34f91f190453aa9cf87480d4559d8818a58

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 1e896b7..68a3574 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -2055,7 +2055,7 @@ void CntntIdxStoreImpl::RestoreUnoCrsrs(SwDoc* pDoc, 
sal_uLong nNode, sal_Int32
 sal_uInt16 nCnt = 0;
 BOOST_FOREACH(const SwUnoCrsr* pUnoCrsr, pDoc-GetUnoCrsrTbl())
 {
-SAL_INFO(sw.core, ::Looking for Index   aEntry.m_nIdx   
now at PaM Index  nCnt  :   pUnoCrsr);
+SAL_INFO(sw.core, Looking for Index   aEntry.m_nIdx   now 
at PaM Index  nCnt  :   pUnoCrsr);
 SwPosition* pPos = NULL;
 FOREACHPAM_START( const_castSwUnoCrsr*(pUnoCrsr) )
 if( aEntry.m_nIdx == nCnt )
commit 8018d8d7e3b120c973a27bb4cd74df81ad5f8463
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Sun Jul 13 01:07:40 2014 +0200

now use the refactored UnoCrsr implementation ...

... now that we verified it to work as the old version used to do.

Change-Id: I7980f263b35a6504337d2836ae2d4b9f29b19942

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 226da0e..1e896b7 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1134,8 +1134,6 @@ namespace
 //  0x2001 = frame anchored at character, which should be moved
 //  0x0800 = Crsr from the CrsrShell Mark
 //  0x0801 = Crsr from the CrsrShell Point
-//  0x0400 = UnoCrsr Mark
-//  0x0401 = UnoCrsr Point
 
 class _SwSaveTypeCountContent
 {
@@ -1246,7 +1244,7 @@ namespace
 rSave.DecType();
 }
 }
-#if OSL_DEBUG_LEVEL  0
+#if 0
 static void DumpSaves(std::vectorsal_uLong rSaveArr)
 {
 sal_uInt16 n = 0;
@@ -1591,29 +1589,6 @@ void _SaveCntntIdx(SwDoc* pDoc,
 FOREACHSHELL_END( pShell )
 }
 }
-// 6. UnoCrsr
-{
-aSave.SetTypeAndCount( 0x400, 0 );
-const SwUnoCrsrTbl rTbl = pDoc-GetUnoCrsrTbl();
-for (SwUnoCrsrTbl::const_iterator it = rTbl.begin();
-it != rTbl.end(); ++it)
-{
-FOREACHPAM_START( *it )
-lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, false );
-aSave.IncCount();
-FOREACHPAM_END()
-
-SwUnoTableCrsr* pUnoTblCrsr =
-dynamic_castSwUnoTableCrsr*(*it);
-if( pUnoTblCrsr )
-{
-FOREACHPAM_START( pUnoTblCrsr-GetSelRing() )
-lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, 
false );
-aSave.IncCount();
-FOREACHPAM_END()
-}
-}
-}
 }
 
 void _RestoreCntntIdx(SwDoc* pDoc,
@@ -1703,49 +1678,6 @@ void _RestoreCntntIdx(SwDoc* pDoc,
 }
 }
 break;
-
-case 0x0400:
-case 0x0401:
-{
-sal_uInt16 nCnt = 0;
-const SwUnoCrsrTbl rTbl = pDoc-GetUnoCrsrTbl();
-for (SwUnoCrsrTbl::const_iterator it = rTbl.begin();
-it != rTbl.end(); ++it)
-{
-FOREACHPAM_START( *it )
-if( aSave.GetCount() == nCnt )
-{
-SAL_INFO(sw.core, Found PaM   PCURCRSR   
for Index   aSave.GetCount());
-pPos = PCURCRSR-GetBound( 0x0400 ==
-aSave.GetType() );
-break;
-}
-else
-SAL_INFO(sw.core, Skipped PaM   PCURCRSR  
 for Index   aSave.GetCount());
-++nCnt;
-FOREACHPAM_END()
-if( pPos )
-break;
-
-SwUnoTableCrsr* pUnoTblCrsr =
-dynamic_castSwUnoTableCrsr*(*it);
-if ( pUnoTblCrsr )
-{
-FOREACHPAM_START( pUnoTblCrsr-GetSelRing() )
-if( aSave.GetCount() == nCnt )
-{
-pPos = PCURCRSR-GetBound( 0x0400 ==
-aSave.GetType() );
-break;
-}
-++nCnt;
-FOREACHPAM_END()
-}
-if ( pPos )
-break;
-

[Libreoffice-commits] core.git: 4 commits - sw/source writerfilter/source

2014-05-25 Thread Miklos Vajna
 sw/source/core/doc/docbm.cxx |6 ++-
 writerfilter/source/ooxml/effort.xsl |   63 ---
 writerfilter/source/ooxml/rngtocxx   |   50 ---
 3 files changed, 4 insertions(+), 115 deletions(-)

New commits:
commit 309a2dabab52dc1498ddbf69b19232e3ad9e88c4
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun May 25 20:11:36 2014 +0200

coverity#1158083 Unchecked dynamic_cast

Change-Id: I8213e0c8e6228320c6efcba5e42e58e87e0379b9

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index e396bc2..dc54734 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1736,8 +1736,8 @@ void _RestoreCntntIdx(SwDoc* pDoc,
 switch( aSave.GetType() )
 {
 case 0x8000:
+if (MarkBase* pMark = 
dynamic_castMarkBase*(pMarkAccess-getAllMarksBegin()[aSave.GetCount()].get()))
 {
-MarkBase* pMark = 
dynamic_castMarkBase*(pMarkAccess-getAllMarksBegin()[aSave.GetCount()].get());
 SwPosition aNewPos(pMark-GetMarkPos());
 aNewPos.nNode = *pCNd;
 aNewPos.nContent.Assign(pCNd, aSave.GetContent() + nOffset);
@@ -1745,8 +1745,8 @@ void _RestoreCntntIdx(SwDoc* pDoc,
 }
 break;
 case 0x8001:
+if (MarkBase* pMark = 
dynamic_castMarkBase*(pMarkAccess-getAllMarksBegin()[aSave.GetCount()].get()))
 {
-MarkBase* pMark = 
dynamic_castMarkBase*(pMarkAccess-getAllMarksBegin()[aSave.GetCount()].get());
 SwPosition aNewPos(pMark-GetOtherMarkPos());
 aNewPos.nNode = *pCNd;
 aNewPos.nContent.Assign(pCNd, aSave.GetContent() + nOffset);
commit eedae0444722923e85766d4b2843ac4e2171c3de
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun May 25 20:05:01 2014 +0200

coverity#1158082 Unchecked dynamic_cast

Change-Id: Ia70d73d64af020c546a0218b996334959ca6b624

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 21de483..e396bc2 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -616,6 +616,8 @@ namespace sw { namespace mark
 // is on position ??
 bool bChangedPos = false, bChangedOPos = false;
 ::sw::mark::MarkBase* const pMark = dynamic_cast 
::sw::mark::MarkBase* (ppMark-get());
+if (!pMark)
+continue;
 if(pMark-GetMarkPos().nNode.GetNode() == pOldNode)
 {
 SwPosition aNewPosRel(aNewPos);
commit 8282656f851ceec7b50d4a8352bb76d7e7219ff0
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun May 25 19:58:18 2014 +0200

writerfilter: remove unused rngtocxx

Change-Id: I780aff48f55bdc4f903404472f22f3fb4bb6968c

diff --git a/writerfilter/source/ooxml/rngtocxx 
b/writerfilter/source/ooxml/rngtocxx
deleted file mode 100755
index bb91c2a..000
--- a/writerfilter/source/ooxml/rngtocxx
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the License); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-xalan -xsl modelpreprocess.xsl -in model.xml  model_processed.xml
-xalan -xsl resourcestokens.xsl -in model_processed.xml  OOXMLtokens.hxx
-xalan -xsl resources.xsl -in model_processed.xml  OOXMLresources.hxx
-xalan -xsl resourcesimpl.xsl -in model_processed.xml  OOXMLresources.cxx
-xalan -xsl resourcesimpl_dml-baseStylesheet.xsl -in model_processed.xml  
OOXMLresources_dml-baseStylesheet.cxx
-xalan -xsl resourcesimpl_dml-baseTypes.xsl -in model_processed.xml  
OOXMLresources_dml-baseTypes.cxx
-xalan -xsl resourcesimpl_dml-chartDrawing.xsl -in model_processed.xml  
OOXMLresources_dml-chartDrawing.cxx
-xalan -xsl resourcesimpl_dml-documentProperties.xsl -in model_processed.xml  
OOXMLresources_dml-documentProperties.cxx
-xalan -xsl resourcesimpl_dml-graphicalObject.xsl -in model_processed.xml  
OOXMLresources_dml-graphicalObject.cxx
-xalan -xsl resourcesimpl_dml-shape3DCamera.xsl -in model_processed.xml  
OOXMLresources_dml-shape3DCamera.cxx
-xalan -xsl resourcesimpl_dml-shape3DLighting.xsl -in model_processed.xml  
OOXMLresources_dml-shape3DLighting.cxx
-xalan -xsl 

[Libreoffice-commits] core.git: 4 commits - sw/source vcl/unx

2014-05-05 Thread Michael Stahl
 sw/source/core/access/acctable.cxx |   44 ++---
 sw/source/core/access/acctable.hxx |9 ---
 sw/source/core/layout/tabfrm.cxx   |   22 --
 sw/source/core/undo/untbl.cxx  |   20 +++-
 vcl/unx/gtk/a11y/atklistener.cxx   |5 +++-
 5 files changed, 50 insertions(+), 50 deletions(-)

New commits:
commit d09d75167d77adcc8538c5cc5d8fe6bac6091ca1
Author: Michael Stahl mst...@redhat.com
Date:   Mon May 5 23:33:00 2014 +0200

AtkListener: consistency check is too strict

Apparently it can happen in JunitTest_sw_unoapi that between the
getAccessibleChildCount() and the getAccessibleChild() calls that the
children all disappear; try not to assert in that case.

Change-Id: Iec8e373281950bf684fa76d69f8c4625ecd1255a

diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx
index 3349be8..511ff0a 100644
--- a/vcl/unx/gtk/a11y/atklistener.cxx
+++ b/vcl/unx/gtk/a11y/atklistener.cxx
@@ -137,7 +137,10 @@ void 
AtkListener::updateChildList(accessibility::XAccessibleContext* pContext)
  }
  catch (lang::IndexOutOfBoundsException const)
  {
- assert(false); // not consistent with getAccessibleChildCount
+ sal_Int32 nChildren2 = pContext-getAccessibleChildCount();
+ assert(nChildren2 = n); // consistency?
+ m_aChildList.resize(std::min(nChildren2, n));
+ break;
  }
  OSL_ASSERT(m_aChildList[n].is());
  }
commit f66d9badf9e510f5bbc94201edd5a53c26f8526a
Author: Michael Stahl mst...@redhat.com
Date:   Mon May 5 21:45:55 2014 +0200

sw: don't dispose SwAccessibles in SwRowFrm::Cut()

This does not appear to work so well: for a row with multiple cells,
when the second cell frame's SwAccessible is disposed it will send an
event, and the AtkListener will then request all children of the row,
and this causes a new SwAccessible to be created for the first cell
frame that was disposed previously.

Unlike most other events, Dispose events cannot be sent delayed.

The SwAccessibles are disposed from ~SwCellFrm already, that should be
sufficient.

Change-Id: I6da72605e5386540f8d82535fca151e97d70869f

diff --git a/sw/source/core/access/acctable.cxx 
b/sw/source/core/access/acctable.cxx
index 2bb9fd6..979dd0d 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -1446,7 +1446,8 @@ void SwAccessibleTable::InvalidateChildPosOrSize( const 
SwAccessibleChild rChil
 SwAccessibleTableData_Impl *pNewTableData = CreateNewTableData(); 
// #i77106#
 if( !pNewTableData-CompareExtents( GetTableData() ) )
 {
-if(pNewTableData-GetRowCount()!= mpTableData-GetRowCount())
+if (pNewTableData-GetRowCount() != mpTableData-GetRowCount()
+ 1  GetTableData().GetRowCount())
 {
 Int32Set_Impl::const_iterator aSttCol( 
GetTableData().GetColumnIter( 0 ) );
 Int32Set_Impl::const_iterator aSttRow( 
GetTableData().GetRowIter( 1 ) );
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 7ac3764..8b26e60 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4178,28 +4178,6 @@ void SwRowFrm::Cut()
 pTab-FindMaster()-InvalidatePos();
 }
 
-// #i103961#
-// notification for accessibility
-{
-SwRootFrm *pRootFrm = getRootFrm();
-if( pRootFrm  pRootFrm-IsAnyShellAccessible() )
-{
-SwViewShell* pVSh = pRootFrm-GetCurrShell();
-if ( pVSh  pVSh-Imp() )
-{
-SwFrm* pCellFrm( GetLower() );
-while ( pCellFrm )
-{
-OSL_ENSURE( pCellFrm-IsCellFrm(),
-SwRowFrm::Cut() - unexpected type of SwRowFrm 
lower. );
-pVSh-Imp()-DisposeAccessibleFrm( pCellFrm );
-
-pCellFrm = pCellFrm-GetNext();
-}
-}
-}
-}
-
 SwLayoutFrm::Cut();
 }
 
commit a82de8698a4569d043a3f656a4afbe21a952f8d3
Author: Michael Stahl mst...@redhat.com
Date:   Mon May 5 21:30:43 2014 +0200

fdo#57197: sw: fix crash on Undo of table row insert on 1-row table

... with accessibility enabled: the SwCellFrms are deleted, but the
entry in the SwAccessibleMap::mpFrmMap is not removed, because Dispose
returns early since the connections to the nodes have been severed already.

This then crashes in some questionable code that iterates over and uses
the frame pointers in mpFrmMap that was added in
76c549eb01dcb7b5bf28a271ce00e386f3d388ba (where previously only the
WeakReferences were used out of that map).

Change-Id: I13885c6ab9a92e34e95925f275e15c20fdc600b7


[Libreoffice-commits] core.git: 4 commits - sw/source

2014-04-01 Thread Miklos Vajna
 sw/source/core/layout/movedfwdfrmsbyobjpos.cxx  |1 -
 sw/source/core/layout/newfrm.cxx|   12 
 sw/source/core/layout/objectformatter.cxx   |3 ---
 sw/source/core/layout/objectformatterlayfrm.cxx |1 -
 4 files changed, 17 deletions(-)

New commits:
commit 7fcab08f36fe8bceeab7235e3b83cddeb06fd103
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Apr 1 21:34:13 2014 +0200

sw: unused include in objectformatterlayfrm

Change-Id: I12bdb00e89978c977d1d9cb721462bf23849a876

diff --git a/sw/source/core/layout/objectformatterlayfrm.cxx 
b/sw/source/core/layout/objectformatterlayfrm.cxx
index 6fee581..fcfe539 100644
--- a/sw/source/core/layout/objectformatterlayfrm.cxx
+++ b/sw/source/core/layout/objectformatterlayfrm.cxx
@@ -20,7 +20,6 @@
 #include objectformatterlayfrm.hxx
 #include anchoredobject.hxx
 #include sortedobjs.hxx
-#include layfrm.hxx
 #include pagefrm.hxx
 
 // #124218#
commit f90898d8c25436307a0a96e8cbe78322b6eda2d0
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Apr 1 21:32:48 2014 +0200

sw: unused include in objectformatter

Change-Id: I7d789c2467c03a20d033b146ef2f89cbf6e9104a

diff --git a/sw/source/core/layout/objectformatter.cxx 
b/sw/source/core/layout/objectformatter.cxx
index b27473d..fa2d735 100644
--- a/sw/source/core/layout/objectformatter.cxx
+++ b/sw/source/core/layout/objectformatter.cxx
@@ -17,17 +17,14 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include objectformatter.hxx
 #include objectformattertxtfrm.hxx
 #include objectformatterlayfrm.hxx
-#include anchoredobject.hxx
 #include anchoreddrawobject.hxx
 #include sortedobjs.hxx
 #include pagefrm.hxx
 #include flyfrms.hxx
 #include txtfrm.hxx
 #include layact.hxx
-#include frmfmt.hxx
 #include fmtanchr.hxx
 #include doc.hxx
 
commit 96851a755b4d2d8a57f6ef6553c6b31606fc1d05
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Apr 1 21:29:20 2014 +0200

sw: unused include in newfrm

Change-Id: Ie7542d39555be3c649a0712a147281cc1066ca2f

diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index a8cf7d8..5a8d3c1 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -19,30 +19,18 @@
 
 #include svx/svdmodel.hxx
 #include svx/svdpage.hxx
-#include fmtfordr.hxx
 #include fmtpdsc.hxx
-#include frmfmt.hxx
 #include swtable.hxx
 #include rootfrm.hxx
 #include pagefrm.hxx
-#include cntfrm.hxx
-#include viewsh.hxx
-#include doc.hxx
-#include node.hxx
 #include dflyobj.hxx
 #include frmtool.hxx
 #include virtoutp.hxx
 #include blink.hxx
-#include ndindex.hxx
 #include sectfrm.hxx
 #include notxtfrm.hxx
 #include pagedesc.hxx
 #include viewimp.hxx
-#include IDocumentTimerAccess.hxx
-#include IDocumentLayoutAccess.hxx
-#include IDocumentFieldsAccess.hxx
-#include IDocumentSettingAccess.hxx
-#include IDocumentDrawModelAccess.hxx
 #include hints.hxx
 #include viewopt.hxx
 #include set
commit 0e9e11526c0941496dd9393c2a997aca957dce5a
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Apr 1 21:21:38 2014 +0200

sw: unused include in movedfwdfrmsbyobjpos

Change-Id: I61aad02e598ca8a286772f8757f980b91ee08bcc

diff --git a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx 
b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
index ebb624d..d812aa3 100644
--- a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
+++ b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
@@ -21,7 +21,6 @@
 #include txtfrm.hxx
 #include rowfrm.hxx
 #include pagefrm.hxx
-#include ndtxt.hxx
 #include switerator.hxx
 
 SwMovedFwdFrmsByObjPos::SwMovedFwdFrmsByObjPos()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 4 commits - sw/source

2014-03-31 Thread Miklos Vajna
 sw/source/core/layout/hffrm.cxx|5 -
 sw/source/core/layout/layact.cxx   |   21 -
 sw/source/core/layout/laycache.cxx |   12 
 sw/source/core/layout/layouter.cxx |2 --
 4 files changed, 40 deletions(-)

New commits:
commit 6e238e51c23476cc5d383e0238ca3a688d342773
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Mar 31 20:52:17 2014 +0200

sw: unused includes in layouter

Change-Id: Iac0799219df9eb07d1de9886153cbf8390cbacb0

diff --git a/sw/source/core/layout/layouter.cxx 
b/sw/source/core/layout/layouter.cxx
index 2df6a5f..62e710b 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -20,8 +20,6 @@
 #include layouter.hxx
 #include doc.hxx
 #include sectfrm.hxx
-#include ftnboss.hxx
-#include cntfrm.hxx
 #include pagefrm.hxx
 #include ftnfrm.hxx
 #include txtfrm.hxx
commit f74a57a4ba327998afac12572f520805539687a6
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Mar 31 20:49:51 2014 +0200

sw: unused includes in laycache

Change-Id: Ibd168ee6a5da734bc3b20bbab698953eb13f0e73

diff --git a/sw/source/core/layout/laycache.cxx 
b/sw/source/core/layout/laycache.cxx
index 598f037..401d837 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -17,9 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include hintids.hxx
 #include editeng/formatbreakitem.hxx
-#include tools/stream.hxx
 #include doc.hxx
 #include docstat.hxx
 #include docary.hxx
@@ -29,30 +27,20 @@
 #include pagefrm.hxx
 #include rootfrm.hxx
 #include txtfrm.hxx
-#include ndtxt.hxx
 #include swtable.hxx
 #include tabfrm.hxx
 #include rowfrm.hxx
-#include colfrm.hxx
-#include bodyfrm.hxx
-#include ndindex.hxx
 #include sectfrm.hxx
-#include frmfmt.hxx
 #include fmtcntnt.hxx
 #include pagedesc.hxx
 #include frmtool.hxx
 #include dflyobj.hxx
 #include dcontact.hxx
 #include viewopt.hxx
-#include viewsh.hxx
 #include flyfrm.hxx
 // OD 2004-05-24 #i28701#
 #include sortedobjs.hxx
 
-#include pam.hxx
-#include docsh.hxx
-#include poolfmt.hxx
-
 #include set
 
 using namespace ::com::sun::star;
commit 8f2d9021d6ea59773099367478a959fa311ac733
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Mar 31 20:42:04 2014 +0200

sw: unused includes in layact

Change-Id: I24f8e817e1f615e8cdab6dde7ede3bce1ab226d2

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 5f72ea6..12016e9 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -22,24 +22,12 @@
 #include time.h
 #include rootfrm.hxx
 #include pagefrm.hxx
-#include cntfrm.hxx
-#include doc.hxx
-#include IDocumentDrawModelAccess.hxx
-#include IDocumentSettingAccess.hxx
-#include IDocumentLayoutAccess.hxx
-#include IDocumentStatistics.hxx
-#include IDocumentTimerAccess.hxx
 #include viewimp.hxx
 #include crsrsh.hxx
 #include dflyobj.hxx
-#include flyfrm.hxx
 #include frmtool.hxx
 #include dcontact.hxx
-#include ndtxt.hxx
-#include frmfmt.hxx
-#include swregion.hxx
 #include viewopt.hxx
-#include pam.hxx
 #include dbg_lay.hxx
 #include layouter.hxx
 #include docstat.hxx
@@ -48,36 +36,27 @@
 #include sfx2/event.hxx
 
 #include ftnidx.hxx
-#include vcl/window.hxx
 #include vcl/svapp.hxx
 #include editeng/opaqitem.hxx
-#include editeng/brushitem.hxx
 #include SwSmartTagMgr.hxx
 
 #define _LAYACT_CXX
 #include layact.hxx
 #include swwait.hxx
 #include fmtsrnd.hxx
-#include fmtanchr.hxx
-#include tools/shl.hxx
 #include docsh.hxx
 
-#include swmodule.hxx
-#include fmtline.hxx
 #include tabfrm.hxx
 #include ftnfrm.hxx
 #include txtfrm.hxx
 #include notxtfrm.hxx
 #include flyfrms.hxx
 #include mdiexp.hxx
-#include fmtornt.hxx
 #include sectfrm.hxx
-#include lineinfo.hxx
 #include acmplwrd.hxx
 // #i28701#
 #include sortedobjs.hxx
 #include objectformatter.hxx
-#include PostItMgr.hxx
 #include vector
 
 // SwLayAction static stuff
commit f4a93651bbda7750021a466e211c530c6bb02dcd
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Mar 31 20:27:48 2014 +0200

sw: unused includes in hffrm

Change-Id: I5e993b6ad54f7d33b1dfb1ff455281975add2981

diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 116650f..0cc8b43 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -18,8 +18,6 @@
  */
 
 #include pagefrm.hxx
-#include viewsh.hxx
-#include doc.hxx
 #include fmtcntnt.hxx
 #include fmthdft.hxx
 #include fmtfsize.hxx
@@ -30,9 +28,6 @@
 #include sectfrm.hxx
 #include flyfrm.hxx
 #include frmtool.hxx
-#include dflyobj.hxx
-#include frmfmt.hxx
-#include ndindex.hxx
 #include hfspacingitem.hxx
 // OD 2004-05-24 #i28701#
 #include sortedobjs.hxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 4 commits - sw/source

2014-02-28 Thread Jacobo Aragunde Pérez
 sw/source/filter/ww8/docxattributeoutput.cxx |  159 ++-
 sw/source/filter/ww8/docxattributeoutput.hxx |1 
 sw/source/filter/ww8/docxexport.cxx  |3 
 3 files changed, 87 insertions(+), 76 deletions(-)

New commits:
commit c5ecd9d2a79d4c2cd80fc7d037074806a021e579
Author: Jacobo Aragunde Pérez jaragu...@igalia.com
Date:   Fri Feb 28 10:51:48 2014 +0100

Correct indentation

Change-Id: I3ce85a17966c155c71cd3e3d1a142cc02ec34bd7

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index ed87bf2..d7d9dea 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3639,85 +3639,83 @@ void DocxAttributeOutput::WriteOLE( SwOLENode rNode, 
const Size rSize, const S
 break;
 }
 
-// wrong indentation ahead
-
-SwOLEObj aObject = rNode.GetOLEObj();
-uno::Reference  embed::XEmbeddedObject  xObj( aObject.GetOleRef() );
-comphelper::EmbeddedObjectContainer* aContainer = 
aObject.GetObject().GetContainer();
-OUString sObjectName = aContainer-GetEmbeddedObjectName( xObj );
-
-// set some attributes according to the type of the embedded object
-OUString sProgID, sMediaType, sRelationType;
-for( sal_Int32 i=0; i  aObjectsInteropList.getLength(); ++i )
-if ( aObjectsInteropList[i].Name == sObjectName )
-{
-aObjectsInteropList[i].Value = sProgID;
-break;
-}
-if( sProgID.startsWith(Excel.Sheet) )
-{
-sMediaType = 
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;
-sRelationType = 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;;
-}
-else if( sProgID.startsWith(PowerPoint.Show) )
-{
-sMediaType = 
application/vnd.openxmlformats-officedocument.presentationml.presentation;
-sRelationType = 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;;
-}
-else
+SwOLEObj aObject = rNode.GetOLEObj();
+uno::Reference  embed::XEmbeddedObject  xObj( aObject.GetOleRef() );
+comphelper::EmbeddedObjectContainer* aContainer = 
aObject.GetObject().GetContainer();
+OUString sObjectName = aContainer-GetEmbeddedObjectName( xObj );
+
+// set some attributes according to the type of the embedded object
+OUString sProgID, sMediaType, sRelationType;
+for( sal_Int32 i=0; i  aObjectsInteropList.getLength(); ++i )
+if ( aObjectsInteropList[i].Name == sObjectName )
 {
-sMediaType = 
application/vnd.openxmlformats-officedocument.oleObject;
-sRelationType = 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject;;
+aObjectsInteropList[i].Value = sProgID;
+break;
 }
+if( sProgID.startsWith(Excel.Sheet) )
+{
+sMediaType = 
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;
+sRelationType = 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;;
+}
+else if( sProgID.startsWith(PowerPoint.Show) )
+{
+sMediaType = 
application/vnd.openxmlformats-officedocument.presentationml.presentation;
+sRelationType = 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;;
+}
+else
+{
+sMediaType = application/vnd.openxmlformats-officedocument.oleObject;
+sRelationType = 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject;;
+}
 
-// write embedded file
-OString sId = m_rExport.WriteOLEObject( aObject, sMediaType, 
sRelationType );
+// write embedded file
+OString sId = m_rExport.WriteOLEObject( aObject, sMediaType, sRelationType 
);
 
-if( sId.isEmpty() )
-{
-// the embedded file could not be saved
-// fallback: save as an image
-FlyFrameGraphic( 0, rSize, rFlyFrmFmt, rNode );
-return;
-}
+if( sId.isEmpty() )
+{
+// the embedded file could not be saved
+// fallback: save as an image
+FlyFrameGraphic( 0, rSize, rFlyFrmFmt, rNode );
+return;
+}
+
+// write preview image
+const Graphic* pGraphic = rNode.GetGraphic();
+OUString sImageId = m_rDrawingML.WriteImage( *pGraphic );
+
+m_pSerializer-startElementNS( XML_w, XML_object, FSEND );
+
+OStringBuffer sShapeStyle, sShapeId;
+sShapeStyle.append( width: ).append( double( rSize.Width() ) / 20 )
+.append( pt;height: ).append( double( rSize.Height() 
) / 20 )
+.append( pt ); //from 
VMLExport::AddRectangleDimensions(), it does: value/20
+sShapeId.append( ole_ ).append( sId );
+
+// shape definition
+m_pSerializer-startElementNS( XML_v, XML_shape,
+   

[Libreoffice-commits] core.git: 4 commits - sw/source

2014-01-30 Thread Matteo Casalin
 sw/source/core/text/porlay.cxx |  142 +
 1 file changed, 61 insertions(+), 81 deletions(-)

New commits:
commit 59239c29269d69a7dec9b093b7832dd032dec1e8
Author: Matteo Casalin matteo.casa...@yahoo.com
Date:   Sun Jan 26 19:17:41 2014 +0100

Use += when possible

Change-Id: I6dad55d3a397becab18f1159f3e8d84cffd7517b

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index d19515e..29861eb 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -352,7 +352,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter rLine, 
SwTxtFormatInfo rInf )
 }
 
 const sal_Int32 nPorSttIdx = rInf.GetLineStart() + nLineLength;
-nLineLength = nLineLength + pPos-GetLen();
+nLineLength += pPos-GetLen();
 AddPrtWidth( pPos-Width() );
 
 // #i3952#
@@ -1629,7 +1629,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, 
sal_Int32 nIdx, sal_Int32 nL
 sal_Int32 nChg = GetCompStart( nCompIdx );
 sal_Int32 nCompLen = GetCompLen( nCompIdx );
 sal_uInt16 nI = 0;
-nLen = nLen + nIdx;
+nLen += nIdx;
 
 if( nChg  nIdx )
 {
@@ -1650,7 +1650,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, 
sal_Int32 nIdx, sal_Int32 nL
 #ifdef DBG_UTIL
 SAL_WARN_IF( nType != CompType( nIdx ), sw.core, Gimme the right 
type! );
 #endif
-nCompLen = nCompLen + nIdx;
+nCompLen += nIdx;
 if( nCompLen  nLen )
 nCompLen = nLen;
 
@@ -2093,7 +2093,7 @@ sal_Int32 SwParaPortion::GetParLen() const
 const SwLineLayout *pLay = this;
 while( pLay )
 {
-nLen = nLen + pLay-GetLen();
+nLen += pLay-GetLen();
 pLay = pLay-GetNext();
 }
 return nLen;
commit 6a9b0aac0362f98a11e9a1f33809b43a30b2c7c7
Author: Matteo Casalin matteo.casa...@yahoo.com
Date:   Sun Jan 26 18:32:50 2014 +0100

Bail out early

Change-Id: Id2a77996cfe9a9ec755766295141123870b4eaf2

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 09445be..d19515e 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -750,20 +750,18 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode 
rNode, sal_Bool bRTL )
 {
 while( nCntComp  CountCompChg() )
 {
-if ( nChg  GetCompStart( nCntComp ) )
-nCntComp++;
-else
+if ( nChg = GetCompStart( nCntComp ) )
 break;
+nCntComp++;
 }
 }
 if ( bAdjustBlock )
 {
 while( nCntKash  CountKashida() )
 {
-if ( nChg  GetKashida( nCntKash ) )
-nCntKash++;
-else
+if ( nChg = GetKashida( nCntKash ) )
 break;
+nCntKash++;
 }
 }
 }
@@ -888,10 +886,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode rNode, 
sal_Bool bRTL )
 while( com::sun::star::i18n::CTLScriptType::CTL_UNKNOWN == 
nCurrentScriptType || nScriptType == nCurrentScriptType )
 {
 nNextCTLScriptStart = ScriptTypeDetector::endOfCTLScriptType( 
rTxt, nNextCTLScriptStart );
-if( nNextCTLScriptStart  rTxt.getLength()  
nNextCTLScriptStart  nChg )
-nCurrentScriptType = ScriptTypeDetector::getCTLScriptType( 
rTxt, nNextCTLScriptStart );
-else
+if( nNextCTLScriptStart = rTxt.getLength() || 
nNextCTLScriptStart = nChg )
 break;
+nCurrentScriptType = ScriptTypeDetector::getCTLScriptType( 
rTxt, nNextCTLScriptStart );
 }
 nChg = std::min( nChg, nNextCTLScriptStart );
 }
@@ -1698,27 +1695,24 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, 
sal_Int32 nIdx, sal_Int32 nL
 }
 }
 
-if( nIdx  nLen )
+if( nIdx = nLen )
+break;
+
+sal_Int32 nTmpChg = nLen;
+if( ++nCompIdx  nCompCount )
 {
-sal_Int32 nTmpChg;
-if( ++nCompIdx  nCompCount )
-{
-nTmpChg = GetCompStart( nCompIdx );
-if( nTmpChg  nLen )
-nTmpChg = nLen;
-nCompLen = GetCompLen( nCompIdx );
-}
-else
+nTmpChg = GetCompStart( nCompIdx );
+if( nTmpChg  nLen )
 nTmpChg = nLen;
-while( nIdx  nTmpChg )
-{
-nLast = pKernArray[ nI ];
-pKernArray[ nI++ ] -= nSub;
-++nIdx;
-}
+nCompLen = GetCompLen( nCompIdx );
+}
+
+while( nIdx  nTmpChg )
+{
+nLast = pKernArray[ nI ];
+pKernArray[ nI++ ] -= nSub;
+++nIdx;
 }
-

[Libreoffice-commits] core.git: 4 commits - sw/source vcl/source

2014-01-21 Thread Khaled Hosny
 sw/source/core/text/guess.cxx  |2 -
 sw/source/core/text/porlay.cxx |2 -
 vcl/source/gdi/outdev3.cxx |   79 -
 3 files changed, 41 insertions(+), 42 deletions(-)

New commits:
commit 5f89d247e3dac99c297066d404c24dea3312fa51
Author: Khaled Hosny khaledho...@eglug.org
Date:   Tue Jan 21 18:57:30 2014 +0200

Typo in comment

Change-Id: I97252a66da63e25166acf3a7bc5a00ad1f8e94f0

diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 04ff05c..2866886 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -365,7 +365,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion rPor, 
SwTxtFormatInfo rInf,
 // which can corrupt the locale pointer inside pBreakIt.
 const lang::Locale aLocale = g_pBreakIt-GetLocale( aLang );
 
-// determines first possible line break from nRightPos to
+// determines first possible line break from nCutPos to
 // start index of current line
 LineBreakResults aResult = g_pBreakIt-GetBreakIter()-getLineBreak(
 rInf.GetTxt(), nCutPos, aLocale,
commit 82943c758c0cd6a8eb23fc222b4e6a1b55c5571b
Author: Khaled Hosny khaledho...@eglug.org
Date:   Tue Jan 21 17:18:42 2014 +0200

Writer, please stop harassing me

This debug code was behind  1 before
9ace8bebd88ff41d65eeaa87a6d1f1dfd8875b6d, so it probably was broken for
ages (or even forever), and all it does now is obscure my terminal with
hundreds of useless messages whenever I open an RTL document since
basically any weak LTR run next to RTL one will have the same script
type, but this code warns about it without explaining what one should
fix here.

I got fed up, whoever knows what to fix here, please do, but for now I’m
just hiding it.

Change-Id: Ifa50e47a080f335ef6fe06bc0f0b5ed5ddbc7338

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 3c73393..a3edbf7 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1245,7 +1245,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode 
rNode, sal_Bool bRTL )
 aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx,
   ScriptChangeInfo(nEnd, 
i18n::ScriptType::COMPLEX) );
 
-#if OSL_DEBUG_LEVEL  0
+#if OSL_DEBUG_LEVEL  1
 // Check that ScriptChangeInfos are in increasing order of
 // position and that we don't have empty changes.
 sal_uInt8 nLastTyp = i18n::ScriptType::WEAK;
commit b7c30884e17027cdb71b05dea5971869b8dbea6c
Author: Khaled Hosny khaledho...@eglug.org
Date:   Tue Jan 21 13:59:56 2014 +0200

It is just an innocent hyphen not a hyphenator

Change-Id: I7454d90adfd507aae4c7efd1d4075454f03cddd8

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index e2a4f38..dd93f55 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6016,11 +6016,11 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString 
rStr, long nTextWidth,
 }
 
 sal_Int32 OutputDevice::GetTextBreak( const OUString rStr, long nTextWidth,
-   sal_Unicode nHyphenatorChar, sal_Int32 
rHyphenatorPos,
+   sal_Unicode nHyphenChar, sal_Int32 
rHyphenPos,
sal_Int32 nIndex, sal_Int32 nLen,
long nCharExtra ) const
 {
-rHyphenatorPos = -1;
+rHyphenPos = -1;
 
 SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
 sal_Int32 nRetVal = -1;
@@ -6046,24 +6046,24 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString 
rStr, long nTextWidth,
 nRetVal = pSalLayout-GetTextBreak( nTextPixelWidth, nExtraPixelWidth, 
nSubPixelFactor );
 
 // calculate hyphenated break position
-OUString aHyphenatorStr(nHyphenatorChar);
+OUString aHyphenStr(nHyphenChar);
 sal_Int32 nTempLen = 1;
-SalLayout* pHyphenatorLayout = ImplLayout( aHyphenatorStr, 0, nTempLen 
);
-if( pHyphenatorLayout )
+SalLayout* pHyphenLayout = ImplLayout( aHyphenStr, 0, nTempLen );
+if( pHyphenLayout )
 {
 // calculate subpixel width of hyphenation character
-long nHyphenatorPixelWidth = pHyphenatorLayout-GetTextWidth() * 
nSubPixelFactor;
-pHyphenatorLayout-Release();
+long nHyphenPixelWidth = pHyphenLayout-GetTextWidth() * 
nSubPixelFactor;
+pHyphenLayout-Release();
 
 // calculate hyphenated break position
-nTextPixelWidth -= nHyphenatorPixelWidth;
+nTextPixelWidth -= nHyphenPixelWidth;
 if( nExtraPixelWidth  0 )
 nTextPixelWidth -= nExtraPixelWidth;
 
-rHyphenatorPos = pSalLayout-GetTextBreak(nTextPixelWidth, 
nExtraPixelWidth, nSubPixelFactor);
+rHyphenPos 

[Libreoffice-commits] core.git: 4 commits - sw/source

2014-01-13 Thread Michael Stahl
 sw/source/core/txtnode/txtedt.cxx |   58 --
 1 file changed, 32 insertions(+), 26 deletions(-)

New commits:
commit 9b9b9ccb7ce5c689e86edffef07f6f78f00391c2
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jan 13 19:16:02 2014 +0100

SwTxtNode::RstTxtAttr(): remove special case continue

The newly inserted hints will always be inserted behind the existing
pHt, since their start position is truly greater than pHt's, so no need
for continue with same i (...and why not i-1 since 2 hints could be
inserted?).

Change-Id: I3c796e7084dc84a360020dfa0ed362fb3305141a

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 343cfdf..b26e6ad 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -612,10 +612,6 @@ void SwTxtNode::RstTxtAttr(
 InsertHint( pNew,
 nsSetAttrMode::SETATTR_NOHINTADJUST );
 }
-
-// don't increment, the inserted attribute has pushed
-// another onto position i!
-continue;
 }
 
 // this case appears to rely on InsertHint not re-sorting
commit 8aab0442355a07cd3bdaf58d37a1f242a0ccf123
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jan 13 19:09:16 2014 +0100

SwTxtNode::RstTxtAttr(): translate german comments

Change-Id: Ie54ff6147ded6cfe88ac86ec02625fbb4a19b364

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index f885990..343cfdf 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -488,23 +488,21 @@ void SwTxtNode::RstTxtAttr(
 continue;
 }
 
-if( nStt = nAttrStart )  // Faelle: 1,3,5
+if (nStt = nAttrStart) // Case: 1,3,5
 {
 const sal_Int32 nAttrEnd = pAttrEnd != NULL
 ? *pAttrEnd
 : nAttrStart;
-if( nEnd  nAttrStart
-|| ( nEnd == nAttrEnd  nEnd == nAttrStart ) )
+if (nEnd  nAttrStart
+|| (nEnd == nAttrEnd  nEnd == nAttrStart)) // Case: 1,3
 {
-// Faelle: 1,3
 if ( nMin  nAttrStart )
 nMin = nAttrStart;
 if ( nMax  nAttrEnd )
 nMax = nAttrEnd;
-// Falls wir nur ein nichtaufgespanntes Attribut entfernen,
-// tun wir mal so, als ob sich nichts geaendert hat.
+// If only a no-extent hint is deleted, no resorting is needed
 bChanged = bChanged || nEnd  nAttrStart || bNoLen;
-if( nAttrEnd = nEnd ) // Fall: 1
+if (nAttrEnd = nEnd)   // Case: 1
 {
 m_pSwpHints-DeleteAtPos(i);
 DestroyAttr( pHt );
@@ -521,16 +519,13 @@ void SwTxtNode::RstTxtAttr(
 break;
 
 //JP 26.11.96:
-// beim DeleteAtPos wird ein Resort ausgefuehrt!!
-// darum muessen wir wieder bei 0 anfangen!!!
-// ueber den Fall 3 koennen Attribute nach hinten
-// verschoben worden sein; damit stimmt jetzt das i
-// nicht mehr!!!
+// DeleteAtPos does a Resort!  Via Case 3 or 4 hints could
+// have been moved around so i is wrong now.
+// So we have to start over at 0 again.
 i = 0;
-
 continue;
 }
-else // Fall: 3
+else// Case: 3
 {
 m_pSwpHints-NoteInHistory( pHt );
 // UGLY: this may temporarily destroy the sorting!
@@ -552,11 +547,11 @@ void SwTxtNode::RstTxtAttr(
 }
 }
 }
-else if ( pAttrEnd != NULL )// Faelle: 2,4,5
+else if (pAttrEnd != 0) // Case: 2,4,5
 {
-if( *pAttrEnd  nStt ) // Faelle: 2,4
+if (*pAttrEnd  nStt)   // Case: 2,4
 {
-if( *pAttrEnd  nEnd )  // Fall: 2
+if (*pAttrEnd  nEnd)   // Case: 2
 {
 if ( nMin  nAttrStart )
 nMin = nAttrStart;
@@ -582,10 +577,10 @@ void SwTxtNode::RstTxtAttr(
 // and pNew being inserted behind pHt
 assert(pHt == m_pSwpHints-GetTextHint(i));
 }
-else if( nLen ) // Fall: 4
+else if (nLen)  // Case: 4
 {
-// bei Lange 0 werden beide Hints vom Insert(Ht)
-// wieder zu einem zusammengezogen 
+// for Length 0 both hints 

[Libreoffice-commits] core.git: 4 commits - sw/source

2013-10-08 Thread Jan Holesovsky
 sw/source/filter/ww8/attributeoutputbase.hxx |5 
 sw/source/filter/ww8/docxattributeoutput.cxx |  220 +--
 sw/source/filter/ww8/docxattributeoutput.hxx |   12 +
 sw/source/filter/ww8/rtfattributeoutput.cxx  |7 
 sw/source/filter/ww8/rtfattributeoutput.hxx  |5 
 sw/source/filter/ww8/wrtw8nds.cxx|4 
 sw/source/filter/ww8/ww8attributeoutput.hxx  |5 
 7 files changed, 236 insertions(+), 22 deletions(-)

New commits:
commit 62ceeb1d1a0ff32e1be615f78da796aa13aaa06c
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue Oct 8 13:50:42 2013 +0200

DOCX export: Export run properties defaults in docDefaults.

The paragraph properties still need some work, so that part is disabled in
order not to break the unit tests.

Change-Id: I06e55a5345d4fe08b14b8a260ab774b38770bf7b

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index b63d78c..1940fa2 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -37,6 +37,7 @@
 
 #include i18nlangtag/languagetag.hxx
 
+#include editeng/autokernitem.hxx
 #include editeng/unoprnms.hxx
 #include editeng/fontitem.hxx
 #include editeng/tstpitem.hxx
@@ -2359,6 +2360,180 @@ void DocxAttributeOutput::StartStyles()
 DocDefaults();
 }
 
+void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem rHt)
+{
+bool bMustWrite = true;
+switch (rHt.Which())
+{
+case RES_CHRATR_CASEMAP:
+bMustWrite = static_cast const SvxCaseMapItem 
(rHt).GetCaseMap() != SVX_CASEMAP_NOT_MAPPED;
+break;
+case RES_CHRATR_COLOR:
+bMustWrite = static_cast const SvxColorItem 
(rHt).GetValue().GetColor() != COL_AUTO;
+break;
+case RES_CHRATR_CONTOUR:
+bMustWrite = static_cast const SvxContourItem (rHt).GetValue();
+break;
+case RES_CHRATR_CROSSEDOUT:
+bMustWrite = static_cast const SvxCrossedOutItem 
(rHt).GetStrikeout() != STRIKEOUT_NONE;
+break;
+case RES_CHRATR_ESCAPEMENT:
+bMustWrite = static_cast const SvxEscapementItem 
(rHt).GetEscapement() != SVX_ESCAPEMENT_OFF;
+break;
+case RES_CHRATR_FONT:
+bMustWrite = true;
+break;
+case RES_CHRATR_FONTSIZE:
+bMustWrite = static_cast const SvxFontHeightItem 
(rHt).GetHeight() != 200; // see StyleSheetTable_Impl::StyleSheetTable_Impl() 
where we set this default
+break;
+case RES_CHRATR_KERNING:
+bMustWrite = static_cast const SvxKerningItem (rHt).GetValue() 
!= 0;
+break;
+case RES_CHRATR_LANGUAGE:
+bMustWrite = true;
+break;
+case RES_CHRATR_POSTURE:
+bMustWrite = static_cast const SvxPostureItem 
(rHt).GetPosture() != ITALIC_NONE;
+break;
+case RES_CHRATR_SHADOWED:
+bMustWrite = static_cast const SvxShadowedItem (rHt).GetValue();
+break;
+case RES_CHRATR_UNDERLINE:
+bMustWrite = static_cast const SvxUnderlineItem 
(rHt).GetLineStyle() != UNDERLINE_NONE;
+break;
+case RES_CHRATR_WEIGHT:
+bMustWrite = static_cast const SvxWeightItem (rHt).GetWeight() 
!= WEIGHT_NORMAL;
+break;
+case RES_CHRATR_AUTOKERN:
+bMustWrite = static_cast const SvxAutoKernItem (rHt).GetValue();
+break;
+case RES_CHRATR_BLINK:
+bMustWrite = static_cast const SvxBlinkItem (rHt).GetValue();
+break;
+case RES_CHRATR_BACKGROUND:
+{
+const SvxBrushItem rBrushItem = static_cast const 
SvxBrushItem (rHt);
+bMustWrite = (rBrushItem.GetColor() != COL_AUTO ||
+  rBrushItem.GetShadingValue() != 
sal_uInt32(ShadingPattern::CLEAR) ||
+  rBrushItem.GetGraphic() != NULL ||
+  rBrushItem.GetGraphicObject() != NULL);
+}
+break;
+
+case RES_CHRATR_CJK_FONT:
+bMustWrite = true;
+break;
+case RES_CHRATR_CJK_FONTSIZE:
+bMustWrite = false; // we have written it already as 
RES_CHRATR_FONTSIZE
+break;
+case RES_CHRATR_CJK_LANGUAGE:
+bMustWrite = true;
+break;
+case RES_CHRATR_CJK_POSTURE:
+bMustWrite = false; // we have written it already as 
RES_CHRATR_POSTURE
+break;
+case RES_CHRATR_CJK_WEIGHT:
+bMustWrite = false; // we have written it already as 
RES_CHRATR_WEIGHT
+break;
+
+case RES_CHRATR_CTL_FONT:
+bMustWrite = true;
+break;
+case RES_CHRATR_CTL_FONTSIZE:
+bMustWrite = static_cast const SvxFontHeightItem 
(rHt).GetHeight() != 200; // see 

[Libreoffice-commits] core.git: 4 commits - sw/source

2013-08-20 Thread Michael Stahl
 sw/source/core/doc/docdesc.cxx |   31 ++-
 sw/source/core/layout/pagedesc.cxx |4 ++--
 2 files changed, 20 insertions(+), 15 deletions(-)

New commits:
commit e1a9a348a519a69f898c9c1e6d87a5837b8267f9
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 20 11:50:34 2013 +0200

fdo#66145: fix copying of header/footer when un-sharing

SwDoc::CopyMasterHeader/Footer(): this could result in sharing the
first-page header/footer with the left-page (!) when un-sharing
via the dialog; the reason is that what actually happens here is that
the left-page header/footer was never changed but the master one
was copied in SwDocStyleSheet::SetItemSet(), so it sort of worked
by accident before the first-page header/footer was added...

Change-Id: Ia24df6ad59cda484559f2ca48ecaa7563878120b

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 6e04bb8..9571e0e 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -194,7 +194,11 @@ void SwDoc::CopyMasterHeader(const SwPageDesc rChged, 
const SwFmtHeader rHead,
 const SwFrmFmt rChgedFrmFmt = (bLeft ? rChged.GetLeft() : 
rChged.GetFirst());
 rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetHeader() );
 }
-else if( (*aRCnt.GetCntntIdx()) == (*aCnt.GetCntntIdx()) )
+else if ((*aRCnt.GetCntntIdx() == *aCnt.GetCntntIdx()) ||
+// The CntntIdx is _always_ different when called from
+// SwDocStyleSheet::SetItemSet, because it deep-copies the
+// PageDesc.  So check if it was previously shared.
+ ((bLeft) ? pDesc-IsHeaderShared() : pDesc-IsFirstShared()))
 {
 SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? Left 
header : First header),
 GetDfltFrmFmt() );
@@ -250,7 +254,11 @@ void SwDoc::CopyMasterFooter(const SwPageDesc rChged, 
const SwFmtFooter rFoot,
 const SwFrmFmt rChgedFrmFmt = (bLeft ? rChged.GetLeft() : 
rChged.GetFirst());
 rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetFooter() );
 }
-else if( (*aRCnt.GetCntntIdx()) == (*aLCnt.GetCntntIdx()) )
+else if ((*aRCnt.GetCntntIdx() == *aLCnt.GetCntntIdx()) ||
+// The CntntIdx is _always_ different when called from
+// SwDocStyleSheet::SetItemSet, because it deep-copies the
+// PageDesc.  So check if it was previously shared.
+ ((bLeft) ? pDesc-IsHeaderShared() : pDesc-IsFirstShared()))
 {
 SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? Left 
footer : First footer),
 GetDfltFrmFmt() );
@@ -344,8 +352,6 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 CopyMasterHeader(rChged, rHead, pDesc, true); // Copy left header
 CopyMasterHeader(rChged, rHead, pDesc, false); // Copy first header
 pDesc-ChgHeaderShare( rChged.IsHeaderShared() );
-// there is just one first shared flag for both header and footer?
-pDesc-ChgFirstShare( rChged.IsFirstShared() );
 
 // Synch Footer.
 const SwFmtFooter rFoot = rChged.GetMaster().GetFooter();
@@ -362,6 +368,8 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 CopyMasterFooter(rChged, rFoot, pDesc, true); // Copy left footer
 CopyMasterFooter(rChged, rFoot, pDesc, false); // Copy first footer
 pDesc-ChgFooterShare( rChged.IsFooterShared() );
+// there is just one first shared flag for both header and footer?
+pDesc-ChgFirstShare( rChged.IsFirstShared() );
 
 if ( pDesc-GetName() != rChged.GetName() )
 pDesc-SetName( rChged.GetName() );
commit 0b7a823bb6df79384939dda4de3b7f28e5e52758
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 20 11:51:27 2013 +0200

fdo#66145: fix Undo invalidation in SwDoc::ChgPageDesc()

SwDoc::ChgPageDesc(): make the invalidation of the Undo stack on
change of IsFirstShared work by delaying ChgFirstShare() until after
the check.

Change-Id: Ifbefe446df8b6d785ed1bb6394ec5beb803fb1fe

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index f5df1d0..6e04bb8 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -324,7 +324,6 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 
 // Take over orientation
 pDesc-SetLandscape( rChged.GetLandscape() );
-pDesc-ChgFirstShare( rChged.IsFirstShared() );
 
 // #i46909# no undo if header or footer changed
 bool bHeaderFooterChanged = false;
@@ -345,6 +344,8 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 CopyMasterHeader(rChged, rHead, pDesc, true); // Copy left header
 CopyMasterHeader(rChged, rHead, pDesc, false); // Copy first header
 

[Libreoffice-commits] core.git: 4 commits - sw/source

2013-08-02 Thread Zolnai Tamás
 sw/source/core/inc/frmtool.hxx |2 
 sw/source/core/inc/swfont.hxx  |   35 +
 sw/source/core/layout/paintfrm.cxx |   46 ++---
 sw/source/core/text/inftxt.cxx |   30 +++
 sw/source/core/text/itratr.cxx |   72 +++
 sw/source/core/text/itratr.hxx |   21 ++--
 sw/source/core/text/itrcrsr.cxx|   52 ++--
 sw/source/core/text/porlay.cxx |9 +++
 sw/source/core/text/txtdrop.cxx|   19 ++-
 sw/source/core/txtnode/swfont.cxx  |   96 +++--
 10 files changed, 327 insertions(+), 55 deletions(-)

New commits:
commit 051b59ca35b30ec44226c7e5d429c46c00076ad5
Author: Zolnai Tamás zolnaitamas2...@gmail.com
Date:   Thu Aug 1 20:17:41 2013 +0200

CharBrd 4.3: drop caps

-Increase the height with the borders width.
(drop portion calculates the height by own, but width is right)
-Avoid caching when there is a border, because caching work
with height and it can happen that border change, but height not.
-Avoid drop portion height when calculate the line height
(except when there is only one line)
-Drop portion has an own font, so we have to use this
font when change the cursor position.
-When painting text, use the current drop portion
part width.

Change-Id: I3d8f4ef9e6f067e28827453f9b6412184943b72e

diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 532ee1e..a57a20f 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -379,6 +379,8 @@ public:
 const boost::optionalediteng::SvxBorderLine GetAbsBottomBorder( const 
bool bVertLayout ) const;
 const boost::optionalediteng::SvxBorderLine GetAbsRightBorder( const 
bool bVertLayout ) const;
 const boost::optionalediteng::SvxBorderLine GetAbsLeftBorder( const 
bool bVertLayout ) const;
+
+bool HasBorder() const;
 };
 
 inline void SwFont::SetColor( const Color rColor )
@@ -828,6 +830,11 @@ inline void SwSubFont::SetVertical( const sal_uInt16 nDir, 
const sal_Bool bVertF
 Font::SetOrientation( nDir );
 }
 
+inline bool SwFont::HasBorder() const
+{
+return m_aTopBorder || m_aBottomBorder || m_aLeftBorder || m_aRightBorder;
+}
+
 
 /*
  *  class SwUnderlineFont
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 17b7681..3e97fa7 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -29,6 +29,7 @@
 #include editeng/adjustitem.hxx
 #include editeng/lspcitem.hxx
 #include editeng/lrspitem.hxx
+#include editeng/borderline.hxx
 #include frmatr.hxx
 #include pagedesc.hxx // SwPageDesc
 #include tgrditem.hxx
@@ -925,9 +926,28 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const 
xub_StrLen nOfst,
 
 // Shift the cursor with the right border width
 // Note: nX remains positive because GetTxtSize() also 
include the width of the right border
-if( GetInfo().GetFont()-GetRightBorder()  
aInf.GetIdx()  nOfst  nOfst  aInf.GetIdx() + pPor-GetLen() )
+if( aInf.GetIdx()  nOfst  nOfst  aInf.GetIdx() + 
pPor-GetLen() )
+{
+// Find the current drop portion part and use its 
right border
+if( pPor-IsDropPortion() )
+{
+SwDropPortion* pDrop = 
static_castSwDropPortion*(pPor);
+const SwDropPortionPart* pCurrPart = 
pDrop-GetPart();
+sal_Int16 nSumLength = 0;
+while( pCurrPart  (nSumLength += 
pCurrPart-GetLen())  nOfst - aInf.GetIdx() )
+{
+pCurrPart = pCurrPart-GetFollow();
+}
+if( pCurrPart  nSumLength != nOfst - 
aInf.GetIdx()  pCurrPart-GetFont().GetRightBorder() )
+{
+nX -= 
pCurrPart-GetFont().GetRightBorder().get().GetScaledWidth();
+}
+}
+else if(GetInfo().GetFont()-GetRightBorder())
+{
 nX -= 
GetInfo().GetFont()-GetRightBorder().get().GetScaledWidth();
-
+}
+ }
 }
 bWidth = sal_False;
 break;
@@ -1088,7 +1108,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const 
xub_StrLen nOfst,
 if ( pCMS-pSpecialPos )
 {
 // apply attributes to font
-Seek( nOfst );
+SeekAndChgAttrIter( nOfst,