[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - editeng/source

2014-05-31 Thread Michael Stahl
 editeng/source/editeng/editdoc.cxx  |   39 -
 editeng/source/editeng/editdoc.hxx  |   17 --
 editeng/source/editeng/impedit.hxx  |1 
 editeng/source/editeng/impedit4.cxx |   42 
 4 files changed, 29 insertions(+), 70 deletions(-)

New commits:
commit edfd206f65afb9afb5b0e9842453ba0cc085a0b5
Author: Michael Stahl 
Date:   Sat May 31 00:03:44 2014 +0200

fdo#64956: editeng: fix RTF color table export

The editengine RTF export produces this:
{\colortbl\red255\green255\blue255;;}

... and then it proceeds to map COL_AUTO to \cf0 i.e. the "white" entry
that is the result of erroneously writing out the 0th entry regardless
of whether it is COL_AUTO or not.

Fix the color table export to always put COL_AUTO first (as the Writer
RTF export already does), and simplify the code a bit.

(cherry picked from commit 55070972b32e719e4855855797263d6342a3625f)

Conflicts:
editeng/source/editeng/editdoc.cxx
editeng/source/editeng/editdoc.hxx
editeng/source/editeng/impedit4.cxx

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

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index f02990b..7eb4398 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -3011,45 +3011,6 @@ bool CharAttribList::DbgCheckAttribs() const
 #endif
 
 
-SvxColorList::SvxColorList()
-{
-}
-
-SvxColorList::~SvxColorList()
-{
-for ( size_t i = 0, n = aColorList.size(); i < n; ++i )
-delete aColorList[ i ];
-aColorList.clear();
-}
-
-size_t SvxColorList::GetId( const SvxColorItem& rColorItem )
-{
-for ( size_t i = 0, n = aColorList.size(); i < n; ++i )
-if ( *aColorList[ i ] == rColorItem )
-return i;
-DBG_WARNING( "Color not found: GetId()" );
-return 0;
-}
-
-void SvxColorList::Insert( SvxColorItem* pItem, size_t nIndex )
-{
-if ( nIndex >= aColorList.size() )
-{
-aColorList.push_back( pItem );
-}
-else
-{
-DummyColorList::iterator it = aColorList.begin();
-::std::advance( it, nIndex );
-aColorList.insert( it, pItem );
-}
-}
-
-SvxColorItem* SvxColorList::GetObject( size_t nIndex )
-{
-return ( nIndex >= aColorList.size() ) ? NULL : aColorList[ nIndex ];
-}
-
 EditEngineItemPool::EditEngineItemPool( sal_Bool bPersistenRefCounts )
 : SfxItemPool( OUString( "EditEngineItemPool" ), EE_ITEMS_START, 
EE_ITEMS_END,
 aItemInfos, 0, bPersistenRefCounts )
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 40676d5..dd04503 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -131,23 +131,8 @@ public:
 
 //  --
 //  class SvxColorList
-//  --
-
-class SvxColorList
-{
-private:
-typedef std::vector DummyColorList;
-DummyColorList aColorList;
 
-public:
-SvxColorList();
-~SvxColorList();
-
-size_t  GetId( const SvxColorItem& rColor );
-size_t  Count() { return aColorList.size(); };
-voidInsert( SvxColorItem* pItem, size_t nIndex );
-SvxColorItem* GetObject( size_t nIndex );
-};
+typedef std::vector SvxColorList;
 
 //  --
 //  class ItemList
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 31b72db..6efe921 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -76,7 +76,6 @@ DBG_NAMEEX( EditEngine )
 
 class EditView;
 class EditEngine;
-class SvxColorList;
 
 class SvxSearchItem;
 class SvxLRSpaceItem;
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index a0f54df..b4ff56e 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -431,30 +431,40 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, 
EditSelection aSel )
 
 // Write out ColorList  ...
 SvxColorList aColorList;
+// COL_AUTO should be the default color, always put it first
+aColorList.push_back(COL_AUTO);
+SvxColorItem const& rDefault(static_cast(
+aEditDoc.GetItemPool().GetDefaultItem(EE_CHAR_COLOR)));
+if (rDefault.GetValue() != COL_AUTO) // is the default always AUTO?
+{
+aColorList.push_back(rDefault.GetValue());
+}
 sal_uInt32 i = 0;
-SvxColorItem* pColorItem = (SvxColorItem*)aEditDoc.GetItemPool().GetItem2( 
EE_CHAR_COLOR, i );
+SvxColorItem const* pColorItem = static_cast(
+aEditDoc.GetItemPool().GetItem2( EE_CHAR_COLOR, i));
   

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - editeng/source

2014-06-22 Thread Caolán McNamara
 editeng/source/editeng/impedit2.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 7a5727ba35ca2cff191208625448994202a94df6
Author: Caolán McNamara 
Date:   Wed Jun 18 13:27:45 2014 +0100

Related: fdo#80140 a11y crash on changing text via spellchecker in impress

i.e. with French dictionary available, open test case of fdo#80140, open
spell checking dialog and choose "correct" on the first example.

Every version of LibreOffice crashes on this, so its an old bug.

As can be seen from the following bt, if a11y is enabled then on calling
ImpEditEngine::ImpInsertText from ImpEditEngine::ImpDeleteSelection then
FormatDoc may be called and throw away all the old portions so the following
ParaPortion* pPortion = FindParaPortion(aStartPaM.GetNode()) will get the 
new
ParaPortion, not the old one, and so the MarkInvalid that uses the old
ParaPortion invalid range is not correct anymore.

Seeing as the only caller of ImpRemoveChars is ImpDeleteSelection and
ImpDeleteSelection calls TextModified after ImpRemoveChars and after the 
use of
MarkInvalid, it seems safe and logical to remove the TextModified from
ImpRemoveChars and rely on the ImpDeleteSelection TextModified.

 #0  TextPortion::TextPortion (this=0x30bd020, nL=5) at 
/home/caolan/LibreOffice/core/editeng/source/editeng/editdoc.hxx:401
 #1  0x7fffd93f4d5a in ImpEditEngine::CreateTextPortions 
(this=0x3f42700, pParaPortion=0x3584930, rStart=@0x7fffa234: 0)
 at 
/home/caolan/LibreOffice/core/editeng/source/editeng/impedit3.cxx:2372
 #2  0x7fffd93ed087 in ImpEditEngine::CreateLines (this=0x3f42700, 
nPara=0, nStartPosY=0)
 at 
/home/caolan/LibreOffice/core/editeng/source/editeng/impedit3.cxx:687
 #3  0x7fffd93ebb3b in ImpEditEngine::FormatDoc (this=0x3f42700)
 at 
/home/caolan/LibreOffice/core/editeng/source/editeng/impedit3.cxx:394
 #4  0x7fffd93fd239 in ImpEditEngine::FormatAndUpdate (this=0x3f42700, 
pCurView=0x0)
 at 
/home/caolan/LibreOffice/core/editeng/source/editeng/impedit3.cxx:4156
 #5  0x7fffd937c3f4 in EditEngine::GetDocPosTopLeft (this=0x3f42690, 
nParagraph=0)
 at 
/home/caolan/LibreOffice/core/editeng/source/editeng/editeng.cxx:1920
 #6  0x7fffd94d298a in Outliner::GetDocPosTopLeft (this=0x3f42390, 
nParagraph=0)
 at 
/home/caolan/LibreOffice/core/editeng/source/outliner/outlin2.cxx:429
 #7  0x7fffd951c2d3 in SvxOutlinerForwarder::GetParaBounds 
(this=0x36015a0, nPara=0)
 at /home/caolan/LibreOffice/core/editeng/source/uno/unoforou.cxx:344
 #8  0x7fffd950efe5 in SvxAccessibleTextAdapter::GetParaBounds 
(this=0x3394e88, nPara=0)
 at /home/caolan/LibreOffice/core/editeng/source/uno/unoedprx.cxx:798
 #9  0x7fffd9aa25b5 in 
accessibility::AccessibleTextHelper_Impl::UpdateVisibleChildren 
(this=0x3394e00, bBroadcastEvents=true)
 at 
/home/caolan/LibreOffice/core/svx/source/accessibility/AccessibleTextHelper.cxx:851
 #10 0x7fffd9aa38b3 in 
accessibility::AccessibleTextHelper_Impl::ProcessQueue (this=0x3394e00)
 at 
/home/caolan/LibreOffice/core/svx/source/accessibility/AccessibleTextHelper.cxx:1332
 #11 0x7fffd9aa400c in accessibility::AccessibleTextHelper_Impl::Notify 
(this=0x3394e00, rHint=...)
 at 
/home/caolan/LibreOffice/core/svx/source/accessibility/AccessibleTextHelper.cxx:1482
 #12 0x7548c6ba in SfxBroadcaster::Broadcast (this=0x3394ac0, 
rHint=...)
 at /home/caolan/LibreOffice/core/svl/source/notify/brdcst.cxx:43
 #13 0x7fffd895ce27 in SvxTextEditSourceImpl::NotifyHdl 
(this=0x3394a50, aNotify=0x7fffb4c0)
 at /home/caolan/LibreOffice/core/svx/source/unodraw/unoshtxt.cxx:1030
 #14 0x7fffd895cd61 in SvxTextEditSourceImpl::LinkStubNotifyHdl 
(pThis=0x3394a50, pCaller=0x7fffb4c0)
 at /home/caolan/LibreOffice/core/svx/source/unodraw/unoshtxt.cxx:1023
 #15 0x7fffd936252a in Link::Call (this=0x3f426a8, 
pCaller=0x7fffb4c0)
 at /home/caolan/LibreOffice/core/include/tools/link.hxx:123
 #16 0x7fffd94db186 in Outliner::EditEngineNotifyHdl (this=0x3f42390, 
pNotify=0x7fffb4c0)
 at 
/home/caolan/LibreOffice/core/editeng/source/outliner/outliner.cxx:2041
 #17 0x7fffd94db149 in Outliner::LinkStubEditEngineNotifyHdl 
(pThis=0x3f42390, pCaller=0x7fffb4c0)
 at 
/home/caolan/LibreOffice/core/editeng/source/outliner/outliner.cxx:2038
 #18 0x7fffd936252a in Link::Call (this=0x7fffb490, 
pCaller=0x7fffb4c0)
 at /home/caolan/LibreOffice/core/include/tools/link.hxx:123
 #19 0x7fffd93e0155 in ImpEditEngine::CallNotify (this=0x3f42700, 
rNotify=...)
 at 
/home/caolan/LibreOffice/core/editeng/source/editeng/impedit2.cxx:4339
 #20 0x7fffd93cf462 in ImpEditEngine::TextModified (this=0x3f42700)
 at 
/home/caolan/LibreOffice/co

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - editeng/source

2014-04-21 Thread László Németh
 editeng/source/misc/svxacorr.cxx |   18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 27810fa1ffe84fd326a1fc6d251fe6a187045ad6
Author: László Németh 
Date:   Mon Apr 21 12:43:32 2014 +0200

fdo#77603 new wildcard in autocorrection: .* instead of *

(cherry picked from commit 022e351c2431e0260220a51a54d576f49f789ebc)

Conflicts:

editeng/source/misc/svxacorr.cxx

Change-Id: I04700e742239c97de39cf502fd8b0845b03c4e3a

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 667f561..f0501f3 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -72,7 +72,6 @@ static const int C_NONE = 0x00;
 static const int C_FULL_STOP= 0x01;
 static const int C_EXCLAMATION_MARK = 0x02;
 static const int C_QUESTION_MARK= 0x04;
-static const int C_ASTERISK = 0x2A;
 static const sal_Unicode cNonBreakingSpace = 0xA0;
 
 static const sal_Char pXMLImplWrdStt_ExcptLstStr[] = "WordExceptList.xml";
@@ -2761,7 +2760,7 @@ const SvxAutocorrWord* 
SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
   sal_Int32 nEndPos) const
 {
 const OUString& rChk = pFnd->GetShort();
-xub_StrLen left_wildcard = ( rChk[0] == C_ASTERISK ) ? 1 : 0; // "*word" 
pattern?
+xub_StrLen left_wildcard = rChk.startsWith( ".*" ) ? 2 : 0; // ".*word" 
pattern?
 xub_StrLen nSttWdPos = nEndPos;
 if( nEndPos >= rChk.getLength() - left_wildcard)
 {
@@ -2774,22 +2773,25 @@ const SvxAutocorrWord* 
SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
 {
 TransliterationWrapper& rCmp = GetIgnoreTranslWrapper();
 OUString sWord = rTxt.copy(nCalcStt, rChk.getLength() - 
left_wildcard);
-if( (!left_wildcard && rCmp.isEqual( rChk, sWord )) || 
(left_wildcard && rCmp.isEqual( rChk.copy(1), sWord) ))
+if( (!left_wildcard && rCmp.isEqual( rChk, sWord )) || 
(left_wildcard && rCmp.isEqual( rChk.copy(left_wildcard), sWord) ))
 {
 rStt = nCalcStt;
 if (!left_wildcard) return pFnd;
-// get the first word delimiter position before the matching 
"*word" pattern
+// get the first word delimiter position before the matching 
".*word" pattern
 while( rStt && !(bWasWordDelim = IsWordDelim( rTxt[ --rStt ])))
 ;
 if (bWasWordDelim) rStt++;
-SvxAutocorrWord* pNew = new SvxAutocorrWord(rTxt.copy(rStt, 
nEndPos - rStt), rTxt.copy(rStt, nEndPos - rStt - rChk.getLength() + 1) + 
pFnd->GetLong());
+OUString left_pattern = rTxt.copy(rStt, nEndPos - rStt - 
rChk.getLength() + left_wildcard);
+// avoid double spaces before simple "word" replacement
+left_pattern += (left_pattern.getLength() == 0 && 
pFnd->GetLong()[0] == 0x20) ? pFnd->GetLong().copy(1) : pFnd->GetLong();
+SvxAutocorrWord* pNew = new SvxAutocorrWord(rTxt.copy(rStt, 
nEndPos - rStt), left_pattern);
 if( Insert( pNew ) ) return pNew; else delete pNew;
 }
 }
-// match "word*" patterns, eg. "i18n*"
-if ( rChk[ rChk.getLength() - 1] == C_ASTERISK )
+// match "word.*" patterns, eg. "i18n.*"
+if ( rChk.endsWith( ".*" ) )
 {
-OUString sTmp( rChk.copy( 0, rChk.getLength() - 1 ) );
+OUString sTmp( rChk.copy( 0, rChk.getLength() - 2 ) );
 // Get the last word delimiter position
 bool not_suffix;
 while( nSttWdPos && !(bWasWordDelim = IsWordDelim( rTxt[ 
--nSttWdPos ])))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - editeng/source

2014-02-10 Thread Kohei Yoshida
 editeng/source/outliner/outlvw.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit 684a0308dcb847f816967202ba87f536b83dcb4e
Author: Kohei Yoshida 
Date:   Mon Feb 10 01:26:35 2014 -0500

fdo#46707: Don't bother with synonyms for text with mixed script types.

Change-Id: I7922905523406d05f864b10e1ecfd27f3fb5f9d6
(cherry picked from commit 49341001e76389f11bf67d756f4742275bc9dcd9)
Reviewed-on: https://gerrit.libreoffice.org/7962
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 036b464..1435c77 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -29,6 +29,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -1552,6 +1553,24 @@ Selection OutlinerView::GetSurroundingTextSelection() 
const
 // = some code for thesaurus sub menu within context menu
 // ==
 
+namespace {
+
+bool isSingleScriptType( sal_uInt16 nScriptType )
+{
+sal_uInt8 nScriptCount = 0;
+
+if (nScriptType & SCRIPTTYPE_LATIN)
+++nScriptCount;
+if (nScriptType & SCRIPTTYPE_ASIAN)
+++nScriptCount;
+if (nScriptType & SCRIPTTYPE_COMPLEX)
+++nScriptCount;
+
+return nScriptCount == 1;
+}
+
+}
+
 // returns: true if a word for thesaurus look-up was found at the current 
cursor position.
 // The status string will be word + iso language string (e.g. "light#en-US")
 bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext(
@@ -1567,6 +1586,10 @@ bool EDITENG_DLLPUBLIC 
GetStatusValueForThesaurusFromContext(
 aTextSel = pEditEngine->GetWord( aTextSel, 
i18n::WordType::DICTIONARY_WORD );
 aText = pEditEngine->GetText( aTextSel );
 aTextSel.Adjust();
+
+if (!isSingleScriptType(pEditEngine->GetScriptType(aTextSel)))
+return false;
+
 LanguageType nLang = pEditEngine->GetLanguage( aTextSel.nStartPara, 
aTextSel.nStartPos );
 OUString aLangText( LanguageTag::convertToBcp47( nLang ) );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - editeng/source sd/qa

2014-06-29 Thread Matúš Kukan
 editeng/source/editeng/impedit3.cxx |4 ++--
 sd/qa/unit/data/xml/n593612_0.xml   |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 379fe6f973a6c9869778d1018591308447e1c4e4
Author: Matúš Kukan 
Date:   Mon Jun 23 11:37:47 2014 +0200

bnc#882631: Do not hide top of the first row when editing text in table 
cells.

This can happen when proportional line spacing is less than 100%
and "FontIndependentLineSpacing" is set, so just keep the height
of the very first line in case of IsFixedCellHeight() too.

Change-Id: Id231fc1f2373645e5420f877e8c2568ce8a1f099
(cherry picked from commit 9388c45c0263a0090f9cb4be9c42b93b5f7985d0)
Reviewed-on: https://gerrit.libreoffice.org/9891
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 57a05aa..a2d92a6 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1343,7 +1343,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
 }
 else if ( rLSItem.GetInterLineSpaceRule() == 
SVX_INTER_LINE_SPACE_PROP )
 {
-if ( nPara || IsFixedCellHeight() || pLine->GetStartPortion() 
) // Not the very first line
+if ( nPara || pLine->GetStartPortion() ) // Not the very first 
line
 {
 // There are documents with PropLineSpace 0, why?
 // (cmc: re above question :-) such documents can be seen 
by importing a .ppt
@@ -1673,7 +1673,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( 
ParaPortion* pParaPortion, sal_uIn
 else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP 
)
 {
 sal_Int32 nPara = GetParaPortions().GetPos( pParaPortion );
-if ( nPara || IsFixedCellHeight() || pTmpLine->GetStartPortion() ) 
// Not the very first line
+if ( nPara || pTmpLine->GetStartPortion() ) // Not the very first 
line
 {
 // There are documents with PropLineSpace 0, why?
 // (cmc: re above question :-) such documents can be seen by 
importing a .ppt
diff --git a/sd/qa/unit/data/xml/n593612_0.xml 
b/sd/qa/unit/data/xml/n593612_0.xml
index c4501c4..19c8a01 100644
--- a/sd/qa/unit/data/xml/n593612_0.xml
+++ b/sd/qa/unit/data/xml/n593612_0.xml
@@ -1,6 +1,6 @@
 
 
- 
+ 
   
   
   
@@ -10,7 +10,7 @@
   
   

-   
+   

   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-15 Thread Michael Stahl
 editeng/source/items/borderline.cxx  |4 +-
 sw/qa/extras/rtfimport/data/fdo68779.rtf |   25 
 sw/qa/extras/rtfimport/rtfimport.cxx |   62 +++
 3 files changed, 90 insertions(+), 1 deletion(-)

New commits:
commit 93f8e87dc7f488bbbfd8a748e47ce53936824391
Author: Michael Stahl 
Date:   Fri Mar 14 19:03:09 2014 +0100

fdo#68779: RTF import: set borders without explicit width

Word reportedly uses 0.75pt as a default if \brdrw is missing.

Change-Id: I263c56f756c65ff6bb30870aa70806564d5826a6
(cherry picked from commit 84f4de3b65cd0f861e80c69b773004f28f9f8d9f)
Reviewed-on: https://gerrit.libreoffice.org/8594
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/editeng/source/items/borderline.cxx 
b/editeng/source/items/borderline.cxx
index b393420..38c61e0 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -177,9 +177,11 @@ static const double OUTSET_line1 = 15.0;
 static const double INSET_line2  = 15.0;
 
 double
-ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const fWidth,
+ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const i_fWidth,
 int const nWordLineStyle)
 {
+// fdo#68779: at least for RTF, 0.75pt is the default if width is missing
+double const fWidth((i_fWidth == 0.0) ? 15.0 : i_fWidth);
 switch (eStyle)
 {
 // Single lines
diff --git a/sw/qa/extras/rtfimport/data/fdo68779.rtf 
b/sw/qa/extras/rtfimport/data/fdo68779.rtf
new file mode 100644
index 000..5dc7683
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo68779.rtf
@@ -0,0 +1,25 @@
+{\rtf1\ansi\ansicpg1251
+\paperw11907\paperh16840\psz9\margl1418\margr1984\margt2438\margb1531
+{\colortbl\red0\green0\blue0;}\deflang1049
+
+\trowd
+\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs\cellx8335
+\pard\plain \intbl foo\cell \pard \intbl \row
+\pard \par
+
+\trowd
+\clbrdrt\brdrdot\clbrdrl\brdrdot\clbrdrb\brdrdot\clbrdrr\brdrdot\cellx8335
+\pard\plain \intbl foo\cell \pard \intbl \row
+\pard \par
+
+\trowd
+\clbrdrt\brdrdb\clbrdrl\brdrdb\clbrdrb\brdrdb\clbrdrr\brdrdb\cellx8335
+\pard\plain \intbl foo\cell \pard \intbl \row
+\pard \par
+
+\trowd
+\clbrdrt\brdrtnthmg\clbrdrl\brdrtnthmg\clbrdrb\brdrtnthmg\clbrdrr\brdrtnthmg\cellx8335
+\pard\plain \intbl foo\cell \pard \intbl \row
+\pard \par
+
+\pard \par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 73bf749..0a16ab4 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1482,6 +1482,68 @@ DECLARE_RTFIMPORT_TEST(testFdo65090, "fdo65090.rtf")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< 
uno::Sequence >(xTableRows->getByIndex(0), 
"TableColumnSeparators").getLength());
 }
 
+DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf")
+{
+// table borders without \brdrw were not imported
+uno::Reference xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xCell(xTable->getCellByName("A1"), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xCell.is());
+table::BorderLine2 solid(
+1, 0, 26, 0, table::BorderLineStyle::SOLID, 26);
+CPPUNIT_ASSERT_BORDER_EQUAL(solid,
+getProperty(xCell, "LeftBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(solid,
+getProperty(xCell, "RightBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(solid,
+getProperty(xCell, "TopBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(solid,
+getProperty(xCell, "BottomBorder"));
+
+xTable.set(xTables->getByIndex(1), uno::UNO_QUERY);
+xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xCell.is());
+table::BorderLine2 dotted(
+1, 0, 26, 0, table::BorderLineStyle::DOTTED, 26);
+CPPUNIT_ASSERT_BORDER_EQUAL(dotted,
+getProperty(xCell, "LeftBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(dotted,
+getProperty(xCell, "RightBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(dotted,
+getProperty(xCell, "TopBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(dotted,
+getProperty(xCell, "BottomBorder"));
+
+xTable.set(xTables->getByIndex(2), uno::UNO_QUERY);
+xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xCell.is());
+table::BorderLine2 doubled(
+1, 26, 26, 26, table::BorderLineStyle::DOUBLE, 79);
+CPPUNIT_ASSERT_BORDER_EQUAL(doubled,
+getProperty(xCell, "LeftBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(doubled,
+getProperty(xCell, "RightBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(doubled,
+getProperty(xCell, "TopBorder"));
+CPPUNIT_ASSERT_BORDER_EQUAL(doubled,
+getProperty(xCell, "BottomBorder"));
+
+xTable.set(xTables->getByIndex(3), uno::UNO_QUERY);
+xCell.set(xTable->getCell

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - editeng/source extras/CustomTarget_autocorr.mk extras/Package_autocorr.mk include/editeng sw/source

2014-07-05 Thread Julien Nabet
 editeng/source/misc/svxacorr.cxx |   24 ++--
 extras/CustomTarget_autocorr.mk  |2 +-
 extras/Package_autocorr.mk   |2 +-
 include/editeng/svxacorr.hxx |5 +++--
 sw/source/core/edit/acorrect.cxx |2 +-
 5 files changed, 24 insertions(+), 11 deletions(-)

New commits:
commit 1f407caeb3f6e2605973458a545547ed82e7da1c
Author: Julien Nabet 
Date:   Wed Jun 18 21:08:03 2014 +0200

Resolves fdo#79276 Add fallback system for autocorrection of French variants

1) Replace the creation of acor_fr-FR.dat by acor_fr.dat since there's no 
specific for variants of fr
2) Add a fallback system to use it

Reviewed-on: https://gerrit.libreoffice.org/9825
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

Conflicts:
editeng/source/misc/svxacorr.cxx
include/editeng/svxacorr.hxx
sw/source/core/edit/acorrect.cxx

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index f0501f3..12413ee 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1560,7 +1560,7 @@ sal_Bool SvxAutoCorrect::CreateLanguageFile( const 
LanguageTag& rLanguageTag, sa
 {
 OSL_ENSURE(pLangTable->find(rLanguageTag) == pLangTable->end(), "Language 
already exists ");
 
-OUString sUserDirFile( GetAutoCorrFileName( rLanguageTag, sal_True, 
sal_False ));
+OUString sUserDirFile( GetAutoCorrFileName( rLanguageTag, true, false, 
false ));
 OUString sShareDirFile( sUserDirFile );
 
 SvxAutoCorrectLanguageListsPtr pLists = 0;
@@ -1583,10 +1583,15 @@ sal_Bool SvxAutoCorrect::CreateLanguageFile( const 
LanguageTag& rLanguageTag, sa
 aLastFileTable.erase(nFndPos);
 }
 }
-else if( ( FStatHelper::IsDocument( sUserDirFile ) ||
-FStatHelper::IsDocument( sShareDirFile =
-  GetAutoCorrFileName( rLanguageTag, sal_False, 
sal_False ) ) ) ||
-( sShareDirFile = sUserDirFile, bNewFile ))
+else if(
+ ( FStatHelper::IsDocument( sUserDirFile ) ||
+   FStatHelper::IsDocument( sShareDirFile =
+   GetAutoCorrFileName( rLanguageTag, false, false, false ) ) 
||
+   FStatHelper::IsDocument( sShareDirFile =
+   GetAutoCorrFileName( rLanguageTag, false, false, true) )
+ ) ||
+( sShareDirFile = sUserDirFile, bNewFile )
+  )
 {
 pLists = new SvxAutoCorrectLanguageLists( *this, sShareDirFile, 
sUserDirFile );
 LanguageTag aTmp(rLanguageTag); // this insert() needs a non-const 
reference
@@ -1902,9 +1907,16 @@ sal_Bool 
SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
 }
 
 OUString SvxAutoCorrect::GetAutoCorrFileName( const LanguageTag& rLanguageTag,
-sal_Bool bNewFile, sal_Bool bTst ) 
const
+bool bNewFile, bool bTst, bool 
bUnlocalized ) const
 {
 OUString sRet, sExt( rLanguageTag.getBcp47() );
+if (bUnlocalized)
+{
+// we don't want variant, so we'll take "fr" instead of "fr-CA" for 
example
+::std::vector< OUString > vecFallBackStrings = 
rLanguageTag.getFallbackStrings(false);
+if (!vecFallBackStrings.empty())
+   sExt = vecFallBackStrings[0];
+}
 
 sExt = "_" + sExt + ".dat";
 if( bNewFile )
diff --git a/extras/CustomTarget_autocorr.mk b/extras/CustomTarget_autocorr.mk
index 66d32f6..ddafa02 100644
--- a/extras/CustomTarget_autocorr.mk
+++ b/extras/CustomTarget_autocorr.mk
@@ -23,7 +23,7 @@ extras_AUTOCORR_LANGS := \
es:es-ES \
fa:fa-IR \
fi:fi-FI \
-   fr:fr-FR \
+   fr:fr \
ga-IE:ga-IE \
hr:hr-HR \
hu:hu-HU \
diff --git a/extras/Package_autocorr.mk b/extras/Package_autocorr.mk
index e42e3d1..8c71a60 100644
--- a/extras/Package_autocorr.mk
+++ b/extras/Package_autocorr.mk
@@ -23,7 +23,7 @@ $(eval $(call 
gb_Package_add_files,extras_autocorr,$(LIBO_SHARE_FOLDER)/autocorr
acor_es-ES.dat \
acor_fa-IR.dat \
acor_fi-FI.dat \
-   acor_fr-FR.dat \
+   acor_fr.dat \
acor_ga-IE.dat \
acor_hr-HR.dat \
acor_hu-HU.dat \
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 82b76ce..0f99d2d 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -329,8 +329,9 @@ public:
 // Query/Set the name of the AutoCorrect file
 // the default is "autocorr.dat"
 OUString GetAutoCorrFileName( const LanguageTag& rLanguageTag /* = 
LANGUAGE_SYSTEM */ ,
-sal_Bool bNewFile = sal_False,
-sal_Bool bTstUserExist = sal_False ) const;
+bool

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - editeng/source include/editeng oox/source sd/source svx/source

2014-03-17 Thread Muthu Subramanian
 editeng/source/editeng/editattr.cxx |   17 +++-
 editeng/source/editeng/editattr.hxx |   12 +++
 editeng/source/editeng/editdoc.cxx  |9 
 editeng/source/editeng/editeng.cxx  |2 +
 editeng/source/editeng/eerdll.cxx   |   12 ++-
 editeng/source/uno/unofdesc.cxx |1 
 editeng/source/uno/unotext.cxx  |2 -
 include/editeng/eeitem.hxx  |   17 
 include/editeng/eeitemid.hxx|2 -
 include/editeng/unoprnms.hxx|1 
 include/editeng/unotext.hxx |1 
 oox/source/drawingml/textcharacterpropertiescontext.cxx |2 +
 sd/source/core/drawdoc4.cxx |2 +
 sd/source/core/stlpool.cxx  |5 
 sd/source/ui/view/drtxtob1.cxx  |7 ++
 svx/source/svdraw/svdotextdecomposition.cxx |5 ++--
 svx/source/tbxctrls/tbcontrl.cxx|6 +
 svx/source/unodraw/unoprov.cxx  |1 
 18 files changed, 86 insertions(+), 18 deletions(-)

New commits:
commit d58adfde297a840a65103a87bf09fb64f70803e1
Author: Muthu Subramanian 
Date:   Tue Feb 4 18:24:03 2014 +0530

cp#125: Import casemaps from pptx.

(Ported from: 887bc4dd3e62fe6dd19dc9d1c3ba273a5b21b5ec
and 9dbcb79782d6a5b80c21a0c093537d18425b826f)

Change-Id: I211491e06273aedf5c8ddbd0ca3fc35f3d168aaa
Reviewed-on: https://gerrit.libreoffice.org/7848
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/editeng/source/editeng/editattr.cxx 
b/editeng/source/editeng/editattr.cxx
index de847d6..b437e9b 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "editattr.hxx"
 
@@ -185,7 +186,7 @@ void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, 
OutputDevice* )
 EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& 
rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
 : EditCharAttrib( rAttr, _nStart, _nEnd )
 {
-DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Not a Size attribute!" );
+DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Not a Strikeout 
attribute!" );
 }
 
 void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* )
@@ -194,6 +195,20 @@ void EditCharAttribStrikeout::SetFont( SvxFont& rFont, 
OutputDevice* )
 }
 
 // -
+// class EditCharAttribCaseMap
+// -
+EditCharAttribCaseMap::EditCharAttribCaseMap( const SvxCaseMapItem& rAttr, 
sal_uInt16 _nStart, sal_uInt16 _nEnd )
+: EditCharAttrib( rAttr, _nStart, _nEnd )
+{
+DBG_ASSERT( rAttr.Which() == EE_CHAR_CASEMAP, "Not a CaseMap Item!" );
+}
+
+void EditCharAttribCaseMap::SetFont( SvxFont& rFont, OutputDevice* )
+{
+rFont.SetCaseMap( ((const SvxCaseMapItem*)GetItem())->GetCaseMap() );
+}
+
+// -
 // class EditCharAttribColor
 // -
 EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, 
sal_uInt16 _nStart, sal_uInt16 _nEnd )
diff --git a/editeng/source/editeng/editattr.hxx 
b/editeng/source/editeng/editattr.hxx
index 4fb657c..3917427 100644
--- a/editeng/source/editeng/editattr.hxx
+++ b/editeng/source/editeng/editattr.hxx
@@ -47,6 +47,7 @@ class SvxEmphasisMarkItem;
 class SvxCharReliefItem;
 class SfxVoidItem;
 class OutputDevice;
+class SvxCaseMapItem;
 
 #define CH_FEATURE_OLD  (sal_uInt8) 0xFF
 #define CH_FEATURE  (sal_Unicode)   0x01
@@ -219,6 +220,17 @@ public:
 };
 
 // -
+// class EditCharAttribCaseMap
+// -
+class EditCharAttribCaseMap : public EditCharAttrib
+{
+public:
+EditCharAttribCaseMap( const SvxCaseMapItem& rAttr, sal_uInt16 nStart, 
sal_uInt16 nEnd );
+
+virtual voidSetFont( SvxFont& rFont, OutputDevice* pOutDev );
+};
+
+// -
 // class EditCharAttribUnderline
 // -
 class EditCharAttribUnderline : public EditCharAttrib
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 26c2b24..f02990b 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -21