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

2013-04-03 Thread Jan Holesovsky
 sw/source/core/docnode/ndtbl.cxx |   57 +++
 1 file changed, 29 insertions(+), 28 deletions(-)

New commits:
commit f8be3d02573c4d6d753b5e0c1a449e932f94bd81
Author: Jan Holesovsky 
Date:   Wed Apr 3 11:49:38 2013 +0200

fdo#32082: Do not reset number format in table cells on edit.

When we changed the default to _not_ to recognize the number formats in 
table
cells (commit 334c34e4ec803c65e43abf20edbc6faf7fa95e76), it caused that any
edit of a number formatted cell had reset it to text on edit.

This was quite unexpected, because when eg. there was a number that 
contributed
to a sum, and it changed to text, the sum changed as if there was a '0' 
there.

To solve this, try hard to retain the number format regardless of the
'Recognize Number Formats' setting when there was a number formatting 
assigned
to the cell.

Change-Id: Ib43e0877420d90cdac7a0357d1ef3a549c866fb7

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 4fd72a8..398dd6a 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4028,31 +4028,35 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool 
bCallUpdate )
 SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt();
 SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, 
RES_BOXATR_VALUE );
 
-sal_Bool bSetNumFmt = IsInsTblFormatNum();
 sal_Bool bLockModify = sal_True;
+sal_Bool bSetNumFmt = sal_False;
+const bool bForceNumberFormat = IsInsTblFormatNum() && 
IsInsTblChangeNumFormat();
 
-if( bSetNumFmt && !IsInsTblChangeNumFormat() )
+// if the user forced a number format in this cell previously,
+// keep it, unless the user set that she wants the full number
+// format recognition
+if( pNumFmtItem && !bForceNumberFormat )
 {
-if( !pNumFmtItem )
-bSetNumFmt = sal_False;
+sal_uLong nOldNumFmt = 
((SwTblBoxNumFormat*)pNumFmtItem)->GetValue();
+SvNumberFormatter* pNumFmtr = GetNumberFormatter();
+
+short nFmtType = pNumFmtr->GetType( nFmtIdx );
+if( nFmtType == pNumFmtr->GetType( nOldNumFmt ) || 
NUMBERFORMAT_NUMBER == nFmtType )
+{
+// Current and specified NumFormat match
+// -> keep old Format
+nFmtIdx = nOldNumFmt;
+bSetNumFmt = sal_True;
+}
 else
 {
-sal_uLong nOldNumFmt = 
((SwTblBoxNumFormat*)pNumFmtItem)->GetValue();
-SvNumberFormatter* pNumFmtr = GetNumberFormatter();
-
-short nFmtType = pNumFmtr->GetType( nFmtIdx );
-if( nFmtType == pNumFmtr->GetType( nOldNumFmt ) || 
NUMBERFORMAT_NUMBER == nFmtType )
-// Current and specified NumFormat match
-// -> keep old Format
-nFmtIdx = nOldNumFmt;
-else
-// Current and specified NumFormat do not match
-// -> insert as Text
-bLockModify = bSetNumFmt = sal_False;
+// Current and specified NumFormat do not match
+// -> insert as Text
+bLockModify = bSetNumFmt = sal_False;
 }
 }
 
-if( bSetNumFmt )
+if( bSetNumFmt || bForceNumberFormat )
 {
 pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
 
commit c44a06a122d916a18bbede0126bb1e4614f244dc
Author: Jan Holesovsky 
Date:   Wed Apr 3 11:44:28 2013 +0200

Keep semantics, but improve readibility.

Change-Id: I32c18cb7b080f4847118a2d7e8d77dcd2bbce308

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 882ff1b..4fd72a8 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4028,39 +4028,36 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool 
bCallUpdate )
 SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt();
 SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, 
RES_BOXATR_VALUE );
 
-sal_Bool bSetNumFmt = IsInsTblFormatNum(), bLockModify = sal_True;
-if( bSetNumFmt )
+sal_Bool bSetNumFmt = IsInsTblFormatNum();
+sal_Bool bLockModify = sal_True;
+
+if( bSetNumFmt && !IsInsTblChangeNumFormat() )
 {
-if( !IsInsTblChangeNumFormat() )
+if( !pNumFmtItem )
+bSetNumFmt = sal_False;
+else
 {
-if( !pNumFmtItem )
-bSetNumFmt = sal_False;
+sal_uLong nOldNumFmt = 
((SwTbl

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

2013-04-05 Thread Xisco Fauli
 sw/source/filter/ww8/ww8atr.cxx   |7 +++
 sw/source/filter/ww8/ww8graf2.cxx |8 +++-
 2 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 9924d6d61af506a6d9cb1fdbe35af220ad2135fb
Author: Xisco Fauli 
Date:   Fri Apr 5 23:07:14 2013 +0200

Fix issue i120716: The graphic's border size and spacing is not correct

* source/filter/ww8/ww8graf2.cxx
MS Word Binary compatibility

Patch by: Fan Zheng,
Found by: dongjun zong,
Review by: Jian Hong Cheng,(cherry picked from commit 
d91933a4fddd16e2997f7bc945424a97a540a8d3)

Change-Id: I63faa611317b554af3d34372ea0d4c8c2cbc4bfb

diff --git a/sw/source/filter/ww8/ww8graf2.cxx 
b/sw/source/filter/ww8/ww8graf2.cxx
index b9f90a0..d98543b 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -599,11 +599,9 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
 
 aAttrSet.Put(aFlySet);
 }
-
-Rectangle aInnerDist(   pRecord->nDxTextLeft,
-pRecord->nDyTextTop, pRecord->nDxTextRight,
-pRecord->nDyTextBottom  );
-
+//Modified for i120716,for graf importing from MS Word 
2003 binary format,
+//there is no border distance.
+Rectangle aInnerDist(0,0,0,0);
 MatchSdrItemsIntoFlySet( pObject, aAttrSet,
 pRecord->eLineStyle, pRecord->eLineDashing,
 pRecord->eShapeType, aInnerDist );
commit a2951d8cc1518638b357dfb09edafff7194b9eb3
Author: Jian Hong Cheng 
Date:   Wed Aug 22 04:17:49 2012 +

Fix issue #i119649: Hyperlink font size increased if saved to .doc file

* sw/source/filter/ww8/ww8atr.cxx
MS Word Binary compatibility

Patch by: Chen Peng,
Found by: Yan Ji,
Review by: Jian Hong Cheng,

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 3210c5f..0b18e29 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -229,6 +229,13 @@ void MSWordExportBase::ExportPoolItemsToCHP( sw::PoolItems 
&rItems, sal_uInt16 n
 sal_uInt16 nWhich = pItem->Which();
 if ( ( isCHRATR( nWhich ) || isTXTATR( nWhich ) ) && 
CollapseScriptsforWordOk( nScript, nWhich ) )
 {
+ //In the id definition, RES_TXTATR_INETFMT must precede 
RES_TXTATR_CHARFMT, so that link style can overwrite char style.
+ //and in #i24291# it describes "All we want to do is ensure for 
now is that if a charfmt exist in the character
+ //properties that it rises to the top and is exported first."
+ //In bug 119649, it is in such situation, so we need to ignore 
the link style when doing ms word filter exports and
+ //add the second judgement for #i24291# definition.
+ if ( nWhich == RES_TXTATR_INETFMT && ( 
rItems.begin()->second->Which() == RES_TXTATR_CHARFMT ) )
+ continue;
 AttrOutput().OutputItem( *pItem );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-07-23 Thread Zolnai Tamás
 sw/source/core/text/itrcrsr.cxx |   11 ++-
 sw/source/core/text/txtdrop.cxx |3 +++
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 1f47b46959267a25195d4f3f5602ca638bb14c58
Author: Zolnai Tamás 
Date:   Tue Jul 23 13:14:53 2013 +0200

Fix drop caps background

Background were shifted upwards with the descent
of the character and so the default grey background
hanged out under the user added background.
Examples: A (no descent), S (small descent)
Q (big descent)

Change-Id: I044fc63cf9988152e7b6aa4042bcf14651e097c0

diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index d61ca5c..d708cc67 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -281,9 +281,11 @@ void SwDropPortion::PaintTxt( const SwTxtPaintInfo &rInf ) 
const
 
 const SwDropPortionPart* pCurrPart = GetPart();
 const xub_StrLen nOldLen = GetLen();
+const KSHORT nOldAscent = GetAscent();
 
 const SwTwips nBasePosY  = rInf.Y();
 ((SwTxtPaintInfo&)rInf).Y( nBasePosY + nY );
+((SwDropPortion*)this)->SetAscent( nOldAscent + nY );
 SwDropSave aSave( rInf );
 // for text inside drop portions we let vcl handle the text directions
 SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() );
@@ -304,6 +306,7 @@ void SwDropPortion::PaintTxt( const SwTxtPaintInfo &rInf ) 
const
 
 ((SwTxtPaintInfo&)rInf).Y( nBasePosY );
 ((SwDropPortion*)this)->SetLen( nOldLen );
+((SwDropPortion*)this)->SetAscent( nOldAscent );
 }
 
 /*
commit c8b4ffc2adcc744c0d7d5e68944439238828692b
Author: Zolnai Tamás 
Date:   Tue Jul 23 11:18:38 2013 +0200

Check explicitily the space at the end of the line

Can be bugous when the last character not a space.
I don't have any real life examples, just some extreme
-Line break is inside a word without hyphenation
-A tabulator follow the last character of the line and so
this tabulator get to the next line.

Change-Id: I3c5d372295b960a5cc22c19ada382d0a995787cc

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index a162a24..42ab844 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1259,7 +1259,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, 
const Point &rPoint,
 // If necessary, as catch up, do the adjustment
 GetAdjusted();
 
-const XubString &rText = GetInfo().GetTxt();
+const OUString &rText = GetInfo().GetTxt();
 xub_StrLen nOffset = 0;
 
 // x is the horizontal offset within the line.
@@ -1452,7 +1452,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, 
const Point &rPoint,
 ( pPor->IsMarginPortion() && !pPor->GetPortion() &&
   // 46598: Consider the situation: We might end up behind the 
last character,
   // in the last line of a centered paragraph
-  nCurrStart < rText.Len() ) )
+  nCurrStart < rText.getLength() ) )
 --nCurrStart;
 else if( pPor->InFldGrp() && ((SwFldPortion*)pPor)->IsFollow()
  && nWidth > nX )
@@ -1523,7 +1523,9 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, 
const Point &rPoint,
 }
 }
 
-if( bLastPortion && (pCurr->GetNext() || pFrm->GetFollow() ) )
+// Skip space at the end of the line
+if( bLastPortion && (pCurr->GetNext() || pFrm->GetFollow() )
+&& rText[nCurrStart + nLength - 1] == ' ' )
 --nLength;
 
 if( nWidth > nX ||
@@ -1592,8 +1594,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, 
const Point &rPoint,
 else
 nOldProp = 0;
 {
-OUString aText = rText;
-SwTxtSizeInfo aSizeInf( GetInfo(), &aText, nCurrStart );
+SwTxtSizeInfo aSizeInf( GetInfo(), &rText, nCurrStart );
 ((SwTxtCursor*)this)->SeekAndChg( aSizeInf );
 SwTxtSlot aDiffTxt( &aSizeInf, ((SwTxtPortion*)pPor), false, 
false );
 SwFontSave aSave( aSizeInf, pPor->IsDropPortion() ?
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-08-03 Thread Matteo Casalin
 sw/source/core/crsr/callnk.cxx   |2 +-
 sw/source/core/crsr/crossrefbookmark.cxx |   12 
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 2d275be83f905f88c8c4ec982165af9102e3a920
Author: Matteo Casalin 
Date:   Wed Jul 31 08:00:39 2013 +0200

Reduce scope of global constants

Change-Id: I938c56d5d1200ada439df2a25b0d46eddf9c3a7f

diff --git a/sw/source/core/crsr/crossrefbookmark.cxx 
b/sw/source/core/crsr/crossrefbookmark.cxx
index 1cc7aea..32442ff 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -21,6 +21,14 @@
 #include 
 #include 
 
+namespace
+{
+
+const char CrossRefHeadingBookmark_NamePrefix[] = "__RefHeading__";
+const char CrossRefNumItemBookmark_NamePrefix[] = "__RefNumPara__";
+
+}
+
 namespace sw { namespace mark
 {
 CrossRefBookmark::CrossRefBookmark(const SwPaM& rPaM,
@@ -60,8 +68,6 @@ namespace sw { namespace mark
 return *static_cast(NULL);
 }
 
-const char CrossRefHeadingBookmark_NamePrefix[] = "__RefHeading__";
-
 CrossRefHeadingBookmark::CrossRefHeadingBookmark(const SwPaM& rPaM,
 const KeyCode& rCode,
 const OUString& rName,
@@ -74,8 +80,6 @@ namespace sw { namespace mark
 return rName.match(CrossRefHeadingBookmark_NamePrefix);
 }
 
-const char CrossRefNumItemBookmark_NamePrefix[] = "__RefNumPara__";
-
 CrossRefNumItemBookmark::CrossRefNumItemBookmark(const SwPaM& rPaM,
 const KeyCode& rCode,
 const OUString& rName,
commit 0e5634e73036767887fb64bf3de7eb0908e98a09
Author: Matteo Casalin 
Date:   Wed Jul 31 07:59:39 2013 +0200

String to OUString

Change-Id: I3290969a556d5eb824cbe6bd06984e0ac0cdbf35

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index bc18dd1..2ee6108 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -203,7 +203,7 @@ SwCallLink::~SwCallLink()
 
 if( g_pBreakIt->GetBreakIter().is() )
 {
-const String& rTxt = ((SwTxtNode*)pCNd)->GetTxt();
+const OUString rTxt = ((SwTxtNode*)pCNd)->GetTxt();
 if( !nCmp ||
 g_pBreakIt->GetBreakIter()->getScriptType( rTxt, nCmp )
  != g_pBreakIt->GetBreakIter()->getScriptType( rTxt, nCmp 
- 1 ))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-08-06 Thread Luboš Luňák
 sw/source/filter/html/htmlcss1.cxx |   12 ++--
 sw/source/filter/html/htmlgrin.cxx |8 
 sw/source/filter/html/svxcss1.cxx  |2 --
 3 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 89aeec9b1d2f771310eeb0fa4c820c19599df0f7
Author: Luboš Luňák 
Date:   Tue Aug 6 23:30:28 2013 +0200

remove unused variable

Change-Id: Iaf22f259fa396deee3cab84cc9549427b76017c2

diff --git a/sw/source/filter/html/svxcss1.cxx 
b/sw/source/filter/html/svxcss1.cxx
index b16349e..a065c3c 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -888,8 +888,6 @@ sal_Bool SvxCSS1Parser::ParseStyleOption( const OUString& 
rIn,
 sal_Bool SvxCSS1Parser::GetEnum( const CSS1PropertyEnum *pPropTable,
   const OUString &rValue, sal_uInt16& rEnum )
 {
-OUString aValue( rValue.toAsciiLowerCase() );
-
 while( pPropTable->pName )
 {
 if( !rValue.equalsIgnoreAsciiCaseAscii( pPropTable->pName ) )
commit 2349d8073072acbf07c36d9fe0dcb4a812779a97
Author: Luboš Luňák 
Date:   Tue Aug 6 23:25:48 2013 +0200

equalsIgnoreAsciiCaseAscii -> equalsIgnoreAsciiCase

Change-Id: I218389623e8774a7aabbbd0be58d4d17acbef631

diff --git a/sw/source/filter/html/htmlcss1.cxx 
b/sw/source/filter/html/htmlcss1.cxx
index 7086555..77871a1 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -861,9 +861,9 @@ sal_Bool SwCSS1Parser::StyleParsed( const CSS1Selector 
*pSelector,
  ('s' == aClass[0] || 'S' == aClass[0]) )
 {
 sal_uInt16 nPoolFmtId = 0;
-if( 
aClass.equalsIgnoreAsciiCaseAscii(OOO_STRING_SVTOOLS_HTML_sdendnote_sym) )
+if( 
aClass.equalsIgnoreAsciiCase(OOO_STRING_SVTOOLS_HTML_sdendnote_sym) )
 nPoolFmtId = RES_POOLCHR_ENDNOTE;
-else if( 
aClass.equalsIgnoreAsciiCaseAscii(OOO_STRING_SVTOOLS_HTML_sdfootnote_sym) )
+else if( 
aClass.equalsIgnoreAsciiCase(OOO_STRING_SVTOOLS_HTML_sdfootnote_sym) )
 nPoolFmtId = RES_POOLCHR_FOOTNOTE;
 if( nPoolFmtId )
 {
@@ -909,9 +909,9 @@ sal_Bool SwCSS1Parser::StyleParsed( const CSS1Selector 
*pSelector,
 if( aClass.getLength() >= 9 &&
 ('s' == aClass[0] || 'S' == aClass[0]) )
 {
-if( 
aClass.equalsIgnoreAsciiCaseAscii(OOO_STRING_SVTOOLS_HTML_sdendnote) )
+if( 
aClass.equalsIgnoreAsciiCase(OOO_STRING_SVTOOLS_HTML_sdendnote) )
 nPoolCollId = RES_POOLCOLL_ENDNOTE;
-else if( 
aClass.equalsIgnoreAsciiCaseAscii(OOO_STRING_SVTOOLS_HTML_sdfootnote) )
+else if( 
aClass.equalsIgnoreAsciiCase(OOO_STRING_SVTOOLS_HTML_sdfootnote) )
 nPoolCollId = RES_POOLCOLL_FOOTNOTE;
 
 if( nPoolCollId )
@@ -1277,12 +1277,12 @@ SwTxtFmtColl *SwCSS1Parser::GetTxtFmtColl( sal_uInt16 
nTxtColl,
 if( RES_POOLCOLL_TEXT == nTxtColl && aClass.getLength() >= 9 &&
 ('s' == aClass[0] || 'S' == aClass[0] ) )
 {
-if( 
aClass.equalsIgnoreAsciiCaseAscii(OOO_STRING_SVTOOLS_HTML_sdendnote) )
+if( aClass.equalsIgnoreAsciiCase(OOO_STRING_SVTOOLS_HTML_sdendnote) )
 {
 nTxtColl = RES_POOLCOLL_ENDNOTE;
 aClass = aEmptyStr;
 }
-else if( 
aClass.equalsIgnoreAsciiCaseAscii(OOO_STRING_SVTOOLS_HTML_sdfootnote) )
+else if( 
aClass.equalsIgnoreAsciiCase(OOO_STRING_SVTOOLS_HTML_sdfootnote) )
 {
 nTxtColl = RES_POOLCOLL_FOOTNOTE;
 aClass = aEmptyStr;
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index d61ecae..bf5163c 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1150,12 +1150,12 @@ ANCHOR_SETEVENT:
 ('s' == aStrippedClass[0] || 'S' == aStrippedClass[0]) &&
 ('d' == aStrippedClass[1] || 'D' == aStrippedClass[1]) )
 {
-if( aStrippedClass.equalsIgnoreAsciiCaseAscii( 
OOO_STRING_SVTOOLS_HTML_sdendnote_anc ) )
+if( aStrippedClass.equalsIgnoreAsciiCase( 
OOO_STRING_SVTOOLS_HTML_sdendnote_anc ) )
 bEnAnchor = sal_True;
-else if( aStrippedClass.equalsIgnoreAsciiCaseAscii( 
OOO_STRING_SVTOOLS_HTML_sdfootnote_anc ) )
+else if( aStrippedClass.equalsIgnoreAsciiCase( 
OOO_STRING_SVTOOLS_HTML_sdfootnote_anc ) )
 bFtnAnchor = sal_True;
-else if( aStrippedClass.equalsIgnoreAsciiCaseAscii( 
OOO_STRING_SVTOOLS_HTML_sdendnote_sym ) ||
- aStrippedClass.equalsIgnoreAsciiCaseAscii( 
OOO_STRING_SVTOOLS_HTML_sdfootnote_sym ) )
+else if( aStrippedClass.equalsIgnoreAsciiCase( 
OOO_STRING_SVTOOLS_HTML_sdendnote_sym ) ||
+ aStrippedClass.equalsIgnoreAsciiCase( 
OOO_STRING_SVTOOLS_HTML_sdfootnote_sym ) )
 bFtnEnSymbol = sal_True;
 if( bEnAnchor || bFtnAnchor || bFtnEnSymbol )
 {
___
Libreoffice-commits mailing list
libreo

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

2013-12-05 Thread Michael Stahl
 sw/source/core/doc/doctxm.cxx|3 ++-
 sw/source/core/frmedt/fecopy.cxx |   23 ++-
 2 files changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 2e7bb8d12647e1c4adb4fa86961b4839afaca253
Author: Michael Stahl 
Date:   Thu Dec 5 23:16:51 2013 +0100

fdo#71866: sw: un-break index updates

SwTOXBaseSection::GenerateText() wants to operate directly on
SwTxtNode::m_Text and accepts no substitutes such as a temporary string
on the stack; this regression shows that developers often
significantly underestimate the craziness of the existing code.

(regression from d6e321f8264188ce8371c060ebeb75b213f0c90f)

Change-Id: I01b831f35a52bde207a7db8cae9d4aadb826b2d8

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 5ac032a..1fb4254 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1583,7 +1583,8 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
 
 // pTOXNd is only set at the first mark
 SwTxtNode* pTOXNd = (SwTxtNode*)aSortArr[nArrayIdx]->pTOXNd;
-OUString rTxt = pTOXNd->GetTxt();
+// FIXME this operates directly on the node text
+OUString & rTxt = const_cast(pTOXNd->GetTxt());
 rTxt = "";
 for(sal_uInt16 nIndex = nArrayIdx; nIndex < nArrayIdx + nCount; nIndex++)
 {
commit 4580094d2d9d5b952c4526ee23204f75a5bb2f1b
Author: Michael Stahl 
Date:   Thu Dec 5 21:58:11 2013 +0100

fdo#71892: sw: fix crash when pasting table in footnote

The code that updates RSIDs assumes that the number of nodes copied is
the same as the number of nodes inserted, which is not true when pasting
a table into a footnote because Writer can't do that, hence all table
nodes are missing.  Count inserted nodes instead.

(regression from 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c)

Change-Id: I77b5b7751d1036a6401f708532537d874969502e

diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 0b93a96..af1dc82 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1039,25 +1039,22 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool 
bIncludingPageFrames )
 aIndexBefore--;
 
 pClpDoc->CopyRange( aCpyPam, rInsPos, false );
+// Note: aCpyPam is invalid now
 
-{
-++aIndexBefore;
-SwPaM aPaM(SwPosition(aIndexBefore),
-   SwPosition(rInsPos.nNode));
+++aIndexBefore;
+SwPaM aPaM(SwPosition(aIndexBefore),
+   SwPosition(rInsPos.nNode));
 
-aPaM.GetDoc()->MakeUniqueNumRules(aPaM);
-}
-}
+aPaM.GetDoc()->MakeUniqueNumRules(aPaM);
 
-// Update the rsid of each pasted text node.
-{
-sal_Int32 nNodesCnt = aCpyPam.End()->nNode.GetIndex() - 
aCpyPam.Start()->nNode.GetIndex();
+// Update the rsid of each pasted text node.
 SwNodes &rDestNodes = GetDoc()->GetNodes();
-sal_Int32 nDestStart = PCURCRSR->GetPoint()->nNode.GetIndex() 
- nNodesCnt;
+sal_uLong const nEndIdx = aPaM.End()->nNode.GetIndex();
 
-for (sal_Int32 nIdx = 0; nIdx <= nNodesCnt; ++nIdx)
+for (sal_uLong nIdx = aPaM.Start()->nNode.GetIndex();
+nIdx <= nEndIdx; ++nIdx)
 {
-SwTxtNode *pTxtNode = rDestNodes[ nDestStart + nIdx 
]->GetTxtNode();
+SwTxtNode *const pTxtNode = rDestNodes[nIdx]->GetTxtNode();
 if ( pTxtNode )
 {
 GetDoc()->UpdateParRsid( pTxtNode );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-12-06 Thread Michael Stahl
 sw/source/core/txtnode/fntcap.cxx |   29 ++
 sw/source/core/txtnode/swfont.cxx |   42 +++---
 2 files changed, 37 insertions(+), 34 deletions(-)

New commits:
commit cc3341847f857b1d340d0b9dd09c7bccfb146ab6
Author: Michael Stahl 
Date:   Fri Dec 6 21:18:37 2013 +0100

sw: fix more cases of SwDrawTextInfo::GetText()/SetText() not restoring

Change-Id: I9625958e4139dd595f269ebac72b9a037118a9f5

diff --git a/sw/source/core/txtnode/swfont.cxx 
b/sw/source/core/txtnode/swfont.cxx
index d569db9..2269f24 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -1092,15 +1092,15 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf )
 {
 SV_STAT( nGetTextSize );
 long nOldKern = rInf.GetKern();
-const OUString &rOldTxt = rInf.GetText();
+const OUString oldTxt = rInf.GetText();
 rInf.SetKern( CheckKerning() );
 if ( !IsCaseMap() )
 aTxtSize = pLastFont->GetTextSize( rInf );
 else
 {
 OUString aTmp = CalcCaseMap( rInf.GetText() );
-const OUString &rOldStr = rInf.GetText();
-bool bCaseMapLengthDiffers(aTmp.getLength() != 
rOldStr.getLength());
+const OUString oldStr = rInf.GetText();
+bool bCaseMapLengthDiffers(aTmp.getLength() != oldStr.getLength());
 
 if(bCaseMapLengthDiffers && rInf.GetLen())
 {
@@ -1110,7 +1110,7 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf )
 // a single snippet since its size may differ, too.
 xub_StrLen nOldIdx(rInf.GetIdx());
 xub_StrLen nOldLen(rInf.GetLen());
-const OUString aSnippet(rOldStr.copy(nOldIdx, nOldLen));
+const OUString aSnippet(oldStr.copy(nOldIdx, nOldLen));
 OUString aNewText(CalcCaseMap(aSnippet));
 
 rInf.SetText( aNewText );
@@ -1128,10 +1128,10 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf )
 aTxtSize = pLastFont->GetTextSize( rInf );
 }
 
-rInf.SetText( rOldStr );
+rInf.SetText(oldStr);
 }
 rInf.SetKern( nOldKern );
-rInf.SetText( rOldTxt );
+rInf.SetText(oldTxt);
 // 15142: Ein Wort laenger als eine Zeile, beim Zeilenumbruch
 //hochgestellt, muss seine effektive Hoehe melden.
 if( GetEscapement() )
@@ -1213,9 +1213,9 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const 
sal_Bool bGrey )
 pLastFont->DrawText( rInf );
 else
 {
-const OUString &rOldStr = rInf.GetText();
-OUString aString( CalcCaseMap( rOldStr ) );
-bool bCaseMapLengthDiffers(aString.getLength() != 
rOldStr.getLength());
+const OUString oldStr = rInf.GetText();
+OUString aString( CalcCaseMap(oldStr) );
+bool bCaseMapLengthDiffers(aString.getLength() != 
oldStr.getLength());
 
 if(bCaseMapLengthDiffers && rInf.GetLen())
 {
@@ -1225,7 +1225,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const 
sal_Bool bGrey )
 // a single snippet since its size may differ, too.
 xub_StrLen nOldIdx(rInf.GetIdx());
 xub_StrLen nOldLen(rInf.GetLen());
-const OUString aSnippet(rOldStr.copy(nOldIdx, nOldLen));
+const OUString aSnippet(oldStr.copy(nOldIdx, nOldLen));
 OUString aNewText = CalcCaseMap(aSnippet);
 
 rInf.SetText( aNewText );
@@ -1243,14 +1243,14 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const 
sal_Bool bGrey )
 pLastFont->DrawText( rInf );
 }
 
-rInf.SetText( rOldStr );
+rInf.SetText(oldStr);
 }
 }
 
 if( pUnderFnt && nOldUnder != UNDERLINE_NONE )
 {
 Size aFontSize = _GetTxtSize( rInf );
-const OUString &rOldStr = rInf.GetText();
+const OUString oldStr = rInf.GetText();
 OUString aStr("  ");
 
 xub_StrLen nOldIdx = rInf.GetIdx();
@@ -1259,8 +1259,8 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const 
sal_Bool bGrey )
 if( rInf.GetSpace() )
 {
 xub_StrLen nTmpEnd = nOldIdx + nOldLen;
-if( nTmpEnd > rOldStr.getLength() )
-nTmpEnd = rOldStr.getLength();
+if (nTmpEnd > oldStr.getLength())
+nTmpEnd = oldStr.getLength();
 
 const SwScriptInfo* pSI = rInf.GetScriptInfo();
 
@@ -1268,8 +1268,8 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const 
sal_Bool bGrey )
 ( rInf.GetFont() && SW_CJK == rInf.GetFont()->GetActual() );
 for( sal_Int32 nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp )
 {
-if( CH_BLANK == rOldStr[nTmp] || bAsianFont ||
-( nTmp + 1 < rOldStr.getLength() && pSI &&
+

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

2013-12-10 Thread Miklos Vajna
 sw/source/filter/ww8/docxattributeoutput.cxx |  230 +--
 sw/source/filter/ww8/docxattributeoutput.hxx |   10 -
 2 files changed, 160 insertions(+), 80 deletions(-)

New commits:
commit 4614af18d3e033e0eed27db3d4c897afb8c8baa1
Author: Miklos Vajna 
Date:   Tue Dec 10 15:55:13 2013 +0100

DOCX shape export: when in experimental mode, use DML instead of VML

Change-Id: I8a07b74c047dfa2c4b1096e3cd3ace3bd5f93d0a

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8e33651..b546b37 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -110,6 +110,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1058,7 +1059,10 @@ void DocxAttributeOutput::StartRunProperties()
 m_postponedDiagram = new std::list< PostponedDiagram >;
 
 OSL_ASSERT( m_postponedVMLDrawing == NULL );
-m_postponedVMLDrawing = new std::list< PostponedVMLDrawing >;
+m_postponedVMLDrawing = new std::list< PostponedDrawing >;
+
+assert(!m_postponedDMLDrawing);
+m_postponedDMLDrawing = new std::list< PostponedDrawing >;
 }
 
 void DocxAttributeOutput::InitCollectedRunProperties()
@@ -1178,6 +1182,7 @@ void DocxAttributeOutput::EndRunProperties( const 
SwRedlineData* pRedlineData )
 
 //We need to write w:pict tag after the w:rPr.
 WritePostponedVMLDrawing();
+WritePostponedDMLDrawing();
 
 // merge the properties _before_ the run text (strictly speaking, just
 // after the start of the run)
@@ -3316,7 +3321,7 @@ void DocxAttributeOutput::WritePostponedVMLDrawing()
 if(m_postponedVMLDrawing == NULL)
 return;
 
-for( std::list< PostponedVMLDrawing >::iterator it = 
m_postponedVMLDrawing->begin();
+for( std::list< PostponedDrawing >::iterator it = 
m_postponedVMLDrawing->begin();
  it != m_postponedVMLDrawing->end();
  ++it )
 {
@@ -3326,6 +3331,21 @@ void DocxAttributeOutput::WritePostponedVMLDrawing()
 m_postponedVMLDrawing = NULL;
 }
 
+void DocxAttributeOutput::WritePostponedDMLDrawing()
+{
+if(m_postponedDMLDrawing == NULL)
+return;
+
+for( std::list< PostponedDrawing >::iterator it = 
m_postponedDMLDrawing->begin();
+ it != m_postponedDMLDrawing->end();
+ ++it )
+{
+WriteDMLDrawing(it->object, it->frame);
+}
+delete m_postponedDMLDrawing;
+m_postponedDMLDrawing = NULL;
+}
+
 void DocxAttributeOutput::WriteDMLDrawing( const SdrObject* pSdrObject, const 
SwFrmFmt* pFrmFmt )
 {
 Size aSize(pSdrObject->GetSnapRect().GetWidth(), 
pSdrObject->GetSnapRect().GetHeight());
@@ -3422,11 +3442,23 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const 
sw::Frame &rFrame, const Po
 }
 else
 {
-if ( m_postponedVMLDrawing == NULL )
-WriteVMLDrawing( pSdrObj, rFrame.GetFrmFmt(), 
rNdTopLeft);
-else // we are writing out attributes, but w:pict 
should not be inside w:rPr,
-{// so write it out later
- m_postponedVMLDrawing->push_back( 
PostponedVMLDrawing( pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft ) );
+SvtMiscOptions aMiscOptions;
+if (aMiscOptions.IsExperimentalMode())
+{
+if ( m_postponedDMLDrawing == NULL )
+WriteDMLDrawing( pSdrObj, &rFrame.GetFrmFmt());
+else
+// we are writing out attributes, but 
w:drawing should not be inside w:rPr, so write it out later
+
m_postponedDMLDrawing->push_back(PostponedDrawing(pSdrObj, 
&(rFrame.GetFrmFmt()), &rNdTopLeft));
+}
+else
+{
+if ( m_postponedVMLDrawing == NULL )
+WriteVMLDrawing( pSdrObj, rFrame.GetFrmFmt(), 
rNdTopLeft);
+else // we are writing out attributes, but w:pict 
should not be inside w:rPr,
+{// so write it out later
+ m_postponedVMLDrawing->push_back( 
PostponedDrawing( pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft ) );
+}
 }
 }
 }
@@ -6406,6 +6438,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport 
&rExport, FSHelperPtr pSeri
   m_postponedGraphic( NULL ),
   m_postponedDiagram( NULL ),
   m_postponedVMLDrawing(NULL),
+  m_postponedDMLDrawing(NULL),
   m_postponedMath( NULL ),
   m_postponedChart( NULL ),
   pendingPlaceholder( NULL ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hx

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

2013-12-18 Thread Matteo Casalin
 sw/source/core/table/swtable.cxx  |4 ++--
 sw/source/filter/ww1/fltshell.cxx |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 65e6d651ceef55f569521a4f4e609f7e5e88847b
Author: Matteo Casalin 
Date:   Tue Dec 17 00:12:03 2013 +0100

xub_StrLen/sal_uInt16 to sal_Int32

Change-Id: I61b717f080b9c667b75eac8dd3b5bd4cb50e6881

diff --git a/sw/source/filter/ww1/fltshell.cxx 
b/sw/source/filter/ww1/fltshell.cxx
index bc8f395..5342ed1 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -767,9 +767,9 @@ void SwFltControlStack::Delete(const SwPaM &rPam)
 return;
 
 SwNodeIndex aStartNode(pStt->nNode, -1);
-sal_uInt16 nStartIdx = pStt->nContent.GetIndex();
+const sal_Int32 nStartIdx = pStt->nContent.GetIndex();
 SwNodeIndex aEndNode(pEnd->nNode, -1);
-sal_uInt16 nEndIdx = pEnd->nContent.GetIndex();
+const sal_Int32 nEndIdx = pEnd->nContent.GetIndex();
 
 //We don't support deleting content that is over one node, or removing a 
node.
 OSL_ENSURE(aEndNode == aStartNode, "nodes must be the same, or this method 
extended");
@@ -817,7 +817,7 @@ void SwFltControlStack::Delete(const SwPaM &rPam)
 continue;
 }
 
-xub_StrLen nCntntDiff = nEndIdx - nStartIdx;
+const sal_Int32 nCntntDiff = nEndIdx - nStartIdx;
 
 //to be adjusted
 if (bEntryStartAfterSelStart)
commit a85d10e0c1a0f79fc807007dbd49975f35f218fe
Author: Matteo Casalin 
Date:   Mon Dec 16 23:39:58 2013 +0100

xub_StrLen to sal_Int32

Change-Id: I614c8a7e3bf508b2f69ae50b07db33c7df691c2e

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 59e4487..1a7ed99 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -167,7 +167,7 @@ void SwTableBox::setDummyFlag( bool bDummy )
 static OUString& lcl_TabToBlankAtSttEnd( OUString& rTxt )
 {
 sal_Unicode c;
-xub_StrLen n;
+sal_Int32 n;
 
 for( n = 0; n < rTxt.getLength() && ' ' >= ( c = rTxt[n] ); ++n )
 if( '\x9' == c )
@@ -2536,7 +2536,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool 
bCheckAttr ) const
 // Flys/fields/...
 if( pHts )
 {
-xub_StrLen nNextSetField = 0;
+sal_Int32 nNextSetField = 0;
 for( sal_uInt16 n = 0; n < pHts->Count(); ++n )
 {
 const SwTxtAttr* pAttr = (*pHts)[ n ];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-12-19 Thread Miklos Vajna
 sw/source/filter/ww8/docxattributeoutput.cxx |   57 ++-
 sw/source/filter/ww8/docxsdrexport.cxx   |   65 +++
 sw/source/filter/ww8/docxsdrexport.hxx   |2 
 3 files changed, 74 insertions(+), 50 deletions(-)

New commits:
commit 9794a0db73b49f3c8b9e4b8348fe7dc9108d3435
Author: Miklos Vajna 
Date:   Thu Dec 19 11:37:08 2013 +0100

DocxAttributeOutput::WriteDMLTextFrame: write effect list

We already had code for this, but only for pictures, factor out the
relevant code into its own method and call it here as well.

CppunitTest_sw_ooxmlexport's testTextFrameBorders is a reproducer for
this problem.

Change-Id: I3b71e64512a65c42a2f3859b4912a4408944e697

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6bcf8e6..ce985b8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -465,6 +465,7 @@ void DocxAttributeOutput::WriteDMLTextFrame(sw::Frame* 
pParentFrame)
 m_pBodyPrAttrList = m_pSerializer->createAttrList();
 m_rExport.OutputFormat( pParentFrame->GetFrmFmt(), false, false, true );
 m_bDMLTextFrameSyntax = false;
+m_rExport.SdrExporter().writeDMLEffectLst(rFrmFmt);
 m_pSerializer->endElementNS(XML_wps, XML_spPr);
 
 m_rExport.mpParentFrame = NULL;
@@ -2922,18 +2923,6 @@ void DocxAttributeOutput::DefaultStyle( sal_uInt16 
nStyle )
 #endif
 }
 
-// Converts ARGB transparency (0..255) to drawingml alpha (opposite, and 
0..10)
-OString lcl_ConvertTransparency(const Color& rColor)
-{
-if (rColor.GetTransparency() > 0)
-{
-sal_Int32 nTransparencyPercent = 100 - float(rColor.GetTransparency()) 
/ 2.55;
-return OString::number(nTransparencyPercent * 
oox::drawingml::PER_PERCENT);
-}
-else
-return OString("");
-}
-
 /* Writes  tag back to document.xml if a file conatins a cropped 
image.
 *  NOTE : Tested on images of type JPEG,EMF/WMF,BMP, PNG and GIF.
 */
@@ -3132,44 +3121,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const 
SwGrfNode* pGrfNode, const Size
 FSEND );
 m_pSerializer->endElementNS( XML_a, XML_ln );
 
-// Output effects
-SvxShadowItem aShadowItem = pFrmFmt->GetShadow();
-if ( aShadowItem.GetLocation() != SVX_SHADOW_NONE )
-{
-// Distance is measured diagonally from corner
-double nShadowDist = 
sqrt((aShadowItem.GetWidth()*aShadowItem.GetWidth())*2.0);
-OString aShadowDist( OString::number( TwipsToEMU( nShadowDist ) ) );
-OString aShadowColor = msfilter::util::ConvertColor( 
aShadowItem.GetColor() );
-OString aShadowAlpha = lcl_ConvertTransparency(aShadowItem.GetColor());
-sal_uInt32 nShadowDir = 0;
-switch ( aShadowItem.GetLocation() )
-{
-case SVX_SHADOW_TOPLEFT: nShadowDir = 1350; break;
-case SVX_SHADOW_TOPRIGHT: nShadowDir = 1890; break;
-case SVX_SHADOW_BOTTOMLEFT: nShadowDir = 810; break;
-case SVX_SHADOW_BOTTOMRIGHT: nShadowDir = 270; break;
-case SVX_SHADOW_NONE:
-case SVX_SHADOW_END:
-break;
-}
-OString aShadowDir( OString::number( nShadowDir ) );
-
-m_pSerializer->startElementNS( XML_a, XML_effectLst, FSEND );
-m_pSerializer->startElementNS( XML_a, XML_outerShdw,
-   XML_dist, aShadowDist.getStr(),
-   XML_dir, aShadowDir.getStr(), FSEND );
-if (aShadowAlpha.isEmpty())
-m_pSerializer->singleElementNS( XML_a, XML_srgbClr,
-XML_val, aShadowColor.getStr(), 
FSEND );
-else
-{
-m_pSerializer->startElementNS(XML_a, XML_srgbClr, XML_val, 
aShadowColor.getStr(), FSEND);
-m_pSerializer->singleElementNS(XML_a, XML_alpha, XML_val, 
aShadowAlpha.getStr(), FSEND);
-m_pSerializer->endElementNS(XML_a, XML_srgbClr);
-}
-m_pSerializer->endElementNS( XML_a, XML_outerShdw );
-m_pSerializer->endElementNS( XML_a, XML_effectLst );
-}
+m_rExport.SdrExporter().writeDMLEffectLst(*pFrmFmt);
 
 m_pSerializer->endElementNS( XML_pic, XML_spPr );
 
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index f04d653..e030a81 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -383,6 +384,70 @@ void DocxSdrExport::writeDMLAndVMLDrawing(const SdrObject* 
sdrObj, const SwFrmFm
 writeVMLDrawing(sdrObj, rFrmFmt, rNdTopLeft);
 }
 
+// Converts ARGB transparency (0..255) to drawingml alpha (opposite, and 
0..10)
+OString lcl_ConvertTransparency(const Color& rColor)
+{
+if (rColor.GetTransparency() > 0)
+{
+

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

2013-06-20 Thread Tor Lillqvist
 sw/source/core/txtnode/thints.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 5c214a04b3e2404495951c9d9520a03011fb0ed6
Author: Tor Lillqvist 
Date:   Thu Jun 20 10:30:45 2013 +0300

Remove pointless overdose comment

Change-Id: I0e9a490ae4364b9bf14d6ad8766aef279a69db01

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 0893dac..f4f96e0 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -64,7 +64,6 @@
 #include 
 #include 
 #include 
-// OD 26.06.2003 #108784#
 #include 
 #include 
 #include 
commit 1410cac73fc6e4d2c360e33ac5d185ad900cd728
Author: Tor Lillqvist 
Date:   Thu Jun 20 10:29:59 2013 +0300

WaE: macro is not used

Change-Id: I2f55abf4526f4184ba04fc173df8cf5236219cfc

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 9bcfcf4..0893dac 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -75,7 +75,6 @@
 #define CHECK   Check(true);
 #define CHECK_NOTMERGED Check(false);
 #else
-#define CHECK
 #define CHECK_NOTMERGED
 #endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-06-27 Thread Oliver-Rainer Wittmann
 sw/source/core/inc/bodyfrm.hxx|5 ---
 sw/source/core/layout/pagechg.cxx |   16 ---
 sw/source/filter/ww8/ww8atr.cxx   |   55 +++---
 3 files changed, 34 insertions(+), 42 deletions(-)

New commits:
commit 11eb95f74088ff830f6aa994250ef18335ca70c2
Author: Oliver-Rainer Wittmann 
Date:   Thu Nov 22 11:46:44 2012 +

Resolves: #i120938# consider left indentation when converting...

tab stop positions of styles

(cherry picked from commit 7b20978d84db1f7f545ff608bdb09275813e2219)

Change-Id: I068a8dced069c4676623723f16ae4d85997f086d

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d2dae7c..e0d9140 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4853,8 +4853,9 @@ void SwWW8WrTabu::PutAll(WW8Export& rWrt)
 }
 
 
-static void ParaTabStopAdd( WW8Export& rWrt, const SvxTabStopItem& rTStops,
-long nLParaMgn )
+static void ParaTabStopAdd( WW8Export& rWrt,
+const SvxTabStopItem& rTStops,
+const long nLParaMgn )
 {
 SwWW8WrTabu aTab( 0, rTStops.Count());
 
@@ -4879,8 +4880,11 @@ static bool lcl_IsEqual(long nOneLeft, const SvxTabStop 
&rOne,
   );
 }
 
-static void ParaTabStopDelAdd( WW8Export& rWrt, const SvxTabStopItem& rTStyle,
-long nLStypeMgn, const SvxTabStopItem& rTNew, long nLParaMgn )
+static void ParaTabStopDelAdd( WW8Export& rWrt,
+   const SvxTabStopItem& rTStyle,
+   const long nLStypeMgn,
+   const SvxTabStopItem& rTNew,
+   const long nLParaMgn )
 {
 SwWW8WrTabu aTab(rTStyle.Count(), rTNew.Count());
 
@@ -4956,15 +4960,15 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, const 
SvxTabStopItem& rTStyle,
 
 void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
 {
-bool bTabsRelativeToIndex = m_rWW8Export.pCurPam->GetDoc()->get( 
IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT );
-long nCurrentLeft = 0;
+const bool bTabsRelativeToIndex = m_rWW8Export.pCurPam->GetDoc()->get( 
IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT );
 
+long nCurrentLeft = 0;
 if ( bTabsRelativeToIndex )
 {
 const SfxPoolItem* pLR = m_rWW8Export.HasItem( RES_LR_SPACE );
 
 if ( pLR != NULL )
-nCurrentLeft = ((const SvxLRSpaceItem*)pLR)->GetTxtLeft();
+nCurrentLeft = static_cast(pLR)->GetTxtLeft();
 }
 
 // #i100264#
@@ -4972,41 +4976,50 @@ void WW8AttributeOutput::ParaTabStop( const 
SvxTabStopItem& rTabStops )
  m_rWW8Export.pCurrentStyle != NULL &&
  m_rWW8Export.pCurrentStyle->DerivedFrom() != NULL )
 {
-SvxTabStopItem aTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP 
);
+SvxTabStopItem aParentTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, 
RES_PARATR_TABSTOP );
 const SwFmt *pParentStyle = m_rWW8Export.pCurrentStyle->DerivedFrom();
-const SvxTabStopItem* pParentTabs = HasItem( 
pParentStyle->GetAttrSet(), RES_PARATR_TABSTOP );
-if ( pParentTabs )
 {
-aTabs.Insert( pParentTabs );
+const SvxTabStopItem* pParentTabs = HasItem( 
pParentStyle->GetAttrSet(), RES_PARATR_TABSTOP );
+if ( pParentTabs )
+{
+aParentTabs.Insert( pParentTabs );
+}
+}
+
+// #i120938# - consider left indentation of style and its parent style
+long nParentLeft = 0;
+if ( bTabsRelativeToIndex )
+{
+const SvxLRSpaceItem &rStyleLR = ItemGet( 
pParentStyle->GetAttrSet(), RES_LR_SPACE );
+nParentLeft = rStyleLR.GetTxtLeft();
 }
 
-ParaTabStopDelAdd( m_rWW8Export, aTabs, 0, rTabStops, 0 );
+ParaTabStopDelAdd( m_rWW8Export, aParentTabs, nParentLeft, rTabStops, 
nCurrentLeft );
 return;
 }
 
-// StyleDef -> "einfach" eintragen || keine Style-Attrs -> dito
 const SvxTabStopItem* pStyleTabs = 0;
 if ( !m_rWW8Export.bStyDef && m_rWW8Export.pStyAttr )
 {
-pStyleTabs =
-HasItem( *m_rWW8Export.pStyAttr, 
RES_PARATR_TABSTOP );
+pStyleTabs = HasItem( *m_rWW8Export.pStyAttr, 
RES_PARATR_TABSTOP );
 }
 
 if ( !pStyleTabs )
+{
 ParaTabStopAdd(m_rWW8Export, rTabStops, nCurrentLeft);
+}
 else
 {
 long nStyleLeft = 0;
-
-if (bTabsRelativeToIndex)
+if ( bTabsRelativeToIndex )
 {
-const SvxLRSpaceItem &rStyleLR =
-ItemGet(*m_rWW8Export.pStyAttr, RES_LR_SPACE);
+const SvxLRSpaceItem &rStyleLR = 
ItemGet(*m_rWW8Export.pStyAttr, RES_LR_SPACE);
 nStyleLeft = rStyleLR.GetTxtLeft();
 }
 
-ParaTabStopDelAdd(m_rWW8Export, *pStyleTabs, nStyleLeft, rTabStops,
-nCurrentLeft);
+ParaTabStopDelAdd( m_rWW8Export,
+   *pSty

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

2013-06-27 Thread Michael Stahl
 sw/source/core/edit/eddel.cxx |   11 ---
 sw/source/ui/wrtsh/delete.cxx |   12 +---
 sw/source/ui/wrtsh/wrtsh4.cxx |5 ++---
 3 files changed, 7 insertions(+), 21 deletions(-)

New commits:
commit fd2bd50bb4fbe139cd1ed9332c0d2eeaebc7dabe
Author: Michael Stahl 
Date:   Thu Jun 27 15:27:03 2013 +0200

Revert "Related: #i121925# fixed by reverting change for issue #i119652#"

This reverts commit e47b7f967bcdd8b1e830d07b2ad941b1302686f7.

The original commit this reverts was never merged anyway and this adds
some line that were context in the AOO commit.

diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 05ea03a..2d7adb6 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -35,17 +35,17 @@
 
 void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
 {
-// only on a selection
-if ( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark())
+// only for selections
+if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark())
 return;
 
 // Is the selection in a table? Then delete only the content of the 
selected boxes.
 // Here, there are two cases:
 // 1. Point and Mark are in one box, delete selection as usual
 // 2. Point and Mare are in different boxes, search all selected boxes and 
delete content
-
 if( rPam.GetNode()->FindTableNode() &&
-rPam.GetNode()->StartOfSectionNode() != 
rPam.GetNode(sal_False)->StartOfSectionNode() )
+rPam.GetNode()->StartOfSectionNode() !=
+rPam.GetNode(sal_False)->StartOfSectionNode() )
 {
 // group the Undo in the table
 if( pUndo && !*pUndo )
@@ -71,9 +71,6 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
 aDelPam.Move( fnMoveBackward, fnGoCntnt );
 }
 // skip protected boxes
-//For i117395, in some situation, the node would be hidden or 
invisible, which makes the frame of it unavailable
-//So verify it before use it.
-SwCntntFrm* pFrm = NULL;
 if( !pNd->IsCntntNode() ||
 !pNd->IsInProtectSect() )
 {
commit 97e6ff086e2601c066c32fca8412e939843dae3f
Author: Michael Stahl 
Date:   Thu Jun 27 15:19:47 2013 +0200

Revert "Resolves: #119652# avoid invalid selection on..."

This reverts commit e6cd5d0b11e7d8562358b883c08a8dba9fd4f61d.

The problem was already solved with
af4b6c94c68b5f67b931cde8d0acda6ec8b288bb.

Change-Id: I21d7ca9fec601377967297bc42835573422c29a7

diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index 940a411..f19455e 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -446,17 +446,7 @@ long SwWrtShell::DelToStartOfSentence()
 if(IsStartOfDoc())
 return 0;
 OpenMark();
-
-SwCrsrSaveState aSaveState( *(_GetCrsr()) );
-sal_Bool bSuccessfulSelection = _BwdSentence();
-if ( _GetCrsr()->IsInProtectTable( sal_True )
- || _GetCrsr()->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-  nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
-{
-bSuccessfulSelection = sal_False;
-}
-long nRet = bSuccessfulSelection ? Delete() : 0;
-
+long nRet = _BwdSentence() ? Delete() : 0;
 CloseMark( 0 != nRet );
 return nRet;
 }
diff --git a/sw/source/ui/wrtsh/wrtsh4.cxx b/sw/source/ui/wrtsh/wrtsh4.cxx
index 6277276..6966e45 100644
--- a/sw/source/ui/wrtsh/wrtsh4.cxx
+++ b/sw/source/ui/wrtsh/wrtsh4.cxx
@@ -198,15 +198,14 @@ sal_Bool SwWrtShell::_BwdSentence()
 if(!SwCrsrShell::Left(1,CRSR_SKIP_CHARS))
 {
 Pop(sal_False);
-return sal_False;
+return 0;
 }
 if( !GoStartSentence()  && !IsSttPara() )
 // not found --> go to the beginning of the paragraph
 SwCrsrShell::MovePara( fnParaCurr, fnParaStart );
 ClearMark();
 Combine();
-
-return sal_True;
+return 1;
 }
 
 sal_Bool SwWrtShell::_FwdPara()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-07-01 Thread Luboš Luňák
 sw/source/core/crsr/swcrsr.cxx  |   65 +---
 sw/source/core/docnode/nodedump.cxx |   43 ++-
 2 files changed, 45 insertions(+), 63 deletions(-)

New commits:
commit dc7498e4f0632c10a0019564d2e71b5403e40812
Author: Luboš Luňák 
Date:   Fri Jun 28 17:04:49 2013 +0200

don't show section/table nodes as plain start nodes in debug dump

Change-Id: I8b4901d98c210f5a3228981a2b180f2fcc06c768

diff --git a/sw/source/core/docnode/nodedump.cxx 
b/sw/source/core/docnode/nodedump.cxx
index 96e787a..01ba1d2 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -220,25 +220,36 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
 {
 WriterHelper writer( w );
 const char* name = "???";
-switch( GetStartNodeType())
+switch( GetNodeType() )
 {
-case SwNormalStartNode:
-name = "start";
-break;
-case SwTableBoxStartNode:
-name = "tablebox";
-break;
-case SwFlyStartNode:
-name = "fly";
-break;
-case SwFootnoteStartNode:
-name = "footnote";
+case ND_TABLENODE:
+name = "table";
 break;
-case SwHeaderStartNode:
-name = "header";
+case ND_SECTIONNODE:
+name = "section";
 break;
-case SwFooterStartNode:
-name = "footer";
+default:
+switch( GetStartNodeType())
+{
+case SwNormalStartNode:
+name = "start";
+break;
+case SwTableBoxStartNode:
+name = "tablebox";
+break;
+case SwFlyStartNode:
+name = "fly";
+break;
+case SwFootnoteStartNode:
+name = "footnote";
+break;
+case SwHeaderStartNode:
+name = "header";
+break;
+case SwFooterStartNode:
+name = "footer";
+break;
+}
 break;
 }
 writer.startElement( name );
commit ed1d006e1ab594ff0b64a41eadd1b8fe48ab0414
Author: Luboš Luňák 
Date:   Mon Jun 24 20:15:06 2013 +0200

remove strange #ifdefs, presumably a workaround for ancient compiler bug

Change-Id: I77287909b88be01615e2aae302c48904c1adf933

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 6b4a772..9dadc67 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -482,13 +482,6 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
 return sal_False;
 }
 
-#if defined( UNX )
-#define IDX (*pCellStt)
-#else
-#define IDX aCellStt
-#endif
-
-
 sal_Bool SwCursor::IsInProtectTable( sal_Bool bMove, sal_Bool bChgCrsr )
 {
 SwCntntNode* pCNd = GetCntntNode();
@@ -540,32 +533,24 @@ sal_Bool SwCursor::IsInProtectTable( sal_Bool bMove, 
sal_Bool bChgCrsr )
 // search next valid box
 // if there is another StartNode after the EndNode of a cell then
 // there is another cell
-#if defined( UNX )
-SwNodeIndex* pCellStt = new SwNodeIndex( *GetNode()->
-FindTableBoxStartNode()->EndOfSectionNode(), 1 );
-#else
 SwNodeIndex aCellStt( 
*GetNode()->FindTableBoxStartNode()->EndOfSectionNode(), 1 );
-#endif
 sal_Bool bProt = sal_True;
 GoNextCell:
 do {
-if( !IDX.GetNode().IsStartNode() )
+if( !aCellStt.GetNode().IsStartNode() )
 break;
-++IDX;
-if( 0 == ( pCNd = IDX.GetNode().GetCntntNode() ))
-pCNd = IDX.GetNodes().GoNext( &IDX );
+++aCellStt;
+if( 0 == ( pCNd = aCellStt.GetNode().GetCntntNode() ))
+pCNd = aCellStt.GetNodes().GoNext( &aCellStt );
 if( 0 == ( bProt = pCNd->IsProtect() ))
 break;
-IDX.Assign( *pCNd->FindTableBoxStartNode()->EndOfSectionNode(), 1 
);
+aCellStt.Assign( 
*pCNd->FindTableBoxStartNode()->EndOfSectionNode(), 1 );
 } while( bProt );
 
 SetNextCrsr:
 if( !bProt ) // found free cell
 {
-GetPoint()->nNode = IDX;
-#if defined( UNX )
-delete pCellStt;
-#endif
+GetPoint()->nNode = aCellStt;
 SwCntntNode* pTmpCNd = GetCntntNode();
 if( pTmpCNd )
 {
@@ -576,19 +561,16 @@ SetNextCrsr:
  nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
 }
 // end of table, so go to next node
-++IDX;
+++aCellStt;
 SwNode* pNd;
-if( ( pNd = &IDX.GetNode())->IsEndNode() || HasMark())
+if( ( pNd = &aCellStt.GetNode())->IsEndNode() || HasMark())
 {
 // if only table in FlyFrame or SSelection then stay on o

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

2013-07-11 Thread Miklos Vajna
 sw/source/filter/ww8/attributeoutputbase.hxx |2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx |7 +++
 sw/source/filter/ww8/docxattributeoutput.hxx |2 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx  |2 +-
 sw/source/filter/ww8/rtfattributeoutput.hxx  |2 +-
 sw/source/filter/ww8/wrtw8nds.cxx|   12 ++--
 sw/source/filter/ww8/ww8atr.cxx  |2 +-
 sw/source/filter/ww8/ww8attributeoutput.hxx  |2 +-
 8 files changed, 15 insertions(+), 16 deletions(-)

New commits:
commit 3a58a0f9d3600d0475e1a2c6595785cfcf5f362e
Author: Miklos Vajna 
Date:   Thu Jul 11 13:02:43 2013 +0200

AttributeOutputBase::RunText: String -> OUString

Change-Id: I413f0c4a270c5246dc87c5ff4f7042bc16330ed7

diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx 
b/sw/source/filter/ww8/attributeoutputbase.hxx
index baad6ac..25ee2a0 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -176,7 +176,7 @@ public:
 virtual void WritePostitFieldEnd() {};
 
 /// Output text (inside a run).
-virtual void RunText( const String& rText, rtl_TextEncoding eCharSet ) = 0;
+virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet ) = 
0;
 
 /// Output text (without markup).
 virtual void RawText( const String& rText, bool bForceUnicode, 
rtl_TextEncoding eCharSet ) = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9957ff4..d7697ca 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1133,18 +1133,17 @@ static void impl_WriteRunText( FSHelperPtr pSerializer, 
sal_Int32 nTextToken,
 pSerializer->endElementNS( XML_w, nTextToken );
 }
 
-void DocxAttributeOutput::RunText( const String& rText, rtl_TextEncoding 
/*eCharSet*/ )
+void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding 
/*eCharSet*/ )
 {
 if( m_closeHyperlinkInThisRun )
 {
 m_closeHyperlinkInPreviousRun = true;
 m_closeHyperlinkInThisRun = false;
 }
-OUString aText( rText );
 
 // one text can be split into more blah's by line breaks etc.
-const sal_Unicode *pBegin = aText.getStr();
-const sal_Unicode *pEnd = pBegin + aText.getLength();
+const sal_Unicode *pBegin = rText.getStr();
+const sal_Unicode *pEnd = pBegin + rText.getLength();
 
 // the text run is usually XML_t, with the exception of the deleted text
 sal_Int32 nTextToken = XML_t;
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index 06f12fa..83913a6 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -127,7 +127,7 @@ public:
 virtual void WritePostitFieldEnd();
 
 /// Output text (inside a run).
-virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = 
RTL_TEXTENCODING_UTF8 );
+virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = 
RTL_TEXTENCODING_UTF8 );
 
 /// Output text (without markup).
 virtual void RawText( const String& rText, bool bForceUnicode, 
rtl_TextEncoding eCharSet );
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 9890f0b..bb88c28 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -415,7 +415,7 @@ void RtfAttributeOutput::EndRunProperties( const 
SwRedlineData* /*pRedlineData*/
 m_aRun->append(m_aStyles.makeStringAndClear());
 }
 
-void RtfAttributeOutput::RunText( const String& rText, rtl_TextEncoding 
/*eCharSet*/ )
+void RtfAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding 
/*eCharSet*/ )
 {
 SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rText: " << rText);
 RawText( rText, 0, m_rExport.eCurrentEncoding );
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx 
b/sw/source/filter/ww8/rtfattributeoutput.hxx
index b13be12..ec5002f 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -73,7 +73,7 @@ public:
 virtual void WritePostitFieldEnd() SAL_OVERRIDE;
 
 /// Output text (inside a run).
-virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = 
RTL_TEXTENCODING_UTF8 );
+virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = 
RTL_TEXTENCODING_UTF8 );
 
 // Access to (anyway) private buffers, used by the sdr exporter
 OStringBuffer& RunText();
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index e0d9140..fb0f24d 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -988,7 +988,7 @@ void WW8AttributeOutput::EndRunProperties( const 
SwRedlineData* pRedlineData )
 m_rWW8Export.pO->clear();
 }
 
-void WW8AttributeOutput::RunText( const String& rText, rtl_Tex

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

2013-11-13 Thread Caolán McNamara
 sw/source/core/edit/edattr.cxx   |2 +-
 sw/source/core/fields/expfld.cxx |2 +-
 sw/source/core/inc/txmsrt.hxx|8 
 sw/source/core/tox/txmsrt.cxx|6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit b17601a4cbedb5e05e22443459366e604194bb77
Author: Caolán McNamara 
Date:   Wed Nov 13 15:20:38 2013 +

longparas: these USHRT_MAX are really STRING_LEN

Change-Id: I5b55204c262e9fd0c14a9562351a9a1f8b080cec

diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 50b6364..2920919 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -357,7 +357,7 @@ sal_uInt16 SwEditShell::GetSeqFtnList( SwSeqFldList& rList, 
bool bEndNotes )
 OUString sTxt( rFtn.GetViewNumStr( *mpDoc ));
 if( !sTxt.isEmpty() )
 sTxt += " ";
-sTxt += pTxtNd->GetExpandTxt( 0, USHRT_MAX );
+sTxt += pTxtNd->GetExpandTxt( 0, STRING_LEN );
 
 _SeqFldLstElem* pNew = new _SeqFldLstElem( sTxt,
 pTxtFtn->GetSeqRefNo() );
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 21dc62a..a35d96b 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -586,7 +586,7 @@ sal_uInt16 SwSetExpFieldType::GetSeqFldList( SwSeqFldList& 
rList )
 pNd->GetNodes().IsDocNodes() )
 {
 _SeqFldLstElem* pNew = new _SeqFldLstElem(
-pNd->GetExpandTxt( 0, USHRT_MAX ),
+pNd->GetExpandTxt( 0, STRING_LEN ),
 ((SwSetExpField*)pF->GetField())->GetSeqNumber() );
 rList.InsertSort( pNew );
 }
commit fbe0a4a12c44901a203a011c9498a67ee6eda411
Author: Caolán McNamara 
Date:   Wed Nov 13 15:17:43 2013 +

longparas: safe STRING_NOTFOUND -> -1

Change-Id: Ib8e2dea41293822cb49ebfc7b398acc20b6c37be

diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index 5d0b3d9..53d90bd 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -240,8 +240,8 @@ struct SwTOXPara : public SwTOXSortTabBase
 SwTOXPara( const SwCntntNode&, SwTOXElement, sal_uInt16 nLevel = 
FORM_ALPHA_DELIMITTER, OUString sSeqName = OUString() );
 virtual ~SwTOXPara() {}
 
-voidSetStartIndex( xub_StrLen nSet) { nStartIndex = nSet;}
-voidSetEndIndex( xub_StrLen nSet )  { nEndIndex = nSet;}
+voidSetStartIndex(sal_Int32 nSet){ nStartIndex = nSet; }
+voidSetEndIndex(sal_Int32 nSet)  { nEndIndex = nSet; }
 
 virtual voidFillText( SwTxtNode& rNd, const SwIndex& rInsPos, 
sal_uInt16 nAuthField = 0 ) const;
 virtual sal_uInt16  GetLevel() const;
@@ -252,8 +252,8 @@ private:
 
 SwTOXElement eType;
 sal_uInt16 m_nLevel;
-xub_StrLen nStartIndex;
-xub_StrLen nEndIndex;
+sal_Int32 nStartIndex;
+sal_Int32 nEndIndex;
 OUString m_sSequenceName;
 };
 
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 37d239f..7e08f1d 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -525,7 +525,7 @@ SwTOXPara::SwTOXPara( const SwCntntNode& rNd, SwTOXElement 
eT, sal_uInt16 nLevel
 eType( eT ),
 m_nLevel(nLevel),
 nStartIndex(0),
-nEndIndex(STRING_LEN),
+nEndIndex(-1),
 m_sSequenceName( sSeqName )
 {
 }
@@ -543,7 +543,7 @@ TextAndReading SwTOXPara::GetText_Impl() const
 xub_StrLen nStt = nStartIndex;
 return TextAndReading(((SwTxtNode*)pNd)->GetExpandTxt(
 nStt,
-STRING_NOTFOUND == nEndIndex ? STRING_LEN : nEndIndex - 
nStt),
+nEndIndex == -1 ? STRING_LEN : nEndIndex - nStt),
 OUString());
 }
 break;
@@ -578,7 +578,7 @@ void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& 
rInsPos, sal_uInt16 ) c
 SwTxtNode* pSrc = (SwTxtNode*)aTOXSources[0].pNd;
 xub_StrLen nStt = nStartIndex;
 pSrc->GetExpandTxt( rNd, &rInsPos, nStt,
-nEndIndex == STRING_LEN ? STRING_LEN : nEndIndex - nStt,
+nEndIndex == -1 ? STRING_LEN : nEndIndex - nStt,
 sal_False, sal_False, sal_True );
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-11-28 Thread Miklos Vajna
 sw/source/core/docnode/nodedump.cxx  |2 +
 sw/source/filter/ww8/docxattributeoutput.cxx |   29 +++
 2 files changed, 23 insertions(+), 8 deletions(-)

New commits:
commit 6c992a54b662d39c860784aff7357b163db63dfb
Author: Miklos Vajna 
Date:   Thu Nov 28 16:16:22 2013 +0100

fdo#69636 DOCX export: fix VML export of vert=vert270 drawingML textframes

Change-Id: I2fc01c1f22dcd55c2fc4d4791c5571ff2861d0cc

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2a8205c..419d745 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -330,17 +330,30 @@ bool lcl_checkFrameBtlr(SwNode* pStartNode, 
sax_fastparser::FastAttributeList* p
 return false;
 
 SwTxtNode* pTxtNode = static_cast(pStartNode);
-if (!pTxtNode->HasHints())
-return false;
 
-SwTxtAttr* pTxtAttr = pTxtNode->GetTxtAttrAt(0, RES_TXTATR_AUTOFMT);
+const SfxPoolItem* pItem;
+bool bItemSet = false;
+if (pTxtNode->HasSwAttrSet())
+{
+const SwAttrSet& rAttrSet = pTxtNode->GetSwAttrSet();
+bItemSet = rAttrSet.GetItemState(RES_CHRATR_ROTATE, true, &pItem) == 
SFX_ITEM_SET;
+}
 
-if (!pTxtAttr || pTxtAttr->Which() != RES_TXTATR_AUTOFMT)
-return false;
+if (!bItemSet)
+{
+if (!pTxtNode->HasHints())
+return false;
 
-boost::shared_ptr pItemSet = 
pTxtAttr->GetAutoFmt().GetStyleHandle();
-const SfxPoolItem* pItem;
-if (pItemSet->GetItemState(RES_CHRATR_ROTATE, true, &pItem) == 
SFX_ITEM_SET)
+SwTxtAttr* pTxtAttr = pTxtNode->GetTxtAttrAt(0, RES_TXTATR_AUTOFMT);
+
+if (!pTxtAttr || pTxtAttr->Which() != RES_TXTATR_AUTOFMT)
+return false;
+
+boost::shared_ptr pItemSet = 
pTxtAttr->GetAutoFmt().GetStyleHandle();
+bItemSet = pItemSet->GetItemState(RES_CHRATR_ROTATE, true, &pItem) == 
SFX_ITEM_SET;
+}
+
+if (bItemSet)
 {
 const SvxCharRotateItem& rCharRotate = static_cast(*pItem);
 if (rCharRotate.GetValue() == 900)
commit 95034bafdaecc9aaad556e6c3e47e74b9b2add5f
Author: Miklos Vajna 
Date:   Thu Nov 28 15:51:19 2013 +0100

sw doc model dump: handle SvxCharRotateItem

Change-Id: I981867bcf4ec5fa6be866b19f82805ab4ff9623f

diff --git a/sw/source/core/docnode/nodedump.cxx 
b/sw/source/core/docnode/nodedump.cxx
index cd0bb5e2..a57e885 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -305,6 +306,7 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const 
SfxItemSet* pSet)
 case RES_CHRATR_CTL_POSTURE: pWhich = "character ctl posture"; 
break;
 case RES_CHRATR_CTL_WEIGHT: pWhich = "character ctl weight"; break;
 case RES_CHRATR_RSID: pWhich = "character rsid"; break;
+case RES_CHRATR_ROTATE: pWhich = "character rotation"; oValue = 
OString::number(static_cast(pItem)->GetValue()); 
break;
 case RES_PARATR_OUTLINELEVEL: pWhich = "paragraph outline level"; 
oValue = OString::number(static_cast(pItem)->GetValue()); 
break;
 case RES_PARATR_NUMRULE: pWhich = "paragraph numbering rule"; 
oValue = OUStringToOString(static_cast(pItem)->GetValue(), RTL_TEXTENCODING_UTF8); break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-06-03 Thread Michael Stahl
 sw/source/core/doc/docredln.cxx   |2 +-
 sw/source/filter/ww8/writerhelper.cxx |7 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 460507f07177587a9bb6438a438de95c47abb3f0
Author: Michael Stahl 
Date:   Mon Jun 3 16:13:52 2013 +0200

SwDoc::AppendRedline: fix an obscure memory leak

... that also causes ~SwIndexReg assertion on closing the document.

Change-Id: Icea617c893ddc08b817a5b16f68fa128a41531d4

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 6f3e18b..a6a92a1 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -430,7 +430,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool 
bCallDelete )
 {
 // own insert-over-insert redlines:
 // just scrap the inside ones
-mpRedlineTbl->Remove( n );
+mpRedlineTbl->DeleteAndDestroy( n );
 bDec = true;
 }
 else if( POS_OVERLAP_BEHIND == eCmpPos )
commit bb6ecd8b40313b7cc83d4e619029f4e001334a52
Author: Michael Stahl 
Date:   Mon Jun 3 12:24:18 2013 +0200

sw: fix ~SwIndexReg assert

Not really a problem, since local aRegion's point is not used after its
node is deleted.

Change-Id: Ibeb885fb31f19b02e4c3c63e3b99d00ced756810

diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index 664d5aa..08c68a0 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -751,7 +751,12 @@ namespace sw
 SwRedlineData aData(pFltRedline->eType, pFltRedline->nAutorNo,
 pFltRedline->aStamp, aEmptyStr, 0);
 
-mrDoc.AppendRedline(new SwRedline(aData, aRegion), true);
+SwRedline *const pNewRedline(new SwRedline(aData, aRegion));
+// the point node may be deleted in AppendRedline, so park
+// the PaM somewhere safe
+aRegion.DeleteMark();
+*aRegion.GetPoint() = 
SwPosition(SwNodeIndex(mrDoc.GetNodes()));
+mrDoc.AppendRedline(pNewRedline, true);
 
mrDoc.SetRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_NONE | 
nsRedlineMode_t::REDLINE_SHOW_INSERT |
  nsRedlineMode_t::REDLINE_SHOW_DELETE ));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-06-14 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par2.cxx |2 +-
 sw/source/filter/ww8/ww8scan.hxx |7 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 43de0b244329378adc8406e97df882c527faf9a5
Author: Caolán McNamara 
Date:   Fri Jun 14 09:56:49 2013 +0100

Related: #i119548# document that ms changed the meaning of fWidowControl

Change-Id: I884c3c57dfd1d2e7bfa0675fd0c0184113cdda9c

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 4b9449b..3ff4585 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3727,7 +3727,7 @@ void WW8RStyle::Set1StyleDefaults()
 pIo->pAktColl->SetFmtAttr(aAttr);
 }
 
-if( /*pIo->pWDop->fWidowControl &&*/ !bWidowsChanged )  // Widows ?
+if( !bWidowsChanged )  // Widows ?
 {
 pIo->pAktColl->SetFmtAttr( SvxWidowsItem( 2, RES_PARATR_WIDOWS ) );
 pIo->pAktColl->SetFmtAttr( SvxOrphansItem( 2, RES_PARATR_ORPHANS ) 
);
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index e52cbc5..5e381e6 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -1496,7 +1496,12 @@ public:
 sal_uInt8nDataStart;
 //-
 sal_uInt16  fFacingPages : 1;   // 1 when facing pages should be printed
-sal_uInt16  fWidowControl : 1;  // 1 when widow control is in effect. 0 
when widow control disabled.
+
+sal_uInt16  fWidowControl : 1;  //a: orig 97 docs say
+//1 when widow control is in effect. 0 
when widow control disabled.
+//b: MS-DOC: Word Binary File Format 
(.doc) Structure Specification 2008 says
+//B - unused1 (1 bit): Undefined and 
MUST be ignored.
+
 sal_uInt16  fPMHMainDoc : 1;// 1 when doc is a main doc for Print 
Merge Helper, 0 when not; default=0
 sal_uInt16  grfSuppression : 2; // 0 Default line suppression storage; 0= 
form letter line suppression; 1= no line suppression; default=0
 sal_uInt16  fpc : 2;// 1 footnote position code: 0 as 
endnotes, 1 at bottom of page, 2 immediately beneath text
commit 0e619cb550390e08930ec2ad58bc5419b1965b0b
Author: Lei De Bin 
Date:   Fri Aug 10 04:12:08 2012 +

Resolves: #i119548# Window/Orphan control setting lost when save .doc file

Reported by: luo qing le
Patch by: Lei De Bin
Review by: Chen Zuo Jun

(cherry picked from commit 9b161d18404d8fac5663bc3b3a854bdd4fad3bf0)

Change-Id: I7e51d2fd6b72d08b793b857cf2a3de5989145695

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 96f1622..4b9449b 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3727,7 +3727,7 @@ void WW8RStyle::Set1StyleDefaults()
 pIo->pAktColl->SetFmtAttr(aAttr);
 }
 
-if( pIo->pWDop->fWidowControl && !bWidowsChanged )  // Widows ?
+if( /*pIo->pWDop->fWidowControl &&*/ !bWidowsChanged )  // Widows ?
 {
 pIo->pAktColl->SetFmtAttr( SvxWidowsItem( 2, RES_PARATR_WIDOWS ) );
 pIo->pAktColl->SetFmtAttr( SvxOrphansItem( 2, RES_PARATR_ORPHANS ) 
);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-04 Thread Bjoern Michaelsen
 sw/source/core/doc/docxforms.cxx|1 
 sw/source/core/doc/poolfmt.cxx  |   94 
 sw/source/core/inc/GetMetricVal.hxx |6 --
 sw/source/filter/xml/xmlimp.cxx |2 
 sw/source/ui/shells/annotsh.cxx |1 
 sw/source/ui/shells/drawsh.cxx  |1 
 sw/source/ui/shells/drwtxtex.cxx|1 
 sw/source/ui/shells/frmsh.cxx   |1 
 sw/source/ui/shells/textsh1.cxx |1 
 sw/source/ui/vba/vbasystem.cxx  |1 
 10 files changed, 1 insertion(+), 108 deletions(-)

New commits:
commit 3df9adb1b0031e77977431c90edee651b2aaa195
Author: Bjoern Michaelsen 
Date:   Sun Jan 5 04:21:57 2014 +0100

remove broken DBG_UNHANDLED_EXCEPTION macro crap

this breaks quickly doing a `make sw debug=T` hard, with e.g.

 sw/source/ui/vba/vbasystem.cxx:239: undefined reference to 
`DbgUnhandledException(com::sun::star::uno::Any const&, char const*, char 
const*)'

fix this for --disable-dbgutl builds too before reverting this commit.

Change-Id: Ie54d63ea11b4e36c737b22099027711ad0435acc

diff --git a/sw/source/core/doc/docxforms.cxx b/sw/source/core/doc/docxforms.cxx
index 793d721..82a6946 100644
--- a/sw/source/core/doc/docxforms.cxx
+++ b/sw/source/core/doc/docxforms.cxx
@@ -90,7 +90,6 @@ void SwDoc::initXForms( bool bCreateDefaultModel )
 }
 catch( const Exception& )
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 }
 
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 96b0722..23eb813 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -915,7 +915,6 @@ void SwXMLImport::endDocument( void )
 }
 catch( const Exception& )
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 }
 }
@@ -1484,7 +1483,6 @@ void SwXMLImport::SetDocumentSpecificSettings(
 }
 catch( const Exception& )
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 }
 
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 6f1b45d..60c8c5c 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -438,7 +438,6 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
 }
 catch (const uno::Exception&)
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 rReq.Ignore ();
 }
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index 9ee7a70..c3d3120 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -213,7 +213,6 @@ void SwDrawShell::Execute(SfxRequest &rReq)
 }
 catch (const uno::Exception&)
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 rReq.Ignore ();
 }
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index 56f4184..761e507 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -375,7 +375,6 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
 }
 catch (const uno::Exception&)
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 rReq.Ignore ();
 }
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 8ffa207..dedc996 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -262,7 +262,6 @@ void SwFrameShell::Execute(SfxRequest &rReq)
 }
 catch (const uno::Exception&)
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 rReq.Ignore ();
 }
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 9868653..2a97cdb 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1303,7 +1303,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
 }
 catch (const uno::Exception&)
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 rReq.Ignore ();
 }
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index 9af1dbb..94757da 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -236,7 +236,6 @@ SwVbaSystem::setCursor( sal_Int32 _cursor ) throw 
(uno::RuntimeException)
 }
 catch( const uno::Exception& )
 {
-DBG_UNHANDLED_EXCEPTION();
 }
 }
 
commit d6bc2204e81fecccfb56517b34d67a0522eeae0d
Author: Bjoern Michaelsen 
Date:   Sun Jan 5 03:47:36 2014 +0100

ancient USE_MEASUREMENT define is never set

Change-Id: Ib5c1001c08ac194367c211506416abaee1f156c8

diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 55f5012..72a94ec 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -1707,18 +1707,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
 //  cm: 0,5  1,0  1,5  2,0   2,5   3,0   3,5   4,0   4

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

2014-01-15 Thread Stephan Bergmann
 sw/source/ui/dochdl/swdtflvr.cxx |  144 ---
 sw/source/ui/docvw/edtwin.cxx|2 
 sw/source/ui/inc/swdtflvr.hxx|   32 
 3 files changed, 91 insertions(+), 87 deletions(-)

New commits:
commit ac3221855ec080ddc028119b646b38d1fe62e417
Author: Stephan Bergmann 
Date:   Wed Jan 15 17:21:16 2014 +0100

Change various SwTransferable functions to return bool

...which required to add an explicit channel to return
SWTRANSFER_GRAPHIC_INSERTED from SwTransferable::_PasteFileName.

Change-Id: I6d1401830f82dc44b37879ebdd0345cff14eecfa

diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 8928fbf..64aeb9f 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -133,8 +133,6 @@ extern bool bExecuteDrag;
 #define SWTRANSFER_OBJECTTYPE_SWOLE 0x0010
 #define SWTRANSFER_OBJECTTYPE_DDE   0x0020
 
-#define SWTRANSFER_GRAPHIC_INSERTED 0x0040
-
 using namespace ::svx;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -1109,7 +1107,7 @@ sal_Bool SwTransferable::IsPaste( const SwWrtShell& rSh,
 return bIsPaste;
 }
 
-int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData )
+bool SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData )
 {
 sal_uInt16 nEventAction, nAction=0,
nDestination = SwTransferable::GetSotDestination( rSh );
@@ -1153,7 +1151,7 @@ int SwTransferable::Paste( SwWrtShell& rSh, 
TransferableDataHelper& rData )
 nDestination, sal_False, sal_False );
 }
 
-int SwTransferable::PasteData( TransferableDataHelper& rData,
+bool SwTransferable::PasteData( TransferableDataHelper& rData,
 SwWrtShell& rSh, sal_uInt16 nAction, sal_uLong 
nFormat,
 sal_uInt16 nDestination, sal_Bool bIsPasteFmt,
 sal_Bool bIsDefault,
@@ -1165,7 +1163,7 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
 SwTrnsfrActionAndUndo* pAction = 0;
 SwModule* pMod = SW_MOD();
 
-int nRet = 0;
+bool nRet = false;
 bool bCallAutoCaption = false;
 
 if( pPt )
@@ -1316,7 +1314,7 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
 {
 SwFmtINetFmt aFmt( aBkmk.GetURL(), OUString() );
 rSh.InsertURL( aFmt, aBkmk.GetDescription() );
-nRet = 1;
+nRet = true;
 }
 }
 break;
@@ -1354,7 +1352,7 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
 : EXCHG_IN_ACTION_LINK == nClearedAction
 ? SW_PASTESDR_SETATTR
 : SW_PASTESDR_INSERT),
-pPt, nActionFlags, bMsg );
+pPt, nActionFlags, bMsg, 0 );
 break;
 
 case SOT_FORMAT_FILE_LIST:
@@ -1380,7 +1378,7 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
 }
 }
 rSh.NavigatorPaste( aBkmk, nClearedAction );
-nRet = 1;
+nRet = true;
 }
 }
 break;
@@ -1398,11 +1396,15 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
 break;
 
 case EXCHG_OUT_ACTION_INSERT_FILE:
-nRet = SwTransferable::_PasteFileName( rData, rSh, nFormat,
-SW_PASTESDR_INSERT, pPt,
-nActionFlags, bMsg );
-if( nRet & SWTRANSFER_GRAPHIC_INSERTED )
-bCallAutoCaption = true;
+{
+bool graphicInserted;
+nRet = SwTransferable::_PasteFileName( rData, rSh, nFormat,
+SW_PASTESDR_INSERT, pPt,
+nActionFlags, bMsg,
+&graphicInserted );
+if( graphicInserted )
+bCallAutoCaption = true;
+}
 break;
 
 case EXCHG_OUT_ACTION_INSERT_OLE:
@@ -1427,7 +1429,7 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
 SwTransferable::_CheckForURLOrLNKFile( rData, sURL, 
&sDesc );
 if( sDesc.isEmpty() )
 sDesc = sURL;
-nRet = 1;
+nRet = true;
 }
 }
 else
@@ -1437,7 +1439,7 @@ int SwTransferable::PasteData( TransferableDataHelper& 
rData,
 {
 sURL = aBkmk.GetU

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

2013-08-17 Thread Ivan Timofeev
 sw/source/filter/html/svxcss1.cxx |2 +-
 sw/source/filter/html/swhtml.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6e84be040be7d3ec214c2b19462cafcc3f4b277e
Author: Ivan Timofeev 
Date:   Sat Aug 17 13:20:32 2013 +0400

fix copypasta

Change-Id: I92f2203988c5a4843ce512029ec60750fe4d25ff

diff --git a/sw/source/filter/html/svxcss1.cxx 
b/sw/source/filter/html/svxcss1.cxx
index 14d881d..e04ccbd 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -185,7 +185,7 @@ static CSS1PropertyEnum const aBorderStyleTable[] =
 { "groove",  CSS1_BS_GROOVE  },
 { "ridge",   CSS1_BS_RIDGE   },
 { "inset",   CSS1_BS_INSET   },
-{ "inset",  CSS1_BS_OUTSET  },
+{ "outset",  CSS1_BS_OUTSET  },
 { 0,0   }
 };
 
commit befc3e457df9daa7955752bb30cbad632da913de
Author: Ivan Timofeev 
Date:   Sat Aug 17 12:56:49 2013 +0400

fix string conversion

before commit 7a504c8752bf7c5accbb9bcc33a98f79b31b8bf2 there was:
aUnknownToken.CompareTo(sSaveToken) != COMPARE_EQUAL

Change-Id: I4c6411777f342e160c78b0ec591456e284e4e385

diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 87fc2c2..1f88229 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -1225,7 +1225,7 @@ void SwHTMLParser::NextToken( int nToken )
 switch( nToken )
 {
 case HTML_UNKNOWNCONTROL_OFF:
-if( aUnknownToken.startsWith(sSaveToken) )
+if( aUnknownToken != sSaveToken )
 return;
 case HTML_FRAMESET_ON:
 case HTML_HEAD_OFF:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-09-18 Thread Zolnai Tamás
 sw/source/core/text/inftxt.cxx  |   39 +--
 sw/source/core/text/itrcrsr.cxx |   12 +++-
 2 files changed, 32 insertions(+), 19 deletions(-)

New commits:
commit 7ef89c96cc27aee96ceb947c7b676d56b55cd7b5
Author: Zolnai Tamás 
Date:   Wed Sep 18 14:16:24 2013 +0200

Make the code of character border a bit robust

Change-Id: I62a6c932745ee8ff5adeed00df808b62cbb9884f

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 41d569b..e680672 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -639,7 +639,7 @@ void SwTxtPaintInfo::_DrawText( const OUString &rText, 
const SwLinePortion &rPor
 
 // Draw text next to the left border
 Point aFontPos(aPos);
-if( !static_cast(rPor).GetJoinBorderWithPrev() )
+if( m_pFnt->GetLeftBorder() && !static_cast(rPor).GetJoinBorderWithPrev() )
 {
 const sal_uInt16 nLeftBorderSpace = m_pFnt->GetLeftBorderSpace();
 if ( GetTxtFrm()->IsRightToLeft() )
@@ -664,6 +664,10 @@ void SwTxtPaintInfo::_DrawText( const OUString &rText, 
const SwLinePortion &rPor
 break;
 }
 }
+if( aFontPos.X() < 0 )
+aFontPos.X() = 0;
+if( aFontPos.X() < 0 )
+aFontPos.X() = 0;
 }
 
 if( GetTxtFly()->IsOn() )
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index e524c5e..1e981892 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -940,12 +940,13 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const 
xub_StrLen nOfst,
 {
 pCurrPart = pCurrPart->GetFollow();
 }
-if( pCurrPart && nSumLength != nOfst - 
aInf.GetIdx() && !pCurrPart->GetJoinBorderWithNext() )
+if( pCurrPart && nSumLength != nOfst - 
aInf.GetIdx() &&
+pCurrPart->GetFont().GetRightBorder() && 
!pCurrPart->GetJoinBorderWithNext() )
 {
 nX -= 
pCurrPart->GetFont().GetRightBorderSpace();
 }
 }
-else if( !pPor->GetJoinBorderWithNext())
+else if( GetInfo().GetFont()->GetRightBorder() && 
!pPor->GetJoinBorderWithNext())
 {
 nX -= 
GetInfo().GetFont()->GetRightBorderSpace();
 }
@@ -1650,11 +1651,12 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, 
const Point &rPoint,
 while( pCurrPart && nSumWidth <= nX - nCurrStart )
 {
 nSumWidth += pCurrPart->GetWidth();
-if( !pCurrPart->GetJoinBorderWithPrev() )
+if( pCurrPart->GetFont().GetLeftBorder() && 
!pCurrPart->GetJoinBorderWithPrev() )
 {
 nSumBorderWidth += 
pCurrPart->GetFont().GetLeftBorderSpace();
 }
-if( nSumWidth <= nX - nCurrStart && 
!pCurrPart->GetJoinBorderWithNext() )
+if( nSumWidth <= nX - nCurrStart && 
pCurrPart->GetFont().GetRightBorder() &&
+!pCurrPart->GetJoinBorderWithNext() )
 {
 nSumBorderWidth += 
pCurrPart->GetFont().GetRightBorderSpace();
 }
@@ -1663,7 +1665,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, 
const Point &rPoint,
 nX = std::max(0, nX - nSumBorderWidth);
 }
 // Shift the offset with the left border width
-else if( !pPor->GetJoinBorderWithPrev() )
+else if( GetInfo().GetFont()->GetLeftBorder() && 
!pPor->GetJoinBorderWithPrev() )
 {
 nX = std::max(0, nX - 
GetInfo().GetFont()->GetLeftBorderSpace());
 }
commit 89093f50cd0b25f9789fc7023fee116a839fd3aa
Author: Zolnai Tamás 
Date:   Wed Sep 18 13:21:53 2013 +0200

Fix RTL character border

Change-Id: I9cad3f7689e5badafb7fe2cd3f707e3f226c9725

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index cf8e582..41d569b 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -642,20 +642,27 @@ void SwTxtPaintInfo::_DrawText( const OUString &rText, 
const SwLinePortion &rPor
 if( !static_cast(rPor).GetJoinBorderWithPrev() )
 {
 const sal_uInt16 nLeftBorderSpace = m_pFnt->GetLeftBorderSpace();
-switch( m_pFnt->GetOrientation(GetTxtFrm()->IsVertical()) )
+if ( GetTxtFrm()->IsRightToLeft() )
 {
-case 0 :
-aFontPos.X() += nLeftBorderSpace;
-   

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

2013-10-02 Thread Caolán McNamara
 sw/source/core/doc/docdraw.cxx |8 
 sw/source/core/doc/docedt.cxx  |2 
 sw/source/core/doc/docglbl.cxx |   54 +++---
 sw/source/core/doc/doclay.cxx  |2 
 sw/source/core/doc/docnew.cxx  |4 
 sw/source/core/doc/docredln.cxx|2 
 sw/source/core/doc/number.cxx  |4 
 sw/source/core/docnode/node.cxx|9 -
 sw/source/core/inc/UndoManager.hxx |6 
 sw/source/core/undo/docundo.cxx|   14 -
 sw/source/filter/ww8/ww8atr.cxx|  317 ++---
 sw/source/filter/ww8/ww8par2.cxx   |   10 -
 sw/source/filter/ww8/ww8par5.cxx   |3 
 sw/source/ui/app/docsh2.cxx|2 
 sw/source/ui/index/cnttab.cxx  |   56 +++---
 sw/source/ui/misc/outline.cxx  |   10 -
 sw/source/ui/uiview/view2.cxx  |6 
 17 files changed, 248 insertions(+), 261 deletions(-)

New commits:
commit d66af0955d917d509192ca5892f2504edc41c1ec
Author: Caolán McNamara 
Date:   Wed Oct 2 16:32:05 2013 +0100

murder an auto_ptr

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

diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 605b9b8..d4ba831 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -185,10 +185,8 @@ SwDoc::SwDoc()
 mpAttrPool(new SwAttrPool(this)),
 mpMarkManager(new ::sw::mark::MarkManager(*this)),
 m_pMetaFieldManager(new ::sw::MetaFieldManager()),
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
 m_pUndoManager(new ::sw::UndoManager(
-::std::auto_ptr(new SwNodes(this)), *this, *this, *this)),
-SAL_WNODEPRECATED_DECLARATIONS_POP
+boost::shared_ptr(new SwNodes(this)), *this, *this, 
*this)),
 mpDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
 mpEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, mpDfltFrmFmt ) 
),
 mpColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, mpDfltFrmFmt 
) ),
diff --git a/sw/source/core/inc/UndoManager.hxx 
b/sw/source/core/inc/UndoManager.hxx
index c470a68..bf0ac20 100644
--- a/sw/source/core/inc/UndoManager.hxx
+++ b/sw/source/core/inc/UndoManager.hxx
@@ -21,7 +21,7 @@
 #define SW_UNDO_MANAGER_HXX
 
 #include 
-#include 
+#include 
 #include 
 
 class IDocumentDrawModelAccess;
@@ -35,7 +35,7 @@ class UndoManager
 , public SdrUndoManager
 {
 public:
-UndoManager(::std::auto_ptr pUndoNodes,
+UndoManager(boost::shared_ptr pUndoNodes,
 IDocumentDrawModelAccess & rDrawModelAccess,
 IDocumentRedlineAccess & rRedlineAccess,
 IDocumentState & rState);
@@ -90,7 +90,7 @@ private:
 IDocumentState & m_rState;
 
 /// Undo nodes array: content not currently in document
-::std::auto_ptr m_pUndoNodes;
+boost::shared_ptr m_xUndoNodes;
 
 bool m_bGroupUndo   : 1;// TRUE: Undo grouping enabled
 bool m_bDrawUndo: 1;// TRUE: Draw Undo enabled
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index cbe642c..3e690e4 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -48,40 +48,38 @@ using namespace ::com::sun::star;
 
 namespace sw {
 
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-UndoManager::UndoManager(::std::auto_ptr pUndoNodes,
+UndoManager::UndoManager(boost::shared_ptr xUndoNodes,
 IDocumentDrawModelAccess & rDrawModelAccess,
 IDocumentRedlineAccess & rRedlineAccess,
 IDocumentState & rState)
 :   m_rDrawModelAccess(rDrawModelAccess)
 ,   m_rRedlineAccess(rRedlineAccess)
 ,   m_rState(rState)
-,   m_pUndoNodes(pUndoNodes)
+,   m_xUndoNodes(xUndoNodes)
 ,   m_bGroupUndo(true)
 ,   m_bDrawUndo(true)
 ,   m_bLockUndoNoModifiedPosition(false)
 ,   m_UndoSaveMark(MARK_INVALID)
 {
-OSL_ASSERT(m_pUndoNodes.get());
+OSL_ASSERT(m_xUndoNodes.get());
 // writer expects it to be disabled initially
 // Undo is enabled by SwEditShell constructor
 SdrUndoManager::EnableUndo(false);
 }
-SAL_WNODEPRECATED_DECLARATIONS_POP
 
 SwNodes const& UndoManager::GetUndoNodes() const
 {
-return *m_pUndoNodes;
+return *m_xUndoNodes;
 }
 
 SwNodes  & UndoManager::GetUndoNodes()
 {
-return *m_pUndoNodes;
+return *m_xUndoNodes;
 }
 
 bool UndoManager::IsUndoNodes(SwNodes const& rNodes) const
 {
-return & rNodes == m_pUndoNodes.get();
+return & rNodes == m_xUndoNodes.get();
 }
 
 void UndoManager::DoUndo(bool const bDoUndo)
commit 0dfaa5ff93a1dc1bffd8dbe49a00941e99113fbb
Author: Philipp Riemer 
Date:   Sun Sep 29 18:57:46 2013 +0200

fix format for code consistency

Conflicts:
sw/source/core/doc/docglbl.cxx
sw/source/filter/ww8/ww8par2.cxx

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

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

2013-10-02 Thread Tor Lillqvist
 sw/source/core/unocore/unocoll.cxx |   33 +
 1 file changed, 17 insertions(+), 16 deletions(-)

New commits:
commit 5017ccda02e755eb1986bf6f16b7e847199946ed
Author: Tor Lillqvist 
Date:   Wed Oct 2 20:51:27 2013 +0300

Fix indentation

Change-Id: If50bc5be982eec1d2db4e7d1320da0f0d8d17c50

diff --git a/sw/source/core/unocore/unocoll.cxx 
b/sw/source/core/unocore/unocoll.cxx
index ae83cfc..2807f5b 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -145,25 +145,27 @@ public:
 uno::Reference< container::XIndexAccess > xIndex( 
xSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
 
 bool bMatched = false;
-try
+try
+{
+uno::Reference< form::XFormsSupplier >  xFormSupplier( xIndex, 
uno::UNO_QUERY_THROW );
+uno::Reference< container::XIndexAccess > xFormIndex( 
xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
+// get the www-standard container
+uno::Reference< container::XIndexAccess > xFormControls( 
xFormIndex->getByIndex(0), uno::UNO_QUERY_THROW );
+sal_Int32 nCntrls = xFormControls->getCount();
+for( sal_Int32 cIndex = 0; cIndex < nCntrls; ++cIndex )
 {
-uno::Reference< form::XFormsSupplier >  xFormSupplier( 
xIndex, uno::UNO_QUERY_THROW );
-uno::Reference< container::XIndexAccess > xFormIndex( 
xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
-// get the www-standard container
-uno::Reference< container::XIndexAccess > xFormControls( 
xFormIndex->getByIndex(0), uno::UNO_QUERY_THROW );
-sal_Int32 nCntrls = xFormControls->getCount();
-for( sal_Int32 cIndex = 0; cIndex < nCntrls; ++cIndex )
+uno::Reference< uno::XInterface > xControl( 
xFormControls->getByIndex( cIndex ), uno::UNO_QUERY_THROW );
+bMatched = ( xControl == xIf );
+if ( bMatched )
 {
-uno::Reference< uno::XInterface > xControl( 
xFormControls->getByIndex( cIndex ), uno::UNO_QUERY_THROW );
-bMatched = ( xControl == xIf );
-if ( bMatched )
-{
-sCodeName = msThisDocumentCodeName;
-break;
-}
+sCodeName = msThisDocumentCodeName;
+break;
 }
 }
-catch( uno::Exception& ) {}
+}
+catch( uno::Exception& )
+{
+}
 }
 // Probably should throw here ( if !bMatched )
 return sCodeName;
commit e5ae44bbd3f0041e980269bb6041642e5935ce1b
Author: Tor Lillqvist 
Date:   Wed Oct 2 20:49:56 2013 +0300

WaE: unused variable

Change-Id: Ic44062cca5c0b552ca38e2ea57191f288aa550d0

diff --git a/sw/source/core/unocore/unocoll.cxx 
b/sw/source/core/unocore/unocoll.cxx
index 3230129..ae83cfc 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -145,7 +145,6 @@ public:
 uno::Reference< container::XIndexAccess > xIndex( 
xSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
 
 bool bMatched = false;
-uno::Sequence< script::ScriptEventDescriptor > aFakeEvents;
 try
 {
 uno::Reference< form::XFormsSupplier >  xFormSupplier( 
xIndex, uno::UNO_QUERY_THROW );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-02 Thread Caolán McNamara
 sw/source/ui/shells/textfld.cxx |8 
 sw/source/ui/utlui/glbltree.cxx |1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 983419f97d0b89d42d388c3081c39a58928d
Author: Caolán McNamara 
Date:   Wed Oct 2 20:22:58 2013 +0100

CID#705764 fix memory leak

Change-Id: Iade3e4cedddb2428d2df8243525d14121722c776

diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index e822984..c2666c8 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -496,7 +496,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 sal_Bool bIsUrl=sal_False;
 sal_Bool bNew=sal_False;
 bool bUpdate = false;
-SwFldMgr* pMgr = new SwFldMgr;
+SwFldMgr aMgr;
 if ( pItem )
 {
 aText = ((SfxStringItem*)pItem)->GetValue();
@@ -507,7 +507,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 if ( pIsUrl )
 bIsUrl = pIsUrl->GetValue();
 
-SwScriptField* pFld = (SwScriptField*)pMgr->GetCurFld();
+SwScriptField* pFld = (SwScriptField*)aMgr.GetCurFld();
 bNew = !pFld || !(pFld->GetTyp()->Which() == 
RES_SCRIPTFLD);
 bUpdate = pFld && ( bIsUrl != pFld->GetFormat() || 
pFld->GetPar2() != aType || pFld->GetPar1() != aText );
 }
@@ -535,12 +535,12 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 if( bNew )
 {
 SwInsertFld_Data aData(TYP_SCRIPTFLD, 0, aType, aText, 
bIsUrl);
-pMgr->InsertFld(aData);
+aMgr.InsertFld(aData);
 rReq.Done();
 }
 else if( bUpdate )
 {
-pMgr->UpdateCurFld( bIsUrl, aType, aText );
+aMgr.UpdateCurFld( bIsUrl, aType, aText );
 rSh.SetUndoNoResetModified();
 rReq.Done();
 }
commit 9f5e82598fc3d145b83d5c6df0f7b5668408608e
Author: Caolán McNamara 
Date:   Wed Oct 2 20:19:04 2013 +0100

CID#705767 memory leak

Change-Id: I73aa4dd524f9d0d9afbf254fc095da93400b2a54

diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index e433b95..438e862 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -851,6 +851,7 @@ voidSwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 
nSelectedPopupEntry
 pSelEntry = PrevSelected(pSelEntry);
 if(pSelEntry)
 {
+delete pTempContents;
 pTempContents = new SwGlblDocContents;
 pActiveShell->GetGlobalDocContent(*pTempContents);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-11 Thread Caolán McNamara
 sw/source/core/bastyp/calc.cxx |   15 +--
 sw/source/core/text/txtfld.cxx |   10 +-
 2 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit 2a198c02b95bd76c8d7c9e7dd7aff8fc7c030fd5
Author: Caolán McNamara 
Date:   Fri Oct 11 20:53:02 2013 +0100

CID#1103739 unintialized members

Change-Id: I15860351c15f7c28ae197fa626c58b5f3ead8bb7

diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 9082c04..a5c0c96 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -229,12 +229,15 @@ static double lcl_ConvertToDateValue( SwDoc& rDoc, 
sal_Int32 nDate )
 }
 
 SwCalc::SwCalc( SwDoc& rD )
-: aErrExpr( aEmptyStr, SwSbxValue(), 0 ),
-rDoc( rD ),
-pLclData( m_aSysLocale.GetLocaleDataPtr() ),
-pCharClass( &GetAppCharClass() ),
-nListPor( 0 ),
-eError( CALC_NOERR )
+: aErrExpr( aEmptyStr, SwSbxValue(), 0 )
+, nCommandPos(0)
+, rDoc( rD )
+, pLclData( m_aSysLocale.GetLocaleDataPtr() )
+, pCharClass( &GetAppCharClass() )
+, nListPor( 0 )
+, eCurrOper( CALC_NAME )
+, eCurrListOper( CALC_NAME )
+, eError( CALC_NOERR )
 {
 aErrExpr.aStr = "~C_ERR~";
 memset( VarTable, 0, sizeof(VarTable) );
commit dace560b350346b9f9a102ee602bb129a008bcfe
Author: Caolán McNamara 
Date:   Fri Oct 11 20:45:22 2013 +0100

CID#736194 out of bounds

Change-Id: I236c2f51716bfebd0c132bbaed50c1f1ec811ffa

diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index f830594..0133de7 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -395,7 +395,15 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( 
SwTxtFormatInfo &rInf ) const
 // hat ein "gueltige" Nummer ?
 if( pTxtNd->IsNumbered() && pTxtNd->IsCountedInList())
 {
-const SwNumFmt &rNumFmt = pNumRule->Get( 
static_cast(pTxtNd->GetActualListLevel()) );
+int nLevel = pTxtNd->GetActualListLevel();
+
+if (nLevel < 0)
+nLevel = 0;
+
+if (nLevel >= MAXLEVEL)
+nLevel = MAXLEVEL - 1;
+
+const SwNumFmt &rNumFmt = pNumRule->Get( nLevel );
 const sal_Bool bLeft = SVX_ADJUST_LEFT == rNumFmt.GetNumAdjust();
 const sal_Bool bCenter = SVX_ADJUST_CENTER == rNumFmt.GetNumAdjust();
 const bool bLabelAlignmentPosAndSpaceModeActive(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-11 Thread Michael Stahl
 sw/source/core/crsr/findtxt.cxx |   25 +++--
 1 file changed, 7 insertions(+), 18 deletions(-)

New commits:
commit b60ce8465c8f01242354abccebe00742d164af60
Author: Michael Stahl 
Date:   Sat Oct 12 01:54:37 2013 +0200

sw: fix regex search/replace of $ in selection

SwView::Replace() nowadays first searches for the to-be-replaced text in
the current selection, which does not work in the corner case of "$"
when the selection starts at end of a paragraph, as it will when
clicking "Find" to look for "$" and then clicking "Replace".

The problem is that there is some antique code in SwPaM::Find() to
move the cursor forward if it's at the end of a paragraph, which is
presumably some pointless micro-optimization; the result is that
"Replace" does not replace the selected paragraph break but the
one in the following paragraph.

(regression from 68a014dbca8bbd25056f75ef551fb81a0dbfb1b7)

Change-Id: I5aae9c272d102a48166c63e01775dc6322f9f02d

diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index c41be12..76b44c2 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -221,22 +221,6 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool 
bSearchInNotes , utl::Te
 SwNodeIndex& rNdIdx = pPam->GetPoint()->nNode;
 SwIndex& rCntntIdx = pPam->GetPoint()->nContent;
 
-// If a beginning/end, from out of node; stop if empty node
-if( bSrchForward
-? ( rCntntIdx.GetIndex() == pPam->GetCntntNode()->Len() &&
-rCntntIdx.GetIndex() )
-: !rCntntIdx.GetIndex() && pPam->GetCntntNode()->Len() )
-{
-if( !(*fnMove->fnNds)( &rNdIdx, sal_False ))
-{
-delete pPam;
-return false;
-}
-SwCntntNode *pNd = rNdIdx.GetNode().GetCntntNode();
-xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len();
-rCntntIdx.Assign( pNd, nTmpPos );
-}
-
 // If bFound is true then the string was found and is between nStart and 
nEnd
 bool bFound = false;
 // start position in text or initial position
commit dca5163b6ef206ceb1f2d56feb7546c1929afe60
Author: Michael Stahl 
Date:   Sat Oct 12 01:53:51 2013 +0200

fdo#64495: sw: fix regex search for soft hyphen \xAD

The problem is that the soft hyphen apparently needs special handling,
and SwPaM::DoSearch() looked for the no longer supported legacy syntax,
not for any of the unicode character syntax that ICU regex supports.

Change-Id: I754296d2cf9286242e083cc7906ce3b8fda78dd5

diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index d4110e6..c41be12 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -416,9 +416,14 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, 
utl::TextSearch& rSTxt,
 
 if ( bRegSearch )
 {
-const OUString a00AD("\\x00AD");
-if ( -1 != rSearchOpt.searchString.indexOf( a00AD ) )
+if (   -1 != rSearchOpt.searchString.indexOf("\\xAD")
+|| -1 != rSearchOpt.searchString.indexOf("\\x{00AD}")
+|| -1 != rSearchOpt.searchString.indexOf("\\u00AD")
+|| -1 != rSearchOpt.searchString.indexOf("\\U00AD")
+|| -1 != rSearchOpt.searchString.indexOf("\\N{SOFT HYPHEN}"))
+{
  bRemoveSoftHyphens = false;
+}
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-17 Thread Andras Timar
 sw/source/ui/dbui/mmaddressblockpage.cxx |2 +-
 sw/source/ui/dbui/mmaddressblockpage.src |   21 -
 2 files changed, 1 insertion(+), 22 deletions(-)

New commits:
commit 7527e8f71bbdb87f283a6c19e4dbdfa0faf0622a
Author: Andras Timar 
Date:   Thu Oct 17 21:14:01 2013 +0200

fix thinko

Change-Id: I75e9b4cc83a78d718b194eb8dbb3fd5113aa

diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx 
b/sw/source/ui/dbui/mmaddressblockpage.cxx
index e9ead95..aef961e 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -684,7 +684,7 @@ sal_Int32 
SwCustomizeAddressBlockDialog::GetSelectedItem_Impl()
 {
 SvTreeListEntry* pEntry = m_pAddressElementsLB->GetEntry(i);
 OUString sEntry = m_pAddressElementsLB->GetEntryText(pEntry);
-if( sSelected == sEntry.copy( 1, sSelected.getLength() - 2 ) )
+if( sEntry == sSelected.copy( 1, sSelected.getLength() - 2 ) )
 {
 nRet = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
 break;
commit 828bc9d9376d296db47fbee699ae08e546b50a8d
Author: Andras Timar 
Date:   Thu Oct 17 20:38:59 2013 +0200

remove German text from resource

Change-Id: I8a34d2a5d4ea5e8e7f2245b97e4b8b0577edcc17

diff --git a/sw/source/ui/dbui/mmaddressblockpage.src 
b/sw/source/ui/dbui/mmaddressblockpage.src
index fdd871d..81f6f9e 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.src
+++ b/sw/source/ui/dbui/mmaddressblockpage.src
@@ -232,13 +232,6 @@ String ST_TEXT
 };
 StringArray RA_SALUTATION_MALE
 {
-ItemList =
-{
-< "Sehr geehrter Herr <2>," ; > ;
-< "Lieber Herr <2>," ; > ;
-< "Hallo Herr <2>," ; > ;
-< "Hallo <1>," ; > ;
-};
 ItemList [en-US]=
 {
 < "Dear Mr. <2>," ; > ;
@@ -249,13 +242,6 @@ StringArray RA_SALUTATION_MALE
 };
 StringArray RA_SALUTATION_FEMALE
 {
-ItemList =
-{
-< "Sehr geehrte Frau <2>," ; > ;
-< "Liebe Frau <2>," ; > ;
-< "Hallo Frau <2>," ; > ;
-< "Hallo <1>," ; > ;
-};
 ItemList [en-US]=
 {
 < "Dear Mrs. <2>," ; > ;
@@ -266,13 +252,6 @@ StringArray RA_SALUTATION_FEMALE
 };
 StringArray RA_PUNCTUATION
 {
-ItemList =
-{
-< "," ; > ;
-< ":" ; > ;
-< "!" ; > ;
-< "(kein)" ; > ;
-};
 ItemList [en-US]=
 {
 < "," ; > ;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-17 Thread Matteo Casalin
 sw/source/core/graphic/ndgrf.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 43ccd83d2598256de2193348c0b3c7f85fb4870e
Author: Matteo Casalin 
Date:   Thu Oct 17 23:31:03 2013 +0200

URI schemes must be matched case-insensitive

Change-Id: I0ca761cdbf2509ab225101984484905c94e8b3a1

diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 1cd2bd5..ef84d5d 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -479,7 +479,7 @@ StreamAndStorageNames lcl_GetStreamStorageNames( const 
OUString sUserData )
 return aNames;
 
 const OUString aProt( "vnd.sun.star.Package:" );
-if (sUserData.startsWith(aProt))
+if (sUserData.startsWithIgnoreAsciiCase(aProt))
 {
 // 6.0 (XML) Package
 const sal_Int32 nPos = sUserData.indexOf('/');
commit fc357b79e71577916e8d1970c6419619b950bd1c
Author: Matteo Casalin 
Date:   Thu Oct 17 23:21:18 2013 +0200

Remove dead check for start of string

Change-Id: Ib8fcc3dc5d216d1cfae569f605a3f415f80770c4

diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 70436b0..1cd2bd5 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -489,9 +489,7 @@ StreamAndStorageNames lcl_GetStreamStorageNames( const 
OUString sUserData )
 }
 else
 {
-sal_Int32 nPathStart = aProt.getLength();
-if (sUserData.startsWith("./"))
-nPathStart += 2;
+const sal_Int32 nPathStart = aProt.getLength();
 aNames.sStorage = sUserData.copy( nPathStart, nPos-nPathStart );
 aNames.sStream = sUserData.copy( nPos+1 );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-22 Thread Tor Lillqvist
 sw/source/core/inc/rootfrm.hxx   |2 --
 sw/source/core/text/itrform2.cxx |2 --
 sw/source/core/text/porexp.hxx   |6 --
 sw/source/core/text/porfld.hxx   |8 
 sw/source/core/text/porfly.hxx   |4 
 sw/source/core/text/porftn.hxx   |6 --
 sw/source/core/text/porglue.hxx  |5 -
 sw/source/core/text/porhyph.hxx  |6 --
 sw/source/core/text/porlay.hxx   |3 ---
 sw/source/core/text/porlin.hxx   |8 
 sw/source/core/text/pormulti.hxx |2 --
 sw/source/core/text/porref.hxx   |8 
 sw/source/core/text/porrst.hxx   |   11 ---
 sw/source/core/text/portab.hxx   |8 
 sw/source/core/text/portox.hxx   |8 
 sw/source/core/text/portxt.hxx   |4 
 16 files changed, 91 deletions(-)

New commits:
commit ad24ad98818fed80980ac5f49b431d0fa66e5eed
Author: Tor Lillqvist 
Date:   Tue Oct 22 14:16:31 2013 +0300

CLASSIO is dead

Change-Id: Ib08fe1f8faf9d4a527ac84d69eaaa19eb7102a6a

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index ab5a623..1fd8c78 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -859,8 +859,6 @@ public:
 //OUTPUT_OPERATOR
 };
 
-//CLASSIO( SwMetaPortion )
-
 /*
  *   virtual SwMetaPortion::Paint()
  */
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index fc99428..4c9e087 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -90,12 +90,6 @@ public:
 OUTPUT_OPERATOR
 };
 
-
-CLASSIO( SwExpandPortion )
-CLASSIO( SwBlankPortion )
-CLASSIO( SwPostItsPortion )
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index e0df8b4..fb6ff64 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -246,14 +246,6 @@ public:
 OUTPUT_OPERATOR
 };
 
-
-CLASSIO( SwHiddenPortion )
-CLASSIO( SwNumberPortion )
-CLASSIO( SwBulletPortion )
-CLASSIO( SwGrfNumPortion )
-CLASSIO( SwCombinedPortion )
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 2057b6e..f5fbfa8 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -94,10 +94,6 @@ public:
 OUTPUT_OPERATOR
 };
 
-CLASSIO( SwFlyPortion )
-CLASSIO( SwFlyCntPortion )
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx
index a3c80c2..b20e1eb 100644
--- a/sw/source/core/text/porftn.hxx
+++ b/sw/source/core/text/porftn.hxx
@@ -108,12 +108,6 @@ public:
 OUTPUT_OPERATOR
 };
 
-CLASSIO( SwFtnPortion )
-CLASSIO( SwFtnNumPortion )
-CLASSIO( SwQuoVadisPortion )
-CLASSIO( SwErgoSumPortion )
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porglue.hxx b/sw/source/core/text/porglue.hxx
index c47d127..f368fbf 100644
--- a/sw/source/core/text/porglue.hxx
+++ b/sw/source/core/text/porglue.hxx
@@ -115,11 +115,6 @@ inline void SwGluePortion::MoveHalfGlue( SwGluePortion 
*pTarget )
 MoveGlue( pTarget, GetPrtGlue() / 2 );
 }
 
-CLASSIO( SwGluePortion )
-CLASSIO( SwFixPortion )
-CLASSIO( SwMarginPortion )
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx
index 9da5395..3b7450e 100644
--- a/sw/source/core/text/porhyph.hxx
+++ b/sw/source/core/text/porhyph.hxx
@@ -103,12 +103,6 @@ public:
 OUTPUT_OPERATOR
 };
 
-CLASSIO( SwHyphPortion )
-CLASSIO( SwHyphStrPortion )
-CLASSIO( SwSoftHyphPortion )
-CLASSIO( SwSoftHyphStrPortion )
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 8635645..b8e5668 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -399,9 +399,6 @@ inline void SwParaPortion::FormatReset()
 inline SwLinePortion *SwLineLayout::GetFirstPortion() const
 { return( pPortion ? pPortion : (SwLinePortion*)this ); }
 
-CLASSIO( SwLineLayout )
-CLASSIO( SwParaPortion )
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index fb8065c..48329b4 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -31,8 +31,6 @@ class SwTxtFormatInfo;
 class SwPortionHandler;
 
 // The portions output operators are virtual methods of the portion.
-// The CLASSIO macro implements the 'levitating' function.
-// In doing so we end up with both benefits: virtual output operators and 
general utility
 #ifdef DBG_UTIL
 #define OUTPUT_OPERATOR  virtual SvStream &op

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

2014-06-03 Thread Takeshi Abe
 sw/source/ui/envelp/envfmt.cxx|6 +++---
 sw/source/ui/envelp/envprt.cxx|5 +++--
 sw/source/ui/envelp/labfmt.cxx|4 ++--
 sw/source/ui/envelp/labprt.cxx|5 +++--
 sw/source/ui/fldui/fldedt.cxx |6 +++---
 sw/source/ui/frmdlg/frmpage.cxx   |   11 +--
 sw/source/ui/index/cnttab.cxx |   12 ++--
 sw/source/ui/index/swuiidxmrk.cxx |4 ++--
 sw/source/ui/lingu/cvdata.mac |   19 ---
 sw/source/ui/misc/docfnote.cxx|   11 +--
 sw/source/ui/misc/glossary.cxx|   11 ---
 sw/source/ui/misc/outline.cxx |   11 +--
 12 files changed, 41 insertions(+), 64 deletions(-)

New commits:
commit 7883992dd5f8561b6eb192fce864b76c3034b1c5
Author: Takeshi Abe 
Date:   Wed Jun 4 04:11:15 2014 +0900

Avoid possible memory leaks in case of exceptions

Change-Id: I45929aae52fa106b5f5c0199f8ce8b60c0ac5438

diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 760c9c2..c816fe9 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -44,6 +44,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include "swabstdlg.hxx"
@@ -352,12 +353,11 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* 
pColl, bool bSender)
 std::vector pVec = ::lcl_convertRangesToList(pRanges);
 std::vector aVec = ::lcl_convertRangesToList(aRanges);
 pVec.insert(pVec.end(), aVec.begin(), aVec.end());
-sal_uInt16 *pNewRanges = ::lcl_convertListToRanges(pVec);
+boost::scoped_array 
pNewRanges(::lcl_convertListToRanges(pVec));
 
 pAddrSet = new 
SfxItemSet(GetParentSwEnvDlg()->pSh->GetView().GetCurShell()->GetPool(),
-pNewRanges);
+  pNewRanges.get());
 pAddrSet->Put(pColl->GetAttrSet());
-delete[] pNewRanges;
 }
 
 return pAddrSet;
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index 6978b045..252cf04 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -27,6 +27,7 @@
 #include "uitool.hxx"
 
 #include "envprt.hrc"
+#include 
 
 SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet)
 : SfxTabPage(pParent, "EnvPrinterPage",
@@ -98,10 +99,10 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn )
 // Call printer setup
 if (pPrt)
 {
-PrinterSetupDialog* pDlg = new PrinterSetupDialog(this );
+boost::scoped_ptr pDlg(new 
PrinterSetupDialog(this));
 pDlg->SetPrinter(pPrt);
 pDlg->Execute();
-delete pDlg;
+pDlg.reset();
 GrabFocus();
 m_pPrinterInfo->SetText(pPrt->GetName());
 }
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index ae27b71..49593db 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -34,6 +34,7 @@
 #include "../../uibase/envelp/label.hrc"
 #include "labfmt.hrc"
 #include 
+#include 
 
 using namespace utl;
 using namespace ::com::sun::star::uno;
@@ -557,7 +558,7 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl)
 aRec.lPWidth  = static_cast< long >(GETFLDVAL(*m_pPWidthField ));
 aRec.lPHeight = static_cast< long >(GETFLDVAL(*m_pPHeightField));
 aRec.bCont = aItem.bCont;
-SwSaveLabelDlg* pSaveDlg = new SwSaveLabelDlg(this, aRec);
+boost::scoped_ptr pSaveDlg(new SwSaveLabelDlg(this, aRec));
 pSaveDlg->SetLabel(aItem.aLstMake, aItem.aLstType);
 pSaveDlg->Execute();
 if(pSaveDlg->GetLabel(aItem))
@@ -572,7 +573,6 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl)
 m_pMakeFI->SetText(aItem.aMake);
 m_pTypeFI->SetText(aItem.aType);
 }
-delete pSaveDlg;
 return 0;
 }
 
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 454660d..cc5a9e3 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -27,6 +27,7 @@
 #include "swuilabimp.hxx"
 
 #include 
+#include 
 
 SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet)
 : SfxTabPage(pParent, "LabelOptionsPage",
@@ -73,10 +74,10 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
 if (!pPrinter)
 pPrinter = new Printer;
 
-PrinterSetupDialog* pDlg = new PrinterSetupDialog(this );
+boost::scoped_ptr pDlg(new 
PrinterSetupDialog(this));
 pDlg->SetPrinter(pPrinter);
 pDlg->Execute();
-delete pDlg;
+pDlg.reset();
 GrabFocus();
 m_pPrinterInfo->SetText(pPrinter->GetName());
 return 0;
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 45bf150..54b938b 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -46,6 +46,7 @@
 
 #include 
 #include 
+#include 
 
 namespace swui
 {
@@ -312,15 +313,14 @@ IMPL_LINK_NOARG(SwFldEditDlg, AddressHdl)
 SwAbstractDialogFactory* pFact = swu

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

2014-06-04 Thread Takeshi Abe
 sw/source/ui/misc/pgfnote.cxx|8 +--
 sw/source/ui/misc/srtdlg.cxx |7 +--
 sw/source/ui/table/convert.cxx   |4 -
 sw/source/ui/table/instable.cxx  |4 -
 sw/source/ui/table/tautofmt.cxx  |   17 +++
 sw/source/uibase/app/docsh2.cxx  |   13 ++---
 sw/source/uibase/app/docshini.cxx|   13 +++--
 sw/source/uibase/dialog/regionsw.cxx |   14 ++
 sw/source/uibase/dochdl/gloshdl.cxx  |   12 ++---
 sw/source/uibase/dochdl/swdtflvr.cxx |   59 +++
 sw/source/uibase/docvw/DashedLine.cxx|6 +-
 sw/source/uibase/docvw/HeaderFooterWin.cxx   |6 +-
 sw/source/uibase/docvw/PageBreakWin.cxx  |6 +-
 sw/source/uibase/docvw/PostItMgr.cxx |5 +-
 sw/source/uibase/docvw/SidebarTxtControl.cxx |4 -
 sw/source/uibase/docvw/SidebarWin.cxx|7 +--
 sw/source/uibase/docvw/edtwin.cxx|   10 ++--
 17 files changed, 91 insertions(+), 104 deletions(-)

New commits:
commit e0057072817ccad2a54eca45ffdb84d1c99ee7a7
Author: Takeshi Abe 
Date:   Thu Jun 5 14:10:15 2014 +0900

Avoid possible memory leaks in case of exceptions

Change-Id: Ia8bc0e24a76dd953000b73806ac21f21db4c4ca3

diff --git a/sw/source/uibase/dialog/regionsw.cxx 
b/sw/source/uibase/dialog/regionsw.cxx
index 299c26c..938c552 100644
--- a/sw/source/uibase/dialog/regionsw.cxx
+++ b/sw/source/uibase/dialog/regionsw.cxx
@@ -83,12 +83,11 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
 aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
 OSL_ENSURE(pFact, "Dialogdiet fail!");
-AbstractInsertSectionTabDialog* aTabDlg = 
pFact->CreateInsertSectionTabDialog(
-&GetView().GetViewFrame()->GetWindow(), aSet , rSh);
+boost::scoped_ptr 
aTabDlg(pFact->CreateInsertSectionTabDialog(
+&GetView().GetViewFrame()->GetWindow(), aSet , rSh));
 OSL_ENSURE(aTabDlg, "Dialogdiet fail!");
 aTabDlg->Execute();
 rReq.Ignore();
-delete aTabDlg;
 }
 else
 {
@@ -194,13 +193,11 @@ IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, 
SwSectionData*, pSect )
 aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
 OSL_ENSURE(pFact, "Dialogdiet fail!");
-AbstractInsertSectionTabDialog* aTabDlg = 
pFact->CreateInsertSectionTabDialog(
-&pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis);
+boost::scoped_ptr 
aTabDlg(pFact->CreateInsertSectionTabDialog(
+&pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis));
 OSL_ENSURE(aTabDlg, "Dialogdiet fail!");
 aTabDlg->SetSectionData(*xSectionData);
 aTabDlg->Execute();
-
-delete aTabDlg;
 }
 return 0;
 }
@@ -222,14 +219,13 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq)
 {
 SwAbstractDialogFactory* pFact = 
SwAbstractDialogFactory::Create();
 OSL_ENSURE(pFact, "Dialogdiet fail!");
-AbstractEditRegionDlg* pEditRegionDlg = 
pFact->CreateEditRegionDlg(pParentWin, rWrtShell);
+boost::scoped_ptr 
pEditRegionDlg(pFact->CreateEditRegionDlg(pParentWin, rWrtShell));
 OSL_ENSURE(pEditRegionDlg, "Dialogdiet fail!");
 if(pItem && pItem->ISA(SfxStringItem))
 {
 pEditRegionDlg->SelectSection(((const 
SfxStringItem*)pItem)->GetValue());
 }
 pEditRegionDlg->Execute();
-delete pEditRegionDlg;
 }
 }
 break;
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 572f51a..f34c1fa 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -124,6 +124,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 extern bool bFrmDrag;
@@ -2632,14 +2633,14 @@ bool SwTransferable::_PasteDBData( 
TransferableDataHelper& rData,
 }
 else if( nWh )
 {
-SfxUsrAnyItem* pConnectionItem  = 0;
-SfxUsrAnyItem* pCursorItem  = 0;
-SfxUsrAnyItem* pColumnItem  = 0;
-SfxUsrAnyItem* pSourceItem  = 0;
-SfxUsrAnyItem* pCommandItem = 0;
-SfxUsrAnyItem* pCommandTypeItem = 0;
-SfxUsrAnyItem* pColumnNameItem  = 0;
-SfxUsrAnyItem* pSelectionItem   = 0;
+boost::scoped_ptr pConnectionItem;
+boost::scoped_ptr pCursorItem;
+boost::scoped_ptr pColumnItem;
+boost::scoped_ptr pSourceItem;
+boost::scoped_ptr pCommandItem;
+boost::scoped_ptr pCommandTypeItem;
+boost::scoped_ptr pColumnNameItem;
+   

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

2014-06-05 Thread Miklos Vajna
 sw/source/core/docnode/nodedump.cxx  |5 +
 sw/source/core/layout/anchoreddrawobject.cxx |4 
 2 files changed, 9 insertions(+)

New commits:
commit 199eb08be994ef968eb38f4966bc27ef1756d382
Author: Miklos Vajna 
Date:   Thu Jun 5 16:25:01 2014 +0200

SwAnchoredDrawObject::GetObjBoundRect: avoid SwDoc::SetModified()

This is a const method, but it does a const_cast to still resize an
object... if that's so, then we should ensure that the "is modified"
flag of SwDoc is untouched.

CppunitTest_sw_ooxmlimport's testChartSize is a reproducer for this,
when shape text is imported as textbox.

Change-Id: I6dedb31520a14127ca91782874c285f6e0f93c65

diff --git a/sw/source/core/layout/anchoreddrawobject.cxx 
b/sw/source/core/layout/anchoreddrawobject.cxx
index 72f947e..1e011aa 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -655,9 +655,13 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
 
 if ( nTargetWidth != aCurrObjRect.GetWidth( ) || nTargetHeight != 
aCurrObjRect.GetHeight( ) )
 {
+SwDoc* pDoc = const_cast(GetPageFrm()->GetFmt()->GetDoc());
+bool bModified = pDoc->IsModified();
 const_cast< SdrObject* >( GetDrawObj() )->Resize( 
aCurrObjRect.TopLeft(),
 Fraction( nTargetWidth, aCurrObjRect.GetWidth() ),
 Fraction( nTargetHeight, aCurrObjRect.GetHeight() ), false 
);
+if (!bModified)
+pDoc->ResetModified();
 }
 }
 return GetDrawObj()->GetCurrentBoundRect();
commit 383cc9deee599a59ee2c8fcb15ab3ab6e1d9bee7
Author: Miklos Vajna 
Date:   Thu Jun 5 15:33:32 2014 +0200

SwDoc::dumpAsXml: show mbModified

Change-Id: I491d4af104453bb5ff3b55b28e3e1775d8aab8f7

diff --git a/sw/source/core/docnode/nodedump.cxx 
b/sw/source/core/docnode/nodedump.cxx
index fde49d7..0c40a8a 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -191,6 +191,11 @@ void SwDoc::dumpAsXml( xmlTextWriterPtr w )
 mpRedlineTbl->dumpAsXml( writer );
 mpExtraRedlineTbl->dumpAsXml( writer );
 lcl_dumpSdrModel( writer, getIDocumentDrawModelAccess().GetDrawModel() );
+
+writer.startElement("mbModified");
+writer.writeFormatAttribute("value", TMP_FORMAT, mbModified);
+writer.endElement();
+
 writer.endElement();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-05 Thread Caolán McNamara
 sw/source/core/doc/docruby.cxx |2 +-
 sw/source/uibase/utlui/uiitems.cxx |1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bf01bb6e80a999bf13f45cf22421b54ab6779bcc
Author: Caolán McNamara 
Date:   Thu Jun 5 17:14:45 2014 +0100

coverity#736056 Missing break in switch, assuming intentional

Change-Id: I4f729d26bae2f2e371e0f2c7aabd5cabd7bf5a62

diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index 1a4994c..1f71269 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -282,7 +282,7 @@ bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, 
SwRubyListEntry& rEntry, sal_uInt
 
 case UnicodeType::OTHER_LETTER:
 bChkNxtWrd = true;
-
+//fall-through
 default:
 bIsAlphaNum = false;
 break;
commit dce5aea971d322f20e1e84254ccb4106bebce699
Author: Caolán McNamara 
Date:   Thu Jun 5 17:10:03 2014 +0100

coverity#736075 Missing break in switch, assuming its unintentional

Change-Id: Id00c93eb5b43b8dfb38ecfe4c40076b8b1a18465

diff --git a/sw/source/uibase/utlui/uiitems.cxx 
b/sw/source/uibase/utlui/uiitems.cxx
index a819ffc..1a7e347 100644
--- a/sw/source/uibase/utlui/uiitems.cxx
+++ b/sw/source/uibase/utlui/uiitems.cxx
@@ -182,6 +182,7 @@ bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 
nMemberId)
 else
 bRet = false;
 }
+break;
 case MID_FTN_LINE_STYLE:
 {
 ::editeng::SvxBorderStyle eStyle = table::BorderLineStyle::NONE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-24 Thread Takeshi Abe
 sw/source/ui/chrdlg/drpcps.cxx   |2 +-
 sw/source/ui/config/optload.cxx  |2 +-
 sw/source/ui/frmdlg/cption.cxx   |2 +-
 sw/source/ui/inc/shdwcrsr.hxx|2 +-
 sw/source/ui/inc/uitool.hxx  |2 +-
 sw/source/ui/inc/unotools.hxx|2 +-
 sw/source/ui/index/cnttab.cxx|2 +-
 sw/source/ui/utlui/content.cxx   |1 -
 sw/source/ui/utlui/glbltree.cxx  |1 -
 sw/source/ui/utlui/navipi.cxx|3 ---
 sw/source/ui/utlui/numfmtlb.cxx  |4 ++--
 sw/source/ui/utlui/shdwcrsr.cxx  |6 +++---
 sw/source/ui/utlui/uitool.cxx|   12 ++--
 sw/source/ui/utlui/unotools.cxx  |4 ++--
 sw/source/ui/vba/vbabookmark.cxx |4 ++--
 sw/source/ui/vba/vbabookmark.hxx |2 +-
 sw/source/ui/vba/vbafield.cxx|4 ++--
 sw/source/ui/vba/vbafind.cxx |   18 +-
 sw/source/ui/vba/vbafind.hxx |6 +++---
 19 files changed, 37 insertions(+), 42 deletions(-)

New commits:
commit 359b0ebc911b3bba30d0bb715a49ba335c413d28
Author: Takeshi Abe 
Date:   Mon Feb 25 10:56:06 2013 +0900

sal_Bool to bool

Change-Id: Iee9b03c8c5e8c226710822108b3503b0ee4f9717

diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 3ef4051..1b2cc0c 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -622,7 +622,7 @@ void  SwDropCapsPage::Reset(const SfxItemSet &rSet)
 aDistanceField.SetValue(0);
 }
 
-::FillCharStyleListBox(aTemplateBox, rSh.GetView().GetDocShell(), 
sal_True);
+::FillCharStyleListBox(aTemplateBox, rSh.GetView().GetDocShell(), true);
 
 aTemplateBox.InsertEntry(SW_RESSTR(SW_STR_NONE), 0);
 
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index e8910d3..aa04658 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -462,7 +462,7 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const 
SfxItemSet& rSet )
 }
 }
 
-::FillCharStyleListBox( aCharStyleLB, pSh->GetView().GetDocShell(), 
sal_True, sal_True );
+::FillCharStyleListBox( aCharStyleLB, pSh->GetView().GetDocShell(), 
true, true );
 }
 
 
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index af90e55..ab1e5d8 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -448,7 +448,7 @@ SwSequenceOptionDialog::SwSequenceOptionDialog( Window 
*pParent, SwView &rV,
 m_pEdDelim->SetText(sDelim);
 
 m_pLbCharStyle->InsertEntry(sNone);
-::FillCharStyleListBox( *m_pLbCharStyle, rView.GetDocShell(), sal_True, 
sal_True );
+::FillCharStyleListBox( *m_pLbCharStyle, rView.GetDocShell(), true, true );
 m_pLbCharStyle->SelectEntryPos( 0 );
 }
 
diff --git a/sw/source/ui/inc/shdwcrsr.hxx b/sw/source/ui/inc/shdwcrsr.hxx
index ef2de90..b13e801 100644
--- a/sw/source/ui/inc/shdwcrsr.hxx
+++ b/sw/source/ui/inc/shdwcrsr.hxx
@@ -34,7 +34,7 @@ class SwShadowCursor
 long nOldHeight;
 sal_uInt16 nOldMode;
 
-void DrawTri( const Point& rPt, long nHeight, sal_Bool bLeft );
+void DrawTri( const Point& rPt, long nHeight, bool bLeft );
 void DrawCrsr( const Point& rPt, long nHeight, sal_uInt16 nMode );
 
 public:
diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx
index c3a95f8..6373801 100644
--- a/sw/source/ui/inc/uitool.hxx
+++ b/sw/source/ui/inc/uitool.hxx
@@ -68,7 +68,7 @@ SW_DLLPUBLIC sal_Bool HasCharUnit( sal_Bool bWeb );
 void SetApplyCharUnit(sal_Bool bApplyChar, sal_Bool bWeb);
 
 // ListBox mit allen Zeichenvorlagen fuellen - ausser Standard!
-SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, 
sal_Bool bSorted = sal_False, sal_Bool bWithDefault = sal_False);
+SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, 
bool bSorted = false, bool bWithDefault = false);
 
 //inserts a string sorted into a ListBox,
 SW_DLLPUBLIC sal_uInt16 InsertStringSorted(const String& rEntry, ListBox& 
rToFill, sal_uInt16 nOffset);
diff --git a/sw/source/ui/inc/unotools.hxx b/sw/source/ui/inc/unotools.hxx
index 658a77e..33a8cba 100644
--- a/sw/source/ui/inc/unotools.hxx
+++ b/sw/source/ui/inc/unotools.hxx
@@ -87,7 +87,7 @@ class SW_DLLPUBLIC SwOneExampleFrame
 sal_BoolbIsInitialized;
 sal_BoolbServiceAvailable;
 
-static  sal_BoolbShowServiceNotAvailableMessage;
+static  boolbShowServiceNotAvailableMessage;
 
 SW_DLLPRIVATE DECL_LINK( TimeoutHdl, Timer* );
 SW_DLLPRIVATE DECL_LINK( PopupHdl, Menu* );
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 83d9e35..9546729 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2764,7 +2764,7 @@ IMPL_LINK(SwTOXEntryTabPage, AutoRightHdl, CheckBox*, 
pBox)
 void SwTOXEntryTabPage::SetWrtShell(SwWrtShell& rSh)
 {
 SwDocShell* pDocSh = rSh.GetView().GetDocShell();
-::FillCharStyleListBox(aCharStyleLB, pDocSh, sal_True, sal_True);

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

2013-02-27 Thread Takeshi Abe
 sw/source/ui/vba/vbacell.cxx   |4 ++--
 sw/source/ui/vba/vbaheaderfooterhelper.cxx |2 +-
 sw/source/ui/vba/vbarangehelper.cxx|8 
 sw/source/ui/vba/vbaselection.cxx  |   16 
 sw/source/ui/vba/vbaselection.hxx  |4 ++--
 sw/source/ui/vba/vbatablehelper.cxx|6 +++---
 sw/source/ui/vba/vbatablehelper.hxx|6 +++---
 sw/source/ui/vba/vbatables.cxx |6 +++---
 sw/source/ui/vba/vbatabstops.cxx   |4 ++--
 sw/source/ui/vba/wordvbahelper.cxx |8 +++-
 sw/source/ui/vba/wordvbahelper.hxx |2 +-
 11 files changed, 32 insertions(+), 34 deletions(-)

New commits:
commit 3f5434114bd8e67e97d73df76003ce08a2e931d2
Author: Takeshi Abe 
Date:   Thu Feb 28 15:37:00 2013 +0900

sal_Bool to bool

Change-Id: I78955b1a7aba864e83c5c5869f389809be0e76e0

diff --git a/sw/source/ui/vba/vbacell.cxx b/sw/source/ui/vba/vbacell.cxx
index 9244ea3..62d274a 100644
--- a/sw/source/ui/vba/vbacell.cxx
+++ b/sw/source/ui/vba/vbacell.cxx
@@ -42,13 +42,13 @@ SwVbaCell::~SwVbaCell()
 ::sal_Int32 SAL_CALL SwVbaCell::getWidth() throw (css::uno::RuntimeException)
 {
 SwVbaTableHelper aTableHelper( mxTextTable );
-return aTableHelper.GetColWidth( mnColumn, mnRow, sal_True );
+return aTableHelper.GetColWidth( mnColumn, mnRow, true );
 }
 
 void SAL_CALL SwVbaCell::setWidth( ::sal_Int32 _width ) throw 
(css::uno::RuntimeException)
 {
 SwVbaTableHelper aTableHelper( mxTextTable );
-aTableHelper.SetColWidth( _width, mnColumn, mnRow, sal_True );
+aTableHelper.SetColWidth( _width, mnColumn, mnRow, true );
 }
 
 uno::Any SAL_CALL SwVbaCell::getHeight() throw (css::uno::RuntimeException)
diff --git a/sw/source/ui/vba/vbarangehelper.cxx 
b/sw/source/ui/vba/vbarangehelper.cxx
index bed1059..0c45260 100644
--- a/sw/source/ui/vba/vbarangehelper.cxx
+++ b/sw/source/ui/vba/vbarangehelper.cxx
@@ -92,12 +92,12 @@ void SwVbaRangeHelper::insertString( uno::Reference< 
text::XTextRange >& rTextRa
 uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const 
uno::Reference< text::XTextRange >& rTextRange, const uno::Reference< 
text::XText >& rText ) throw ( uno::RuntimeException )
 {
 uno::Reference< text::XTextCursor > xTextCursor;
-sal_Bool bGotTextCursor = sal_False;
+bool bGotTextCursor = false;
 
 try
 {
 xTextCursor = rText->createTextCursorByRange( rTextRange );
-bGotTextCursor = sal_True;
+bGotTextCursor = true;
 }
 catch (const uno::Exception& e)
 {
@@ -110,7 +110,7 @@ uno::Reference< text::XTextCursor > 
SwVbaRangeHelper::initCursor( const uno::Ref
 {
 uno::Reference< text::XText > xText = rTextRange->getText();
 xTextCursor = xText->createTextCursor();
-bGotTextCursor = sal_True;
+bGotTextCursor = true;
 }
 catch (const uno::Exception& e)
 {
@@ -123,7 +123,7 @@ uno::Reference< text::XTextCursor > 
SwVbaRangeHelper::initCursor( const uno::Ref
 try
 {
 xTextCursor = rText->createTextCursor();
-bGotTextCursor = sal_True;
+bGotTextCursor = true;
 }
 catch (const uno::Exception& e)
 {
diff --git a/sw/source/ui/vba/vbaselection.cxx 
b/sw/source/ui/vba/vbaselection.cxx
index a2f015a..9e81400 100644
--- a/sw/source/ui/vba/vbaselection.cxx
+++ b/sw/source/ui/vba/vbaselection.cxx
@@ -736,9 +736,9 @@ uno::Any SAL_CALL SwVbaSelection::Information( sal_Int32 
_type ) throw (uno::Run
 uno::Reference< beans::XPropertySet > xCursorProps( 
mxTextViewCursor, uno::UNO_QUERY_THROW );
 rtl::OUString aPageStyleName;
 xCursorProps->getPropertyValue( rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName;
-sal_Bool bFirstPage = sal_False;
+bool bFirstPage = false;
 if ( aPageStyleName == "First Page" )
-bFirstPage = sal_True;
+bFirstPage = true;
 if( nView == word::WdSeekView::wdSeekFirstPageHeader )
 {
 if( bFirstPage )
@@ -959,22 +959,22 @@ uno::Reference< text::XTextTable > 
SwVbaSelection::GetXTextTable() throw( uno::R
 return xTextTable;
 }
 
-sal_Bool SwVbaSelection::IsInTable() throw( uno::RuntimeException )
+bool SwVbaSelection::IsInTable() throw( uno::RuntimeException )
 {
 uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
 if( xTextTable.is() )
-return sal_True;
-return sal_False;
+return true;
+return false;
 }
 
-sal_Bool SwVbaSelection::HasSelection() throw( uno::RuntimeException )
+bool SwVbaSelection::HasSelection() throw( uno::RuntimeException )
 {
 uno::Reference< text::XTextRange > xStart = mxTextViewCursor->getStart();
 uno::Reference< text::XTextRange 

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

2013-03-08 Thread Miklos Vajna
 sw/source/core/table/swtable.cxx |5 +
 sw/source/core/txtnode/ndtxt.cxx |2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 332fa1344aaaf8ff190c594fe5829cf1551c5211
Author: Miklos Vajna 
Date:   Fri Mar 8 18:11:16 2013 +0100

SwTableBox::IsValidNumTxtNd: Allow trivial formatting

Not allowing flys or footnotes during string -> number conversion is
fine, but I don't see what's the reason for rejecting simple formatting
(like bold) completely.

Change-Id: I8f54aebeb6ea35d099a88570d3f7d365c7325dc0

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index b54531a..0b54d93 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2518,7 +2518,6 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool 
bCheckAttr ) const
 if( bCheckAttr )
 {
 const SwpHints* pHts = pTextNode->GetpSwpHints();
-const String& rTxt = pTextNode->GetTxt();
 // do some tests if there's only text in the node!
 // Flys/fields/...
 if( pHts )
@@ -2527,9 +2526,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool 
bCheckAttr ) const
 for( sal_uInt16 n = 0; n < pHts->Count(); ++n )
 {
 const SwTxtAttr* pAttr = (*pHts)[ n ];
-if( RES_TXTATR_NOEND_BEGIN <= pAttr->Which() ||
-*pAttr->GetStart() ||
-*pAttr->GetAnyEnd() < rTxt.Len() )
+if( RES_TXTATR_NOEND_BEGIN <= pAttr->Which() )
 {
 if ((*pAttr->GetStart() == nNextSetField) &&
 (pAttr->Which() == RES_TXTATR_FIELD))
commit 73422d433bde55a107e4cfebc72a099cbd9b5933
Author: Miklos Vajna 
Date:   Fri Mar 8 18:51:53 2013 +0100

SwTxtNode::GetRedlineTxt: fix string conversion

As I understand it, String allowed the length parameter to be longer
than the remaining string, in which case it simply returned the
substring till the end of the string. In case of OUString, "!!br0ken!!"
is returned instead, so make sure the length is never longer then the
remaining string.

Change-Id: I69499d74f1d9ba8ed6d9ba1a18d10b45ce319bf5

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 0070f9e..6421edd 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3308,7 +3308,7 @@ XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, 
xub_StrLen nLen,
 }
 }
 
-XubString aTxt(GetTxt().copy(nIdx, nLen));
+XubString aTxt(nLen > GetTxt().getLength() ? GetTxt().copy(nIdx) : 
GetTxt().copy(nIdx, nLen));
 
 xub_StrLen nTxtStt = nIdx, nIdxEnd = nIdx + aTxt.Len();
 for( sal_uInt16 n = 0; n < aRedlArr.size(); n += 2 )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-13 Thread Bjoern Michaelsen
 sw/source/core/doc/docbm.cxx |  159 ++-
 1 file changed, 52 insertions(+), 107 deletions(-)

New commits:
commit 25b18c6fe055035a1d5f835cf178acd55a585811
Author: Bjoern Michaelsen 
Date:   Sun Jul 13 10:18:42 2014 +0200

get rid of half the functions by using a functor ...

... and removing duplication

Change-Id: I2339f26ed91e0dc019b0f01fd7802dff23ec9e35

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index ced114d..f500582 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1804,12 +1805,41 @@ namespace
 }
 #endif
 };
+struct OffsetUpdater
+{
+const SwCntntNode* m_pNewCntntNode;
+const sal_Int32 m_nOffset;
+OffsetUpdater(SwCntntNode* pNewCntntNode, sal_Int32 nOffset)
+: m_pNewCntntNode(pNewCntntNode), m_nOffset(nOffset) {};
+void operator()(SwPosition& rPos, sal_Int32 nCntnt) const
+{
+rPos.nNode = *m_pNewCntntNode;
+rPos.nContent.Assign(const_cast(m_pNewCntntNode), 
nCntnt + m_nOffset);
+};
+};
+struct LimitUpdater
+{
+const SwCntntNode* m_pNewCntntNode;
+const sal_uLong m_nLen;
+const sal_Int32 m_nCorrLen;
+LimitUpdater(SwCntntNode* pNewCntntNode, sal_uLong nLen, sal_Int32 
nCorrLen)
+: m_pNewCntntNode(pNewCntntNode), m_nLen(nLen), 
m_nCorrLen(nCorrLen) {};
+void operator()(SwPosition& rPos, sal_Int32 nCntnt) const
+{
+if( nCntnt < m_nCorrLen )
+{
+rPos.nNode = *m_pNewCntntNode;
+
rPos.nContent.Assign(const_cast(m_pNewCntntNode), std::min( 
nCntnt, static_cast(m_nLen) ) );
+}
+};
+};
 struct CntntIdxStoreImpl : sw::mark::CntntIdxStore
 {
 std::vector m_aBkmkEntries;
 std::vector m_aRedlineEntries;
 std::vector m_aUnoCrsrEntries;
 std::vector m_aSaveArr;
+typedef boost::function 
updater_t;
 virtual void Clear() SAL_OVERRIDE
 {
 m_aBkmkEntries.clear();
@@ -1830,29 +1860,31 @@ namespace
 }
 virtual void Restore(SwDoc* pDoc, sal_uLong nNode, sal_Int32 
nOffset=0, bool bAuto = false) SAL_OVERRIDE
 {
-RestoreBkmks(pDoc, nNode, nOffset);
-RestoreRedlines(pDoc, nNode, nOffset);
+SwCntntNode* pCNd = pDoc->GetNodes()[ nNode ]->GetCntntNode();
+updater_t aUpdater = OffsetUpdater(pCNd, nOffset);
+RestoreBkmks(pDoc, aUpdater);
+RestoreRedlines(pDoc, aUpdater);
 _RestoreCntntIdx(pDoc, m_aSaveArr, nNode, nOffset, bAuto);
-RestoreUnoCrsrs(pDoc, nNode, nOffset);
+RestoreUnoCrsrs(pDoc, aUpdater);
 }
 virtual void Restore(SwNode& rNd, sal_Int32 nLen, sal_Int32 nCorrLen) 
SAL_OVERRIDE
 {
-RestoreBkmksLen(rNd, nLen, nCorrLen);
-RestoreRedlinesLen(rNd, nLen, nCorrLen);
+SwCntntNode* pCNd = (SwCntntNode*)rNd.GetCntntNode();
+SwDoc* pDoc = rNd.GetDoc();
+updater_t aUpdater = LimitUpdater(pCNd, nLen, nCorrLen);
+RestoreBkmks(pDoc, aUpdater);
+RestoreRedlines(pDoc, aUpdater);
 _RestoreCntntIdx(m_aSaveArr, rNd, nLen, nCorrLen);
-RestoreUnoCrsrsLen(rNd, nLen, nCorrLen);
+RestoreUnoCrsrs(pDoc, aUpdater);
 }
 virtual ~CntntIdxStoreImpl(){};
 private:
 inline void SaveBkmks(SwDoc* pDoc, sal_uLong nNode, sal_Int32 
nCntnt);
-inline void RestoreBkmks(SwDoc* pDoc, sal_uLong nNode, sal_Int32 
nOffset);
-inline void RestoreBkmksLen(SwNode& rNd, sal_uLong nLen, sal_Int32 
nCorrLen);
+inline void RestoreBkmks(SwDoc* pDoc, updater_t& rUpdater);
 inline void SaveRedlines(SwDoc* pDoc, sal_uLong nNode, sal_Int32 
nCntnt);
-inline void RestoreRedlines(SwDoc* pDoc, sal_uLong nNode, 
sal_Int32 nOffset);
-inline void RestoreRedlinesLen(SwNode& rNd, sal_uLong nLen, 
sal_Int32 nCorrLen);
+inline void RestoreRedlines(SwDoc* pDoc, updater_t& rUpdater);
 inline void SaveUnoCrsrs(SwDoc* pDoc, sal_uLong nNode, sal_Int32 
nCntnt);
-inline void RestoreUnoCrsrs(SwDoc* pDoc, sal_uLong nNode, 
sal_Int32 nOffset);
-inline void RestoreUnoCrsrsLen(SwNode& rNd, sal_uLong nLen, 
sal_Int32 nCorrLen);
+inline void RestoreUnoCrsrs(SwDoc* pDoc, updater_t& rUpdater);
 inline const SwPosition& GetRightMarkPos(::sw::mark::IMark* pMark, 
bool bOther)
 { return bOther ? pMark->GetOtherMarkPos() : 
pMark->GetMarkPos(); };
 inline void SetRightMarkPos(MarkBase* pMark, bool bOther, const 
SwPosition* const pPos)
@@ -1933,42 +1965,20 @@ void CntntIdxStoreImpl::SaveBkmk

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

2014-08-05 Thread Michael Stahl
 sw/source/core/doc/docfmt.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit 2e9840d18c09ce5552eec2f9d489d952da1034ae
Author: Michael Stahl 
Date:   Tue Aug 5 22:56:17 2014 +0200

SwDoc::CopyPageDesc(): probably sending Modify for first too cannot hurt

Change-Id: I2056bee7555d3f6723ac374863187d82e4ad9edd

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index d650a02..faf1214 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1510,6 +1510,12 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, 
SwPageDesc& rDstDesc,
 {
 rDstDesc.GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
 }
+{
+rDstDesc.GetFirstMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) 
);
+}
+{
+rDstDesc.GetFirstLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
+}
 }
 }
 
commit 5c1cc92ee09f9fcc99077cacd3fc55640f03b7b2
Author: Michael Stahl 
Date:   Tue Aug 5 22:50:23 2014 +0200

fdo#69282: sw: fix updating of page styles via SwDocShell::_LoadStyles()

SwDoc::CopyPageDesc() only copies master and left SwFrmFmt attributes,
but not first-master and first-left.  They will contain exactly the same
attributes as master and left but they still need to be copied...

(see also: that FIXME in pagedesc.hxx)

(regression from 75084f6c42c27dc95418df9cefed2fddfb26000e)

Change-Id: I3dcc3627708b5d6a477eb7fef76cf6c42c95c004

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 055bc46..d650a02 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1443,6 +1443,22 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, 
SwPageDesc& rDstDesc,
 
 rDstDesc.GetLeft().DelDiffs( aAttrSet );
 rDstDesc.GetLeft().SetFmtAttr( aAttrSet );
+
+aAttrSet.ClearItem();
+aAttrSet.Put( rSrcDesc.GetFirstMaster().GetAttrSet() );
+aAttrSet.ClearItem( RES_HEADER );
+aAttrSet.ClearItem( RES_FOOTER );
+
+rDstDesc.GetFirstMaster().DelDiffs( aAttrSet );
+rDstDesc.GetFirstMaster().SetFmtAttr( aAttrSet );
+
+aAttrSet.ClearItem();
+aAttrSet.Put( rSrcDesc.GetFirstLeft().GetAttrSet() );
+aAttrSet.ClearItem( RES_HEADER );
+aAttrSet.ClearItem( RES_FOOTER );
+
+rDstDesc.GetFirstLeft().DelDiffs( aAttrSet );
+rDstDesc.GetFirstLeft().SetFmtAttr( aAttrSet );
 }
 
 CopyHeader( rSrcDesc.GetMaster(), rDstDesc.GetMaster() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-09-11 Thread Michael Stahl
 sw/source/core/crsr/crstrvl.cxx |   59 +++-
 1 file changed, 34 insertions(+), 25 deletions(-)

New commits:
commit 5979ab84e8a0038a1225020e19e4b884423247fc
Author: Michael Stahl 
Date:   Thu Sep 11 10:34:51 2014 +0200

sw: actually check that iterator is valid

Change-Id: Icefedf1d3fe09ed6670481dcdc4c5e745e816b1b

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index ab6c2d4..898f56b 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -635,7 +635,7 @@ lcl_FindField(bool & o_rFound, _SetGetExpFlds const& 
rSrtLst,
 
 _SetGetExpFlds::const_iterator it = rSrtLst.lower_bound(pSrch.get());
 
-o_rFound = (**it == *pSrch);
+o_rFound = (it == rSrtLst.end()) ? false : (**it == *pSrch);
 return it;
 }
 
commit cd994fc07f82bf950410bbdc88fbc4de7805547a
Author: Michael Stahl 
Date:   Thu Sep 11 10:27:23 2014 +0200

sw: factor out a function to encapsulate object lifetimes

Change-Id: Ie49cb4729d70f2b1fee9a2b7bd4ac095732a3d58

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 86ebf8c..ab6c2d4 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -608,6 +608,37 @@ void lcl_MakeFldLst(
 }
 }
 
+static _SetGetExpFlds::const_iterator
+lcl_FindField(bool & o_rFound, _SetGetExpFlds const& rSrtLst,
+SwRootFrm *const pLayout, SwTxtNode *const pTxtNode,
+SwTxtFld *const pTxtFld, SwPosition const& rPos,
+sal_Int32 const nContentOffset)
+{
+boost::scoped_ptr<_SetGetExpFld> pSrch;
+boost::scoped_ptr pIndex;
+if (-1 == nContentOffset)
+{
+pSrch.reset(new _SetGetExpFld(rPos.nNode, pTxtFld, &rPos.nContent));
+}
+else
+{
+pIndex.reset(new SwIndex(rPos.nNode.GetNode().GetCntntNode(), 
nContentOffset));
+pSrch.reset(new _SetGetExpFld(rPos.nNode, pTxtFld, pIndex.get()));
+}
+
+if (rPos.nNode.GetIndex() < 
pTxtNode->GetNodes().GetEndOfExtras().GetIndex())
+{
+// also at collection use only the first frame
+Point aPt;
+pSrch->SetBodyPos(*pTxtNode->getLayoutFrm(pLayout, &aPt, &rPos, 
false));
+}
+
+_SetGetExpFlds::const_iterator it = rSrtLst.lower_bound(pSrch.get());
+
+o_rFound = (**it == *pSrch);
+return it;
+}
+
 bool SwCrsrShell::MoveFldType(
 const SwFieldType* pFldType,
 const bool bNext,
@@ -693,31 +724,9 @@ bool SwCrsrShell::MoveFldType(
 && rPos.nContent.GetIndex() != pTxtFld->GetStart())
 nContentOffset = pTxtFld->GetStart();
 }
-
-_SetGetExpFld *pSrch = NULL;
-SwIndex *pIndex = NULL;
-if( -1 == nContentOffset )
-{
-pSrch = new _SetGetExpFld( rPos.nNode, pTxtFld, &rPos.nContent );
-}
-else
-{
-pIndex = new SwIndex( rPos.nNode.GetNode().GetCntntNode(), 
nContentOffset );
-pSrch = new _SetGetExpFld( rPos.nNode, pTxtFld, pIndex );
-}
-
-if( rPos.nNode.GetIndex() < 
mpDoc->GetNodes().GetEndOfExtras().GetIndex() )
-{
-// also at collection use only the first frame
-Point aPt;
-pSrch->SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, 
false ) );
-}
-
-it = aSrtLst.lower_bound( pSrch );
-
-bool isSrch = (**it == *pSrch);
-delete pIndex;
-delete pSrch;
+bool isSrch;
+it = lcl_FindField(isSrch, aSrtLst,
+GetLayout(), pTNd, pTxtFld, rPos, nContentOffset);
 
 if( bDelFld )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-26 Thread Miklos Vajna
 sw/source/core/doc/textboxhelper.cxx |   14 --
 sw/source/core/docnode/nodedump.cxx  |3 +++
 2 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 63da79385ad858f5040f8d0a8898d3b5be5e4f93
Author: Miklos Vajna 
Date:   Thu Jun 26 15:51:50 2014 +0200

SwTextBoxHelper::syncProperty: handle TextAutoGrowHeight

This propagates the "to shape to text" property of the shape to the
textbox, and the textbox is already layouted accordingly, but not the
shape yet. (As the shape thinks it has no text.)

Change-Id: I1fdf0d5743bcb201f112a4c5db18924210858cea

diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index e0fbd5d..e93aae7 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -320,6 +320,8 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, const 
OUString& rPropertyNa
 }
 else if (rPropertyName == UNO_NAME_TEXT_VERT_ADJUST)
 syncProperty(pShape, RES_TEXT_VERT_ADJUST, 0, rValue);
+else if (rPropertyName == UNO_NAME_TEXT_AUTOGROWHEIGHT)
+syncProperty(pShape, RES_FRM_SIZE, MID_FRMSIZE_IS_AUTO_HEIGHT, rValue);
 }
 
 void SwTextBoxHelper::getProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 
nMemberId, css::uno::Any& rValue)
@@ -398,8 +400,16 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, 
sal_uInt16 nWID, sal_uInt8
 }
 break;
 case RES_FRM_SIZE:
-aPropertyName = UNO_NAME_SIZE;
-bAdjustSize = true;
+switch (nMemberId)
+{
+case MID_FRMSIZE_IS_AUTO_HEIGHT:
+aPropertyName = UNO_NAME_FRAME_ISAUTOMATIC_HEIGHT;
+break;
+default:
+aPropertyName = UNO_NAME_SIZE;
+bAdjustSize = true;
+break;
+}
 break;
 case RES_ANCHOR:
 switch (nMemberId)
commit d89d8169716a748c098108eaada789206bb722c3
Author: Miklos Vajna 
Date:   Thu Jun 26 15:50:41 2014 +0200

sw doc model xml dump: handle SwFmtFrmSize

Change-Id: Ie1a8dbc86c9725f3d238226c166ec657722c1770

diff --git a/sw/source/core/docnode/nodedump.cxx 
b/sw/source/core/docnode/nodedump.cxx
index df9a8fb..248aa06 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -21,6 +21,7 @@
 #include "fmtautofmt.hxx"
 #include "fmtcntnt.hxx"
 #include "fmtornt.hxx"
+#include "fmtfsize.hxx"
 #include "charfmt.hxx"
 #include "frmfmt.hxx"
 #include "fmtanchr.hxx"
@@ -413,6 +414,8 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const 
SfxItemSet* pSet)
 case RES_FRM_SIZE:
 {
 pWhich = "frame size";
+const SwFmtFrmSize* pSize = static_cast(pItem);
+oValue = "height size type: " + 
OString::number(pSize->GetHeightSizeType()) + ", width size type: " + 
OString::number(pSize->GetWidthSizeType());
 break;
 }
 case RES_VERT_ORIENT:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-17 Thread Michael Stahl
 sw/source/core/fields/reffld.cxx |   72 ++-
 sw/source/core/uibase/utlui/glbltree.cxx |6 --
 2 files changed, 36 insertions(+), 42 deletions(-)

New commits:
commit cbfcb837fb06a14daf5281ae13fc1886328cee6f
Author: Michael Stahl 
Date:   Thu Apr 17 15:25:23 2014 +0200

fdo#77342: sw: fix copy/paste of footnote cross references

The fix for sequence fields broke the footnote references some more;
simplify it by handling the footnotes in the same way as the sequence
fields, and not remapping GetExp fields for which the corresponding
SetExp field / footnote is missing.

Also, don't do any remapping when the target is a clipboard document, to
prevent modifying the source document.

(regression from bb665affbd8870652ade3951d626d76e99143f67)

Change-Id: If1be1e1d9742182a4085bbbff53e26a8fa8665b8

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index b9faba3..ad19f9f 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1013,6 +1013,17 @@ void _RefIdsMap::Init( SwDoc& rDoc, SwDoc& rDestDoc, 
bool bField )
 {
 GetNoteIdsFromDoc( rDestDoc, aIds );
 GetNoteIdsFromDoc( rDoc, aDstIds );
+
+for (std::set::iterator pIt = aDstIds.begin(); pIt != 
aDstIds.end(); ++pIt)
+AddId( GetFirstUnusedId(aIds), *pIt );
+
+// Change the footnotes/endnotes in the source doc to the new ID
+for (sal_uInt16 i = 0, nCnt = rDoc.GetFtnIdxs().size(); i < nCnt; ++i)
+{
+SwTxtFtn *const pFtnIdx = rDoc.GetFtnIdxs()[i];
+sal_uInt16 const n = pFtnIdx->GetSeqRefNo();
+pFtnIdx->SetSeqNo(sequencedIds[n]);
+}
 }
 bInit = true;
 }
@@ -1050,53 +1061,38 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, 
SwGetRefField& rFld,
 {
 Init( rDoc, rDestDoc, bField);
 
-sal_uInt16 nSeqNo = rFld.GetSeqNo();
-
-// Check if the number is used in both documents
-// Note: For fields, aIds contains both the ids of SetExp from rDestDoc
-// and the targets of the already remapped ones from rDoc.
-// It is possible that aDstIds contains numbers that aIds does not contain!
-// For example, copying a selection to clipboard that does not contain
-// the first SwSetExpField will result in id 0 missing, then pasting that
-// into empty document gives a mapping 1->0 ... N->N-1 (fdo#63553).
-if (aIds.count(nSeqNo) || aDstIds.count(nSeqNo))
-{
-// Number already taken, so need a new one.
-if( sequencedIds.count(nSeqNo) )
-rFld.SetSeqNo( sequencedIds[nSeqNo] );
-else
-{
-assert(!bField || !aDstIds.count(nSeqNo)); // postcond of Init
-
-sal_uInt16 n = GetFirstUnusedId( aIds );
-
-// register the new SeqNo, so that it's "in use"
-AddId( n, nSeqNo );
-rFld.SetSeqNo( n );
+sal_uInt16 const nSeqNo = rFld.GetSeqNo();
 
-// and move the footnotes/endnotes to the new ID
-if( !bField )
-{
-SwTxtFtn* pFtnIdx;
-for( sal_uInt16 i = 0, nCnt = rDoc.GetFtnIdxs().size(); i < 
nCnt; ++i )
-if( nSeqNo == (pFtnIdx = rDoc.GetFtnIdxs()[ i 
])->GetSeqRefNo() )
-{
-pFtnIdx->SetSeqNo( n );
-break;
-}
-}
-}
-}
-else
+// check if it needs to be remapped
+// if sequencedIds doesn't contain the number, it means there is no
+// SetExp field / footnote in the source document: do not modify
+// the number, which works well for copy from/paste to same document
+// (and if it is not the same document, there's no "correct" result anyway)
+if (sequencedIds.count(nSeqNo))
 {
-AddId( nSeqNo, nSeqNo ); // this requires that nSeqNo is unused in 
both!
+rFld.SetSeqNo( sequencedIds[nSeqNo] );
 }
 }
 
+/// 1. if _both_ SetExp + GetExp / Footnote + GetExp field are copied,
+///enusure that both get a new unused matching number
+/// 2. if only SetExp / Footnote is copied, it gets a new unused number
+/// 3. if only GetExp field is copied, for the case of copy from / paste to
+///same document it's desirable to keep the same number;
+///for other cases of copy/paste or master documents it's not obvious
+///what is most desirable since it's going to be wrong anyway
 void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
 {
 if( &rDestDoc != pDoc )
 {
+if (rDestDoc.IsClipBoard())
+{
+// when copying _to_ clipboard, expectation is that no fields exist
+// so no re-mapping is required to avoid collisions
+assert(!rDestDoc.GetSysFldType(RES_GETREFFLD)->GetDepends());
+return; // don't modify the fields in the source doc
+}
+
 // then there are RefF

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

2014-04-29 Thread Michael Stahl
 sw/source/ui/index/cnttab.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 1a18c27bfbaec32520f2a03b40ae09c9e44c59b8
Author: Michael Stahl 
Date:   Tue Apr 29 16:07:55 2014 +0200

sw: actually why does this not simply call FlatIndex()?

Change-Id: I74f5e25a05ca3c4c0259dd7f33da57a9e0790caa

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index c3d04ef..31bcf37 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -368,11 +368,7 @@ short SwMultiTOXTabDialog::Ok()
 SwTOXDescription& rDesc = GetTOXDescription(eCurrentTOXType);
 SwTOXBase aNewDef(*rSh.GetDefaultTOXBase( eCurrentTOXType.eType, true ));
 
-const sal_uInt16 nIndex = static_cast< sal_uInt16 >(
-(eCurrentTOXType.eType == TOX_USER && eCurrentTOXType.nIndex)
-? TOX_AUTHORITIES + eCurrentTOXType.nIndex
-: eCurrentTOXType.eType);
-
+const sal_uInt16 nIndex = eCurrentTOXType.GetFlatIndex();
 if(pFormArr[nIndex])
 {
 rDesc.SetForm(*pFormArr[nIndex]);
commit ccfbc9e1791dd764bb06b87b3c65a7d2b76a35f2
Author: Michael Stahl 
Date:   Tue Apr 29 15:58:11 2014 +0200

fdo#76696: CurTOXType::GetFlatIndex(): fix inverted conditional

(regression from 6af1e845baa0ec63ce16f25868e5e3313bd647bb)

Change-Id: I22dd77fe9bb03f2cf4ce4518ef12c566aad66785

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 0e44b97..c3d04ef 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -205,7 +205,7 @@ public:
 sal_uInt16 CurTOXType::GetFlatIndex() const
 {
 return static_cast< sal_uInt16 >( (eType == TOX_USER && nIndex)
-? eType : TOX_AUTHORITIES + nIndex );
+? TOX_AUTHORITIES + nIndex : eType );
 }
 
 #define EDIT_MINWIDTH 15
@@ -369,9 +369,9 @@ short SwMultiTOXTabDialog::Ok()
 SwTOXBase aNewDef(*rSh.GetDefaultTOXBase( eCurrentTOXType.eType, true ));
 
 const sal_uInt16 nIndex = static_cast< sal_uInt16 >(
-eCurrentTOXType.eType == TOX_USER && eCurrentTOXType.nIndex
-? eCurrentTOXType.eType
-: TOX_AUTHORITIES + eCurrentTOXType.nIndex );
+(eCurrentTOXType.eType == TOX_USER && eCurrentTOXType.nIndex)
+? TOX_AUTHORITIES + eCurrentTOXType.nIndex
+: eCurrentTOXType.eType);
 
 if(pFormArr[nIndex])
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-07 Thread Miklos Vajna
 sw/source/core/docnode/nodedump.cxx |   14 ++
 sw/source/core/layout/atrfrm.cxx|2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 0c5c0cd534b12254d71c874d80ee8d4637ff2d0b
Author: Miklos Vajna 
Date:   Wed May 7 11:34:53 2014 +0200

SwFrmFmts::dumpAsXml: dump which id

Change-Id: I66d7c8444c1a89c21ea2ce5e42fb3cd97fd39b7c

diff --git a/sw/source/core/docnode/nodedump.cxx 
b/sw/source/core/docnode/nodedump.cxx
index 6a53433..31d9821 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -527,6 +527,20 @@ void SwFrmFmts::dumpAsXml(xmlTextWriterPtr w)
 OString aName = OUStringToOString(pFmt->GetName(), 
RTL_TEXTENCODING_UTF8);
 writer.writeFormatAttribute("name", "%s", 
BAD_CAST(aName.getStr()));
 
+writer.writeFormatAttribute("whichId", TMP_FORMAT, pFmt->Which());
+const char* pWhich = 0;
+switch (pFmt->Which())
+{
+case RES_FLYFRMFMT:
+pWhich = "fly frame format";
+break;
+case RES_DRAWFRMFMT:
+pWhich = "draw frame format";
+break;
+}
+if (pWhich)
+writer.writeFormatAttribute("which", "%s", BAD_CAST(pWhich));
+
 lcl_dumpSfxItemSet(writer, &pFmt->GetAttrSet());
 writer.endElement();
 }
commit 3273d800cd50e6f80b629262198f3508fb5bbc7d
Author: Miklos Vajna 
Date:   Wed May 7 10:29:31 2014 +0200

SwFmtCntnt::operator==: most probably bool was intended here

The code here counted the numerical XOR of the two pointer values, but
most probably the logical XOR was intended (in case only we or only they
have a node index, then we are not equal).

Change-Id: I261b8c4b498eb860fa0e0fa72ba5a5e0758064e6

diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 428a906..558ddbd 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -560,7 +560,7 @@ void SwFmtCntnt::SetNewCntntIdx( const SwNodeIndex *pIdx )
 bool SwFmtCntnt::operator==( const SfxPoolItem& rAttr ) const
 {
 OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
-if( (sal_IntPtr)pStartNode ^ (sal_IntPtr)((SwFmtCntnt&)rAttr).pStartNode )
+if( (bool)pStartNode ^ (bool)((SwFmtCntnt&)rAttr).pStartNode )
 return false;
 if( pStartNode )
 return ( *pStartNode == *((SwFmtCntnt&)rAttr).GetCntntIdx() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-13 Thread Michael Stahl
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 sw/source/filter/ww8/rtfsdrexport.cxx|5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit d5642fe00cfd23d1470fa2062a93b30a612bbadd
Author: Michael Stahl 
Date:   Thu Aug 14 00:01:42 2014 +0200

warning C4702: unreachable code

that's a real bug in f6e7b94042070241cd1cfb1d7f8610fe1801b4f2

Change-Id: I46b9f6000b4c5e3b4aec44d96100cb41b6a8b41e

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 30c0596..f8f2d00 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4030,8 +4030,8 @@ void DocxAttributeOutput::FlyFrameGraphic( const 
SwGrfNode* pGrfNode, const Size
 if ("SdtEndBefore" == aGrabBag[nProp].Name && 
m_bStartedCharSdt && !m_bEndCharSdt)
 {
 aGrabBag[nProp].Value >>= m_bEndCharSdt;
+break;
 }
-break;
 }
 }
 }
commit 62f9179110482b97fa0ffe3218b3e9da9644292f
Author: Michael Stahl 
Date:   Wed Aug 13 23:59:24 2014 +0200

spurious warning C4189 local variable initialized but not referenced

Change-Id: I67ac7757a05dfba5724f8f73856e0a23194adaf8

diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx 
b/sw/source/filter/ww8/rtfsdrexport.cxx
index d8706a2..b32dae2 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -451,8 +451,9 @@ void RtfSdrExport::impl_writeGraphic()
 return;
 }
 OString aURLBS(OUStringToOString(sGraphicURL, RTL_TEXTENCODING_UTF8));
-const char aURLBegin[] = "vnd.sun.star.GraphicObject:";
-Graphic aGraphic = 
GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic();
+Graphic aGraphic = GraphicObject(
+aURLBS.copy(RTL_CONSTASCII_LENGTH("vnd.sun.star.GraphicObject:")))
+.GetTransformedGraphic();
 
 // Export it to a stream.
 SvMemoryStream aStream;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-15 Thread Michael Stahl
 sw/source/core/uibase/uiview/viewport.cxx |   16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 8ad3b50dc02875d9a6da46d88b27b2bccf094652
Author: Michael Stahl 
Date:   Fri Mar 14 23:18:17 2014 +0100

replace ugly number with SAL_WHEELMOUSE_EVENT_PAGESCROLL

Change-Id: If56d5a3fe325182907264882d6a1bf5fb979d969

diff --git a/sw/source/core/uibase/uiview/viewport.cxx 
b/sw/source/core/uibase/uiview/viewport.cxx
index 21ecf81..30fa410 100644
--- a/sw/source/core/uibase/uiview/viewport.cxx
+++ b/sw/source/core/uibase/uiview/viewport.cxx
@@ -1250,7 +1250,8 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& 
rCEvt )
 m_bWheelScrollInProgress=true;
 }
 
-if (pWData && (COMMAND_WHEEL_SCROLL==pWData->GetMode()) && 
(((sal_uLong)0x) == pWData->GetScrollLines()))
+if (pWData && (COMMAND_WHEEL_SCROLL==pWData->GetMode()) &&
+(COMMAND_WHEEL_PAGESCROLL == pWData->GetScrollLines()))
 {
 if (pWData->GetDelta()<0)
 PhyPageDown();
commit 6795b251e2011cae945c6bb903de8053953b5e30
Author: Michael Stahl 
Date:   Fri Mar 14 23:08:11 2014 +0100

fdo#75460: sw: fix AutoScroll

This reverts commit 5141201fba2d080841b81e02be92f4b47aae2684. which
fixed a crash but unfortunately also prevents the
m_pEditWin->HandleScrollCommand from being called, thus disabling
AutoScroll.  Fix the crash in the ugly way by another pWData check.

(regression from 8880c773e779710dc0a08760e92afd709a73ca31)

Change-Id: I958f1403ad23d0c0631eca5dbbef977a9ca1210d

diff --git a/sw/source/core/uibase/uiview/viewport.cxx 
b/sw/source/core/uibase/uiview/viewport.cxx
index 119e03e..21ecf81 100644
--- a/sw/source/core/uibase/uiview/viewport.cxx
+++ b/sw/source/core/uibase/uiview/viewport.cxx
@@ -1187,14 +1187,9 @@ void SwView::Move()
 
 sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
 {
-const CommandWheelData* pWData = rCEvt.GetWheelData();
-if (!pWData)
-{
-return sal_False;
-}
-
 sal_Bool bOk = sal_False;
-if( COMMAND_WHEEL_ZOOM == pWData->GetMode() )
+const CommandWheelData* pWData = rCEvt.GetWheelData();
+if (pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode())
 {
 long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
 if( 0L > pWData->GetDelta() )
@@ -1205,7 +1200,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& 
rCEvt )
 SetZoom( SVX_ZOOM_PERCENT, nFact );
 bOk = sal_True;
 }
-else if( COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode() )
+else if (pWData && COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode())
 {
 // mobile touch zoom (pinch) section
 // remember the center location to reach in logic
@@ -1249,13 +1244,13 @@ sal_Bool SwView::HandleWheelCommands( const 
CommandEvent& rCEvt )
 }
 else
 {
-if( pWData->GetMode()==COMMAND_WHEEL_SCROLL )
+if (pWData && pWData->GetMode()==COMMAND_WHEEL_SCROLL)
 {
 // This influences whether quick help is shown
 m_bWheelScrollInProgress=true;
 }
 
-if( (COMMAND_WHEEL_SCROLL==pWData->GetMode()) && 
(((sal_uLong)0x) == pWData->GetScrollLines()) )
+if (pWData && (COMMAND_WHEEL_SCROLL==pWData->GetMode()) && 
(((sal_uLong)0x) == pWData->GetScrollLines()))
 {
 if (pWData->GetDelta()<0)
 PhyPageDown();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-17 Thread Kohei Yoshida
 sw/source/core/layout/paintfrm.cxx |   63 +++--
 1 file changed, 27 insertions(+), 36 deletions(-)

New commits:
commit d2eb2c5a02718b83475bc718e117eb6255cbac98
Author: Kohei Yoshida 
Date:   Mon Mar 17 19:41:07 2014 -0400

fdo#76195: Set the border type to NONE to ensure it won't be drawn.

We can no longer rely on the width being zero for no border condition.

Change-Id: I02c5c825661b4a0aa4190306e8276bdfd8bff944

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 41aadc1..57d662d 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -108,13 +108,6 @@ using ::drawinglayer::primitive2d::BorderLinePrimitive2D;
 using ::std::pair;
 using ::std::make_pair;
 
-//subsidiary lines enabled?
-#define IS_SUBS_TABLE \
-(pGlobalShell->GetViewOptions()->IsTable() && \
-!pGlobalShell->GetViewOptions()->IsPagePreview()&&\
-!pGlobalShell->GetViewOptions()->IsReadonly()&&\
-!pGlobalShell->GetViewOptions()->IsFormView() &&\
- SwViewOption::IsTableBoundaries())
 //other subsidiary lines enabled?
 #define IS_SUBS (!pGlobalShell->GetViewOptions()->IsPagePreview() && \
 !pGlobalShell->GetViewOptions()->IsReadonly() && \
@@ -260,6 +253,27 @@ static sal_Bool bTableHack = sal_False;
 //To optimize the expensive RetouchColor determination
 Color aGlobalRetoucheColor;
 
+namespace {
+
+bool isTableBoundariesEnabled()
+{
+if (!pGlobalShell->GetViewOptions()->IsTable())
+return false;
+
+if (pGlobalShell->GetViewOptions()->IsPagePreview())
+return false;
+
+if (pGlobalShell->GetViewOptions()->IsReadonly())
+return false;
+
+if (pGlobalShell->GetViewOptions()->IsFormView())
+return false;
+
+return SwViewOption::IsTableBoundaries();
+}
+
+}
+
 // Set borders alignment statics.
 // adjustment for 'small' twip-to-pixel relations:
 // For 'small' twip-to-pixel relations (less then 2:1)
@@ -2540,8 +2554,10 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, 
const SwRect& rRect) const
 const Color* pTmpColor = 0;
 if (0 == aStyles[ 0 ].GetWidth())
 {
-if (IS_SUBS_TABLE && pGlobalShell->GetWin())
+if (isTableBoundariesEnabled() && pGlobalShell->GetWin())
 aStyles[ 0 ].Set( rCol, rCol, rCol, false, 1, 0, 0 );
+else
+aStyles[0].SetType(table::BorderLineStyle::NONE);
 }
 else
 pTmpColor = pHCColor;
@@ -4242,12 +4258,8 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData 
const*const) const
 PaintShadow( rRect, aRect, rAttrs );
 }
 
-if (pViewOption->IsTableBoundaries())
-{
-// fdo#75118 Paint border lines only when it's enabled.
-SwTabFrmPainter aHelper(*this);
-aHelper.PaintLines(*pGlobalShell->GetOut(), rRect);
-}
+SwTabFrmPainter aHelper(*this);
+aHelper.PaintLines(*pGlobalShell->GetOut(), rRect);
 }
 
 SwLayoutFrm::Paint( rRect );
@@ -6482,7 +6494,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const 
SwPageFrm *pPage,
 /// Refreshes all subsidiary lines of a page.
 void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
 {
-if ( IS_SUBS || IS_SUBS_TABLE || IS_SUBS_SECTION || IS_SUBS_FLYS )
+if ( IS_SUBS || isTableBoundariesEnabled() || IS_SUBS_SECTION || 
IS_SUBS_FLYS )
 {
 SwRect aRect( rRect );
 if ( aRect.HasArea() )
commit 1c6fb266567c8e397e3c65663b21f0fa50696aa5
Author: Kohei Yoshida 
Date:   Mon Mar 17 19:11:35 2014 -0400

fdo#75260: These old hacks no longer make sense.

The clip region in fact cuts off the lower part of the bottom border, both
on screen and when printing / exporting to PDF.

Change-Id: Id350531f09b3ded66fd05ea7ebeefe8771260b62

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 120634e..41aadc1 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2420,9 +2420,6 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, 
const SwRect& rRect) const
 // #i16816# tagged pdf support
 SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, rDev );
 
-const SwFrm* pTmpFrm = &mrTabFrm;
-const bool bVert = pTmpFrm->IsVertical();
-
 SwLineEntryMapConstIter aIter = maHoriLines.begin();
 bool bHori = true;
 
@@ -2440,17 +2437,6 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, 
const SwRect& rRect) const
 rDev.SetDrawMode( 0 );
 }
 
-// set clip region:
-rDev.Push( PUSH_CLIPREGION );
-Size aSize( rRect.SSize() );
-// Hack! Necessary, because the layout is not pixel aligned!
-aSize.Width() += nPixelSzW; aSize.Height() += nPixelSzH;
-rDev.SetClipRegion(Region(Rectangle(rRect.Pos(), aSize)));
-
-// The 

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

2014-03-28 Thread Caolán McNamara
 sw/source/core/frmedt/feshview.cxx  |5 +++--
 sw/source/core/table/swnewtable.cxx |6 ++
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 70245edb948c7f084f8490ed1e7f79f3962b4322
Author: Caolán McNamara 
Date:   Fri Mar 28 13:28:47 2014 +

coverity#705106 Integer overflowed argument

Change-Id: I843b02cb8d215c149aa646441f3c7b0ab5550906

diff --git a/sw/source/core/table/swnewtable.cxx 
b/sw/source/core/table/swnewtable.cxx
index b74132f..cbbda80 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -1325,6 +1325,12 @@ static sal_uInt16 lcl_CalculateSplitLineHeights( 
SwSplitLines &rCurr, SwSplitLin
 
 if( aBoxes.empty() )
 return 0;
+
+//coverity#705106, help coverity out here
+assert(nFirst != USHRT_MAX);
+if (nFirst == USHRT_MAX)
+return 0;
+
 SwTwips nHeight = 0;
 SwTwips* pLines = new SwTwips[ nLast + 1 - nFirst ];
 for( sal_uInt16 i = nFirst; i <= nLast; ++i )
commit 29f1b19679de9852c64196e495a33a0cdd210f94
Author: Caolán McNamara 
Date:   Fri Mar 28 13:14:58 2014 +

coverity#1078669 Failure to restore non-local value

Change-Id: I3817295a39e409cf5a9ab72b9b24d7b859f5a186

diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 5cc02c1..c7fabef 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2673,6 +2673,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt 
&rSource,
 if ( rChain.GetNext() )
 return SW_CHAIN_SOURCE_CHAINED;
 
+int nRet = SW_CHAIN_NOT_FOUND;
 if( Imp()->HasDrawView() )
 {
 SdrObject* pObj;
@@ -2689,11 +2690,11 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt 
&rSource,
 // Target and source should not be equal and the list
 // should not be cyclic
 SwFrmFmt *pFmt = pFly->GetFmt();
-return GetDoc()->Chainable(rSource, *pFmt);
+nRet = GetDoc()->Chainable(rSource, *pFmt);
 }
 pDView->SetHitTolerancePixel( nOld );
 }
-return SW_CHAIN_NOT_FOUND;
+return nRet;
 }
 
 int SwFEShell::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-30 Thread Miklos Vajna
 sw/source/filter/ww8/docxattributeoutput.cxx |3 ++-
 sw/source/filter/ww8/rtfattributeoutput.cxx  |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit c2ed5f000efafdababa5aa2caa47b159b33ef65c
Author: Miklos Vajna 
Date:   Sun Mar 30 16:27:52 2014 +0200

coverity#735942 Unchecked dynamic_cast

Change-Id: Id508e771b0f117437671f40060c68122a408e386

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 2074a06..97749ff 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3679,7 +3679,8 @@ bool RtfAttributeOutput::FlyFrameOLEMath(const 
SwFlyFrmFmt* pFlyFrmFmt, SwOLENod
 oox::FormulaExportBase* pBase = 
dynamic_cast(dynamic_cast(xClosable.get()));
 assert( pBase != NULL );
 OStringBuffer aBuf;
-pBase->writeFormulaRtf(aBuf, m_rExport.eCurrentEncoding);
+if (pBase)
+pBase->writeFormulaRtf(aBuf, m_rExport.eCurrentEncoding);
 m_aRunText->append(aBuf.makeStringAndClear());
 // Replacement graphic.
 m_aRunText->append("{" LO_STRING_SVTOOLS_RTF_MMATHPICT " ");
commit 1ad901464afa29c96682bde59a12f864fccd525a
Author: Miklos Vajna 
Date:   Sun Mar 30 16:26:50 2014 +0200

coverity#735940 Unchecked dynamic_cast

Change-Id: Ic5acb9afd69dda3fc630a438324ef692950ff2de

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index a425ae0..15874e3 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3729,7 +3729,8 @@ void DocxAttributeOutput::WritePostponedMath()
 // to RTLD_GLOBAL, so most probably a gcc bug.
 oox::FormulaExportBase* formulaexport = 
dynamic_cast(dynamic_cast(xInterface.get()));
 assert( formulaexport != NULL );
-formulaexport->writeFormulaOoxml( m_pSerializer, 
GetExport().GetFilter().getVersion());
+if (formulaexport)
+formulaexport->writeFormulaOoxml( m_pSerializer, 
GetExport().GetFilter().getVersion());
 m_postponedMath = NULL;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-29 Thread Takeshi Abe
 sw/source/core/crsr/findattr.cxx |9 +++--
 sw/source/core/crsr/findfmt.cxx  |5 ++---
 sw/source/core/doc/docbasic.cxx  |   16 +++-
 sw/source/core/text/inftxt.cxx   |1 -
 sw/source/ui/dochdl/swdtflvr.cxx |4 ++--
 5 files changed, 14 insertions(+), 21 deletions(-)

New commits:
commit 27aa26a1953524304f75d8a7a58e87f67485d32c
Author: Takeshi Abe 
Date:   Thu Jan 30 16:49:24 2014 +0900

Drop unnecessary #include

Change-Id: I2a879712adfad3307d608eca0b27f674d32e6a73

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index de10934..6aa466c 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -61,7 +61,6 @@
 #include 
 #include 
 #include "numrule.hxx"
-#include 
 // #i12836# enhanced pdf export
 #include 
 #include 
commit 9e9a59293a6538f4b41ba6892cf3f84967003000
Author: Takeshi Abe 
Date:   Thu Jan 30 16:46:22 2014 +0900

Avoid resource leaks in case of exception

Change-Id: I4461ab619a71fcbe18d4d805a964fd358e857eda

diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 38aac54..9ebd1a2 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
@@ -879,7 +880,7 @@ bool SwPaM::Find( const SfxPoolItem& rAttr, bool bValue, 
SwMoveFn fnMove,
 const sal_uInt16 nWhich = rAttr.Which();
 bool bCharAttr = isCHRATR(nWhich) || isTXTATR(nWhich);
 
-SwPaM* pPam = MakeRegion( fnMove, pRegion );
+boost::scoped_ptr pPam(MakeRegion( fnMove, pRegion ));
 
 bool bFound = false;
 sal_Bool bFirst = sal_True;
@@ -895,7 +896,6 @@ bool SwPaM::Find( const SfxPoolItem& rAttr, bool bValue, 
SwMoveFn fnMove,
 {
 if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False ))
 {
-delete pPam;
 return false;
 }
 SwCntntNode *pNd = pPam->GetCntntNode();
@@ -950,7 +950,6 @@ bool SwPaM::Find( const SfxPoolItem& rAttr, bool bValue, 
SwMoveFn fnMove,
 if( bFound && !bSrchForward )
 Exchange();
 
-delete pPam;
 return bFound;
 }
 
@@ -959,7 +958,7 @@ typedef int (*FnSearchAttr)( const SwTxtNode&, 
SwAttrCheckArr&, SwPaM& );
 bool SwPaM::Find( const SfxItemSet& rSet, bool bNoColls, SwMoveFn fnMove,
   const SwPaM *pRegion, bool bInReadOnly, bool bMoveFirst )
 {
-SwPaM* pPam = MakeRegion( fnMove, pRegion );
+boost::scoped_ptr pPam(MakeRegion( fnMove, pRegion ));
 
 bool bFound = false;
 sal_Bool bFirst = sal_True;
@@ -985,7 +984,6 @@ bool SwPaM::Find( const SfxItemSet& rSet, bool bNoColls, 
SwMoveFn fnMove,
 {
 if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False ))
 {
-delete pPam;
 return false;
 }
 SwCntntNode *pNd = pPam->GetCntntNode();
@@ -1043,7 +1041,6 @@ bool SwPaM::Find( const SfxItemSet& rSet, bool bNoColls, 
SwMoveFn fnMove,
 if( bFound && !bSrchForward )
 Exchange();
 
-delete pPam;
 return bFound;
 }
 
diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx
index e9c30eb..d73f5d9 100644
--- a/sw/source/core/crsr/findfmt.cxx
+++ b/sw/source/core/crsr/findfmt.cxx
@@ -19,13 +19,14 @@
 
 #include 
 #include 
+#include 
 
 bool SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove,
   const SwPaM *pRegion, bool bInReadOnly  )
 {
 bool bFound = false;
 const bool bSrchForward = (fnMove == fnMoveForward);
-SwPaM* pPam = MakeRegion( fnMove, pRegion );
+boost::scoped_ptr pPam(MakeRegion( fnMove, pRegion ));
 
 // if at beginning/end then move it out of the node
 if( bSrchForward
@@ -34,7 +35,6 @@ bool SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove,
 {
 if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False ))
 {
-delete pPam;
 return false;
 }
 SwCntntNode *pNd = pPam->GetPoint()->nNode.GetNode().GetCntntNode();
@@ -65,7 +65,6 @@ bool SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove,
 break;
 }
 }
-delete pPam;
 return bFound;
 }
 
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index 15fcf5f..4b2fdfe 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star::uno;
 
@@ -98,17 +99,17 @@ bool SwDoc::ExecMacro( const SvxMacro& rMacro, OUString* 
pRet, SbxArray* pArgs )
 break;
 case EXTENDED_STYPE:
 {
-Sequence *pUnoArgs = 0;
+boost::scoped_ptr > pUnoArgs;
 if( pArgs )
 {
 // better to rename the local function to 
lcl_translateBasic2Uno and
 // a much shorter routine can be found in 
sfx2/source/doc/objmisc.cxx
- 

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

2014-02-06 Thread Michael Stahl
 sw/source/core/bastyp/calc.cxx |3 +--
 sw/source/ui/app/appenv.cxx|9 +
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 9dbe5a576330b7fadd8838249d07aafe548a4ee2
Author: Michael Stahl 
Date:   Fri Feb 7 00:11:55 2014 +0100

fdo#74474: sw: fix Label wizard document creation harder

The function ReplacePoint() was changed to return a value but not all
call sites were adapted.

(regression from 263153842741d7ce21cc0bf1c5296a55a1138024)

Change-Id: I33efd9ce61611e025dfc76047187826aa0f8dd84

diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 9843a27..d446816 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -512,8 +512,7 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, 
sal_uInt16 ins )
 }
 
 // At this point the "real" case variable has to be used
-OUString sTmpName( rStr );
-::ReplacePoint( sTmpName );
+OUString const sTmpName( ::ReplacePoint(rStr) );
 
 if( !ins )
 {
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index b068661..67519b0 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -114,7 +114,7 @@ OUString InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& 
rFldMgr, const OUString& r
 sal_uInt16 nCnt = 
comphelper::string::getTokenCount(sDBName, '.');
 if (nCnt >= 3)
 {
-::ReplacePoint(sDBName, true);
+sDBName = ::ReplacePoint(sDBName, true);
 SwInsertFld_Data aData(TYP_DBFLD, 0, sDBName, 
aEmptyOUStr, 0, &rSh );
 rFldMgr.InsertFld( aData );
 sRet = sDBName;
commit 7e61bfe813347949307cdf2876ead3cc42e4cd7b
Author: Michael Stahl 
Date:   Thu Feb 6 23:49:20 2014 +0100

fdo#74474: sw: fix Label wizard document creation

Infinite loop in InsertLabEnvText() due to wrong handling of starting '<'.

(regression from fa469b2e00d83459faebe4c1fcb3ea1aac5fb20d)

Change-Id: I1d7ab1b276756bddd87890bb39d3e817330bc6dd

diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 8d3842a..b068661 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -90,10 +90,11 @@ OUString InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& 
rFldMgr, const OUString& r
 bool bField = false;
 
 sal_Int32 nPos = aLine.indexOf( '<' );
-if ( nPos != -1)
+if (0 != nPos)
 {
-sTmpText = aLine.copy( 0, nPos );
-aLine = aLine.copy( nPos );
+sal_Int32 const nCopy((nPos != -1) ? nPos : aLine.getLength());
+sTmpText = aLine.copy(0, nCopy);
+aLine = aLine.copy(nCopy);
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-17 Thread Jan Holesovsky
 sw/source/filter/html/parcss1.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3ecdc23d164d8e8632375247604cddf04f1e4df4
Author: Jan Holesovsky 
Date:   Mon Feb 17 21:00:03 2014 +0100

Let's not parse nonsensical data.

Change-Id: Icf956c3824286e8244cf5809be88568de0d6a068

diff --git a/sw/source/filter/html/parcss1.cxx 
b/sw/source/filter/html/parcss1.cxx
index 8489355..692474b 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1273,11 +1273,11 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
 {
 sal_uInt8 aColors[3] = { 0, 0, 0 };
 
-OSL_ENSURE( aValue.startsWithIgnoreAsciiCase( "rgb" ) &&
-aValue.getLength() > 5 &&
-'(' == aValue[3] &&
-')' == aValue[aValue.getLength()-1],
-"keine gueltiges RGB(...)" );
+if (!aValue.startsWithIgnoreAsciiCase( "rgb" ) || 
aValue.getLength() < 6 ||
+aValue[3] != '(' || aValue[aValue.getLength()-1] != ')')
+{
+break;
+}
 
 OUString aColorStr(aValue.copy(4, aValue.getLength() - 5));
 
commit 2afb605601ec0b29e177dd38e4f16bfe06590882
Author: Jan Holesovsky 
Date:   Mon Feb 17 20:49:24 2014 +0100

Fix crash in css rgb color handling.

Crashing since 2000 (or earlier).

Change-Id: I9f91d56f380be2421370b0acbee351461e1f0973

diff --git a/sw/source/filter/html/parcss1.cxx 
b/sw/source/filter/html/parcss1.cxx
index 3dfbaea..8489355 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1279,7 +1279,7 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
 ')' == aValue[aValue.getLength()-1],
 "keine gueltiges RGB(...)" );
 
-OUString aColorStr( aValue.copy( 4, aValue.getLength()-1 ) );
+OUString aColorStr(aValue.copy(4, aValue.getLength() - 5));
 
 sal_Int32 nPos = 0;
 sal_uInt16 nCol = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-28 Thread Tor Lillqvist
 sw/source/core/undo/undobj.cxx  |2 +-
 sw/source/ui/frmdlg/frmpage.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2df809f4a3671720b15de3c44185766d09e4c425
Author: Tor Lillqvist 
Date:   Fri Feb 28 14:47:32 2014 +0200

WaE: unused parameter 'bCopyNext'

Change-Id: Ic455c6f7a40d8f96335ecda37084ff7c0ef601a5

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 9f45a4a..b20d91c 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -998,7 +998,7 @@ sal_Bool SwUndo::FillSaveData(
 const SwPaM& rRange,
 SwRedlineSaveDatas& rSData,
 sal_Bool bDelRange,
-sal_Bool bCopyNext )
+sal_Bool /* bCopyNext */ )
 {
 rSData.DeleteAndDestroyAll();
 
commit dc23ea1522f5304944ef9ade4cd2a722db2e3505
Author: Tor Lillqvist 
Date:   Fri Feb 28 14:45:04 2014 +0200

WaE: implicit conversion of literal of type 'sal_Bool' to 'bool'

Change-Id: Ide2bd5caf2d6920c99400fbad290349d7dcca464

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 8c98fd6..040cbc8 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2420,7 +2420,7 @@ void SwGrfExtPage::Reset(const SfxItemSet &rSet)
 && ((const SfxBoolItem *)pItem)->GetValue() )
 {
 m_pBrowseBT->Enable();
-m_pConnectED->SetReadOnly(sal_False);
+m_pConnectED->SetReadOnly(false);
 }
 
 ActivatePage(rSet);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-27 Thread Michael Stahl
 sw/source/core/crsr/crsrsh.cxx |   60 +
 1 file changed, 14 insertions(+), 46 deletions(-)

New commits:
commit efc5995170f2ffe98374acb16a4f851bede6842d
Author: Michael Stahl 
Date:   Wed Mar 27 23:33:44 2013 +0100

SwCrsrShell: remove pointless resetting of Mark positions...

... before calling DeleteMark(), which actually resets the Mark
position to something guaranteed not to be an SwIndexReg since CWS
odfmetadata2; checking HasMark() before DeleteMark() is pointless too.

Change-Id: I145c3800a4a7e5d20de9567d8f3163431577e918

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 0c9a620..73c01be 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -808,15 +808,7 @@ void SwCrsrShell::ClearMark()
 delete pCurCrsr->GetNext();
 pTblCrsr->DeleteMark();
 
-if( pCurCrsr->HasMark() )
-{
-// move content part from mark to nodes array if not all indices
-// were moved correctly (e.g. when deleting header/footer)
-SwPosition& rPos = *pCurCrsr->GetMark();
-rPos.nNode.Assign( mpDoc->GetNodes(), 0 );
-rPos.nContent.Assign( 0, 0 );
-pCurCrsr->DeleteMark();
-}
+pCurCrsr->DeleteMark();
 
 *pCurCrsr->GetPoint() = *pTblCrsr->GetPoint();
 pCurCrsr->GetPtPos() = pTblCrsr->GetPtPos();
@@ -827,11 +819,6 @@ void SwCrsrShell::ClearMark()
 {
 if( !pCurCrsr->HasMark() )
 return;
-// move content part from mark to nodes array if not all indices
-// were moved correctly (e.g. when deleting header/footer)
-SwPosition& rPos = *pCurCrsr->GetMark();
-rPos.nNode.Assign( mpDoc->GetNodes(), 0 );
-rPos.nContent.Assign( 0, 0 );
 pCurCrsr->DeleteMark();
 if( !nCrsrMove )
 pCurCrsr->SwSelPaintRects::Show();
@@ -1214,8 +1201,7 @@ void SwCrsrShell::UpdateCrsrPos()
 aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
 GetLayout()->GetCrsrOfst( pShellCrsr->GetPoint(), 
pShellCrsr->GetPtPos(),
  &aTmpState );
-if( pShellCrsr->HasMark())
-pShellCrsr->DeleteMark();
+pShellCrsr->DeleteMark();
 }
 IGrammarContact *pGrammarContact = GetDoc() ? 
GetDoc()->getGrammarContact() : 0;
 if( pGrammarContact )
@@ -2354,10 +2340,9 @@ sal_Bool SwCrsrShell::ParkTblCrsr()
 while( pCurCrsr->GetNext() != pCurCrsr )
 delete pCurCrsr->GetNext();
 
-// *always* move cursor's SPoint and Mark
-pCurCrsr->SetMark();
-*pCurCrsr->GetMark() = *pCurCrsr->GetPoint() = *pTblCrsr->GetPoint();
+// *always* move cursor's Point and Mark
 pCurCrsr->DeleteMark();
+*pCurCrsr->GetPoint() = *pTblCrsr->GetPoint();
 
 return sal_True;
 }
@@ -2388,7 +2373,7 @@ void SwCrsrShell::_ParkPams( SwPaM* pDelRg, SwShellCrsr** 
ppDelRing )
 pTmpDel = pTmp;
 
 bGoNext = true;
-if( pTmpDel ) // is the pam in area -> delete
+if (pTmpDel) // is the pam in the range -> delete
 {
 sal_Bool bDelete = sal_True;
 if( *ppDelRing == pTmpDel )
@@ -2409,20 +2394,10 @@ void SwCrsrShell::_ParkPams( SwPaM* pDelRg, 
SwShellCrsr** ppDelRing )
 delete pTmpDel; // invalidate old area
 else
 {
-pTmpDel->GetPoint()->nContent.Assign( 0, 0 );
-pTmpDel->GetPoint()->nNode = 0;
-pTmpDel->SetMark();
 pTmpDel->DeleteMark();
 }
 pTmpDel = 0;
 }
-else if( !pTmp->HasMark() )
-{
-// Take care that not used indices are considered.
-// SPoint is not in area but maybe GetMark is, thus set it.
-pTmp->SetMark();
-pTmp->DeleteMark();
-}
 if( bGoNext )
 pTmp = (SwPaM*)pTmp->GetNext();
 } while( !bGoNext || *ppDelRing != pTmp );
@@ -2478,9 +2453,6 @@ void SwCrsrShell::ParkCrsr( const SwNodeIndex &rIdx )
 SwNode* pTblNd = 
pTCrsr->GetPoint()->nNode.GetNode().FindTableNode();
 if ( pTblNd )
 {
-pTCrsr->GetPoint()->nContent.Assign( 0, 0 );
-pTCrsr->GetPoint()->nNode = 0;
-pTCrsr->SetMark();
 pTCrsr->DeleteMark();
 pSh->pCurCrsr->GetPoint()->nNode = *pTblNd;
 }
@@ -3065,14 +3037,6 @@ void SwCrsrShell::SetSelection( const SwPaM& rCrsr )
 EndAction();
 }
 
-static void lcl_RemoveMark( SwPaM* pPam )
-{
-OSL_ENSURE( pPam->HasMark(), "Don't remove pPoint!" );
-pPam->GetMark()->nContent.Assign( 0, 0 );
-pPam->GetMark()->nNode = 0;
-pPam->DeleteMark();
-}
-
 static const SwStartNode* lcl_NodeContext( const SwNode& rNode )
 {
 const SwStartNode *pRet = rNode.StartOfSectionNode();
@@ -3135,

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

2013-02-18 Thread Takeshi Abe
 sw/source/ui/lingu/olmenu.cxx |2 +-
 sw/source/ui/shells/textfld.cxx   |8 
 sw/source/ui/shells/textglos.cxx  |6 +++---
 sw/source/ui/shells/textidx.cxx   |8 
 sw/source/ui/shells/textsh.cxx|4 ++--
 sw/source/ui/shells/textsh1.cxx   |   12 ++--
 sw/source/ui/shells/textsh2.cxx   |4 ++--
 sw/source/ui/shells/txtattr.cxx   |6 +++---
 sw/source/ui/shells/txtnum.cxx|2 +-
 sw/source/ui/table/swtablerep.cxx |4 ++--
 sw/source/ui/table/tabledlg.cxx   |   25 -
 11 files changed, 40 insertions(+), 41 deletions(-)

New commits:
commit 510a7175d29139ead9eb3bcbdc5fcf60f37a9e4f
Author: Takeshi Abe 
Date:   Mon Feb 18 22:04:45 2013 +0900

sal_Bool to bool

Change-Id: I9dff9f25afff4253001902a2685b626d1e706e22

diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index c1d56a5..2b47249 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -96,7 +96,7 @@
 using namespace ::com::sun::star;
 using ::rtl::OUString;
 
-extern void sw_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 
nSlot,const SfxItemSet *pArgs, SfxRequest *pReq );
+extern void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 
nSlot,const SfxItemSet *pArgs, SfxRequest *pReq );
 
 
 
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 5eb4940..f230189 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -102,7 +102,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 pArgs->GetItemState(GetPool().GetWhich(nSlot), sal_False, &pItem);
 
 Window *pMDI = &GetView().GetViewFrame()->GetWindow();
-sal_Bool bMore = sal_False;
+bool bMore = false;
 bool bIsText = true;
 sal_uInt16 nInsertType = 0;
 sal_uInt16 nInsertSubType = 0;
@@ -182,7 +182,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 break;
 
 default:
-bMore = sal_True;
+bMore = true;
 }
 if(bMore)
 {
@@ -338,7 +338,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 case FN_POSTIT:
 {
 SwPostItField* pPostIt = (SwPostItField*)aFldMgr.GetCurFld();
-  sal_Bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == 
RES_POSTITFLD);
+bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == 
RES_POSTITFLD);
 if (bNew || GetView().GetPostItMgr()->IsAnswer())
 {
 SvtUserOptions aUserOpt;
@@ -689,7 +689,7 @@ void SwTextShell::StateField( SfxItemSet &rSet )
 break;
 case FN_POSTIT :
 case FN_JAVAEDIT :
-sal_Bool bCurField = sal_False;
+bool bCurField = false;
 pField = rSh.GetCurFld();
 if(nWhich == FN_POSTIT)
 bCurField = pField && pField->GetTyp()->Which() == 
RES_POSTITFLD;
diff --git a/sw/source/ui/shells/textglos.cxx b/sw/source/ui/shells/textglos.cxx
index 45cd3ca..c48690b 100644
--- a/sw/source/ui/shells/textglos.cxx
+++ b/sw/source/ui/shells/textglos.cxx
@@ -39,7 +39,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
 FN_GLOSSARY_DLG == nSlot );
 SwGlossaryHdl* pGlosHdl = GetView().GetGlosHdl();
 // SwGlossaryList updaten?
-sal_Bool bUpdateList = sal_False;
+bool bUpdateList = false;
 
 const SfxItemSet *pArgs = rReq.GetArgs();
 const SfxPoolItem* pItem = 0;
@@ -50,7 +50,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
 {
 case FN_GLOSSARY_DLG:
 pGlosHdl->GlossaryDlg();
-bUpdateList = sal_True;
+bUpdateList = true;
 rReq.Ignore();
 break;
 case FN_EXPAND_GLOSSARY:
@@ -82,7 +82,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
 pGlosHdl->NewGlossary( aName, aShortName, sal_True );
 rReq.Done();
 }
-bUpdateList = sal_True;
+bUpdateList = true;
 break;
 case FN_SET_ACT_GLOSSARY:
 if(pItem)
diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx
index c78a404..ef62e91 100644
--- a/sw/source/ui/shells/textidx.cxx
+++ b/sw/source/ui/shells/textidx.cxx
@@ -176,7 +176,7 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
 
 SfxChildWindow* pAuthMark = 
pVFrame->GetChildWindow(FN_INSERT_AUTH_ENTRY_DLG);
 
-const sal_Bool bHtmlMode = 0 != ::GetHtmlMode( GetView().GetDocShell() );
+const bool bHtmlMode = 0 != ::GetHtmlMode( GetView().GetDocShell() );
 const SwTOXBase* pBase = 0;
 if( bHtmlMode || 0 != ( pBase = rSh.GetCurTOX()) )
 {
@@ -205,16 +205,16 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
 else
 {
 
-sal_Bool bEnableEdit = sal_True;
+bool bEnableEdit = true;
 sal_Bool bInReadonly = rSh.HasReadonlySel();
   

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

2013-02-19 Thread Michael Stahl
 sw/source/core/txtnode/ndtxt.cxx |3 +-
 sw/source/ui/docvw/edtwin.cxx|   43 ++-
 sw/source/ui/wrtsh/wrtsh2.cxx|   14 
 3 files changed, 31 insertions(+), 29 deletions(-)

New commits:
commit a4a457100a3a6e9f59113e82c9d0b12786273671
Author: Michael Stahl 
Date:   Wed Feb 20 00:08:45 2013 +0100

fdo#59928: sw: fix mouse selection of fields differently

Unfortunately selecting the field in SwEditWin::MouseButtonDown()
prevents the click field handling code in SwEditWin::MouseButtonUp()
from running.  Instead select the field in MouseButtonUp and
SwWrtShell::ClickToField(), which seems to work better.
(regression from 94721b2aec614e0d99504138d484b2ad6cd550c7)

Change-Id: I3d769487b9d5225ffd07b384fbb0ce01e0733be5

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 818663f..61a8c72 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -3559,36 +3559,17 @@ void SwEditWin::MouseButtonDown(const MouseEvent& 
_rMEvt)
 // Are we clicking on a field?
 if (rSh.GetContentAtPos(aDocPos, aFieldAtPos))
 {
-bool bAddMode(false); // AdditionalMode if applicable
-if (KEY_MOD1 == rMEvt.GetModifier() && !rSh.IsAddMode())
-{
-bAddMode = true;
-rSh.EnterAddMode();
-}
 rSh.SetCursor(&aDocPos, bOnlyText);
-// Select the field. Unfortunately cursor may be on field
+// Unfortunately the cursor may be on field
 // position or on position after field depending on which
 // half of the field was clicked on.
 SwTxtAttr const*const pTxtFld(aFieldAtPos.pFndTxtAttr);
 if (rSh.GetCurrentShellCursor().GetPoint()->nContent
-.GetIndex() == *pTxtFld->GetStart())
-{
-rSh.Right( CRSR_SKIP_CHARS, true, 1, false );
-rSh.NormalizePam();
-}
-else
+.GetIndex() != *pTxtFld->GetStart())
 {
 assert(rSh.GetCurrentShellCursor().GetPoint()->nContent
 .GetIndex() == (*pTxtFld->GetStart() + 1));
-rSh.Left( CRSR_SKIP_CHARS, true, 1, false );
-}
-// it's a bit of a mystery what this is good for?
-// in this case we assume it's valid since we just
-// selected a field
-bValidCrsrPos = true;
-if (bAddMode)
-{
-rSh.LeaveAddMode();
+rSh.Left( CRSR_SKIP_CHARS, false, 1, false );
 }
 // don't go into the !bOverSelect block below - it moves
 // the cursor
@@ -4422,7 +4403,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 if(pApplyTempl)
 bExecHyperlinks = sal_False;
 
-SwContentAtPos aCntntAtPos( 
SwContentAtPos::SW_CLICKFIELD |
+SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD |
 
SwContentAtPos::SW_INETATTR |
 
SwContentAtPos::SW_SMARTTAG  | SwContentAtPos::SW_FORMCTRL);
 
@@ -4441,7 +4422,23 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 
 if( SwContentAtPos::SW_FIELD == 
aCntntAtPos.eCntntAtPos )
 {
+bool bAddMode(false);
+// AdditionalMode if applicable
+if (KEY_MOD1 == rMEvt.GetModifier()
+&& !rSh.IsAddMode())
+{
+bAddMode = true;
+rSh.EnterAddMode();
+}
 rSh.ClickToField( *aCntntAtPos.aFnd.pFld );
+// a bit of a mystery what this is good for?
+// in this case we assume it's valid since we
+// just selected a field
+bValidCrsrPos = true;
+if (bAddMode)
+{
+rSh.LeaveAddMode();
+}
 }
 else if ( SwContentAtPos::SW_SMARTTAG == 
aCntntAtPos.eCntntAtPos )
 {
diff --git a/sw/source/ui/wrtsh/wr

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

2013-02-19 Thread Takeshi Abe
 sw/source/ui/docvw/edtwin.cxx   |   10 
 sw/source/ui/inc/view.hxx   |8 +++---
 sw/source/ui/index/cnttab.cxx   |4 +--
 sw/source/ui/table/tautofmt.cxx |   18 +++
 sw/source/ui/uiview/formatclipboard.cxx |4 +--
 sw/source/ui/uiview/pview.cxx   |   37 
 sw/source/ui/uiview/srcview.cxx |   16 ++---
 sw/source/ui/uiview/uivwimp.cxx |4 +--
 sw/source/ui/uiview/view.cxx|4 +--
 sw/source/ui/uiview/viewsrch.cxx|   12 +-
 10 files changed, 50 insertions(+), 67 deletions(-)

New commits:
commit 03d5d8891076b1c668d2eae30b5690bb564a
Author: Takeshi Abe 
Date:   Wed Feb 20 00:58:47 2013 +0900

sal_Bool to bool

Change-Id: I87266c0b2aff04b888d7b201c00b36156d82fe93

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 61a8c72..73b9331 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -4607,7 +4607,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 rSh.EnterStdMode();
 rSh.SetVisCrsr(aDocPt);
 
-pApplyTempl->bUndo = sal_True;
+pApplyTempl->bUndo = true;
 bCallBase = false;
 aTemplateTimer.Stop();
 }
@@ -4628,7 +4628,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
  & eSelection ) && !rSh.HasReadonlySel() )
 {
 rSh.SetTxtFmtColl( pApplyTempl->aColl.pTxtColl );
-pApplyTempl->bUndo = sal_True;
+pApplyTempl->bUndo = true;
 bCallBase = false;
 if ( pApplyTempl->aColl.pTxtColl )
 aStyleName = 
pApplyTempl->aColl.pTxtColl->GetName();
@@ -4642,7 +4642,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 rSh.UnSetVisCrsr();
 rSh.EnterStdMode();
 rSh.SetVisCrsr(aDocPt);
-pApplyTempl->bUndo = sal_True;
+pApplyTempl->bUndo = true;
 bCallBase = false;
 if ( pApplyTempl->aColl.pCharFmt )
 aStyleName = 
pApplyTempl->aColl.pCharFmt->GetName();
@@ -4654,7 +4654,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 if(PTR_CAST(SwFlyFrmFmt, pFmt))
 {
 rSh.SetFrmFmt( pApplyTempl->aColl.pFrmFmt, false, 
&aDocPt );
-pApplyTempl->bUndo = sal_True;
+pApplyTempl->bUndo = true;
 bCallBase = false;
 if( pApplyTempl->aColl.pFrmFmt )
 aStyleName = pApplyTempl->aColl.pFrmFmt->GetName();
@@ -4675,7 +4675,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
false,

pApplyTempl->aColl.pNumRule->GetDefaultListId() );
 bCallBase = false;
-pApplyTempl->bUndo = sal_True;
+pApplyTempl->bUndo = true;
 if( pApplyTempl->aColl.pNumRule )
 aStyleName = 
pApplyTempl->aColl.pNumRule->GetName();
 }
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 70c0f08..71e1a17 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -133,13 +133,13 @@ struct SwApplyTemplate
 int eType;
 sal_uInt16 nColor;
 SwFormatClipboard* pFormatClipboard;
-sal_Bool bUndo;
+bool bUndo;
 
 SwApplyTemplate() :
 eType(0),
 nColor(0),
 pFormatClipboard(0),
-bUndo(sal_False)
+bUndo(false)
 {
 aColl.pTxtColl = 0;
 }
@@ -166,9 +166,9 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
 static sal_uInt16   nMoveType; // for buttons below the scrollbar 
(viewmdi)
 static sal_Int32nActMark; // current jump mark for unknown mark
 
-static sal_Bool bExtra;
+static bool bExtra;
 static sal_Bool bFound;
-static sal_Bool bJustOpened;
+static bool bJustOpened;
 
 static SearchAttrItemList* pSrchList;
 static SearchAttrItemList* pReplList;
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 5702bd3..165fdb2 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -761,11 +761,11 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
 if(rName.Len() > 0)
 {
 SvTreeListEntry* pEntry = rTLB.First();
-sal_Bool bFound = sal_False;
+bool bFound = false;
 whil

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

2013-04-19 Thread Tor Lillqvist
 sw/source/core/view/viewsh.cxx |   22 +-
 1 file changed, 5 insertions(+), 17 deletions(-)

New commits:
commit 8a5993aeea148ae5d84b4ab8f5116075d9456a5d
Author: Tor Lillqvist 
Date:   Fri Apr 19 23:29:31 2013 +0300

While at it, disable "smooth scroll" for Android and iOS, too

The display updating happens in such a roundabout fashion that
attempting smooth scrolling here can't have any useful effect.

Change-Id: Iac085ea2ed6bad7a644e889f40fef1e329a041c9

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 5257693..da4ab58 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1211,7 +1211,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long 
lYDiff, const Rectangle *pRe
 lMult = 12;
 }
 
-#ifndef MACOSX
+#if !defined(MACOSX) && !defined(ANDROID) && !defined(IOS)
 // #i98766# - disable smooth scrolling for Mac
 
 // #i75172# isolated static conditions
commit e03dc2b84f820814d5da0eb0a5629d252dac75ca
Author: Tor Lillqvist 
Date:   Fri Apr 19 23:10:49 2013 +0300

Bin three useless variables and simplify

Change-Id: I9e015028ad7a3e0bbac4368a636fad52f0823383

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 3ddb9cb..5257693 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1211,28 +1211,15 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long 
lYDiff, const Rectangle *pRe
 lMult = 12;
 }
 
+#ifndef MACOSX
+// #i98766# - disable smooth scrolling for Mac
+
 // #i75172# isolated static conditions
 const bool bOnlyYScroll(!lXDiff && Abs(lYDiff) != 0 && Abs(lYDiff) < lMax);
 const bool 
bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel(WINDOW_GETCLIPREGION_NOCHILDREN|WINDOW_GETCLIPREGION_NULL).IsNull());
-// --> OD 2009-08-12 #i98766# - disable smooth scrolling for Mac port builds
-#ifdef MACOSX
-const bool bSmoothScrollAllowed(false);
-(void) bOnlyYScroll;
-(void) bAllowedWithChildWindows;
-#else
 const bool bSmoothScrollAllowed(bOnlyYScroll && mbEnableSmooth && 
GetViewOptions()->IsSmoothScroll() &&  bAllowedWithChildWindows);
-#endif
-// <-
-const bool bIAmCursorShell(ISA(SwCrsrShell));
-(void) bIAmCursorShell;
 
-// #i75172# with selection on overlay, smooth scroll should be allowed 
with it
-const bool bAllowedForSelection(true || (bIAmCursorShell && 
!((SwCrsrShell*)this)->HasSelection()));
-
-// #i75172# with cursors on overlay, smooth scroll should be allowed with 
it
-const bool bAllowedForMultipleCursors(true || (bIAmCursorShell && 
((SwCrsrShell*)this)->GetCrsrCnt() < 2));
-
-if(bSmoothScrollAllowed  && bAllowedForSelection && 
bAllowedForMultipleCursors)
+if(bSmoothScrollAllowed)
 {
 Imp()->bStopSmooth = sal_False;
 
@@ -1426,6 +1413,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long 
lYDiff, const Rectangle *pRe
 }
 delete pVout;
 }
+#endif
 
 maVisArea.Pos().X() -= lXDiff;
 maVisArea.Pos().Y() -= lYDiff;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-12 Thread Matteo Casalin
 sw/source/ui/uiview/viewport.cxx |   30 +-
 1 file changed, 17 insertions(+), 13 deletions(-)

New commits:
commit 0e540d7e393b05b3813206ed60be2c51a8d80aa2
Author: Matteo Casalin 
Date:   Sun May 12 17:37:22 2013 +0200

Fix indentation

Change-Id: I56f4352ca1703950a2eb37eda1dbe0c1ab5a0b1c

diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 0e87e45..e9f5d1a 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1286,16 +1286,15 @@ sal_Bool SwView::HandleWheelCommands( const 
CommandEvent& rCEvt )
 }
 
 if ((COMMAND_WHEEL_SCROLL==pWData->GetMode()) && 
(((sal_uLong)0x) == pWData->GetScrollLines()))
-{
-if (pWData->GetDelta()<0)
-PhyPageDown();
-else
-PhyPageUp();
-bOk = sal_True;
-}
+{
+if (pWData->GetDelta()<0)
+PhyPageDown();
+else
+PhyPageUp();
+bOk = sal_True;
+}
 else
-bOk = m_pEditWin->HandleScrollCommand( rCEvt,
-m_pHScrollbar, m_pVScrollbar);
+bOk = m_pEditWin->HandleScrollCommand(rCEvt, m_pHScrollbar, 
m_pVScrollbar);
 
 // Restore default state for case when scroll command comes from 
dragging scrollbar handle
 m_bWheelScrollInProgress=false;
commit 5141201fba2d080841b81e02be92f4b47aae2684
Author: Matteo Casalin 
Date:   Sun May 12 16:52:54 2013 +0200

Return early in case of NULL pointer

Change-Id: I1c31608b960f750ef777d214ac482c4f52b44aff

diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index a273495..0e87e45 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1253,9 +1253,14 @@ void SwView::Move()
 
 sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
 {
-sal_Bool bOk = sal_False;
 const CommandWheelData* pWData = rCEvt.GetWheelData();
-if( pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode() )
+if (!pWData)
+{
+return sal_False;
+}
+
+sal_Bool bOk = sal_False;
+if( COMMAND_WHEEL_ZOOM == pWData->GetMode() )
 {
 long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
 if( 0L > pWData->GetDelta() )
@@ -1266,7 +1271,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& 
rCEvt )
 SetZoom( SVX_ZOOM_PERCENT, nFact );
 bOk = sal_True;
 }
-else if( pWData && COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode() )
+else if( COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode() )
 {
 int newZoom = 100 * (m_pWrtShell->GetViewOptions()->GetZoom() / 100.0) 
* (pWData->GetDelta() / 100.0);
 SetZoom( SVX_ZOOM_PERCENT, std::max( 20, std::min( 600, newZoom ) ) );
@@ -1280,7 +1285,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& 
rCEvt )
 m_bWheelScrollInProgress=true;
 }
 
-if (pWData && (COMMAND_WHEEL_SCROLL==pWData->GetMode()) && 
(((sal_uLong)0x) == pWData->GetScrollLines()))
+if ((COMMAND_WHEEL_SCROLL==pWData->GetMode()) && 
(((sal_uLong)0x) == pWData->GetScrollLines()))
 {
 if (pWData->GetDelta()<0)
 PhyPageDown();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-15 Thread Xisco Fauli
 sw/source/filter/ww8/ww8par6.cxx |   31 +++
 1 file changed, 31 insertions(+)

New commits:
commit bc2fe616febbaccb3cda16f66101d393e91232cd
Author: Xisco Fauli 
Date:   Thu May 16 01:38:17 2013 +0200

Wae: unused variable

Change-Id: I1025bb9766d6d6aad2d60467a72a15d3a3af97d4

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index d852358..0d9a638 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3952,7 +3952,6 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
 {
 if (!lcl_HasExplicitLeft(pPlcxMan, bVer67))
 {
-int tmp = pNumFmt->GetIndentAt();
 aLR.SetTxtLeft(pNumFmt->GetIndentAt());
 
 // If have not explicit left, set number format 
list tab position is doc default tab
commit b858429f2495fceb820de20815318cff8882ed78
Author: Lei De Bin 
Date:   Wed Aug 29 04:44:52 2012 +

Related:#119576# fix indent and spacing between bullets and text

they are inconsistent with MS word

Reported by: Yan Ji
Patch by: Lei De Bin
Review by: Chen Zuo Jun
Conflicts:
sw/source/filter/ww8/ww8par6.cxx

Change-Id: I48a6761a8e8fb1c052aa4f2a261aefb850d6c112

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 78733af..d852358 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3822,6 +3822,18 @@ void SwWW8ImplReader::Read_NoLineNumb(sal_uInt16 , const 
sal_uInt8* pData, short
 NewAttr( aLN );
 }
 
+bool lcl_HasExplicitLeft(const WW8PLCFMan *pPlcxMan, bool bVer67)
+{
+WW8PLCFx_Cp_FKP *pPap = pPlcxMan ? pPlcxMan->GetPapPLCF() : 0;
+if (pPap)
+{
+if (bVer67)
+return pPap->HasSprm(17);
+else
+return (pPap->HasSprm(0x840F) || pPap->HasSprm(0x845E));
+}
+return false;
+}
 // Sprm 16, 17
 void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short 
nLen )
 {
@@ -3931,6 +3943,26 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
 }
 
 aLR.SetTxtFirstLineOfst(nPara);
+
+if (!pAktColl)
+{
+if (const SwTxtNode* pNode = pPaM->GetNode()->GetTxtNode())
+{
+if ( const SwNumFmt *pNumFmt = 
GetNumFmtFromTxtNode(*pNode) )
+{
+if (!lcl_HasExplicitLeft(pPlcxMan, bVer67))
+{
+int tmp = pNumFmt->GetIndentAt();
+aLR.SetTxtLeft(pNumFmt->GetIndentAt());
+
+// If have not explicit left, set number format 
list tab position is doc default tab
+const SvxTabStopItem *pDefaultStopItem = (const 
SvxTabStopItem *)rDoc.GetAttrPool().GetPoolDefaultItem(RES_PARATR_TABSTOP);
+if ( pDefaultStopItem &&  
pDefaultStopItem->Count() > 0 )
+((SwNumFmt*)(pNumFmt))->SetListtabPos( 
((SvxTabStop&)(*pDefaultStopItem)[0]).GetTabPos() );
+}
+}
+}
+}
 if (pAktColl && nAktColl < vColl.size())
 {
 vColl[nAktColl].bListReleventIndentSet = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-26 Thread Caolán McNamara
 sw/source/core/tox/tox.cxx |   17 ++-
 unusedcode.easy|   66 -
 2 files changed, 74 insertions(+), 9 deletions(-)

New commits:
commit 3270de71b09ddaa72fadd70bf592c3ca7995513f
Author: Caolán McNamara 
Date:   Sat Apr 26 10:20:00 2014 +0100

callcatcher: update unused code

Change-Id: I86713d8f5516fafbd7e713e4fa85f4d7f02cb9ec

diff --git a/unusedcode.easy b/unusedcode.easy
index 3de349d..f75e3b1 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1,12 +1,18 @@
 BigInt::BigInt(unsigned int)
+CPhysicalCamera::CPhysicalCamera()
+CPhysicalCamera::GetAngleY()
 CalcUnoApiTest::CalcUnoApiTest(rtl::OUString const&)
 ConfigurationAccess::getPath(rtl::OUString const&)
+DocumentHandler::DocumentHandler(com::sun::star::uno::Reference&)
 DocxSdrExport::getFlyFrameGraphic()
 DocxSdrExport::setFlyFrameGraphic(bool)
 DocxSdrExport::setFrameBtLr(bool)
 EditEngine::IsIdleFormatterActive() const
+FPSCounter::getGPUTime()
 FillAttributes::FillAttributes()
 FillAttributes::getFillGradientAttribute() const
+Font::LoadSystemFont(std::basic_string, 
std::allocator >, int)
+Font::deleteFont()
 GDriveDocument::GDriveDocument(GDriveSession*)
 GDriveFolder::GDriveFolder(GDriveSession*)
 GDriveProperty::GDriveProperty()
@@ -14,11 +20,13 @@ GDriveSession::GDriveSession()
 Json::Json(std::map, 
std::allocator >, Json, std::less, std::allocator > >, 
std::allocator, 
std::allocator > const, Json> > > const&)
 Json::Json(std::map, 
std::allocator >, boost::shared_ptr, 
std::less, std::allocator 
> >, std::allocator, 
std::allocator > const, boost::shared_ptr > > > const&)
 Json::swap(Json&)
+LWPFilterReader::LWPFilterReader()
 MenuBar::AddMenuBarButton(Image const&, Link const&, rtl::OUString const&, 
unsigned short)
 MenuBar::GetMenuBarButtonRectPixel(unsigned short)
 MenuBar::RemoveMenuBarButton(unsigned short)
 MenuBar::SetMenuBarButtonHighlightHdl(unsigned short, Link const&)
 OpenGLContext::getOpenGLWindow()
+OutDevState::~OutDevState()
 OutputDevice::GetCanvas() const
 OutputDevice::HasAlpha()
 OutputDevice::LogicToLogic(basegfx::B2DPolyPolygon const&, MapMode const&, 
MapMode const&)
@@ -26,12 +34,18 @@ OutputDevice::LogicToPixel(Region const&, MapMode const&) 
const
 OutputDevice::LogicToPixel(basegfx::B2DPolygon const&) const
 OutputDevice::LogicToPixel(basegfx::B2DPolygon const&, MapMode const&) const
 OutputDevice::PixelToLogic(Region const&, MapMode const&) const
+RenderScene::loadScene(std::basic_string, 
std::allocator > const&, std::basic_string, 
std::allocator > const&)
+RenderScene::renderMoveCamera(double, double, double, double)
+RenderScene::renderRotateCamera(double, double, double, double)
 SalGraphics::drawTransformedBitmap(basegfx::B2DPoint const&, basegfx::B2DPoint 
const&, basegfx::B2DPoint const&, SalBitmap const&, SalBitmap const*)
 ScBitMaskCompressedArray::GetFirstForCondition(int, int, 
unsigned char const&, unsigned char const&) const
 ScDocument::CreateFormatTable() const
 ScDocument::GetRowFlagsArray(short) const
 ScExtIButton::GetSelected() const
+ScFormulaCell::SwapWithinGroup(ScFormulaCell*)
 ScFormulaCellGroup::scheduleCompilation()
+ScTable::GetCellTextAttr(short, int) const
+ScTable::TransferCellValuesFrom(short, int, sc::CellValues&)
 ScVbaFormat::getAddIndent()
 ScVbaFormat::setAddIndent(com::sun::star::uno::Any 
const&)
 SdrItemBrowser::ForceParent()
@@ -44,6 +58,12 @@ SdrTextObj::NbcSetMaxTextFrameWidth(long)
 SfxAppMenuControl_Impl::RegisterControl(unsigned short, SfxModule*)
 SfxInt64Item::SetValue(long)
 SfxVisibilityItem::GetValueCount() const
+ShaderProgram::createProgram(std::basic_string, 
std::allocator > const&, std::basic_string, 
std::allocator > const&)
+ShaderProgram::setUniform(unsigned int, char const*, float)
+ShaderProgram::setUniform(unsigned int, char const*, glm::detail::tvec2)
+ShaderProgram::setUniform(unsigned int, char const*, glm::detail::tvec3)
+ShaderProgram::setUniform(unsigned int, char const*, glm::detail::tvec4)
+ShaderProgram::setUniform(unsigned int, char const*, int*)
 StyleSettings::SetActiveColor2(Color const&)
 StyleSettings::SetCursorSize(long)
 StyleSettings::SetDeactiveColor2(Color const&)
@@ -65,6 +85,7 @@ SwAccessibleMap::FireSectionChangeEvent(unsigned short, 
unsigned short)
 SwExtraRedlineTbl::GetPos(SwExtraRedline const*) const
 SwExtraRedlineTbl::Remove(unsigned short)
 TextDoc::IsValidPaM(TextPaM const&)
+Texture::greateEmptyTexture(int, int, unsigned int)
 
UnoApiTest::closeDocument(com::sun::star::uno::Reference)
 VCLXGraphics::getFillColor()
 VCLXGraphics::getFont()
@@ -184,7 +205,10 @@ apitest::XText::testInsertRemoveTextContent()
 apitest::XTextContent::testAttach()
 apitest::XTextContent::testGetAnchor()
 apitest::XTextField::testGetPresentation()
+basegfx::tools::containsOnlyHorizontalAndVerticalEdges(basegfx::B2DPolyPolygon 
const&)
 canvas::createSurfaceProxyManager(boost::shared_ptr 
const&)
+chart::ChartTypeUnoDlg::Create(com::sun::star::uno::Reference
 cons

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

2014-02-18 Thread Stephan Bergmann
Let me shamelessly misuse this opportunity to campaign for a likely 
little-known feature of the rtl string starts/endsWith family of 
functions that can take an additional "rest" out parameter that gets 
assigned the remainder of the input iff the input matches.


That is, the code from the two commits below could boil down to 
something like


  OUString aColorStr(aValue);
  if (!aColorStr.startsWithIgnoreAsciiCase("rgb(", &aColorStr)
  || !aColorStr.endsWith(")", &aColorStr)
  || aColorStr.isEmpty())
  {
  break;
  }

(Is this feature too subtle?  Likely; but I didn't find a cooler way to 
add it.)


Stephan


On 02/17/2014 09:08 PM, Jan Holesovsky wrote:

  sw/source/filter/html/parcss1.cxx |   12 ++--
  1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3ecdc23d164d8e8632375247604cddf04f1e4df4
Author: Jan Holesovsky 
Date:   Mon Feb 17 21:00:03 2014 +0100

 Let's not parse nonsensical data.

 Change-Id: Icf956c3824286e8244cf5809be88568de0d6a068

diff --git a/sw/source/filter/html/parcss1.cxx 
b/sw/source/filter/html/parcss1.cxx
index 8489355..692474b 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1273,11 +1273,11 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
  {
  sal_uInt8 aColors[3] = { 0, 0, 0 };

-OSL_ENSURE( aValue.startsWithIgnoreAsciiCase( "rgb" ) &&
-aValue.getLength() > 5 &&
-'(' == aValue[3] &&
-')' == aValue[aValue.getLength()-1],
-"keine gueltiges RGB(...)" );
+if (!aValue.startsWithIgnoreAsciiCase( "rgb" ) || aValue.getLength() 
< 6 ||
+aValue[3] != '(' || aValue[aValue.getLength()-1] != ')')
+{
+break;
+}

  OUString aColorStr(aValue.copy(4, aValue.getLength() - 5));

commit 2afb605601ec0b29e177dd38e4f16bfe06590882
Author: Jan Holesovsky 
Date:   Mon Feb 17 20:49:24 2014 +0100

 Fix crash in css rgb color handling.

 Crashing since 2000 (or earlier).

 Change-Id: I9f91d56f380be2421370b0acbee351461e1f0973

diff --git a/sw/source/filter/html/parcss1.cxx 
b/sw/source/filter/html/parcss1.cxx
index 3dfbaea..8489355 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1279,7 +1279,7 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
  ')' == aValue[aValue.getLength()-1],
  "keine gueltiges RGB(...)" );

-OUString aColorStr( aValue.copy( 4, aValue.getLength()-1 ) );
+OUString aColorStr(aValue.copy(4, aValue.getLength() - 5));

  sal_Int32 nPos = 0;
  sal_uInt16 nCol = 0;



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-04-12 Thread Lei De Bin
 sw/source/filter/ww8/ww8atr.cxx |8 
 vcl/inc/vcl/layout.hxx  |   23 ++-
 2 files changed, 22 insertions(+), 9 deletions(-)

New commits:
commit 1799937b9ec2584c6e6c783ede5f22d72a1f44f9
Author: Lei De Bin 
Date:   Wed Jul 4 05:35:24 2012 +

Resolves: #i119632# Macro button lost if save template to .doc file

Add export MACROBUTTON field codes in AttributeOutputBase::TextField

Found by: yan ji
Patch by: Lei De Bin
Review by: Chen Zuo Jun(cherry picked from commit 
b51d354f043d19c1a8f22e1cfff6d0b43eb62b5e)

Conflicts:
sw/source/filter/ww8/ww8atr.cxx

Change-Id: I419ce091bb676aecfe8b53660549da40eec6057f

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index b212337..2f93faf 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2948,6 +2948,14 @@ void AttributeOutputBase::TextField( const SwFmtFld& 
rField )
 case RES_JUMPEDITFLD:
 bWriteExpand = PlaceholderField( pFld );
 break;
+case RES_MACROFLD:
+sStr.AssignAscii(" MACROBUTTON");
+sStr += pFld->GetPar1();
+sStr.SearchAndReplaceAscii("StarOffice.Standard.Modul1.", String(' '));
+sStr += String(' ');
+sStr += lcl_GetExpandedField(*pFld);
+GetExport().OutputField( pFld, ww::eMACROBUTTON, sStr );
+break;
 default:
 bWriteExpand = true;
 break;
commit f1bdd56b4f983282619a4c1fdc4222f25215ca46
Author: Caolán McNamara 
Date:   Fri Apr 12 14:42:24 2013 +0100

document VclContainer a bit

Change-Id: Ib00a0ab1c2e382547041137c11f8955140b8113d

diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx
index cd06ae6..c6b6a12 100644
--- a/vcl/inc/vcl/layout.hxx
+++ b/vcl/inc/vcl/layout.hxx
@@ -21,15 +21,6 @@ class VCL_DLLPUBLIC VclContainer : public Window
 {
 public:
 VclContainer(Window *pParent, WinBits nStyle = WB_HIDE);
-virtual Size GetOptimalSize() const;
-virtual void SetPosSizePixel(const Point& rNewPos, const Size& rNewSize);
-virtual void SetPosPixel(const Point& rAllocPos);
-virtual void SetSizePixel(const Size& rAllocation);
-
-void markLayoutDirty()
-{
-m_bLayoutDirty = true;
-}
 
 //These take into account the external margins of the rWindow widget
 //while GetOptimalSize/get_preferred_size and SetPosSizePixel are
@@ -41,10 +32,24 @@ public:
 //the rWindows alignment desires within that allocation
 static void setLayoutAllocation(Window &rWindow, const Point &rPos, const 
Size &rSize);
 
+void markLayoutDirty()
+{
+m_bLayoutDirty = true;
+}
 protected:
+//these are the two that need to be implemented by
+//containers, figure out how much space you want...
 virtual Size calculateRequisition() const = 0;
+//..and decide what to do when set to this size
 virtual void setAllocation(const Size &rAllocation) = 0;
+
 virtual sal_uInt16 getDefaultAccessibleRole() const;
+public:
+//you don't want to override these
+virtual Size GetOptimalSize() const;
+virtual void SetPosSizePixel(const Point& rNewPos, const Size& rNewSize);
+virtual void SetPosPixel(const Point& rAllocPos);
+virtual void SetSizePixel(const Size& rAllocation);
 private:
 bool m_bLayoutDirty;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-12 Thread Miklos Vajna
 sw/source/filter/ww8/rtfattributeoutput.cxx |  124 
 sw/source/filter/ww8/rtfattributeoutput.hxx |5 +
 writerfilter/source/rtftok/rtfsdrimport.cxx |   22 
 3 files changed, 102 insertions(+), 49 deletions(-)

New commits:
commit d53dd70b15f0e3f7c8a05a93f8fcd70e1147c1f7
Author: Miklos Vajna 
Date:   Fri Apr 12 15:09:12 2013 +0200

sw: rework RTF export of text frames

Export these as new-style frames. Not counting future possibilities,
this commit finally fixes the following problems:

- borders: spacing to contents wasn't exported at all
- wrap: top/bottom and left/right spacing exported even in case they do
  not equal

Change-Id: I058e00e677e20bc9501b8de320f941f256e8b6f1

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 5d95a56..bc13224 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1497,18 +1497,35 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const 
sw::Frame& rFrame, const Poi
 switch ( rFrame.GetWriterType() )
 {
 case sw::Frame::eTxtBox:
+{
 OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty");
 m_rExport.mpParentFrame = &rFrame;
+
+m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_SHP;
+m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE 
OOO_STRING_SVTOOLS_RTF_SHPINST;
+
+// Shape properties.
+m_aFlyProperties.push_back(std::make_pair("shapeType", OString::number(ESCHER_ShpInst_TextBox)));
+
 m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = true;
 m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
 m_rExport.Strm() << m_aRunText.makeStringAndClear().getStr();
 m_rExport.Strm() << m_aStyles.makeStringAndClear().getStr();
 m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false;
-m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE;
-m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
-m_rExport.Strm() << m_aRunText.makeStringAndClear().getStr();
-m_rExport.Strm() << m_aStyles.makeStringAndClear().getStr();
-m_rExport.Strm() << '}';
+m_pFmtFrmSize = 0;
+
+for (size_t i = 0; i < m_aFlyProperties.size(); ++i)
+{
+m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_SP "{";
+m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_SN " ";
+m_rExport.Strm() << m_aFlyProperties[i].first.getStr();
+m_rExport.Strm() << "}{" OOO_STRING_SVTOOLS_RTF_SV " ";
+m_rExport.Strm() << m_aFlyProperties[i].second.getStr();
+m_rExport.Strm() << "}}";
+}
+m_aFlyProperties.clear();
+
+m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_SHPTXT;
 
 {
 /*
@@ -1542,7 +1559,13 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const 
sw::Frame& rFrame, const Poi
 }
 
 m_rExport.mpParentFrame = NULL;
+
+m_rExport.Strm() << '}'; // shptxt
+m_rExport.Strm() << '}'; // shpinst
+m_rExport.Strm() << '}'; // shp
+
 m_rExport.Strm() << RtfExport::sNewLine;
+}
 break;
 case sw::Frame::eGraphic:
 if (!rFrame.IsInline())
@@ -2629,20 +2652,7 @@ void RtfAttributeOutput::FormatFrameSize( const 
SwFmtFrmSize& rSize )
 
 if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax )
 {
-if( rSize.GetWidth() )
-{
-m_aRunText->append(OOO_STRING_SVTOOLS_RTF_ABSW);
-m_aRunText->append((sal_Int32)rSize.GetWidth());
-}
-
-if( rSize.GetHeight() )
-{
-long nH = rSize.GetHeight();
-if( ATT_FIX_SIZE == rSize.GetHeightSizeType() )
-nH = -nH;
-m_aRunText->append(OOO_STRING_SVTOOLS_RTF_ABSH);
-m_aRunText->append((sal_Int32)nH);
-}
+m_pFmtFrmSize = &rSize;
 }
 else if (m_rExport.bOutPageDescs)
 {
@@ -2696,10 +2706,11 @@ void RtfAttributeOutput::FormatLRSpace( const 
SvxLRSpaceItem& rLRSpace )
 m_aStyles.append( (sal_Int32) rLRSpace.GetTxtFirstLineOfst() );
 }
 }
-else if (rLRSpace.GetLeft() == rLRSpace.GetRight() && 
m_rExport.bRTFFlySyntax)
+else if (m_rExport.bRTFFlySyntax)
 {
-m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTX;
-m_rExport.OutLong( rLRSpace.GetLeft() );
+// Wrap: top and bottom spacing, convert from twips to EMUs.
+m_aFlyProperties.push_back(std::make_pair("dxWrapDistLeft", OString::number(rLRSpace.GetLeft() * 635)));
+m_aFlyProperties.push_back(std::make_pair("dxWrapDistRight", OString::number(rLRSpace.GetRight() * 635)));
 }
 }
 
@@ -2752,10 +2763,11

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

2013-07-22 Thread Cédric Bosdonnat
 sw/source/core/tox/tox.cxx|8 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |  102 +-
 2 files changed, 69 insertions(+), 41 deletions(-)

New commits:
commit fb7b24dc5affb4f29f61a8716c97370951ccba80
Author: Cédric Bosdonnat 
Date:   Thu Jul 18 16:38:39 2013 +0200

n#825976: Table of Illustration has hyperlinks by default like TOC

...and that fixes the formatting of hyperlinks in docx Tableoof
Illustrations.

(cherry picked from commit c1fac43432891bf9f396ff1ec7a1c2ed042bce54)
(cherry picked from commit 49d077b80c15ec9d069435da08bbfe38cdd57c5a)

Change-Id: I990f31a8c9d0d56f58b7b87e368010576d8c8c0d

diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 677d84f..8b98989 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -310,11 +310,15 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
 }
 
 SwFormTokens aTokens;
-if (TOX_CONTENT == eType)
+if (TOX_CONTENT == eType || TOX_ILLUSTRATIONS == eType )
 {
 SwFormToken aLinkStt (TOKEN_LINK_START);
 aLinkStt.sCharStyleName = String(SW_RES(STR_POOLCHR_TOXJUMP));
 aTokens.push_back(aLinkStt);
+}
+
+if (TOX_CONTENT == eType)
+{
 aTokens.push_back(SwFormToken(TOKEN_ENTRY_NO));
 aTokens.push_back(SwFormToken(TOKEN_ENTRY_TEXT));
 }
@@ -334,7 +338,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
 aTokens.push_back(SwFormToken(TOKEN_PAGE_NUMS));
 }
 
-if (TOX_CONTENT == eType)
+if (TOX_CONTENT == eType || TOX_ILLUSTRATIONS == eType)
 aTokens.push_back(SwFormToken(TOKEN_LINK_END));
 
 SetTemplate( 0, SW_RESSTR( nPoolId++ ));
commit f494d9dfd1c0c40eae7aa69a86c3aa4c45971a29
Author: Cédric Bosdonnat 
Date:   Thu Jul 18 15:04:00 2013 +0200

n#825976: handle TOC \h field for illustrations tables in writerfilter

Change-Id: I9ebc91d5f0e706dc1e316e0aa8494af7aec4da4e
(cherry picked from commit 43f7bc96c0117a77610bfa5e1edfa870123f56f1)

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index fb7b8fc..7086c75 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2573,6 +2573,53 @@ void DomainMapper_Impl::handleAuthor
 #undef SET_DATE
 }
 
+uno::Sequence< beans::PropertyValues > lcl_createTOXLevelHyperlinks( bool 
bHyperlinks, OUString sChapterNoSeparator,
+   uno::Sequence< beans::PropertyValues 
>aLevel,
+   PropertyNameSupplier& rPropNameSupplier )
+{
+//create a copy of the level and add two new entries - hyperlink start and 
end
+bool bChapterNoSeparator  = !sChapterNoSeparator.isEmpty();
+sal_Int32 nAdd = (bHyperlinks && bChapterNoSeparator) ? 4 : 2;
+uno::Sequence< beans::PropertyValues > aNewLevel( aLevel.getLength() + 
nAdd);
+beans::PropertyValues* pNewLevel = aNewLevel.getArray();
+if( bHyperlinks )
+{
+beans::PropertyValues aHyperlink(1);
+aHyperlink[0].Name = rPropNameSupplier.GetName( PROP_TOKEN_TYPE );
+aHyperlink[0].Value <<= rPropNameSupplier.GetName( 
PROP_TOKEN_HYPERLINK_START );
+pNewLevel[0] = aHyperlink;
+aHyperlink[0].Value <<= rPropNameSupplier.GetName( 
PROP_TOKEN_HYPERLINK_END );
+pNewLevel[aNewLevel.getLength() -1] = aHyperlink;
+}
+if( bChapterNoSeparator )
+{
+beans::PropertyValues aChapterNo(2);
+aChapterNo[0].Name = rPropNameSupplier.GetName( PROP_TOKEN_TYPE );
+aChapterNo[0].Value <<= rPropNameSupplier.GetName( 
PROP_TOKEN_CHAPTER_INFO );
+aChapterNo[1].Name = rPropNameSupplier.GetName( PROP_CHAPTER_FORMAT );
+//todo: is ChapterFormat::Number correct?
+aChapterNo[1].Value <<= (sal_Int16)text::ChapterFormat::NUMBER;
+pNewLevel[aNewLevel.getLength() - (bHyperlinks ? 4 : 2) ] = aChapterNo;
+
+beans::PropertyValues aChapterSeparator(2);
+aChapterSeparator[0].Name = rPropNameSupplier.GetName( PROP_TOKEN_TYPE 
);
+aChapterSeparator[0].Value <<= rPropNameSupplier.GetName( 
PROP_TOKEN_TEXT );
+aChapterSeparator[1].Name = rPropNameSupplier.GetName( PROP_TEXT );
+aChapterSeparator[1].Value <<= sChapterNoSeparator;
+pNewLevel[aNewLevel.getLength() - (bHyperlinks ? 3 : 1)] = 
aChapterSeparator;
+}
+//copy the 'old' entries except the last (page no)
+for( sal_Int32 nToken = 0; nToken < aLevel.getLength() - 1; ++nToken)
+{
+pNewLevel[nToken + 1] = aLevel[nToken];
+}
+//copy page no entry (last or last but one depending on bHyperlinks
+sal_Int32 nPageNo = aNewLevel.getLength() - (bHyperlinks ? 2 : 3);
+pNewLevel[nPageNo] = aLevel[aLevel.getLength() - 1];
+
+return aNewLevel;
+}
+
 void DomainMapper_Impl::handleToc
 (FieldContextPtr pContext,
 PropertyNameSupplier& rPropNameSuppli

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

2013-12-02 Thread Michael Stahl
 sw/source/filter/ww8/ww8par.cxx|2 +-
 xmloff/source/text/XMLTextFrameContext.cxx |   12 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 8171e713e74e3d09e86592c28abfe05d0400c071
Author: Michael Stahl 
Date:   Mon Dec 2 23:28:20 2013 +0100

fdo#71450 fdo#71698: ODF import: fix frame name corner cases

Trying to set a name that is already in use will throw an exception (and
set a different, generated name); if there is actually no name in the
file then there's no point trying to set anything.

(regression from b69d152cfa1da868ba960345d72ba78f9f8e1b35)

Change-Id: Ie54d4a830cc23e2853a6efeb81f77dcc788192ea

diff --git a/xmloff/source/text/XMLTextFrameContext.cxx 
b/xmloff/source/text/XMLTextFrameContext.cxx
index 6795dcd..3731221 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1307,12 +1307,20 @@ void XMLTextFrameContext_Impl::SetHyperlink( const 
OUString& rHRef,
 void XMLTextFrameContext_Impl::SetName()
 {
 Reference xNamed(xPropSet, UNO_QUERY);
-if (xNamed.is())
+if (!m_sOrigName.isEmpty() && xNamed.is())
 {
 OUString const name(xNamed->getName());
 if (name != m_sOrigName)
 {
-xNamed->setName(m_sOrigName);
+try
+{
+xNamed->setName(m_sOrigName);
+}
+catch (uno::Exception const& e)
+{   // fdo#71698 document contains 2 frames with same draw:name
+SAL_INFO("xmloff.text", "SetName(): exception setting \""
+<< m_sOrigName << "\": " << e.Message);
+}
 }
 }
 }
commit 790896d9a557d34ea91d6e5926471de66503be7a
Author: Michael Stahl 
Date:   Mon Dec 2 22:20:25 2013 +0100

fdo#71749: sw: WW8: don't loop on tables in footnotes

(regression from ee1db992b98378b5e2f5e9aa8af0e36c375e582f)

Change-Id: Id10b6fb8e9e3697b10a1df605cb48d94a55ad207

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 06c1287..651800b 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2707,7 +2707,7 @@ bool SwWW8ImplReader::ProcessSpecial(bool &rbReSync, 
WW8_CP nStartCp)
 pPlcxMan->GetPap()->Restore( aSave );
 }
 }
-} while (nInTable < nCellLevel);
+} while (!bFtnEdn && (nInTable < nCellLevel));
 return bTableRowEnd;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-07-07 Thread Michael Stahl
 sw/source/core/inc/swfont.hxx   |2 +-
 sw/source/core/txtnode/fntcache.cxx |9 ++---
 sw/source/core/txtnode/fntcap.cxx   |   28 
 vcl/source/gdi/outdev3.cxx  |   10 +++---
 4 files changed, 22 insertions(+), 27 deletions(-)

New commits:
commit c06ef2b5638c815c2ed775eaabd9dac98863cef4
Author: Michael Stahl 
Date:   Sun Jul 7 12:04:25 2013 +0200

remove unused SwDoGetCapitalBreak::pExtraPos

Change-Id: I6b64d25c3bddc73ba168ed0c7b6a0f12d0042fad

diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 7e2e017..00a147d 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -317,7 +317,7 @@ public:
 
 xub_StrLen GetCapitalBreak( ViewShell* pSh,  const OutputDevice* pOut,
 const SwScriptInfo* pScript, const XubString& rTxt,
-long nTextWidth, xub_StrLen* pExtra, const xub_StrLen nIdx,
+long nTextWidth, const xub_StrLen nIdx,
 const xub_StrLen nLen );
 
 xub_StrLen GetCapitalCrsrOfst( SwDrawTextInfo& rInf )
diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index 1e608ed..8e30edd 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2427,8 +2427,11 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, 
long nTextWidth )
 }
 
 if( aSub[nActual].IsCapital() && nLn )
+{
 nTxtBreak = GetCapitalBreak( rInf.GetShell(), rInf.GetpOut(),
-rInf.GetScriptInfo(), rInf.GetText(), nTextWidth,0, rInf.GetIdx(),nLn 
);
+rInf.GetScriptInfo(), rInf.GetText(), nTextWidth, rInf.GetIdx(),
+nLn );
+}
 else
 {
 nKern = CheckKerning();
diff --git a/sw/source/core/txtnode/fntcap.cxx 
b/sw/source/core/txtnode/fntcap.cxx
index 9735b2c..5a82414 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -181,13 +181,13 @@ Size SwSubFont::GetCapitalSize( SwDrawTextInfo& rInf )
 class SwDoGetCapitalBreak : public SwDoCapitals
 {
 protected:
-xub_StrLen *pExtraPos;
 long nTxtWidth;
 xub_StrLen nBreak;
 public:
-SwDoGetCapitalBreak( SwDrawTextInfo &rInfo, long nWidth, xub_StrLen 
*pExtra)
-:   SwDoCapitals ( rInfo ), pExtraPos( pExtra ), nTxtWidth( nWidth ),
-nBreak( STRING_LEN )
+SwDoGetCapitalBreak( SwDrawTextInfo &rInfo, long const nWidth)
+:   SwDoCapitals ( rInfo )
+,   nTxtWidth( nWidth )
+,   nBreak( STRING_LEN )
 { }
 virtual ~SwDoGetCapitalBreak() {}
 virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont );
@@ -211,18 +211,7 @@ void SwDoGetCapitalBreak::Do()
 OUString sText(rInf.GetText()); // only needed until 
rInf.GetText() returns OUString
 sal_Int32 nIdx2 = rInf.GetIdx(); // ditto
 sal_Int32 nLen2 = rInf.GetLen(); // ditto
-if( pExtraPos )
-{
-sal_Int32 nExtraPos = *pExtraPos; // ditto
-nBreak = GetOut().GetTextBreak( sText, nTxtWidth,
-static_cast('-'),
- nExtraPos, nIdx2, nLen2, rInf.GetKern() );
-if( nExtraPos > nEnd )
-nExtraPos = nEnd;
-*pExtraPos = (nExtraPos == -1) ? STRING_LEN : nExtraPos;
-}
-else
-nBreak = GetOut().GetTextBreak( sText, nTxtWidth,
+nBreak = GetOut().GetTextBreak( sText, nTxtWidth,
nIdx2, nLen2, rInf.GetKern() );
 
 rInf.SetText(sText); // ditto
@@ -255,8 +244,8 @@ void SwDoGetCapitalBreak::Do()
  */
 
 xub_StrLen SwFont::GetCapitalBreak( ViewShell* pSh, const OutputDevice* pOut,
-const SwScriptInfo* pScript, const XubString& rTxt, long nTextWidth,
-xub_StrLen *pExtra, const xub_StrLen nIdx, const xub_StrLen nLen )
+const SwScriptInfo* pScript, const XubString& rTxt, long const nTextWidth,
+const xub_StrLen nIdx, const xub_StrLen nLen )
 {
 // Start:
 Point aPos( 0, 0 );
@@ -272,7 +261,7 @@ xub_StrLen SwFont::GetCapitalBreak( ViewShell* pSh, const 
OutputDevice* pOut,
 aInfo.SetKanaComp( pScript ? 0 : 100 );
 aInfo.SetFont( this );
 
-SwDoGetCapitalBreak aDo( aInfo, nTextWidth, pExtra );
+SwDoGetCapitalBreak aDo(aInfo, nTextWidth);
 DoOnCapitals( aDo );
 return aDo.GetBreak();
 }
commit 6fa07d2d608646004bc45261275c4ebabb578a09
Author: Michael Stahl 
Date:   Sun Jul 7 11:58:42 2013 +0200

fdo#66478: sw: un-break hyphenation

The main problem is calling SetHyphPos with a stack pointer.
Converting STRING_LEN <-> -1 can't hurt though.

(regression from a2f6402b1fe769a430019042e14e63c9414715dc)

Change-Id: I59a4e3b16b418082de468c7d7f7f38a9b0bccd01

diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index 4b04cc7..1e608ed 

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

2013-06-17 Thread Michael Meeks
 sw/source/core/text/itrcrsr.cxx |  100 +++-
 vcl/qa/cppunit/complextext.cxx  |   11 
 2 files changed, 59 insertions(+), 52 deletions(-)

New commits:
commit 821446a0be326c0065c827ffcd4670c113c78755
Author: Michael Meeks 
Date:   Mon Jun 17 14:27:03 2013 +0100

Use hex numbers for in-line Arabic / UTF-8 string.

Change-Id: I89d5420ad16e7dbfa1f3b6472d78162dffef59c4

diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index 2519092..3f03d62 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -33,7 +33,16 @@ void VclComplexTextTest::testArabic()
 #if !defined (LINUX)
 return;
 #else // only tested on Linux so far
-OUString aOneTwoThree( "واحِدْ إثٍنين ثلاثةٌ" );
+const unsigned char pOneTwoThreeUTF8[] = {
+0xd9, 0x88, 0xd8, 0xa7, 0xd8, 0xad, 0xd9, 0x90,
+0xd8, 0xaf, 0xd9, 0x92, 0x20, 0xd8, 0xa5, 0xd8,
+0xab, 0xd9, 0x8d, 0xd9, 0x86, 0xd9, 0x8a, 0xd9,
+0x86, 0x20, 0xd8, 0xab, 0xd9, 0x84, 0xd8, 0xa7,
+0xd8, 0xab, 0xd8, 0xa9, 0xd9, 0x8c, 0x00
+};
+OUString aOneTwoThree( (sal_Char *)pOneTwoThreeUTF8,
+   SAL_N_ELEMENTS( pOneTwoThreeUTF8 ) - 1,
+   RTL_TEXTENCODING_UTF8 );
 Window* pWin = new WorkWindow( (Window *)NULL );
 CPPUNIT_ASSERT( pWin != NULL );
 
commit 3f1fecdbc784ab2c98321b7de5edfedef690c77c
Author: Rolf Hemmerling 
Date:   Mon Jun 17 14:18:54 2013 +0100

Translate German comments.

Change-Id: Ic9cd2288ac25868949b7f2de8ce517c2cd03d1e4

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 5211ca5..a162a24 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #include "hintids.hxx"
 #include "ndtxt.hxx"
 #include "frmfmt.hxx"
@@ -48,8 +47,8 @@
 // #i111284#
 #include 
 
-// Nicht reentrant !!!
-// wird in GetCharRect gesetzt und im UnitUp/Down ausgewertet.
+// Not reentrant !!!
+// is set in GetCharRect and is interpreted in UnitUp/Down.
 sal_Bool SwTxtCursor::bRightMargin = sal_False;
 
 
@@ -234,7 +233,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, 
SwTxtSizeInfo *pNewInf )
   !nLMWithNum ) )
 {
 nLeft = pFrm->Prt().Left() + pFrm->Frm().Left();
-if( nLeft >= nRight )   // z.B. bei grossen Absatzeinzuegen in 
schmalen Tabellenspalten
+if( nLeft >= nRight )   // e.g. with large paragraph indentations in 
slim table columns
 nRight = nLeft + 1; // einen goennen wir uns immer
 }
 
@@ -273,8 +272,8 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, 
SwTxtSizeInfo *pNewInf )
 case SVX_INTER_LINE_SPACE_PROP:
 {
 long nTmp = pSpace->GetPropLineSpace();
-// 50% ist das Minimum, bei 0% schalten wir auf
-// den Defaultwert 100% um ...
+// 50% is the minimumm, at 0% we switch to
+// the default value 100% ...
 if( nTmp < 50 )
 nTmp = nTmp ? 50 : 100;
 
@@ -375,15 +374,15 @@ void SwTxtMargin::DropInit()
  *SwTxtMargin::GetLineStart()
  */
 
-// Unter Beruecksichtigung des Erstzeileneinzuges und der angebenen Breite.
+// The function is interpreting / observing / evaluating / keeping / 
respecting the first line indention and the specified width.
 SwTwips SwTxtMargin::GetLineStart() const
 {
 SwTwips nRet = GetLeftMargin();
 if( GetAdjust() != SVX_ADJUST_LEFT &&
 !pCurr->GetFirstPortion()->IsMarginPortion() )
 {
-// Wenn die erste Portion ein Margin ist, dann wird das
-// Adjustment durch die Portions ausgedrueckt.
+// If the first portion is a Margin, then the
+// adjustment is expressed by the portions.
 if( GetAdjust() == SVX_ADJUST_RIGHT )
 nRet = Right() - CurrWidth();
 else if( GetAdjust() == SVX_ADJUST_CENTER )
@@ -398,7 +397,7 @@ SwTwips SwTxtMargin::GetLineStart() const
 void SwTxtCursor::CtorInitTxtCursor( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf 
)
 {
 CtorInitTxtMargin( pNewFrm, pNewInf );
-// 6096: Vorsicht, die Iteratoren sind abgeleitet!
+// 6096: Attention, the iterators are derived!
 // GetInfo().SetOut( GetInfo().GetWin() );
 }
 
@@ -406,21 +405,21 @@ void SwTxtCursor::CtorInitTxtCursor( SwTxtFrm *pNewFrm, 
SwTxtSizeInfo *pNewInf )
  *  SwTxtCursor::GetEndCharRect()
  */
 
-// 1170: Antikbug: Shift-Ende vergisst das letzte Zeichen ...
+// 1170: Ancient bug: Shift-End forgets the last character ...
 
 sal_Bool SwTxtCursor::GetEndCharRect( SwRect

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

2013-08-26 Thread Caolán McNamara
 sw/source/filter/ww8/hash_wrap.hxx   |6 -
 sw/source/filter/ww8/sortedarray.hxx |6 -
 vcl/source/control/tabctrl.cxx   |  140 ---
 3 files changed, 119 insertions(+), 33 deletions(-)

New commits:
commit 55cdf3c5f44afe47cbe9eb32cc4f6fdcb6106d8d
Author: Caolán McNamara 
Date:   Mon Aug 26 21:10:27 2013 +0100

most debug-level OUString::valueOf

Change-Id: I3e3cebe225e27a33be423c8b5fa2261b4a48e88c

diff --git a/sw/source/filter/ww8/hash_wrap.hxx 
b/sw/source/filter/ww8/hash_wrap.hxx
index 189e4b1..55231b9 100644
--- a/sw/source/filter/ww8/hash_wrap.hxx
+++ b/sw/source/filter/ww8/hash_wrap.hxx
@@ -88,11 +88,11 @@ namespace ww
 reinterpret_cast(&(*pIter));
 for (size_t i=0; i < nSize; ++i)
 {
-sError += OUString::valueOf(
+sError += OUString::number(
 static_cast(pHack[i]), 16);
-sError += OUString::valueOf(sal_Unicode(' '));
+sError += OUString(' ');
 }
-sError += OUString::valueOf(sal_Unicode('\n'));
+sError += OUString('\n');
 while (*pIter == *(pIter+1) && pIter < pBeforeEnd)
 ++pIter;
 }
diff --git a/sw/source/filter/ww8/sortedarray.hxx 
b/sw/source/filter/ww8/sortedarray.hxx
index 9a596ed..5f975a7 100644
--- a/sw/source/filter/ww8/sortedarray.hxx
+++ b/sw/source/filter/ww8/sortedarray.hxx
@@ -85,11 +85,11 @@ namespace ww
 reinterpret_cast(&(*pIter));
 for (size_t i=0; i < nSize; ++i)
 {
-sError += OUString::valueOf(
+sError += OUString::number(
 static_cast(pHack[i]), 16);
-sError += OUString::valueOf(sal_Unicode(' '));
+sError += OUString(' ');
 }
-sError += OUString::valueOf(sal_Unicode('\n'));
+sError += OUString('\n');
 while (*pIter == *(pIter+1) && pIter < pBeforeEnd)
 ++pIter;
 }
commit b224582aa3e7f0971035603515cf9c0e54ef299d
Author: Caolán McNamara 
Date:   Mon Aug 26 21:08:47 2013 +0100

Related: fdo#66435 enhance decker-wrap using Minimum raggedness algo

Change-Id: Ifb7e6558d39499892a9e94bf1f89f014bacbdbc4

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 4449181..e6e4aba 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -339,7 +339,84 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long 
nMaxWidth )
 return aSize;
 }
 
-// ---
+// Feel free to move this to some more general place for reuse
+// http://en.wikipedia.org/wiki/Word_wrap#Minimum_raggedness
+// Mostly based on Alexey Frunze's nifty example at
+// 
http://stackoverflow.com/questions/9071205/balanced-word-wrap-minimum-raggedness-in-php
+namespace MinimumRaggednessWrap
+{
+std::deque GetEndOfLineIndexes(const std::vector 
rWidthsOf, sal_Int32 nLineWidth)
+{
+++nLineWidth;
+
+size_t nWidthsCount = rWidthsOf.size();
+std::vector aCosts(nWidthsCount * nWidthsCount);
+
+// cost function c(i, j) that computes the cost of a line consisting of
+// the words Word[i] to Word[j]
+for (size_t i = 0; i < nWidthsCount; ++i)
+{
+for (size_t j = 0; j < nWidthsCount; ++j)
+{
+if (j >= i)
+{
+sal_Int32 c = nLineWidth - (j - i);
+for (size_t k = i; k <= j; ++k)
+c -= rWidthsOf[k];
+c = (c >= 0) ? c * c : SAL_MAX_INT32;
+aCosts[j * nWidthsCount + i] = c;
+}
+else
+{
+aCosts[j * nWidthsCount + i] = SAL_MAX_INT32;
+}
+}
+}
+
+std::vector aFunction(nWidthsCount);
+std::vector aWrapPoints(nWidthsCount);
+
+// f(j) in aFunction[], collect wrap points in aWrapPoints[]
+for (size_t j = 0; j < nWidthsCount; ++j)
+{
+aFunction[j] = aCosts[j * nWidthsCount];
+if (aFunction[j] == SAL_MAX_INT32)
+{
+for (size_t k = 0; k < j; ++k)
+{
+sal_Int32 s;
+if (aFunction[k] == SAL_MAX_INT32 || aCosts[j * 
nWidthsCount + k + 1] == SAL_MAX_INT32)
+s = SAL_MAX_INT32;
+else
+s = aFunction[k] + aCosts[j * nWidthsCount + k + 1];
+if (aFunction[j] > s)
+{
+aFunction

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

2013-09-07 Thread Caolán McNamara
 sw/source/ui/dbui/mmoutputpage.cxx   |5 +
 sw/uiconfig/swriter/ui/printmonitordialog.ui |2 ++
 2 files changed, 7 insertions(+)

New commits:
commit a7d61daf03f6410bc313961bd100faa4e4d33059
Author: Caolán McNamara 
Date:   Sat Sep 7 13:26:07 2013 +0100

%1 placeholder never replaced with anything

Change-Id: Icd7111ec044032fe76a19454bcf6b795229a0e56

diff --git a/sw/source/ui/dbui/mmoutputpage.cxx 
b/sw/source/ui/dbui/mmoutputpage.cxx
index 1239423..35d9881 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -170,6 +170,11 @@ SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(Window* 
pParent, const String& rFil
 aWarningImageIM.SetImage(WarningBox::GetStandardImage());
 aFileNameED.SetText(rFileName);
 aFileNameED.SetModifyHdl(LINK(this, SwSaveWarningBox_Impl, ModifyHdl));
+
+INetURLObject aTmp(rFileName);
+aWarningFI.SetText(aWarningFI.GetText().replaceAll("%1", aTmp.getName(
+INetURLObject::LAST_SEGMENT, true, 
INetURLObject::DECODE_WITH_CHARSET)));
+
 ModifyHdl( &aFileNameED );
 }
 
commit 6da7cc143666a1e381f478d97ac7c1be7f3e436a
Author: Caolán McNamara 
Date:   Sat Sep 7 13:25:50 2013 +0100

set explicit default button

Change-Id: I288c00b5eff6876ba9d790ee5ab4f0d1cbc2cd4f

diff --git a/sw/uiconfig/swriter/ui/printmonitordialog.ui 
b/sw/uiconfig/swriter/ui/printmonitordialog.ui
index 2924c3d..d6a7e0a 100644
--- a/sw/uiconfig/swriter/ui/printmonitordialog.ui
+++ b/sw/uiconfig/swriter/ui/printmonitordialog.ui
@@ -20,6 +20,8 @@
 gtk-cancel
 True
 True
+True
+True
 True
 True
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-03 Thread Caolán McNamara
 sw/source/ui/shells/txtattr.cxx |1 +
 xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx |6 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit a8526ce7ead7738ff4ad981c31ca1a4c5b51e5f6
Author: Caolán McNamara 
Date:   Thu Oct 3 13:35:30 2013 +0100

CID#1027709 this fall-through doesn't make sense

though it appears harmless given the nSlot = 0

Change-Id: Ia8e6efa8c8ae3ef9d5320ac63bb548e69ad8cce1

diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index 45f8e37..d5b8e3d 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -652,6 +652,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
 rSet.InvalidateItem(nSlot);
 nSlot = 0;
 }
+break;
 
 case SID_ATTR_PARA_LEFT_TO_RIGHT :
 case SID_ATTR_PARA_RIGHT_TO_LEFT :
commit 094f00651aacac27cffd6839bb4809664a85dabc
Author: Caolán McNamara 
Date:   Thu Oct 3 13:30:13 2013 +0100

CID#708741 uninitialized members

Change-Id: I15475d560e889b0f0fc91d96cfa6ae97e81a41b5

diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx 
b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
index 853bbc6..ee3eb88 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
@@ -55,7 +55,11 @@ namespace cssxw = com::sun::star::xml::wrapper;
 #define NODE_NOTREMOVED 1
 #define NODE_STOPED 2
 
-XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl( )
+XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl()
+: m_nCurrentPosition(0)
+, m_pStopAtNode(0)
+, m_pCurrentReservedNode(0)
+, m_nReservedNodeIndex(0)
 {
 saxHelper.startDocument();
 m_pDocument = saxHelper.getDocument();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-08 Thread Caolán McNamara
 sw/source/core/swg/SwXMLTextBlocks.cxx   |   14 ++
 vcl/unx/generic/dtrans/X11_selection.cxx |2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 766ec29ce6557a83368fa1efdea009fd8f6f85dc
Author: Caolán McNamara 
Date:   Tue Oct 8 16:26:35 2013 +0100

CID#1078847 we're writing a byte, so use a byte

Change-Id: I45fbcaae87b8ecff5fc25eca646e19849beda293

diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx 
b/vcl/unx/generic/dtrans/X11_selection.cxx
index 2cdf21d..e14baa4 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -3836,7 +3836,7 @@ void SelectionManager::shutdown() throw()
 Application::Reschedule();
 }
 // trigger poll()'s wait end by writing a dummy value
-int dummy=0;
+char dummy=0;
 dummy = write(m_EndThreadPipe[1], &dummy, 1);
 }
 osl_joinWithThread( m_aThread );
commit 731174ae31f854ddfd6ba0f8746e74b4e9da
Author: Caolán McNamara 
Date:   Tue Oct 8 16:11:11 2013 +0100

CID#1079275 uninitialized member variables

also CID#1079276

Change-Id: Ib8e5f56f6f970a4eaae334eff2f670b20b13ad2d

diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx 
b/sw/source/core/swg/SwXMLTextBlocks.cxx
index ad9645c..9366504 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -57,7 +57,11 @@ void SwXMLTextBlocks::ResetBlockMode ( )
 }
 
 SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile )
-: SwImpBlocks( rFile ), bAutocorrBlock( sal_False ), nFlags ( 0 )
+: SwImpBlocks(rFile)
+, bAutocorrBlock(false)
+, bBlock(false)
+, nFlags(0)
+, nCurBlk(0)
 {
 SwDocShell* pDocSh = new SwDocShell ( SFX_CREATE_MODE_INTERNAL );
 if( !pDocSh->DoInitNew( 0 ) )
@@ -98,9 +102,11 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile )
 }
 
 SwXMLTextBlocks::SwXMLTextBlocks( const uno::Reference < embed::XStorage >& 
rStg, const OUString& rName )
-: SwImpBlocks( rName )
-, bAutocorrBlock( sal_True )
-, nFlags ( 0 )
+: SwImpBlocks( rName )
+, bAutocorrBlock(false)
+, bBlock(false)
+, nFlags(0)
+, nCurBlk(0)
 {
 SwDocShell* pDocSh = new SwDocShell ( SFX_CREATE_MODE_INTERNAL );
 if( !pDocSh->DoInitNew( 0 ) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-02 Thread Miklos Vajna
 sw/source/core/frmedt/fefly1.cxx   |2 
 writerfilter/source/dmapper/FFData.xml |   75 -
 2 files changed, 1 insertion(+), 76 deletions(-)

New commits:
commit 418c5f7a4911bb2f1a06858556131b1bc4ad54f6
Author: Miklos Vajna 
Date:   Mon Jun 2 22:13:32 2014 +0200

coverity#735904 Unchecked dynamic_cast

Change-Id: I784fa73c69a25ccf5d750b92c6aa8815385df0a9

diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index d7300e0..a20dceb 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1920,7 +1920,7 @@ OUString SwFEShell::GetObjTitle() const
 const SwFrmFmt* pFmt = FindFrmFmt( pObj );
 if ( pFmt->Which() == RES_FLYFRMFMT )
 {
-return dynamic_cast(pFmt)->GetObjTitle();
+return static_cast(pFmt)->GetObjTitle();
 }
 return pObj->GetTitle();
 }
commit ec1ba489fa93297b18cc3a03954bf2048e04bbe0
Author: Miklos Vajna 
Date:   Mon Jun 2 22:03:43 2014 +0200

writerfilter: unused FFData.xml

Change-Id: Id30f35b8a357276c215b71e548ba46e86c51ad48

diff --git a/writerfilter/source/dmapper/FFData.xml 
b/writerfilter/source/dmapper/FFData.xml
deleted file mode 100644
index 6cfdade..000
--- a/writerfilter/source/dmapper/FFData.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-  
-
-
-
-  
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-  
-
\ No newline at end of file
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-15 Thread Matúš Kukan
 sw/source/core/inc/DocumentTimerManager.hxx   |2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7321a659713aeb08cd3d2db13e0bfa17dc3da6aa
Author: Matúš Kukan 
Date:   Tue Jul 15 19:55:37 2014 +0200

-Werror,-Wheader-guard

Change-Id: I6b13c77975d8aeef63b424e418a4a4a98ced159f

diff --git a/sw/source/core/inc/DocumentTimerManager.hxx 
b/sw/source/core/inc/DocumentTimerManager.hxx
index 6bd7fcd..5becf1b 100644
--- a/sw/source/core/inc/DocumentTimerManager.hxx
+++ b/sw/source/core/inc/DocumentTimerManager.hxx
@@ -18,7 +18,7 @@
  */
 
 #ifndef INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTTIMERMANAGER_HXX
-#define INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTTIMERMANAGER_HX
+#define INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTTIMERMANAGER_HXX
 
 #include 
 #include 
commit 6e6cbf44d806457512c142c64cf857eacfaa
Author: Matúš Kukan 
Date:   Tue Jul 15 19:52:43 2014 +0200

WaE: unused variable 'sMarker'

Change-Id: Idba194e9bafa17dcedd5d1d45c5e0b4e3db54cee

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 6645e23..9983b99 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1123,7 +1123,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr 
pPropertyMap )
 if (xCursor.is())
 xCursor->gotoEnd(false);
 PropertyMapPtr pEmpty(new PropertyMap());
-appendTextPortion("X", pEmpty);
+appendTextPortion(sMarker, pEmpty);
 }
 
 xTextRange = xTextAppend->finishParagraph( aProperties );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-06 Thread Miklos Vajna
 sw/source/filter/ww8/docxattributeoutput.cxx  |3 +
 writerfilter/source/dmapper/DomainMapper.cxx  |   59 ++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 
 writerfilter/source/dmapper/PropertyIds.cxx   |2 
 writerfilter/source/dmapper/PropertyIds.hxx   |2 
 writerfilter/source/dmapper/PropertyMap.cxx   |   53 ++-
 writerfilter/source/dmapper/PropertyMap.hxx   |1 
 7 files changed, 117 insertions(+), 5 deletions(-)

New commits:
commit 942f1ed93c4e26e883b7d1d3ee6b729ef72cec67
Author: Miklos Vajna 
Date:   Wed Aug 6 13:20:19 2014 +0200

DOCX import: handle  cell property

Change-Id: I849daf0ddee370775fda73e04739e69acbc64246

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 051b6c1..6ab6bde 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3290,6 +3290,9 @@ void DocxAttributeOutput::TableBackgrounds( 
ww8::WW8TableNodeInfoInner::Pointer_
 
 for( aGrabBagElement = aGrabBag.begin(); aGrabBagElement != 
aGrabBag.end(); ++aGrabBagElement )
 {
+if (!aGrabBagElement->second.has())
+continue;
+
 OString sValue = OUStringToOString( 
aGrabBagElement->second.get(), RTL_TEXTENCODING_UTF8 );
 if( aGrabBagElement->first == "themeFill")
 AddToAttrList( aAttrList, FSNS( XML_w, XML_themeFill ), 
sValue.getStr() );
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index c89395f..7864dd9 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2504,6 +2504,18 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, 
PropertyMapPtr rContext )
 }
 }
 break;
+case NS_ooxml::LN_CT_TcPrBase_cnfStyle:
+{
+m_pImpl->enableInteropGrabBag("cnfStyle");
+resourcemodel::resolveSprmProps(*this, rSprm);
+
+TablePropertyMapPtr pPropMap(new TablePropertyMap());
+pPropMap->Insert(PROP_CELL_CNF_STYLE, 
uno::makeAny(uno::makeAny(m_pImpl->m_aInteropGrabBag.getAsConstList())), true, 
CELL_GRAB_BAG);
+m_pImpl->getTableManager().cellProps(pPropMap);
+
+m_pImpl->disableInteropGrabBag();
+}
+break;
 case NS_ooxml::LN_CT_PPrBase_cnfStyle:
 {
 m_pImpl->enableInteropGrabBag("cnfStyle");
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index 6d236c1..c12e97a 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -397,6 +397,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) 
const
 case PROP_PARA_SDT_END_BEFORE: sName = "ParaSdtEndBefore"; break;
 case META_PROP_TABLE_LOOK: sName = "TableStyleLook"; break;
 case PROP_PARA_CNF_STYLE: sName = "ParaCnfStyle"; break;
+case PROP_CELL_CNF_STYLE: sName = "CellCnfStyle"; break;
 }
 ::std::pair aInsertIt =
 m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, 
sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx 
b/writerfilter/source/dmapper/PropertyIds.hxx
index 5814c34..0ff6ee3 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -369,6 +369,7 @@ enum PropertyIds
 ,PROP_PARA_SDT_END_BEFORE
 ,META_PROP_TABLE_LOOK
 ,PROP_PARA_CNF_STYLE
+,PROP_CELL_CNF_STYLE
 };
 struct PropertyNameSupplier_Impl;
 class PropertyNameSupplier
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index ab1d48d..62c5ba6 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -66,30 +66,50 @@ uno::Sequence< beans::PropertyValue > 
PropertyMap::GetPropertyValues(bool bCharG
 {
 size_t nCharGrabBag = 0;
 size_t nParaGrabBag = 0;
+size_t nCellGrabBag = 0;
+size_t nCellGrabBagSaved = 0; // How many entries do we save from the 
returned sequence.
 for (MapIterator i = m_vMap.begin(); i != m_vMap.end(); ++i)
 {
 if ( i->second.getGrabBagType() == CHAR_GRAB_BAG )
 nCharGrabBag++;
 else if ( i->second.getGrabBagType() == PARA_GRAB_BAG )
 nParaGrabBag++;
+else if ( i->second.getGrabBagType() == CELL_GRAB_BAG )
+{
+nCellGrabBag++;
+nCellGrabBagSaved++;
+}
+else if ( i->first == PROP_CELL_INTEROP_GRAB_BAG)
+{
+uno::Sequence aSeq;
+i->second.getValue() >>= aSeq;
+nCellGrabBag += aSeq.getLength();
+nCellGrabBagSaved++;
+}
 }
 
 // In case there ar

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

2014-06-19 Thread Stephan Bergmann
 sw/source/filter/ascii/ascatr.cxx |8 ++--
 xmloff/source/text/txtparae.cxx   |9 +
 2 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit ef3e481be37a387f6549a561daee890da6712cf5
Author: Stephan Bergmann 
Date:   Thu Jun 19 17:54:27 2014 +0200

Do not call SwASC_AttrIter::NextPos when nAktSwPos is already SAL_MAX_INT32

...and calculating nAktSwPos + 1 would overflow.  Reported by
CppunitTest_sw_odfexport under -sanitize=undefined.

Change-Id: I78bd540851192a768400ce348b42228f9cb10b72

diff --git a/sw/source/filter/ascii/ascatr.cxx 
b/sw/source/filter/ascii/ascatr.cxx
index 1fb879f..04a5d89 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -197,7 +197,7 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& 
rNode )
 const bool bExportSoftHyphens = RTL_TEXTENCODING_UCS2 == 
rWrt.GetAsciiOptions().GetCharSet() ||
 RTL_TEXTENCODING_UTF8 == 
rWrt.GetAsciiOptions().GetCharSet();
 
-do {
+for (;;) {
 const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd);
 
 if( !aAttrIter.OutAttr( nStrPos ))
@@ -209,8 +209,12 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, 
SwCntntNode& rNode )
 rWrt.Strm().WriteUnicodeOrByteText( aOutStr );
 }
 nStrPos = nNextAttr;
+if (nStrPos >= nEnd)
+{
+break;
+}
 aAttrIter.NextPos();
-} while( nStrPos < nEnd );
+}
 
 if( !bLastNd ||
 ( ( !rWrt.bWriteClipboardDoc && !rWrt.bASCII_NoLastLineEnd )
commit d8e7624c9a874aee3ab782715117b118ddd0c496
Author: Stephan Bergmann 
Date:   Thu Jun 19 17:51:36 2014 +0200

Do not dereference null pointer

...and XMLTextCharStyleNamesElementExport only requires a non-null rPropSet 
arg
when its bDoSomething arg is true.

Reported by CppunitTest_sw_odfexport under -sanitize=undefined.

Change-Id: Ia45fa7db250f83d746829c7f411e78bbc50bf721

diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 7c91085..108fe8e 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2843,11 +2843,12 @@ void XMLTextParagraphExport::exportAnyTextFrame(
 else
 bIsUICharStyle = false;
 
+bool bDoSomething = bIsUICharStyle
+&& aCharStyleNamesPropInfoCache.hasProperty( *pRangePropSet );
 XMLTextCharStyleNamesElementExport aCharStylesExport(
-GetExport(), bIsUICharStyle &&
- aCharStyleNamesPropInfoCache.hasProperty(
-*pRangePropSet ), bHasAutoStyle,
-*pRangePropSet, sCharStyleNames );
+GetExport(), bDoSomething, bHasAutoStyle,
+bDoSomething ? *pRangePropSet : Reference(),
+sCharStyleNames );
 
 if( !sStyle.isEmpty() )
 GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-27 Thread Tor Lillqvist
 sw/source/filter/xml/xmltble.cxx|2 --
 vcl/source/opengl/OpenGLContext.cxx |2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 62219707ff063ce4d4679a3614a551b2854ffcfd
Author: Tor Lillqvist 
Date:   Sun Apr 27 19:26:26 2014 +0300

WaE: unused variable 'sBuffer'

Change-Id: I245998bec7981cecec27d377c44f22a71ef0330e

diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index d5d935e..d7825e5 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -546,8 +546,6 @@ void SwXMLExport::ExportTableLinesAutoStyles( const 
SwTableLines& rLines,
 
 pTableLines->push_back( pLines );
 
-OUStringBuffer sBuffer( rNamePrefix.getLength() + 8L );
-
 // pass 2: export column styles
 {
 const SwXMLTableColumns_Impl& rCols = pLines->GetColumns();
commit fb57e17251b819a2339e6a10a9a272f6125d1873
Author: Tor Lillqvist 
Date:   Sun Apr 27 18:57:50 2014 +0300

WaE: implicit conversion of literal of type 'sal_Bool' to 'bool'

Change-Id: I259f3a192097fed449bbea28a18febccfd93db04

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 4daae1c..b8c963b 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -603,7 +603,7 @@ bool OpenGLContext::initWindow()
 {
 if( !m_pChildWindow )
 {
-m_pChildWindow = new SystemChildWindow(mpWindow, 0, &winData, 
sal_False);
+m_pChildWindow = new SystemChildWindow(mpWindow, 0, &winData, 
false);
 m_pChildWindowGC.reset(m_pChildWindow);
 }
 pChildSysData = m_pChildWindow->GetSystemData();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-27 Thread Miklos Vajna
 sw/source/core/view/vprint.cxx  |2 
 writerfilter/source/rtftok/rtftokenizer.cxx |  197 ++--
 writerfilter/source/rtftok/rtftokenizer.hxx |   82 +--
 3 files changed, 143 insertions(+), 138 deletions(-)

New commits:
commit df0dea0bf055fce59beedadbc8d20a2681c96bd6
Author: Miklos Vajna 
Date:   Sun Apr 27 21:31:10 2014 +0200

writerfilter: fix indentation in rtftokenizer

Change-Id: Ia9c609eabc39c3933479eae3d5c4499f11c58528

diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index 2ddc714..a8587e7 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -20,8 +20,10 @@
 
 using namespace com::sun::star;
 
-namespace writerfilter {
-namespace rtftok {
+namespace writerfilter
+{
+namespace rtftok
+{
 
 std::vector RTFTokenizer::m_aRTFControlWords;
 bool RTFTokenizer::m_bControlWordsSorted;
@@ -30,12 +32,12 @@ bool RTFTokenizer::m_bMathControlWordsSorted;
 
 RTFTokenizer::RTFTokenizer(RTFListener& rImport, SvStream* pInStream, 
uno::Reference const& xStatusIndicator)
 : m_rImport(rImport),
-m_pInStream(pInStream),
-m_xStatusIndicator(xStatusIndicator),
-m_nGroup(0),
-m_nLineNumber(0),
-m_nLineStartPos(0),
-m_nGroupStart(0)
+  m_pInStream(pInStream),
+  m_xStatusIndicator(xStatusIndicator),
+  m_nGroup(0),
+  m_nLineNumber(0),
+  m_nLineStartPos(0),
+  m_nGroupStart(0)
 {
 if (!RTFTokenizer::m_bControlWordsSorted)
 {
@@ -62,7 +64,7 @@ SvStream& RTFTokenizer::Strm()
 
 int RTFTokenizer::resolveParse()
 {
-SAL_INFO( "writerfilter", OSL_THIS_FUNC );
+SAL_INFO("writerfilter", OSL_THIS_FUNC);
 char ch;
 int ret;
 // for hex chars
@@ -83,7 +85,7 @@ int RTFTokenizer::resolveParse()
 m_xStatusIndicator->setValue(nLastPos = nCurrentPos);
 }
 
-while ((Strm().ReadChar( ch ), !Strm().IsEof()))
+while ((Strm().ReadChar(ch), !Strm().IsEof()))
 {
 //SAL_INFO("writerfilter", OSL_THIS_FUNC << ": parsing character '" << 
ch << "'");
 
@@ -103,63 +105,63 @@ int RTFTokenizer::resolveParse()
 {
 switch (ch)
 {
-case '{':
-m_nGroupStart = Strm().Tell() - 1;
-ret = m_rImport.pushState();
-if (ret)
-return ret;
-break;
-case '}':
-ret = m_rImport.popState();
-if (ret)
-return ret;
-if (m_nGroup == 0)
-{
-if (m_rImport.isSubstream())
-m_rImport.finishSubstream();
-return 0;
-}
-break;
-case '\\':
-ret = resolveKeyword();
+case '{':
+m_nGroupStart = Strm().Tell() - 1;
+ret = m_rImport.pushState();
+if (ret)
+return ret;
+break;
+case '}':
+ret = m_rImport.popState();
+if (ret)
+return ret;
+if (m_nGroup == 0)
+{
+if (m_rImport.isSubstream())
+m_rImport.finishSubstream();
+return 0;
+}
+break;
+case '\\':
+ret = resolveKeyword();
+if (ret)
+return ret;
+break;
+case 0x0d:
+break; // ignore this
+case 0x0a:
+m_nLineNumber++;
+m_nLineStartPos = nCurrentPos;
+break;
+default:
+if (m_nGroup == 0)
+return ERROR_CHAR_OVER;
+if (m_rImport.getInternalState() == INTERNAL_NORMAL)
+{
+ret = m_rImport.resolveChars(ch);
 if (ret)
 return ret;
-break;
-case 0x0d:
-break; // ignore this
-case 0x0a:
-m_nLineNumber++;
-m_nLineStartPos = nCurrentPos;
-break;
-default:
-if (m_nGroup == 0)
-return ERROR_CHAR_OVER;
-if (m_rImport.getInternalState() == INTERNAL_NORMAL)
+}
+else
+{
+SAL_INFO("writerfilter", OSL_THIS_FUNC << ": hex internal 
state");
+b = b << 4;
+sal_Int8 parsed = asHex(ch);
+if (parsed == -1)
+return ERROR_HEX_INVALID;
+b += parsed;
+count--;
+if (

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

2014-05-01 Thread Chris Sherlock
 sw/source/core/crsr/crsrsh.cxx |2 +-
 vcl/source/outdev/font.cxx |   12 +++-
 2 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit d0b3832bedf65d466b37a69036b0b4ba550a849b
Author: Chris Sherlock 
Date:   Fri May 2 03:03:37 2014 +1000

Fix 6b431b1f0d397067504b5300d49e10e232936836

Pushed wrong branch. Oops, sorry.

Change-Id: I592cf16c7af3c5e37a03eee79e5822dcc0b39225

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index c2d2639..9958ede 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2511,7 +2511,7 @@ void SwCrsrShell::_ParkPams( SwPaM* pDelRg, SwShellCrsr** 
ppDelRing )
 }
 pTmpDel = 0;
 }
-if( bGoNext && !bDelete )
+if( bGoNext && !pTmp )
 pTmp = (SwPaM*)pTmp->GetNext();
 
 } while( !bGoNext || *ppDelRing != pTmp );
commit e97f19e96c094457ba98e3f89195cad4d814e8a3
Author: Chris Sherlock 
Date:   Fri May 2 02:34:14 2014 +1000

coverity#441827 Deference before null check

In OutputDevice::ImplGlyphFallbackLayout we should check to ensure that
mpFontEntry is valid, if not then return NULL early.

Change-Id: I946aa4d724a73a2ff85a4281c0df5f75e12104f7

diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index e9ae02e..78f8204 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -2029,6 +2029,16 @@ SalLayout* OutputDevice::getFallbackFont(ImplFontEntry 
&rFallbackFont,
 
 SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, 
ImplLayoutArgs& rLayoutArgs ) const
 {
+// This function relies on a valid mpFontEntry, if it doesn't exist bail 
out
+// - we'd have crashed later on anyway. At least here we can catch the 
error in debug
+// mode.
+if ( !mpFontEntry )
+{
+SAL_WARN ("vcl.gdi", "No font entry set in OutputDevice");
+assert(mpFontEntry);
+return NULL;
+}
+
 // prepare multi level glyph fallback
 MultiSalLayout* pMultiSalLayout = NULL;
 ImplLayoutRuns aLayoutRuns = rLayoutArgs.maRuns;
@@ -2062,7 +2072,7 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( 
SalLayout* pSalLayout, ImplLay
 
 aFontSelData.mpFontEntry = pFallbackFont;
 aFontSelData.mpFontData = pFallbackFont->maFontSelData.mpFontData;
-if( mpFontEntry && nFallbackLevel < MAX_FALLBACK-1)
+if( nFallbackLevel < MAX_FALLBACK-1)
 {
 // ignore fallback font if it is the same as the original font
 if( mpFontEntry->maFontSelData.mpFontData == 
aFontSelData.mpFontData )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-03 Thread Miklos Vajna
 sw/source/core/access/accnotextframe.cxx  |6 --
 writerfilter/source/rtftok/rtfdocumentfactory.cxx |   16 +---
 2 files changed, 13 insertions(+), 9 deletions(-)

New commits:
commit dbbaa85d296d5c3ee9db42a132649570d977b429
Author: Miklos Vajna 
Date:   Sat May 3 21:00:15 2014 +0200

writerfilter: fix indentation in rtfdocumentfactory

Change-Id: I9cf6abaf091d358670bbe71de9abe832fa139f42

diff --git a/writerfilter/source/rtftok/rtfdocumentfactory.cxx 
b/writerfilter/source/rtftok/rtfdocumentfactory.cxx
index 5bbbc92..8771295 100644
--- a/writerfilter/source/rtftok/rtfdocumentfactory.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentfactory.cxx
@@ -9,14 +9,16 @@
 
 #include 
 
-namespace writerfilter {
-namespace rtftok {
+namespace writerfilter
+{
+namespace rtftok
+{
 
-RTFDocument::Pointer_t RTFDocumentFactory::createDocument(uno::Reference< 
uno::XComponentContext > const & xContext,
-uno::Reference< io::XInputStream > const & xInputStream,
-uno::Reference< lang::XComponent > const & xDstDoc,
-uno::Reference< frame::XFrame > const & xFrame,
-uno::Reference< task::XStatusIndicator > const & xStatusIndicator)
+RTFDocument::Pointer_t RTFDocumentFactory::createDocument(uno::Reference< 
uno::XComponentContext > const& xContext,
+uno::Reference< io::XInputStream > const& xInputStream,
+uno::Reference< lang::XComponent > const& xDstDoc,
+uno::Reference< frame::XFrame > const& xFrame,
+uno::Reference< task::XStatusIndicator > const& xStatusIndicator)
 {
 return RTFDocument::Pointer_t(new RTFDocumentImpl(xContext, xInputStream, 
xDstDoc, xFrame, xStatusIndicator));
 }
commit 26946775d73ee0b4f8fd3effa37549f463fde6db
Author: Miklos Vajna 
Date:   Sat May 3 20:53:02 2014 +0200

coverity#1078575 Unchecked dynamic_cast

Change-Id: Ie25c91ce0035c78629ebd8466baa717d62948503

diff --git a/sw/source/core/access/accnotextframe.cxx 
b/sw/source/core/access/accnotextframe.cxx
index 33d4b7a..7481b12 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -109,8 +109,10 @@ void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* 
pOld, const SfxPoolItem
 // #i73249#
 case RES_TITLE_CHANGED:
 {
-const OUString& sOldTitle(
-dynamic_cast(pOld)->GetString() );
+OUString sOldTitle;
+const SwStringMsgPoolItem* pOldItem = dynamic_cast(pOld);
+if (pOldItem)
+sOldTitle = pOldItem->GetString();
 const OUString& sNewTitle(
 dynamic_cast(pNew)->GetString() );
 if ( sOldTitle == sNewTitle )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-18 Thread Miklos Vajna
 sw/source/filter/ww8/docxsdrexport.cxx|   16 +++-
 sw/source/filter/ww8/docxsdrexport.hxx|2 --
 writerfilter/source/dmapper/SdtHelper.cxx |4 ++--
 3 files changed, 5 insertions(+), 17 deletions(-)

New commits:
commit 2736674aa1eca906ba5f726e47279266cce2149e
Author: Miklos Vajna 
Date:   Tue Mar 18 14:32:43 2014 +0100

sw: not used getter / setter methods

Change-Id: Id357ee22d041cd191d06b0dc2dbf162312a4df0a

diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 72f5724..be0baa1 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -572,7 +572,7 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* 
pSdrObject, const SwFrmFmt*
  * was originally a Locked Canvas and is now inside a Text 
Frame.
  */
 
-bLockedCanvas = getIsInDMLTextFrame();
+bLockedCanvas = m_pImpl->m_bIsInDMLTextFrame;
 break;
 }
 }
@@ -1027,7 +1027,7 @@ void DocxSdrExport::writeDiagram(const SdrObject* 
sdrObject, const SwFrmFmt& rFr
 
 void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId)
 {
-setIsInDMLTextFrame(true);
+m_pImpl->m_bIsInDMLTextFrame = true;
 sax_fastparser::FSHelperPtr pFS = m_pImpl->m_pSerializer;
 const SwFrmFmt& rFrmFmt = pParentFrame->GetFrmFmt();
 const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx();
@@ -1189,7 +1189,7 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* 
pParentFrame, int nAnchorId)
 }
 
 endDMLAnchorInline(&rFrmFmt);
-setIsInDMLTextFrame(false);
+m_pImpl->m_bIsInDMLTextFrame = false;
 }
 
 void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame)
@@ -1315,14 +1315,4 @@ bool DocxSdrExport::checkFrameBtlr(SwNode* pStartNode, 
sax_fastparser::FastAttri
 return false;
 }
 
-bool DocxSdrExport::getIsInDMLTextFrame()
-{
-return m_pImpl->m_bIsInDMLTextFrame;
-}
-
-void DocxSdrExport::setIsInDMLTextFrame(bool bIsInDMLTextFrame)
-{
-m_pImpl->m_bIsInDMLTextFrame = bIsInDMLTextFrame;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxsdrexport.hxx 
b/sw/source/filter/ww8/docxsdrexport.hxx
index 73c981f..dced28c 100644
--- a/sw/source/filter/ww8/docxsdrexport.hxx
+++ b/sw/source/filter/ww8/docxsdrexport.hxx
@@ -90,8 +90,6 @@ public:
   com::sun::star::uno::Reference< 
com::sun::star::io::XOutputStream > xOutStream, const OUString& 
sGrabBagProperyName);
 /// Writes text frame in DML format.
 void writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId);
-bool getIsInDMLTextFrame();
-void setIsInDMLTextFrame(bool bIsInDMLTextFrame);
 /// Writes text frame in VML format.
 void writeVMLTextFrame(sw::Frame* pParentFrame);
 /// Undo the text direction mangling done by the frame btLr handler in 
writerfilter::dmapper::DomainMapper::lcl_startCharacterGroup()
commit e584d38f75db115edf5e07e479665336ea7a4d54
Author: Miklos Vajna 
Date:   Tue Mar 18 14:30:44 2014 +0100

writerfilter: fix indentation in SdtHelper

Change-Id: I00773d4ac74d09aba9c75daf547eb1a16885ddde

diff --git a/writerfilter/source/dmapper/SdtHelper.cxx 
b/writerfilter/source/dmapper/SdtHelper.cxx
index af30b74..32691d9 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -190,7 +190,7 @@ bool SdtHelper::hasElements()
 
 void SdtHelper::appendToInteropGrabBag(const OUString& rName, const 
css::uno::Any& rValue)
 {
-if(isInteropGrabBagEnabled())
+if (isInteropGrabBagEnabled())
 {
 sal_Int32 nLength = m_aGrabBag.getLength();
 m_aGrabBag.realloc(nLength + 1);
@@ -202,7 +202,7 @@ void SdtHelper::appendToInteropGrabBag(const OUString& 
rName, const css::uno::An
 beans::PropertyValue SdtHelper::getInteropGrabBagAndClear()
 {
 beans::PropertyValue aProp;
-if(isInteropGrabBagEnabled())
+if (isInteropGrabBagEnabled())
 {
 aProp.Name = m_sGrabBagName;
 aProp.Value = uno::Any(m_aGrabBag);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-23 Thread Miklos Vajna
 sw/source/filter/ww8/docxsdrexport.cxx|   20 
 writerfilter/source/ooxml/OOXMLStreamImpl.cxx |   32 +-
 2 files changed, 26 insertions(+), 26 deletions(-)

New commits:
commit 59698a4797101a286c177069c41d43762de6a4d5
Author: Miklos Vajna 
Date:   Sun Mar 23 15:49:12 2014 +0100

DocxSdrExport: fix indentation

Change-Id: I8318caf6a80fe5fd0dbe98ef5877103f9250f616

diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index d4f63bf..1083477 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -73,7 +73,7 @@ OUString lclGetAnchorIdFromGrabBag(const SdrObject* pObj)
 OUString aResult;
 uno::Reference 
xShape(const_cast(pObj)->getUnoShape(), uno::UNO_QUERY);
 uno::Sequence< beans::PropertyValue > propList =
-lclGetProperty< uno::Sequence >(xShape, 
"FrameInteropGrabBag");
+lclGetProperty< uno::Sequence >(xShape, 
"FrameInteropGrabBag");
 for (sal_Int32 nProp = 0; nProp < propList.getLength(); ++nProp)
 {
 OUString aPropName = propList[nProp].Name;
@@ -91,19 +91,19 @@ void lclMovePositionWithRotation(awt::Point& aPos, 
sal_Int64 nRotation)
 // code from ImplEESdrWriter::ImplFlipBoundingBox 
(filter/source/msfilter/eschesdo.cxx)
 // TODO: refactor
 
-if ( nRotation == 0 )
+if (nRotation == 0)
 return;
 
-if ( nRotation < 0 )
-nRotation = ( 36000 + nRotation ) % 36000;
-if ( nRotation % 18000 == 0 )
+if (nRotation < 0)
+nRotation = (36000 + nRotation) % 36000;
+if (nRotation % 18000 == 0)
 nRotation = 0;
-while ( nRotation > 9000 )
-nRotation = ( 18000 - ( nRotation % 18000 ) );
+while (nRotation > 9000)
+nRotation = (18000 - (nRotation % 18000));
 
 double fVal = (double) nRotation * F_PI18000;
-double  fCos = cos( fVal );
-double  fSin = sin( fVal );
+double  fCos = cos(fVal);
+double  fSin = sin(fVal);
 
 double  nWidthHalf = (double) aPos.X / 2;
 double  nHeightHalf = (double) aPos.Y / 2;
@@ -609,7 +609,7 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* 
pSdrObject, const SwFrmFmt*
 
 bool bLockedCanvas = false;
 uno::Sequence< beans::PropertyValue > propList =
-lclGetProperty< uno::Sequence >(xShape, 
"InteropGrabBag");
+lclGetProperty< uno::Sequence >(xShape, 
"InteropGrabBag");
 for (sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp)
 {
 OUString propName = propList[nProp].Name;
commit 5e01f04cf34970e8583858146c79380fa1bf7aba
Author: Miklos Vajna 
Date:   Sun Mar 23 15:43:22 2014 +0100

a -> r prefix for references

Change-Id: I62d54ba948a78dceef1d50fa684e205a9709

diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx 
b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index 6c6b2ee..6f639e6 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -243,42 +243,42 @@ bool 
OOXMLStreamImpl::lcl_getTarget(uno::Reference
 
 for (sal_Int32 j = 0; j < aSeqs.getLength(); j++)
 {
-const uno::Sequence< beans::StringPair > &aSeq = aSeqs[j];
+const uno::Sequence< beans::StringPair > &rSeq = aSeqs[j];
 
 bool bExternalTarget = false;
 OUString sMyTarget;
-for (sal_Int32 i = 0; i < aSeq.getLength(); i++)
+for (sal_Int32 i = 0; i < rSeq.getLength(); i++)
 {
-const beans::StringPair &aPair = aSeq[i];
+const beans::StringPair &rPair = rSeq[i];
 
-if (aPair.First.compareTo(sType) == 0 &&
-( aPair.Second.compareTo(sStreamType) == 0 ||
-  aPair.Second.compareTo(sStreamTypeStrict) == 0))
+if (rPair.First.compareTo(sType) == 0 &&
+( rPair.Second.compareTo(sStreamType) == 0 ||
+  rPair.Second.compareTo(sStreamTypeStrict) == 0))
 bFound = true;
-else if(aPair.First.compareTo(sType) == 0 &&
-((aPair.Second.compareTo(sOleObjectType) == 0 ||
-  aPair.Second.compareTo(sOleObjectTypeStrict) == 0) &&
+else if(rPair.First.compareTo(sType) == 0 &&
+((rPair.Second.compareTo(sOleObjectType) == 0 ||
+  rPair.Second.compareTo(sOleObjectTypeStrict) == 0) &&
   nStreamType == EMBEDDINGS))
 {
 bFound = true;
 }
-else if (aPair.First.compareTo(sId) == 0 &&
- aPair.Second.compareTo(rId) == 0)
+else if (rPair.First.compareTo(sId) == 0 &&
+ rPair.Second.compareTo(rId) == 0)
 bFound = true;
-else if (aPair.First.compareTo(sTarget) == 0)
+   

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

2014-02-04 Thread Miklos Vajna
 sw/source/core/frmedt/fews.cxx|   10 -
 sw/source/ui/frmdlg/frmpage.cxx   |   22 
 sw/source/ui/inc/frmpage.hxx  |1 
 sw/uiconfig/swriter/ui/frmtypepage.ui |   60 +++---
 4 files changed, 73 insertions(+), 20 deletions(-)

New commits:
commit ae394876e7e49505efd1be514ec3893ed53d0e08
Author: Miklos Vajna 
Date:   Tue Feb 4 11:18:12 2014 +0100

swpagerelsize ui: implement remaining height support

Change-Id: Ia603c4ac6c8e9e049473904203d2c471f03ce8a5

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 3942d5d..8670fb0 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -649,6 +649,7 @@ SwFrmPage::SwFrmPage(Window *pParent, const SfxItemSet 
&rSet)
 get(m_pHeightAutoFT, "autoheightft");
 m_aHeightED.set(get("height"));
 get(m_pRelHeightCB, "relheight");
+get(m_pRelHeightRelationLB, "relheightrelation");
 get(m_pAutoHeightCB, "autoheight");
 
 get(m_pFixedRatioCB, "ratio");
@@ -823,6 +824,7 @@ void SwFrmPage::setOptimalRelWidth()
 m_pHoriRelationLB->set_width_request(aBiggest.Width());
 m_pVertRelationLB->set_width_request(aBiggest.Width());
 m_pRelWidthRelationLB->set_width_request(aBiggest.Width());
+m_pRelHeightRelationLB->set_width_request(aBiggest.Width());
 m_pHoriRelationLB->Clear();
 }
 
@@ -954,12 +956,18 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
 else
 m_pRelWidthRelationLB->Disable();
 
+
m_pRelHeightRelationLB->InsertEntry(aFramePosString.GetString(SwFPos::FRAME));
+
m_pRelHeightRelationLB->InsertEntry(aFramePosString.GetString(SwFPos::REL_PG_FRAME));
 if (rFrmSize.GetHeightPercent() != 0xff && rFrmSize.GetHeightPercent() != 
0)
 {
 //calculate the rerference value from the with and relative width 
values
 sal_Int32 nSpace = rFrmSize.GetHeight() * 100 / 
rFrmSize.GetHeightPercent();
 m_aHeightED.SetRefValue( nSpace );
+
+m_pRelHeightRelationLB->Enable();
 }
+else
+m_pRelHeightRelationLB->Disable();
 
 // general initialisation part
 switch(rAnchor.GetAnchorId())
@@ -1152,6 +1160,14 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet)
 else if (nRelWidthRelation == 1)
 aSz.SetWidthPercentRelation(text::RelOrientation::PAGE_FRAME);
 }
+sal_uInt16 nRelHeightRelation = 
m_pRelHeightRelationLB->GetSelectEntryPos();
+if (nRelHeightRelation != LISTBOX_ENTRY_NOTFOUND)
+{
+if (nRelHeightRelation == 0)
+aSz.SetHeightPercentRelation(text::RelOrientation::FRAME);
+else if (nRelHeightRelation == 1)
+aSz.SetHeightPercentRelation(text::RelOrientation::PAGE_FRAME);
+}
 
 bool bValueModified = (m_aWidthED.IsValueModified() || 
m_aHeightED.IsValueModified());
 bool bCheckChanged = (m_pRelWidthCB->GetSavedValue() != 
m_pRelWidthCB->IsChecked()
@@ -1743,6 +1759,7 @@ IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn )
 else // pBtn == m_pRelHeightCB
 {
 m_aHeightED.ShowPercent(pBtn->IsChecked());
+m_pRelHeightRelationLB->Enable(pBtn->IsChecked());
 if(pBtn->IsChecked())
 m_aHeightED.get()->SetMax(MAX_PERCENT_HEIGHT);
 }
@@ -2331,6 +2348,11 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool 
bReset)
 m_pRelWidthRelationLB->SelectEntryPos(1);
 else
 m_pRelWidthRelationLB->SelectEntryPos(0);
+
+if (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME)
+m_pRelHeightRelationLB->SelectEntryPos(1);
+else
+m_pRelHeightRelationLB->SelectEntryPos(0);
 }
 
 sal_uInt16* SwFrmPage::GetRanges()
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index 515a0be..b033f51 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -55,6 +55,7 @@ class SwFrmPage: public SfxTabPage
 FixedText*   m_pHeightAutoFT;
 PercentField m_aHeightED;
 CheckBox*m_pRelHeightCB;
+ListBox* m_pRelHeightRelationLB;
 CheckBox*m_pAutoHeightCB;
 
 CheckBox*m_pFixedRatioCB;
diff --git a/sw/uiconfig/swriter/ui/frmtypepage.ui 
b/sw/uiconfig/swriter/ui/frmtypepage.ui
index 144ab36..f6fad3d 100644
--- a/sw/uiconfig/swriter/ui/frmtypepage.ui
+++ b/sw/uiconfig/swriter/ui/frmtypepage.ui
@@ -206,24 +206,6 @@
   
 
 
-  
-Re_lative
-True
-True
-False
-12
-True
-0
-True
-  
-  
-0
-1
-2
-1
-  

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

2014-02-24 Thread Jan Holesovsky
 sw/source/filter/ww8/docxattributeoutput.cxx |   22 +++---
 sw/source/filter/ww8/docxhelper.hxx  |2 +-
 xmloff/source/text/txtparae.cxx  |2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit a13622923af5024398eff324dadb048fd6fd7b04
Author: Jan Holesovsky 
Date:   Mon Feb 24 10:56:11 2014 +0100

Here the line made sense, bring it back.

Change-Id: Iba1c798edfe1b0eb5edcba904ceacec9174cacc6

diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 0135f28..95f6f0ce5 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -258,7 +258,7 @@ static int txtparae_bContainsIllegalCharacters = sal_False;
 // The following map shows which property values are required:
 //
 // property auto style pass export
-
+// ---
 // ParaStyleNameif style exists always
 // ParaConditionalStyleName if style exists always
 // NumberingRules   if style exists always
commit d39f1358372e6b0994fdd3f82542caeb547a64e7
Author: Jan Holesovsky 
Date:   Mon Feb 24 10:10:33 2014 +0100

OUString -> const OUString&, Sequence<> -> const Sequence<>&

Change-Id: I5d17a04fe0a3051374d75d9c989d95377f18c79d

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9dd8cd5..1322131 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1183,12 +1183,12 @@ const NameToId constNameToIdMapping[] =
 { OUString("lumMod"),FSNS( XML_w14, XML_lumMod ) },
 };
 
-boost::optional lclGetElementIdForName(OUString aName)
+boost::optional lclGetElementIdForName(const OUString& rName)
 {
 sal_Int32 aLength = sizeof (constNameToIdMapping) / sizeof(NameToId);
 for (sal_Int32 i=0; i < aLength; ++i)
 {
-if(aName == constNameToIdMapping[i].maName)
+if (rName == constNameToIdMapping[i].maName)
 {
 return constNameToIdMapping[i].maId;
 }
@@ -1196,16 +1196,16 @@ boost::optional 
lclGetElementIdForName(OUString aName)
 return boost::optional();
 }
 
-void lclProcessRecursiveGrabBag(sal_Int32 aElementId, 
css::uno::Sequence aElements, 
sax_fastparser::FSHelperPtr pSerializer)
+void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const 
css::uno::Sequence& rElements, 
sax_fastparser::FSHelperPtr pSerializer)
 {
 css::uno::Sequence aAttributes;
 FastAttributeList* pAttributes = pSerializer->createAttrList();
 
-for (sal_Int32 j=0; j < aElements.getLength(); ++j)
+for (sal_Int32 j=0; j < rElements.getLength(); ++j)
 {
-if( aElements[j].Name == "attributes")
+if (rElements[j].Name == "attributes")
 {
-aElements[j].Value >>= aAttributes;
+rElements[j].Value >>= aAttributes;
 }
 }
 
@@ -1232,14 +1232,14 @@ void lclProcessRecursiveGrabBag(sal_Int32 aElementId, 
css::uno::SequencestartElement(aElementId, xAttributesList);
 
-for (sal_Int32 j=0; j < aElements.getLength(); ++j)
+for (sal_Int32 j=0; j < rElements.getLength(); ++j)
 {
 css::uno::Sequence aSumElements;
 
-boost::optional aSubElementId = 
lclGetElementIdForName(aElements[j].Name);
+boost::optional aSubElementId = 
lclGetElementIdForName(rElements[j].Name);
 if(aSubElementId)
 {
-aElements[j].Value >>= aSumElements;
+rElements[j].Value >>= aSumElements;
 lclProcessRecursiveGrabBag(*aSubElementId, aSumElements, 
pSerializer);
 }
 }
@@ -2759,9 +2759,9 @@ void DocxAttributeOutput::StartStyles()
 LatentStyles();
 }
 
-sal_Int32 DocxStringGetToken(DocxStringTokenMap const * pMap, OUString aName)
+sal_Int32 DocxStringGetToken(DocxStringTokenMap const * pMap, const OUString& 
rName)
 {
-OString sName = OUStringToOString(aName, RTL_TEXTENCODING_UTF8);
+OString sName = OUStringToOString(rName, RTL_TEXTENCODING_UTF8);
 while (pMap->pToken)
 {
 if (sName == pMap->pToken)
diff --git a/sw/source/filter/ww8/docxhelper.hxx 
b/sw/source/filter/ww8/docxhelper.hxx
index d6d158f..4791aaa 100644
--- a/sw/source/filter/ww8/docxhelper.hxx
+++ b/sw/source/filter/ww8/docxhelper.hxx
@@ -18,7 +18,7 @@ struct DocxStringTokenMap
 sal_Int32 nToken;
 };
 
-sal_Int32 DocxStringGetToken(DocxStringTokenMap const * pMap, OUString aName);
+sal_Int32 DocxStringGetToken(DocxStringTokenMap const * pMap, const OUString& 
rName);
 
 #endif // INCLUDED_SW_SOURCE_FILTER_WW8_DOCXHELPER_HXX
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-05 Thread Zolnai Tamás
 sw/source/core/inc/flyfrm.hxx|   13 +
 sw/source/core/inc/frame.hxx |2 
 sw/source/core/layout/calcmove.cxx   |   15 ++
 sw/source/core/layout/fly.cxx|  181 ++-
 sw/source/core/layout/flylay.cxx |8 +
 sw/source/ui/frmdlg/frmpage.cxx  |   36 +
 sw/source/ui/inc/frmpage.hxx |3 
 sw/uiconfig/swriter/ui/frmaddpage.ui |  233 +--
 8 files changed, 367 insertions(+), 124 deletions(-)

New commits:
commit cb19042f4395c97d123a27c6960d5e30d666c010
Author: Zolnai Tamás 
Date:   Wed Mar 5 22:15:09 2014 +0100

New feature: vertical alignment for text frames: Layout part

- Introduce a new attribute (content position) for fly frames. Content
position specify the top-left corner of the content area (where
frame content can be placed). Add methods and members for invalidation.
- Extract content's height calculation from SwFlyFrm::Format()
to a funtction so we can use this inside SwFlyFrm::MakeContentPos.

Change-Id: I64abb70afb652ad5c11aa69b5ba12a85210e215b

diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 234e94d..a666a9d 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -118,8 +118,12 @@ protected:
 
 friend class SwNoTxtFrm; // is allowed to call NotifyBackground
 
+Point m_aContentPos;// content area's position relatively to Frm
+bool m_bValidContentPos;
+
 virtual void Format( const SwBorderAttrs *pAttrs = 0 );
 void MakePrtArea( const SwBorderAttrs &rAttrs );
+void MakeContentPos( const SwBorderAttrs &rAttrs );
 
 void Lock() { bLocked = sal_True; }
 void Unlock()   { bLocked = sal_False; }
@@ -147,6 +151,8 @@ protected:
 
 virtual const IDocumentDrawModelAccess* getIDocumentDrawModelAccess( );
 
+SwTwips CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips 
nMinHeight, const SwTwips nUL);
+
 public:
 // #i26791#
 TYPEINFO();
@@ -279,6 +285,13 @@ public:
 virtual   SwFlyFrmFmt *GetFmt();
 
 virtual void dumpAsXml( xmlTextWriterPtr writer ) { 
SwLayoutFrm::dumpAsXml( writer ); };
+
+virtual void Calc() const;
+
+const Point& ContentPos() const { return m_aContentPos; }
+Point& ContentPos() { return m_aContentPos; }
+
+void InvalidateContentPos();
 };
 #endif
 
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index c78614a..73b32f8 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -682,7 +682,7 @@ public:
 inline SwLayoutFrm *GetPrevLayoutLeaf();
 inline SwLayoutFrm *GetNextLayoutLeaf();
 
-inline void Calc() const;   // here might be "formatted"
+virtual void Calc() const;  // here might be "formatted"
 inline void OptCalc() const;// here we assume (for optimization) that
 // the predecessors are already formatted
 
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index b8e9b12..88be7b6 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -25,6 +25,7 @@
 #include "fmtftn.hxx"
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -581,7 +582,11 @@ void SwFrm::MakePos()
 else
 {
 maFrm.Pos( GetUpper()->Frm().Pos() );
-maFrm.Pos() += GetUpper()->Prt().Pos();
+if( GetUpper()->IsFlyFrm() )
+maFrm.Pos() += 
static_cast(GetUpper())->ContentPos();
+else
+maFrm.Pos() += GetUpper()->Prt().Pos();
+
 if( FRM_NEIGHBOUR & nMyType && IsRightToLeft() )
 {
 if( bVert )
@@ -1335,6 +1340,14 @@ void SwCntntFrm::MakeAll()
 if ( nConsequetiveFormatsWithoutChange <= cnStopFormat )
 {
 Format();
+
+// When a lower of a vertically aligned fly frame changes it's 
size we need to recalculate content pos.
+if( GetUpper() && GetUpper()->IsFlyFrm() &&
+GetUpper()->GetFmt()->GetTextVertAdjust().GetValue() != 
SDRTEXTVERTADJUST_TOP )
+{
+static_cast(GetUpper())->InvalidateContentPos();
+GetUpper()->SetCompletePaint();
+}
 }
 #if OSL_DEBUG_LEVEL > 0
 else
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index df97a35..5d0aede 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -72,7 +72,8 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm 
*pAnch ) :
 bLayout( sal_False ),
 bAutoPosition( sal_False ),
 bNoShrink( sal_False ),
-bLockDeleteContent( sal_False )
+bLockDeleteContent( sal_False ),
+m_bValidContentPos( false )
 {
 mnType = FRMC_FLY;
 
@@ -931,6 +932,13 @@ void SwFlyFrm::_Upd

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

2013-02-09 Thread Caolán McNamara
 sw/source/core/docnode/ndsect.cxx   |2 +-
 sw/uiconfig/swriter/ui/titlepage.ui |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 76a70fe843640949b9fb97278c8f018cf67e130e
Author: Caolán McNamara 
Date:   Sat Feb 9 13:34:46 2013 +

fix build

Change-Id: I410479392141d10688edf16115309ccc4c1edad1

diff --git a/sw/source/core/docnode/ndsect.cxx 
b/sw/source/core/docnode/ndsect.cxx
index 5610c40..42983c9 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1016,7 +1016,7 @@ SwFrm* SwClearDummies( SwFrm* pFrm )
 if( !pSectFrm->GetLower() )
 {
 if( pSectFrm->GetPrev() )
-pSectFrm->GetPrev()->pNext = pTmp;
+pSectFrm->GetPrev()->mpNext = pTmp;
 else
 pFrm = pTmp;
 if( pTmp )
commit 74e64514bb53c7e5ff6fc7b90b629c28121d40f0
Author: Caolán McNamara 
Date:   Fri Feb 8 15:53:35 2013 +

standardize on 6 pixel padding

Change-Id: I5b10bd0bd3376ecf7cf204d4a4a1567ba1a5e9e5

diff --git a/sw/uiconfig/swriter/ui/titlepage.ui 
b/sw/uiconfig/swriter/ui/titlepage.ui
index ff40c75..e4f8e7f 100644
--- a/sw/uiconfig/swriter/ui/titlepage.ui
+++ b/sw/uiconfig/swriter/ui/titlepage.ui
@@ -10,7 +10,7 @@
   
   
 False
-5
+6
 Title Page
 dialog
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-23 Thread Luboš Luňák
 sw/source/filter/ww8/docxattributeoutput.cxx   |  148 -
 writerfilter/source/dmapper/GraphicHelpers.cxx |   23 +++
 writerfilter/source/dmapper/GraphicHelpers.hxx |   11 +
 writerfilter/source/dmapper/GraphicImport.cxx  |   12 +-
 4 files changed, 133 insertions(+), 61 deletions(-)

New commits:
commit 9413f2124dff0c38fd52d318d5ac2f392a7d36e0
Author: Luboš Luňák 
Date:   Thu May 23 16:32:44 2013 +0200

improve exporting of picture alignment to docx

Basing this on anchoring is wrong, as SwFmt{Hori/Vert}Orient seems to 
provide
everything. Also try avoid hardcoding position if possible.

Change-Id: I880bc5c3eeabdde9e52c0c16d1033e44e203a8a3

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 549ed52..a062499 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2143,65 +2143,113 @@ void DocxAttributeOutput::FlyFrameGraphic( const 
SwGrfNode* pGrfNode, const Size
 m_pSerializer->singleElementNS( XML_wp, XML_simplePos, XML_x, "0", 
XML_y, "0", FSEND ); // required, unused
 const char* relativeFromH;
 const char* relativeFromV;
-switch( pFrmFmt->GetAnchor().GetAnchorId())
+const char* alignH = NULL;
+const char* alignV = NULL;
+switch (pFrmFmt->GetVertOrient().GetRelationOrient() )
 {
-case FLY_AT_PAGE:
-relativeFromV = relativeFromH = "page";
+case text::RelOrientation::PAGE_PRINT_AREA:
+relativeFromV = "margin";
 break;
-case FLY_AT_PARA:
-relativeFromH = "column";
+case text::RelOrientation::PAGE_FRAME:
+relativeFromV = "page";
+break;
+case text::RelOrientation::FRAME:
 relativeFromV = "paragraph";
 break;
-case FLY_AT_CHAR:
+case text::RelOrientation::TEXT_LINE:
 default:
-// We apply the same conversion that we do in import
-// (see writerfilter/source/dmapper/GraphicHelper.cxx)
-switch (pFrmFmt->GetVertOrient().GetRelationOrient() )
-{
-case text::RelOrientation::PAGE_PRINT_AREA:
-relativeFromV = "margin";
-break;
-case text::RelOrientation::PAGE_FRAME:
-relativeFromV = "page";
-break;
-case text::RelOrientation::FRAME:
-relativeFromV = "paragraph";
-break;
-case text::RelOrientation::TEXT_LINE:
-default:
-relativeFromV = "line";
-}
-switch (pFrmFmt->GetHoriOrient().GetRelationOrient() )
-{
-case text::RelOrientation::PAGE_PRINT_AREA:
-relativeFromH = "margin";
-break;
-case text::RelOrientation::PAGE_FRAME:
-relativeFromH = "page";
-break;
-case text::RelOrientation::CHAR:
-relativeFromH = "character";
-break;
-case text::RelOrientation::FRAME:
-default:
-relativeFromH = "column";
-}
+relativeFromV = "line";
+break;
+}
+switch (pFrmFmt->GetVertOrient().GetVertOrient() )
+{
+case text::VertOrientation::TOP:
+case text::VertOrientation::CHAR_TOP:
+case text::VertOrientation::LINE_TOP:
+if( pFrmFmt->GetVertOrient().GetRelationOrient() == 
text::RelOrientation::TEXT_LINE)
+alignV = "bottom";
+else
+alignV = "top";
+break;
+case text::VertOrientation::BOTTOM:
+case text::VertOrientation::CHAR_BOTTOM:
+case text::VertOrientation::LINE_BOTTOM:
+if( pFrmFmt->GetVertOrient().GetRelationOrient() == 
text::RelOrientation::TEXT_LINE)
+alignV = "top";
+else
+alignV = "bottom";
+break;
+case text::VertOrientation::CENTER:
+case text::VertOrientation::CHAR_CENTER:
+case text::VertOrientation::LINE_CENTER:
+alignV = "center";
+break;
+default:
+break;
+}
+switch (pFrmFmt->GetHoriOrient().GetRelationOrient() )
+{
+case text::RelOrientation::PAGE_PRINT_AREA:
+relativeFromH = "margin";
+break;
+case text::RelOrientation::PAGE_FRAME:
+   

[Libreoffice-commits] core.git: 2 commits - sw/source sw/uiconfig sw/UIConfig_swriter.mk

2013-08-17 Thread Caolán McNamara
 sw/UIConfig_swriter.mk |2 +
 sw/source/ui/app/app.src   |7 
 sw/source/ui/inc/app.hrc   |1 
 sw/source/ui/uiview/srcview.cxx|   24 +++---
 sw/source/ui/uiview/view.src   |   12 ---
 sw/source/ui/uiview/viewsrch.cxx   |   22 ++---
 sw/uiconfig/swriter/ui/querycontinuebegindialog.ui |   35 +
 sw/uiconfig/swriter/ui/querycontinueenddialog.ui   |   35 +
 8 files changed, 108 insertions(+), 30 deletions(-)

New commits:
commit f34881370ac9d9f499e00143ca840ba88021843f
Author: Caolán McNamara 
Date:   Sat Aug 17 15:43:54 2013 +0100

convert continue queryboxes to .ui

Change-Id: I8e23eb484177ccd47b7780ccafbdf8b377ea57e1

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 907c251..61f22dc 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -132,6 +132,8 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/outlinenumbering \
sw/uiconfig/swriter/ui/outlinenumberingpage \
sw/uiconfig/swriter/ui/outlinepositionpage \
+   sw/uiconfig/swriter/ui/querycontinuebegindialog \
+   sw/uiconfig/swriter/ui/querycontinueenddialog \
sw/uiconfig/swriter/ui/querydefaultcompatdialog \
sw/uiconfig/swriter/ui/querysavelabeldialog \
sw/uiconfig/swriter/ui/queryshowchangesdialog \
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index b305602..c3ceef3 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -633,12 +633,26 @@ sal_uInt16 SwSrcView::StartSearchAndReplace(const 
SvxSearchItem& rSearchItem,
 {
 InfoBox( 0, SW_RES(MSG_NOT_FOUND)).Execute();
 }
-else if(!bRecursive && RET_YES ==
-QueryBox(0, SW_RES( bForward ? MSG_SEARCH_END
- : MSG_SEARCH_START)).Execute())
+else if(!bRecursive)
 {
-pTextView->SetSelection( TextSelection( aPaM, aPaM ) );
-StartSearchAndReplace( rSearchItem, sal_False, sal_False, 
sal_True );
+int nRet;
+
+if (!bForward)
+{
+nRet = MessageDialog(0, "QueryContinueEndDialog",
+
"modules/swriter/ui/querycontinueenddialog.ui").Execute();
+}
+else
+{
+nRet = MessageDialog(0, "QueryContinueBeginDialog",
+
"modules/swriter/ui/querycontinuebegindialog.ui").Execute();
+}
+
+if (nRet == RET_YES)
+{
+pTextView->SetSelection( TextSelection( aPaM, aPaM ) );
+StartSearchAndReplace( rSearchItem, sal_False, sal_False, 
sal_True );
+}
 }
 }
 }
diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src
index 2dafb93..471a176 100644
--- a/sw/source/ui/uiview/view.src
+++ b/sw/source/ui/uiview/view.src
@@ -53,18 +53,6 @@ QueryBox DLG_SPECIAL_FORCED
 DEFBUTTON = WB_DEF_NO ;
 Message [ en-US ] = "Check special regions is deactivated. Check anyway?" ;
 };
-QueryBox MSG_SEARCH_END
-{
-Buttons = WB_YES_NO ;
-DefButton = WB_DEF_YES ;
-Message [ en-US ] = "%PRODUCTNAME Writer has searched to the end of the 
document. Do you want to continue at the beginning?" ;
-};
-QueryBox MSG_SEARCH_START
-{
-Buttons = WB_YES_NO ;
-DefButton = WB_DEF_YES ;
-Message [ en-US ] = "%PRODUCTNAME Writer has searched to the beginning of 
the document. Do you want to continue at the end?" ;
-};
 InfoBox MSG_NO_MERGE_ENTRY
 {
 Message [ en-US ] = "Could not merge documents." ;
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index e89b7ea..2df0a38 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "editeng/unolingu.hxx"
@@ -501,11 +502,22 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
 m_pWrtShell->EndAllAction();
 // Try again with WrapAround?
 
-if( bApi || RET_NO == QueryBox( GetParentWindow( m_pSrchDlg ),
-SW_RES( DOCPOS_START == aOpts.eEnd
-? MSG_SEARCH_START
-: MSG_SEARCH_END )
-).Execute() )
+int nRet = RET_NO;
+if( !bApi )
+{
+if (DOCPOS_START == aOpts.eEnd)
+{
+nRet = MessageDialog(GetParentWindow(m_pSrchDlg), 
"QueryContinueEndDialog",
+"modules/swriter/ui/querycontinueenddialog.ui").Execute();
+}
+else
+{
+nRet 

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

2013-03-01 Thread Caolán McNamara
 sw/source/core/view/viewsh.cxx |2 -
 vcl/inc/vcl/layout.hxx |   13 +++-
 vcl/source/window/builder.cxx  |   24 +-
 vcl/source/window/layout.cxx   |   43 ++---
 4 files changed, 68 insertions(+), 14 deletions(-)

New commits:
commit 16d7194ee73786c212e8639d41c7c31735ca930a
Author: Caolán McNamara 
Date:   Fri Mar 1 16:15:05 2013 +

sort frame labels before frame contents for tab traversal

If there is more than one widget with the same mnemonic, and one is a frame
label, then we need to sort frame labels before frame bodies in the tab
traversal order. Otherwise if the focus is in the body of a frame whose 
label
has that shortcut and the shortcut is pressed again, the traversal through
following widgets will encounter the frame label as the next candidate, 
leading
back to the starting point and not onwards to the next widget using that
shortcut.

Frame labels have type "label" in the .ui, so suck that out to designate 
which
widget is the frame label at load time.

Change-Id: Ie21ed87867bd0c983981a3a8f3318b3cf598c1d6

diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx
index 239e84c..457a389 100644
--- a/vcl/inc/vcl/layout.hxx
+++ b/vcl/inc/vcl/layout.hxx
@@ -436,9 +436,20 @@ public:
 
 class VCL_DLLPUBLIC VclFrame : public VclBin
 {
+private:
+Window *m_pLabel;
+private:
+friend class VclBuilder;
+void designate_label(Window *pWindow);
 public:
-VclFrame(Window *pParent) : VclBin(pParent) {}
+VclFrame(Window *pParent)
+: VclBin(pParent)
+, m_pLabel(NULL)
+{
+}
 void set_label(const OUString &rLabel);
+virtual Window *get_child();
+virtual const Window *get_child() const;
 Window *get_label_widget();
 const Window *get_label_widget() const;
 protected:
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 8654b65..3716a02 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1425,7 +1425,20 @@ bool 
VclBuilder::sortIntoBestTabTraversalOrder::operator()(const Window *pA, con
 return false;
 }
 //honour relative box positions with pack group
-return m_pBuilder->get_window_packing_data(pA).m_nPosition < 
m_pBuilder->get_window_packing_data(pB).m_nPosition;
+bPackA = m_pBuilder->get_window_packing_data(pA).m_nPosition;
+bPackB = m_pBuilder->get_window_packing_data(pB).m_nPosition;
+if (bPackA < bPackB)
+return true;
+if (bPackA > bPackB)
+return false;
+//sort labels of Frames before body
+if (pA->GetParent() == pB->GetParent())
+{
+const VclFrame *pFrameParent = dynamic_cast(pA->GetParent());
+if (pFrameParent && pA == pFrameParent->get_label_widget())
+return true;
+}
+return false;
 }
 
 void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader)
@@ -1487,6 +1500,15 @@ void VclBuilder::handleChild(Window *pParent, 
xmlreader::XmlReader &reader)
 }
 else
 {
+// We want to sort labels before contents of frames
+// for key board traversal, especially if there
+// are multiple widgets using the same mnemonic
+if (sType.equals("label"))
+{
+if (VclFrame *pFrameParent = 
dynamic_cast(pParent))
+pFrameParent->designate_label(pCurrentChild);
+}
+
 //To-Do make reorder a virtual in Window, move this foo
 //there and see above
 std::vector aChilds;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 934e08e..88790f3 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1088,10 +1088,8 @@ Size VclFrame::calculateRequisition() const
 {
 Size aRet(0, 0);
 
-WindowImpl* pWindowImpl = ImplGetWindowImpl();
-
 const Window *pChild = get_child();
-const Window *pLabel = pChild != pWindowImpl->mpLastChild ? 
pWindowImpl->mpLastChild : NULL;
+const Window *pLabel = get_label_widget();
 
 if (pChild && pChild->IsVisible())
 aRet = getLayoutRequisition(*pChild);
@@ -1121,11 +1119,8 @@ void VclFrame::setAllocation(const Size &rAllocation)
 rAllocation.Height() - rFrameStyle.top - rFrameStyle.bottom);
 Point aChildPos(rFrameStyle.left, rFrameStyle.top);
 
-WindowImpl* pWindowImpl = ImplGetWindowImpl();
-
-//The label widget is the last (of two) children
 Window *pChild = get_child();
-Window *pLabel = pChild != pWindowImpl->mpLastChild ? 
pWindowImpl->mpLastChild : NULL;
+Window *pLabel = get_label_widget();
 
 if (pLabel && pLabel->IsVisible())
 {
@@ -1141,12 +1136,22 @@ void VclFrame::setAllocati