diff options
author | Attila Szűcs <attila.szucs@collabora.com> | 2024-07-11 11:24:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-07-17 10:52:38 +0200 |
commit | 84d63cfccf7af8f2b3b689ab0e622f8b408eb470 (patch) | |
tree | 55c561e5d09759e2045b897f29f5ee18042898f3 /desktop/source | |
parent | ddcc9515bc4313b580fad6474b603266ef2b9c15 (diff) |
Sw: extract/transform document structure 2
inserting a ContentControl, now generate a unique ID for it...
search the lowest possible non used (non negative) number
added a GetType() function for SwXContentControl that get it from
SwContentControl, and used it for extract and transform.
Added some support for all other types.. some are not really usable
yet.
Fixed a problem when setting checkbox check, did not changed its
content.
If content is set to “”. It now set as placeholder,
and reset its content to the initial placeholder value, like:
“Choose an item” or “Click here to enter text”
(work for checkbox, and picture CntentControl.)
Change-Id: I0fc696f73734bdfb9ac5b8fdc6891168b8d4ed5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170600
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/init.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2769c47bf9b0..48b771c9f7f3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2588,7 +2588,8 @@ static void lo_setOption(LibreOfficeKit* pThis, const char* pOption, const char* static void lo_dumpState(LibreOfficeKit* pThis, const char* pOptions, char** pState); -static char* lo_extractDocumentStructureRequest(LibreOfficeKit* pThis, const char* pFilePath); +static char* lo_extractDocumentStructureRequest(LibreOfficeKit* pThis, const char* pFilePath, + const char* pFilter); LibLibreOffice_Impl::LibLibreOffice_Impl() : m_pOfficeClass( gOfficeClass.lock() ) @@ -3147,7 +3148,8 @@ static char* lo_extractRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath) return strdup("{ }"); } -static char* lo_extractDocumentStructureRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath) +static char* lo_extractDocumentStructureRequest(LibreOfficeKit* /*pThis*/, const char* pFilePath, + const char* pFilter) { uno::Reference<frame::XDesktop2> xComponentLoader = frame::Desktop::create(xContext); uno::Reference< css::lang::XComponent > xComp; @@ -3194,9 +3196,14 @@ static char* lo_extractDocumentStructureRequest(LibreOfficeKit* /*pThis*/, const { tools::JsonWriter aJson; { - pDoc->getCommandValues(aJson, ".uno:ExtractDocumentStructure"); - //auto aNode = aJson.startNode("Controls"); - //extractLinks(xLTS->getLinks(), false, aJson); + OString aCommand = ".uno:ExtractDocumentStructure"_ostr; + if (pFilter && pFilter[0]) + { + aCommand + = OString::Concat(aCommand) + "?filter="_ostr + pFilter; + } + + pDoc->getCommandValues(aJson, aCommand); } return convertOString(aJson.finishAndGetAsOString()); } |