summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-04-10 23:02:01 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-04-11 20:23:06 +0000
commit312fc74f5bb49da4066ace46558179a03e164556 (patch)
tree4599ef4a1a5c0466d824522bff276d6457a4e182 /sw/source/uibase
parent8ccdd23ac00e90333a02c9cee6e4353632d8883e (diff)
tdf#86578: sw: fix rendering of legacy documents with fly achored at fly
Resurrect the special hack "lcl_SubtractFlys" that effectively paints "lower" flys on top of "higher" flys, defying the z-ordering, if the lower fly is *anchored* in or at the higher fly. It turns out that this is not obvious to emulate in any other way that it is currently implemented: One idea would be to split up painting of the fly background from the foreground, by creating 2 different view objects per fly as children of the SdrPage when decomposing it in svx; but the problem is, they will be ordered in z-order of the flys, and the point would be to paint the backgrounds first and in a different order, call it "anchoring order". What that order should be is hard to tell, there is a conflict between the defined z-order and the flys that are part of one "anchoring hierarchy" and should have their backgrounds re-ordered, because entirely unrelated flys that could belong to different "anchoring hierarchies" but overlap the first ones may result in a cyclic ordering. Painting one "anchoring hierarchy" recursively would not get z-order of flys from different anchoring hierarchies right. Another difficulty is that heaven-layer backgrounds would need to be painted before hell-layer ones. Another aspect of the lcl_SubtractFlys is that it entirely ignores drawing shapes; only Writer's own flys are handled. Since none of the above makes much sense, we clearly want to deprecate the lcl_SubtractFlys rendering. Introduce a new compatibility flag "SubtractFlysAnchoredAtFlys" so that the legacy rendering is only active for legacy documents, while new ones remain free from its taint. (regression from 6e61ecd09679a66060f932835622821d39e92f01) (cherry picked from commit c5cf8824a619401627f18abc7b3049551c71ac2a) Conflicts: sw/inc/IDocumentSettingAccess.hxx sw/source/core/doc/DocumentSettingManager.cxx sw/source/core/layout/paintfrm.cxx Change-Id: I710fe79710b89c8f865ebb7162e14713aac6cc4a Reviewed-on: https://gerrit.libreoffice.org/15238 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index aceed1f91318..33def9cda448 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -128,6 +128,7 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_SURROUND_TEXT_WRAP_SMALL,
HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING,
HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE,
+ HANDLE_SUBTRACT_FLYS,
};
static MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -200,6 +201,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
{ OUString("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType<bool>::get(), 0, 0},
{ OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0, 0},
{ OUString("PropLineSpacingShrinksFirstLine"), HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType<bool>::get(), 0, 0},
+ { OUString("SubtractFlysAnchoredAtFlys"), HANDLE_SUBTRACT_FLYS, cppu::UnoType<bool>::get(), 0, 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
* find another solution before adding them to this property set - MTG
@@ -817,6 +819,16 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
}
}
break;
+ case HANDLE_SUBTRACT_FLYS:
+ {
+ bool bTmp;
+ if (rValue >>= bTmp)
+ {
+ mpDoc->getIDocumentSettingAccess().set(
+ IDocumentSettingAccess::SUBTRACT_FLYS, bTmp);
+ }
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -1253,6 +1265,13 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue <<= bTmp;
}
break;
+ case HANDLE_SUBTRACT_FLYS:
+ {
+ bool const bTmp(mpDoc->getIDocumentSettingAccess().get(
+ IDocumentSettingAccess::SUBTRACT_FLYS));
+ rValue <<= bTmp;
+ }
+ break;
default:
throw UnknownPropertyException();
}