[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - 2 commits - cui/source sw/qa sw/source
Mike Kaganski
mike.kaganski at collabora.com
Thu Apr 26 14:16:39 UTC 2018
cui/source/dialogs/SpellDialog.cxx | 21 +++++++++++----------
sw/qa/core/data/ww8/pass/tdf117129_dxagoal0.doc |binary
sw/source/filter/ww8/ww8graf2.cxx | 3 ++-
3 files changed, 13 insertions(+), 11 deletions(-)
New commits:
commit ea33797be1b683ca5743a00bd3347d0806bd62a8
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date: Mon Apr 16 14:25:16 2018 +0100
tdf#116725: justify selection to handle right-to-left selections
Change-Id: I6298a87170236059ff08a1f891ead21236be663a
Reviewed-on: https://gerrit.libreoffice.org/52979
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit f7de9473b2fddd84d03fb521709d805486292800)
Reviewed-on: https://gerrit.libreoffice.org/53043
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index a81b3ede251a..c99efacc7217 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1247,15 +1247,16 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt )
{
TextEngine* pTextEngine = GetTextEngine();
TextView* pTextView = pTextEngine->GetActiveView();
- const TextSelection& rCurrentSelection = pTextView->GetSelection();
+ TextSelection aCurrentSelection = pTextView->GetSelection();
+ aCurrentSelection.Justify();
//determine if the selection contains a field
bool bHasFieldLeft = false;
bool bHasErrorLeft = false;
- bool bHasRange = rCurrentSelection.HasRange();
+ bool bHasRange = aCurrentSelection.HasRange();
sal_uInt8 nSelectionType = 0; // invalid type!
- TextPaM aCursor(rCurrentSelection.GetStart());
+ TextPaM aCursor(aCurrentSelection.GetStart());
const TextCharAttrib* pBackAttr = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_BACKGROUND );
const TextCharAttrib* pErrorAttr = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_ERROR );
const TextCharAttrib* pBackAttrLeft = nullptr;
@@ -1266,21 +1267,21 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt )
if(bHasRange)
{
if(pBackAttr &&
- pBackAttr->GetStart() == rCurrentSelection.GetStart().GetIndex() &&
- pBackAttr->GetEnd() == rCurrentSelection.GetEnd().GetIndex())
+ pBackAttr->GetStart() == aCurrentSelection.GetStart().GetIndex() &&
+ pBackAttr->GetEnd() == aCurrentSelection.GetEnd().GetIndex())
{
nSelectionType = FULL;
}
else if(pErrorAttr &&
- pErrorAttr->GetStart() <= rCurrentSelection.GetStart().GetIndex() &&
- pErrorAttr->GetEnd() >= rCurrentSelection.GetEnd().GetIndex())
+ pErrorAttr->GetStart() <= aCurrentSelection.GetStart().GetIndex() &&
+ pErrorAttr->GetEnd() >= aCurrentSelection.GetEnd().GetIndex())
{
nSelectionType = INSIDE_YES;
}
else
{
nSelectionType = bHasField||bHasError ? BRACE : OUTSIDE_NO;
- while(aCursor.GetIndex() < rCurrentSelection.GetEnd().GetIndex())
+ while(aCursor.GetIndex() < aCurrentSelection.GetEnd().GetIndex())
{
++aCursor.GetIndex();
const TextCharAttrib* pIntBackAttr = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_BACKGROUND );
@@ -1301,8 +1302,8 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt )
const TextCharAttrib* pCurAttr = pBackAttr ? pBackAttr : pErrorAttr;
if(pCurAttr)
{
- nSelectionType = pCurAttr->GetStart() == rCurrentSelection.GetStart().GetIndex() ?
- LEFT_NO : pCurAttr->GetEnd() == rCurrentSelection.GetEnd().GetIndex() ? RIGHT_NO : INSIDE_NO;
+ nSelectionType = pCurAttr->GetStart() == aCurrentSelection.GetStart().GetIndex() ?
+ LEFT_NO : pCurAttr->GetEnd() == aCurrentSelection.GetEnd().GetIndex() ? RIGHT_NO : INSIDE_NO;
}
else
nSelectionType = OUTSIDE_NO;
commit 9b55701b88c42cac491587072f1f09522207de77
Author: Justin Luth <justin_luth at sil.org>
Date: Mon Apr 23 09:27:00 2018 +0300
tdf#117129 ww8import: prevent divide-by-zero
Before commit ffc3358515799057e72379b76a1165c6ea5a9bd1 for
tdf#75539, the divisor was hard-coded at 1000. The preceeding code
also notes that an undefined relativeWidth is forced to 1000.
So, on an invalid divisor, revert to previous behaviour.
Change-Id: I40210194eec39682d9ab3ce68268d343af16e2b1
Reviewed-on: https://gerrit.libreoffice.org/53329
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/qa/core/data/ww8/pass/tdf117129_dxagoal0.doc b/sw/qa/core/data/ww8/pass/tdf117129_dxagoal0.doc
new file mode 100644
index 000000000000..9fca8ef048ae
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/tdf117129_dxagoal0.doc differ
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index fde01e6ad296..4035d583c1ba 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -579,10 +579,11 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj,
relativeWidth = pRecord->isHorizontalRule ? 1000 : 0;
if( relativeWidth != 0 )
{
+ const sal_Int16 nScale = aPic.dxaGoal ? aPic.dxaGoal : 1000;
aPic.mx = msword_cast<sal_uInt16>(
m_aSectionManager.GetPageWidth() -
m_aSectionManager.GetPageRight() -
- m_aSectionManager.GetPageLeft()) * relativeWidth / aPic.dxaGoal;
+ m_aSectionManager.GetPageLeft()) * relativeWidth / nScale;
aPD = WW8PicDesc( aPic );
// This SetSnapRect() call adjusts the size of the
// object itself, no idea why it's this call (or even
More information about the Libreoffice-commits
mailing list