summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorAttila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>2022-04-05 13:37:55 +0200
committerLászló Németh <nemeth@numbertext.org>2022-04-28 11:47:42 +0200
commit41b012767feb8552b60a68c7be18d80c403304bf (patch)
treea0ec2781fbc34a50216c84b8be8d446deb5b7b86 /sw/source/uibase
parent6c724e18c2af227c2ad865342531ff35b0d511ac (diff)
tdf#100680 sw DOCX compatibility: fix wrap of as_char flys
New DOCX compatibility flag "WordLikeWrapForAsCharFlys" has been introduced which true in case of importing DOCX documents. It modifies the wrapping of long words with as_char anchored flys anchored into the same line, resulting e.g. correct import of poor man's header lines drawn by using underline characters under an image. Note: this example was imported as a broken header line: half of it was there after the left aligned image in the same line, and after the line break, only the other half under the image. Change-Id: I9474900ef778bcf5ddc9d95f39d536d67015f3b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132571 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 4cfda7bbf3e4..49e6baeb4b28 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -152,6 +152,7 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_FOOTNOTE_IN_COLUMN_TO_PAGEEND,
HANDLE_IMAGE_PREFERRED_DPI,
HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE,
+ HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS
};
}
@@ -250,6 +251,7 @@ static rtl::Reference<MasterPropertySetInfo> lcl_createSettingsInfo()
{ OUString("FootnoteInColumnToPageEnd"), HANDLE_FOOTNOTE_IN_COLUMN_TO_PAGEEND, cppu::UnoType<bool>::get(), 0 },
{ OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType<sal_Int32>::get(), 0 },
{ OUString("AutoFirstLineIndentDisregardLineSpace"), HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE, cppu::UnoType<bool>::get(), 0 },
+ { OUString("WordLikeWrapForAsCharFlys"), HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS, cppu::UnoType<bool>::get(), 0 },
/*
* As OS said, we don't have a view when we need to set this, so I have to
@@ -1051,6 +1053,14 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
}
}
break;
+ case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS:
+ {
+ bool bValue = false;
+ if (rValue >>= bValue)
+ mpDoc->getIDocumentSettingAccess().set(
+ DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML, bValue);
+ }
+ break;
default:
throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
}
@@ -1574,6 +1584,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE);
}
break;
+ case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS:
+ {
+ rValue <<= mpDoc->getIDocumentSettingAccess().get(
+ DocumentSettingId::WRAP_AS_CHAR_FLYS_LIKE_IN_OOXML);
+ }
+ break;
default:
throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
}