summaryrefslogtreecommitdiffstats
path: root/editeng/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2019-05-27 20:52:18 +0200
committerJulien Nabet <serval2412@yahoo.fr>2019-05-28 10:21:53 +0200
commite8f4bf9df5b6a9b24256d00462d94c430e319134 (patch)
tree5255d1a0fb86cd7655daadf61087bd0f96200183 /editeng/source
parentFix domain in ui files (sfx2, svtools) (diff)
downloadcore-e8f4bf9df5b6a9b24256d00462d94c430e319134.tar.gz
core-e8f4bf9df5b6a9b24256d00462d94c430e319134.zip
Add comment about this "weird assignment" in editdoc
See http://document-foundation-mail-archive.969070.n3.nabble.com/Fishy-assignment-in-editdoc-editeng-td4262109.html Remove the previous comment less clear Change-Id: I06b0bc3254068d58146d9582c2b69afbadbe56ee Reviewed-on: https://gerrit.libreoffice.org/73062 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/editdoc.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 63990e4c9121..73a356054741 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2025,10 +2025,12 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S
if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_RELIEF ) == SfxItemState::SET ) )
rFont.SetRelief( rSet.Get( EE_CHAR_RELIEF ).GetValue() );
- // If comparing the entire font, or if checking before each alteration
- // whether the value changes, remains relatively the same thing.
- // So possible one MakeUniqFont more in the font, but as a result a quicker
- // abortion of the query, or one must each time check bChanged.
+ // Operator == compares the individual members of the font if the impl pointer is
+ // not equal. If all members are the same, this assignment makes
+ // sure that both also point to the same internal instance of the font.
+ // To avoid this assignment, you would need to check in
+ // every if statement above whether or not the new value differs from the
+ // old value before making an assignment.
if ( rFont == aPrevFont )
rFont = aPrevFont; // => The same ImpPointer for IsSameInstance
}