[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - editeng/source svl/source
editeng/source/misc/svxacorr.cxx | 17 - svl/source/numbers/zforfind.cxx |4 +++- 2 files changed, 11 insertions(+), 10 deletions(-) New commits: commit d6f90b9ec323b1871ff5a23e30bd090b124cf006 Author: Laurent Balland-Poirier laurent.balland-poir...@laposte.net Date: Sun Sep 22 00:19:12 2013 +0200 fdo#54686 Treat hard blank as soft blank in number AutoCorrect option Add non-breaking space in French... insert non-breaking space (hard blank) and avoid recognition of percent number and time number. This patch treats hard blanks as soft blank in number format recognition Rev.#1: change #define to const variable. Same change in svxaccor Rev.#2: improvements Reviewed-on: https://gerrit.libreoffice.org/6015 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com (cherry picked from commit 2f4d7eacabd62db35777682bcca353e142e024bf) Conflicts: editeng/source/misc/svxacorr.cxx svl/source/numbers/zforfind.cxx (cherry picked from commit 1ca4b1bae11704a1119a9c680c6ae5b85ea1b31e) Signed-off-by: Eike Rathke er...@redhat.com Conflicts: editeng/source/misc/svxacorr.cxx Change-Id: I30c2c36778cb53a0238a0829043dad4d709f97d2 diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 046c4b3..9887540 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -63,8 +63,6 @@ #include vcl/help.hxx #include rtl/logfile.hxx -#define CHAR_HARDBLANK ((sal_Unicode)0x00A0) - using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::uno; using namespace ::com::sun::star; @@ -76,6 +74,7 @@ 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 sal_Unicode cNonBreakingSpace = 0xA0; static const sal_Char pImplWrdStt_ExcptLstStr[]= WordExceptList; static const sal_Char pImplCplStt_ExcptLstStr[]= SentenceExceptList; @@ -102,7 +101,7 @@ typedef SvxAutoCorrectLanguageLists* SvxAutoCorrectLanguageListsPtr; static inline int IsWordDelim( const sal_Unicode c ) { return ' ' == c || '\t' == c || 0x0a == c || -0xA0 == c || 0x2011 == c || 0x1 == c; +cNonBreakingSpace == c || 0x2011 == c || 0x1 == c; } static inline int IsLowerLetter( sal_Int32 nCharType ) @@ -628,7 +627,7 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( { // Remove any previous normal space xub_StrLen nPos = nEndPos - 1; -while ( cPrevChar == ' ' || cPrevChar == CHAR_HARDBLANK ) +while ( cPrevChar == ' ' || cPrevChar == cNonBreakingSpace ) { if ( nPos == 0 ) break; nPos--; @@ -641,7 +640,7 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( // Add the non-breaking space at the end pos if ( bHasSpace ) -rDoc.Insert( nPos, rtl::OUString(CHAR_HARDBLANK) ); +rDoc.Insert( nPos, rtl::OUString(cNonBreakingSpace) ); bRunNext = true; bRet = true; } @@ -654,7 +653,7 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( // Remove the hardspace right before to avoid formatting URLs sal_Unicode cPrevChar = rTxt.GetChar( nEndPos - 1 ); sal_Unicode cMaybeSpaceChar = rTxt.GetChar( nEndPos - 2 ); -if ( cPrevChar == ':' cMaybeSpaceChar == CHAR_HARDBLANK ) +if ( cPrevChar == ':' cMaybeSpaceChar == cNonBreakingSpace ) { rDoc.Delete( nEndPos - 2, nEndPos - 1 ); bRet = true; @@ -1126,7 +1125,7 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc rDoc, xub_StrLen nInsPos, case LANGUAGE_FRENCH_SWISS: case LANGUAGE_FRENCH_LUXEMBOURG: { -rtl::OUString s( static_cast sal_Unicode (0xA0) ); +rtl::OUString s( cNonBreakingSpace ); // UNICODE code for no break space if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s )) { @@ -1225,7 +1224,7 @@ sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc rDoc, const String rTxt, { // Remove the NBSP if it wasn't an autocorrection if ( nInsPos != 0 NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) -cChar != ' ' cChar != '\t' cChar != CHAR_HARDBLANK ) +cChar != ' ' cChar != '\t' cChar != cNonBreakingSpace ) { // Look for the last HARD_SPACE xub_StrLen nPos = nInsPos - 1; @@ -1233,7 +1232,7 @@ sal_uLong
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - editeng/source sw/inc sw/source
editeng/source/misc/svxacorr.cxx | 13 - sw/inc/swtypes.hxx |2 ++ sw/source/core/doc/docfmt.cxx| 24 3 files changed, 34 insertions(+), 5 deletions(-) New commits: commit 5b3867f801dadc5c2c6346561e7d71990cd7eb33 Author: Michael Stahl mst...@redhat.com Date: Thu Jun 20 00:20:52 2013 +0200 fdo#62536: sw: fix AutoCorrect bold/underline on existing AUTOFMT With the native AUTOFMT in Writer the SETATTR_DONTEXPAND does no longer work reliably: if there is an existing AUTOFMT at the position then it will be modified and no new hint with DontExpand will be inserted. Work around this deficiency by inserting a no-length hint with the preivous formatting at the end of the range. (similar fix to the i#75891 problem in SwTextShell::InsertSymbol) (commit 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c did not introduce the problem but made it far more annoying) Change-Id: I58ece7f5bd5a786b22a066e5902f1784dafa5dce (cherry picked from commit fe444d1f74abe417962be0bcd3340f40f2446b58) Reviewed-on: https://gerrit.libreoffice.org/4393 Reviewed-by: Noel Power noel.po...@suse.com Tested-by: Noel Power noel.po...@suse.com diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index cf486af..046c4b3 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -732,24 +732,27 @@ sal_Bool SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc rDoc, const String if( STRING_NOTFOUND != nFndPos ) { -// Span the Attribute over the area and delete the Character found at +// first delete the Character at the end - this allows insertion +// of an empty hint in SetAttr which would be removed by Delete +// (fdo#62536, AUTOFMT in Writer) +rDoc.Delete( nEndPos, nEndPos + 1 ); +rDoc.Delete( nFndPos, nFndPos + 1 ); +// Span the Attribute over the area // the end. if( '*' == cInsChar ) // Bold { SvxWeightItem aSvxWeightItem( WEIGHT_BOLD, SID_ATTR_CHAR_WEIGHT ); -rDoc.SetAttr( nFndPos + 1, nEndPos, +rDoc.SetAttr( nFndPos, nEndPos - 1, SID_ATTR_CHAR_WEIGHT, aSvxWeightItem); } else// underline { SvxUnderlineItem aSvxUnderlineItem( UNDERLINE_SINGLE, SID_ATTR_CHAR_UNDERLINE ); -rDoc.SetAttr( nFndPos + 1, nEndPos, +rDoc.SetAttr( nFndPos, nEndPos - 1, SID_ATTR_CHAR_UNDERLINE, aSvxUnderlineItem); } -rDoc.Delete( nEndPos, nEndPos + 1 ); -rDoc.Delete( nFndPos, nFndPos + 1 ); } return STRING_NOTFOUND != nFndPos; diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index fe1c414..214ba5a 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -192,6 +192,8 @@ typedef sal_uInt16 SetAttrMode; namespace nsSetAttrMode { const SetAttrMode SETATTR_DEFAULT= 0x; // Default. +/// @attention: DONTEXPAND does not work very well for CHARATR +/// because it can expand only the whole AUTOFMT or nothing const SetAttrMode SETATTR_DONTEXPAND = 0x0001; // Don't expand text attribute any further. const SetAttrMode SETATTR_DONTREPLACE= 0x0002; // Don't replace another text attribute. diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 4341aa9..c3171cd 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -2453,7 +2453,31 @@ void SwDoc::SetFmtItemByAutoFmt( const SwPaM rPam, const SfxItemSet rSet ) SetRedlineMode_intern( (RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE)); } +xub_StrLen const nEnd(rPam.End()-nContent.GetIndex()); +std::vectorsal_uInt16 whichIds; +SfxItemIter iter(rSet); +for (SfxPoolItem const* pItem = iter.FirstItem(); +pItem; pItem = iter.NextItem()) +{ +whichIds.push_back(pItem-Which()); +whichIds.push_back(pItem-Which()); +} +whichIds.push_back(0); +SfxItemSet currentSet(GetAttrPool(), whichIds[0]); +pTNd-GetAttr(currentSet, nEnd, nEnd, false, true, false); +for (size_t i = 0; whichIds[i]; i += 2) +{ // yuk - want to explicitly set the pool defaults too :-/ +currentSet.Put(currentSet.Get(whichIds[i], true)); +} + InsertItemSet( rPam, rSet, nsSetAttrMode::SETATTR_DONTEXPAND ); + +// fdo#62536: DONTEXPAND does not work when there is already an AUTOFMT +// here, so insert the old attributes as an empty hint to stop expand +SwPaM endPam(*pTNd, nEnd); +endPam.SetMark(); +InsertItemSet(endPam, currentSet, nsSetAttrMode::SETATTR_DEFAULT); + SetRedlineMode_intern( eOld ); } ___
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - editeng/source
editeng/source/items/frmitems.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 924fdc8773a75de54b6ca6ceeaa686035b1f270d Author: Lionel Elie Mamane lio...@mamane.lu Date: Fri May 3 17:42:12 2013 +0200 fdo#64150 don't segfault when there is no line Change-Id: Iab36de3d407925cdb0e092afae457907f0261b3e Reviewed-on: https://gerrit.libreoffice.org/3765 Reviewed-by: Thorsten Behrens tbehr...@suse.com Tested-by: Thorsten Behrens tbehr...@suse.com diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 35c04bb..275ef73f 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -1966,7 +1966,8 @@ bool SvxBoxItem::PutValue( const uno::Any rVal, sal_uInt8 nMemberId ) for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n) { editeng::SvxBorderLine* pLine = const_cast editeng::SvxBorderLine* ( GetLine( aBorders[n] ) ); -pLine-SetWidth( nWidth ); +if( pLine ) +pLine-SetWidth( nWidth ); } } return sal_True; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - editeng/source
editeng/source/editeng/impedit3.cxx | 49 1 file changed, 28 insertions(+), 21 deletions(-) New commits: commit 377e95a33f77dcb7e76c4afc98f9d61465363d75 Author: László Németh nem...@numbertext.org Date: Wed Apr 24 00:21:03 2013 +0200 fdo#63711 Calc: fix Catalan and Hungarian hyphenation Change-Id: Ib9b3a63ad48ab9a8c109a97f4053c0fc4aca8a28 Reviewed-on: https://gerrit.libreoffice.org/3591 Reviewed-by: Fridrich Strba fridr...@documentfoundation.org Tested-by: Fridrich Strba fridr...@documentfoundation.org diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index bcd3695..5fd8362 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1748,6 +1748,9 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te sal_Bool bHangingPunctuation = sal_False; sal_Unicode cAlternateReplChar = 0; sal_Unicode cAlternateExtraChar = 0; +sal_Bool bAltFullLeft = sal_False; +sal_Bool bAltFullRight = sal_False; +sal_uInt32 nAltDelChar = 0; if ( ( nMaxBreakPos ( nMax + pLine-GetStart() ) ) ( pNode-GetChar( nMaxBreakPos ) == ' ' ) ) { @@ -1853,29 +1856,38 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te } else { -String aAlt( xHyphWord-getHyphenatedWord() ); - -// We expect the two cases, which might exist now: +// TODO: handle all alternative hyphenations (see hyphen-1.2.8/tests/unicode.*) +OUString aAlt( xHyphWord-getHyphenatedWord() ); +OUString aWord2(aWord); +OUString aAltLeft(aAlt.copy(0, _nWordLen)); +OUString aAltRight(aAlt.copy(_nWordLen)); +bAltFullLeft = aWord2.startsWith(aAltLeft); +bAltFullRight = aWord2.endsWith(aAltRight); +nAltDelChar = aWord2.getLength() - aAlt.getLength() + (1 - bAltFullLeft) + (1 - bAltFullRight); + +// NOTE: improved for other cases, see fdo#63711 + +// We expect[ed] the two cases: // 1) packen becomes pak-ken // 2) Schiffahrt becomes Schiff-fahrt // In case 1, a character has to be replaced // in case 2 a character is added. // The identification is complicated by long // compound words because the Hyphenator separates -// all position of the word. +// all position of the word. [This is not true for libhyphen.] // Schiffahrtsbrennesseln - Schifffahrtsbrennnesseln // We can thus actually not directly connect the index of the // AlternativeWord to aWord. The whole issue will be simplified // by a function in the Hyphenator as soon as AMA builds this in... sal_uInt16 nAltStart = _nWordLen - 1; -sal_uInt16 nTxtStart = nAltStart - (aAlt.Len() - aWord.Len()); +sal_uInt16 nTxtStart = nAltStart - (aAlt.getLength() - aWord.Len()); sal_uInt16 nTxtEnd = nTxtStart; sal_uInt16 nAltEnd = nAltStart; // The regions between the nStart and nEnd is the // difference between alternative and original string. -while( nTxtEnd aWord.Len() nAltEnd aAlt.Len() - aWord.GetChar(nTxtEnd) != aAlt.GetChar(nAltEnd) ) +while( nTxtEnd aWord.Len() nAltEnd aAlt.getLength() + aWord.GetChar(nTxtEnd) != aAlt[nAltEnd] ) { ++nTxtEnd; ++nAltEnd; @@ -1883,7 +1895,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te // If a character is added, then we notice it now: if( nAltEnd nTxtEnd nAltStart == nAltEnd -aWord.GetChar( nTxtEnd ) == aAlt.GetChar(nAltEnd) ) +aWord.GetChar( nTxtEnd ) == aAlt[nAltEnd] ) { ++nAltEnd; ++nTxtStart; @@ -1893,13 +1905,13 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te DBG_ASSERT(
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - editeng/source filter/source sd/source
editeng/source/editeng/eerdll.cxx |6 -- editeng/source/uno/unonrule.cxx|3 ++- filter/source/msfilter/svdfppt.cxx |7 --- sd/source/core/drawdoc4.cxx|3 ++- sd/source/core/stlpool.cxx |5 +++-- 5 files changed, 15 insertions(+), 9 deletions(-) New commits: commit 6f504b6307179f00075bd1dadd722ff2e8855ea9 Author: Cao Cuong Ngo cao.cuong@gmail.com Date: Wed Apr 10 20:41:54 2013 +0200 fdo#47018 Impress crashes when modifying bullet Default numbering rules shouldn't be left zero nor hard-coded. Reviewed-on: https://gerrit.libreoffice.org/3312 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com (cherry picked from commit 5785db93c5739846fb0a84b138be485044d4bda5) Conflicts: sd/source/core/drawdoc4.cxx sd/source/core/stlpool.cxx Change-Id: I8a34331006abf3de8c170f8dca43ccf9cec92f04 diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 740de3a..0ae4491 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -36,6 +36,7 @@ #include editeng/flditem.hxx #include editeng/emphitem.hxx #include editeng/scriptspaceitem.hxx +#include editeng/numdef.hxx #include svl/itempool.hxx #include vcl/virdev.hxx @@ -98,14 +99,15 @@ SfxPoolItem** GlobalEditData::GetDefItems() ppDefItems = new SfxPoolItem*[EDITITEMCOUNT]; // Paragraph attributes: -SvxNumRule aTmpNumRule( 0, 0, sal_False ); +SvxNumRule aDefaultNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, +SVX_MAX_NUM, sal_False ); ppDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ); ppDefItems[1] = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS ); ppDefItems[2] = new SfxBoolItem( EE_PARA_HANGINGPUNCTUATION, sal_False ); ppDefItems[3] = new SfxBoolItem( EE_PARA_FORBIDDENRULES, sal_True ); ppDefItems[4] = new SvxScriptSpaceItem( sal_True, EE_PARA_ASIANCJKSPACING ); -ppDefItems[5] = new SvxNumBulletItem( aTmpNumRule, EE_PARA_NUMBULLET ); +ppDefItems[5] = new SvxNumBulletItem( aDefaultNumRule, EE_PARA_NUMBULLET ); ppDefItems[6] = new SfxBoolItem( EE_PARA_HYPHENATE, sal_False ); ppDefItems[7] = new SfxBoolItem( EE_PARA_BULLETSTATE, sal_True ); ppDefItems[8] = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE ); diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index 749dad5..52262c8 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -34,6 +34,7 @@ #include editeng/unofdesc.hxx #include editeng/unonrule.hxx #include editeng/editids.hrc +#include editeng/numdef.hxx using ::rtl::OUString; using ::com::sun::star::util::XCloneable; @@ -494,7 +495,7 @@ com::sun::star::uno::Reference com::sun::star::container::XIndexReplace SvxCr } else { -SvxNumRule aDefaultRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , sal_False); +SvxNumRule aDefaultRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, SVX_MAX_NUM , sal_False); return new SvxUnoNumberingRules( aDefaultRule ); } } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 306309d..beb774b 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -47,6 +47,7 @@ #include svx/svdocapt.hxx #include svx/svdotable.hxx #include editeng/outlobj.hxx +#include editeng/numdef.hxx #include svx/svdattr.hxx #include svx/xattr.hxx #include svx/svditext.hxx @@ -4283,20 +4284,20 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader rSlideHd, SvStream rIn, Sd eNumRuleType = SVX_RULETYPE_NUMBERING; break; case TSS_TYPE_SUBTITLE : -nLevels = 10; +nLevels = SVX_MAX_NUM; eNumRuleType = SVX_RULETYPE_NUMBERING; break; case TSS_TYPE_BODY : case TSS_TYPE_HALFBODY : case TSS_TYPE_QUARTERBODY : -nLevels = 10; +nLevels = SVX_MAX_NUM; eNumRuleType = SVX_RULETYPE_PRESENTATION_NUMBERING; break; default : case TSS_TYPE_NOTES : case TSS_TYPE_UNUSED : case TSS_TYPE_TEXT_IN_SHAPE : -nLevels = 10; +nLevels = SVX_MAX_NUM; eNumRuleType = SVX_RULETYPE_NUMBERING; break; } diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 3e1b1e1..56b8f08 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -40,6 +40,7 @@ #include editeng/ulspitem.hxx #include editeng/lspcitem.hxx #include editeng/adjitem.hxx +#include editeng/numdef.hxx
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - editeng/source
editeng/source/editeng/impedit3.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit 065c8507bc6393468c0186370b1b991e22008b27 Author: navin patidar pati...@kacst.edu.sa Date: Sat Feb 2 08:40:30 2013 +0300 fix fdo#59892 completely and fdo#33302 partially. fix fdo#33302 for rtl scripts in cal,impress and draw. Reviewed-on: https://gerrit.libreoffice.org/1961 Reviewed-by: Ahmad Harthi aalhar...@kacst.edu.sa Tested-by: Ahmad Harthi aalhar...@kacst.edu.sa (cherry picked from commit 73de30ca9ca0d3d4edd00e0e8f22451238699989) fix logic to get L/R direction Reviewed-on: https://gerrit.libreoffice.org/1972 Reviewed-by: Norbert Thiebaud nthieb...@gmail.com Tested-by: Norbert Thiebaud nthieb...@gmail.com (cherry picked from commit fb697ed0ab6e0182b45c78412563c51d6f22f9d5) Change-Id: I21449d8ee236d798481fc61fbb1b4d12623cac90 Signed-off-by: Lior Kaplan kaplanl...@gmail.com Reviewed-on: https://gerrit.libreoffice.org/2728 Reviewed-by: Fridrich Strba fridr...@documentfoundation.org Tested-by: Fridrich Strba fridr...@documentfoundation.org diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index b45c826..bada916 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4300,7 +4300,7 @@ void ImpEditEngine::ImplInitDigitMode( OutputDevice* pOutDev, String* pString, x void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_uInt16 nPara, sal_uInt16 nIndex ) { sal_Bool bCTL = sal_False; -sal_uInt8 bR2L = sal_False; +sal_Bool bR2L = sal_False; if ( nIndex == 0x ) { bCTL = HasScriptType( nPara, i18n::ScriptType::COMPLEX ); @@ -4311,8 +4311,9 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_uInt16 nPara, ContentNode* pNode = GetEditDoc().GetObject( nPara ); short nScriptType = GetScriptType( EditPaM( pNode, nIndex+1 ) ); bCTL = nScriptType == i18n::ScriptType::COMPLEX; -bR2L = GetRightToLeft( nPara, nIndex + 1); // this change was discussed in issue 37190 -// it also works for issue 55927 +// this change was discussed in issue 37190 +bR2L = GetRightToLeft( nPara, nIndex + 1) % 2 ? sal_True : sal_False; +// it also works for issue 55927 } sal_uLong nLayoutMode = pOutDev-GetLayoutMode(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - editeng/source
editeng/source/editeng/impedit3.cxx |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit 8518173f0b8dc73eece82be959e65dba2768d33c Author: Jan Holesovsky ke...@suse.cz Date: Mon Feb 25 14:46:21 2013 +0100 fdo#55931, fdo#57956: Fix both autofit and stretched width. This rewrites commit fa694a21b806ed7837c1337ec49a4b299c478393 (fix of fdo#55931), and fixes it a better way. Change-Id: I9ac0c78294e6a9c510c12b22547564b736416131 Reviewed-on: https://gerrit.libreoffice.org/2388 Tested-by: Thorsten Behrens tbehr...@suse.com Reviewed-by: Thorsten Behrens tbehr...@suse.com diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 964579c..098fd92 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2643,7 +2643,13 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont rF // ugly on the screen! OutputDevice* pDev = pOut ? pOut : GetRefDevice(); rFont.SetPhysFont( pDev ); -Size aRealSz( rFont.GetSize().Width(), rFont.GetSize().Height() ); +FontMetric aMetric( pDev-GetFontMetric() ); + +// Set the font as we want it to look like reset the Propr attribute +// so that it is not counted twice. +Size aRealSz( aMetric.GetSize() ); +rFont.SetPropr( 100 ); + if ( aStatus.DoStretch() ) { if ( nStretchY != 100 ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - editeng/source
editeng/source/editeng/impedit3.cxx | 64 +++- 1 file changed, 35 insertions(+), 29 deletions(-) New commits: commit 26817798a54bf7e81c4805c45c4200b8a697 Author: Armin Le Grand a...@apache.org Date: Fri Jun 8 09:24:39 2012 + Fix i#119756 Safer take care of empty paragraphs in EditEngine layouting This fixes fdo#59629 on our side. Conflicts: editeng/source/editeng/impedit3.cxx and moved sal_uInt16 nIndex back up in scope. (cherry picked from commit b57cb5326713da9e926bb2ad5a56dce90ac00a87) Change-Id: Ie2b5dac48b10ff8c031f481f0a7ddde644694975 Signed-off-by: Thorsten Behrens tbehr...@suse.com diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 098fd92..b45c826 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2880,6 +2880,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta pPDFExtOutDevData-BeginStructureElement( vcl::PDFWriter::Paragraph ); long nParaHeight = pPortion-GetHeight(); +sal_uInt16 nIndex = 0; if ( pPortion-IsVisible() ( ( !IsVertical() ( ( aStartPos.Y() + nParaHeight ) aClipRec.Top() ) ) || ( IsVertical() ( ( aStartPos.X() - nParaHeight ) aClipRec.Right() ) ) ) ) @@ -2891,6 +2892,9 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta sal_uInt16 nLines = pPortion-GetLines().Count(); sal_uInt16 nLastLine = nLines-1; +// #108052# +bool bEndOfParagraphWritten(false); + if ( !IsVertical() ) aStartPos.Y() += pPortion-GetFirstLineOffset(); else @@ -2901,9 +2905,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta const SvxLineSpacingItem rLSItem = ((const SvxLineSpacingItem)pPortion-GetNode()-GetContentAttribs().GetItem( EE_PARA_SBL )); sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; +bool bPaintBullet (false); + for ( sal_uInt16 nLine = 0; nLine nLines; nLine++ ) { pLine = pPortion-GetLines()[nLine]; +nIndex = pLine-GetStart(); DBG_ASSERT( pLine, NULL-Pointer in the line iterator in UpdateViews ); aTmpPos = aStartPos; if ( !IsVertical() ) @@ -2926,7 +2933,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta if ( ( !IsVertical() ( aStartPos.Y() aClipRec.Top() ) ) || ( IsVertical() aStartPos.X() aClipRec.Right() ) ) { -bool bPaintBullet (false); +bPaintBullet = false; // Why not just also call when stripping portions? This will give the correct values // and needs no position corrections in OutlinerEditEng::DrawingText which tries to call @@ -2945,37 +2952,9 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta // -- // Over the Portions of the line ... // -- -sal_uInt16 nIndex = pLine-GetStart(); bool bParsingFields = false; ::std::vector sal_Int32 ::iterator itSubLines; -// #i108052# When stripping a callback for empty paragraphs is needed. This -// was somehow lost/removed/killed by making the TextPortions with empty -// paragraph to type PORTIONKIND_TAB instead of PORTIONKIND_TEXT. Adding here - - // since I could not find out who and why this has - // changed. -// #i118881#: Do not include the empty paragraph -// after a bullet. Otherwise the wrong paragraph -// indices will eventually find their way into -// metafiles and break the association between -// paragraphs and Impress animations. - if(!bPaintBullet bStripOnly pLine-GetStartPortion() == pLine-GetEndPortion()) -{ -const Color aOverlineColor(pOutDev-GetOverlineColor()); -const Color aTextLineColor(pOutDev-GetTextLineColor()); - -GetEditEnginePtr()-DrawingText( -aTmpPos, String(), 0, 0, 0, -aTmpFont, n, nIndex, 0, -0, -