[Libreoffice-commits] core.git: Branch 'feature/cib_contract3753' - 3 commits - sw/inc sw/qa sw/source vcl/unx
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Thu Feb 4 18:34:17 UTC 2021
sw/inc/doc.hxx | 8
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 4
sw/qa/extras/unowriter/data/tdf134252_onlytable_protected.fodt | 87 ++++++++++
sw/qa/extras/unowriter/unowriter.cxx | 59 ++++++
sw/source/core/docnode/ndtbl.cxx | 18 +-
sw/source/core/frmedt/fecopy.cxx | 20 --
sw/source/core/frmedt/fetab.cxx | 3
sw/source/core/unocore/unoobj2.cxx | 2
sw/source/core/unocore/unotbl.cxx | 2
vcl/unx/generic/app/i18n_cb.cxx | 4
10 files changed, 179 insertions(+), 28 deletions(-)
New commits:
commit c13103179b9c1a8472d5d7b215075f25afaec252
Author: Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Thu Feb 4 12:36:41 2021 +0100
Commit: Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Feb 4 19:20:05 2021 +0100
sw: fix copying and deleting of table in section via API
This is a follow-up to 7ab349296dac79dad3fec09f60348efcbb9ea17e.
The first problem was that tables that contain protected cells refused
to be deleted, which caused an infinite loop in
SwXTextRange::DeleteAndInsert().
This also affected SwXTextTable::dispose(), and DDE tables.
Fix this by forcibly deleting even protected cells from UNO APIs;
protection is an UI feature.
The second problem was that pasting the table SwFEShell::Paste() would
set up aCpyPam so that it selects from the start node of the table to
the last text node in the table, excluding the table cell and table end
nodes, which caused:
DocumentContentOperationsManager.cxx:3548: An insufficient number of nodes were copied!
Fix this by setting up aCpyPam over the entire body section of the
clipboard document.
Change-Id: I8c6caee5e75260dff79f106efc11f9669feddc0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110411
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
(cherry picked from commit c598e0accf24e149520a22a8c062249f147844c7)
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index b80e1157a7c9..7a2096f303ad 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -21,6 +21,7 @@
// SwDoc interfaces
#include <o3tl/deleter.hxx>
+#include <o3tl/typed_flags_set.hxx>
#include <vcl/idle.hxx>
#include "swdllapi.h"
#include "swtypes.hxx"
@@ -1189,7 +1190,8 @@ public:
sal_uInt16 nCnt = 1, bool bBehind = true );
// Delete Columns/Rows in table.
- bool DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn = false );
+ enum class RowColMode { DeleteRow = 0, DeleteColumn = 1, DeleteProtected = 2 };
+ bool DeleteRowCol(const SwSelBoxes& rBoxes, RowColMode eMode = RowColMode::DeleteRow);
void DeleteRow( const SwCursor& rCursor );
void DeleteCol( const SwCursor& rCursor );
@@ -1658,6 +1660,10 @@ private:
};
+namespace o3tl {
+ template<> struct typed_flags<SwDoc::RowColMode> : is_typed_flags<SwDoc::RowColMode, 3> {};
+}
+
// This method is called in Dtor of SwDoc and deletes cache of ContourObjects.
void ClrContourCache();
diff --git a/sw/qa/extras/unowriter/data/tdf134252_onlytable_protected.fodt b/sw/qa/extras/unowriter/data/tdf134252_onlytable_protected.fodt
new file mode 100644
index 000000000000..f588fdba0515
--- /dev/null
+++ b/sw/qa/extras/unowriter/data/tdf134252_onlytable_protected.fodt
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns
:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="ur
n:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+ <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/>
+ </style:default-style>
+ <style:default-style style:family="table">
+ <style:table-properties table:border-model="collapsing"/>
+ </style:default-style>
+ <style:default-style style:family="table-row">
+ <style:table-row-properties fo:keep-together="auto"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
+ <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
+ <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Table1" style:family="table">
+ <style:table-properties style:width="17cm" table:align="margins"/>
+ </style:style>
+ <style:style style:name="Table1.A" style:family="table-column">
+ <style:table-column-properties style:column-width="17cm" style:rel-column-width="65535*"/>
+ </style:style>
+ <style:style style:name="Table1.A1" style:family="table-cell">
+ <style:table-cell-properties fo:padding="0.097cm" fo:border="0.05pt solid #000000"/>
+ </style:style>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
+ <style:text-properties officeooo:rsid="00078615" officeooo:paragraph-rsid="00078615"/>
+ </style:style>
+ <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+ <style:text-properties officeooo:rsid="00095b34" officeooo:paragraph-rsid="00095b34"/>
+ </style:style>
+ <style:style style:name="Sect1" style:family="section">
+ <style:section-properties fo:background-color="#81d41a" style:editable="false">
+ <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+ <style:background-image/>
+ </style:section-properties>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:sequence-decls>
+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+ </text:sequence-decls>
+ <text:section text:style-name="Sect1" text:name="Section1">
+ <table:table table:name="Table1" table:style-name="Table1">
+ <table:table-column table:style-name="Table1.A"/>
+ <table:table-row>
+ <table:table-cell table:style-name="Table1.A1" office:value-type="string" table:protected="true">
+ <text:p text:style-name="P3">baz</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ </text:section>
+ <text:p text:style-name="P1">foo</text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx
index fd3fe08a5a13..48c3ed7ba90d 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -481,6 +481,65 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTableAtEnd)
xCursor->getString());
}
+CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTable)
+{
+ // this contains a section that ends with a table (plus another section)
+ load(DATA_DIRECTORY, "tdf134252_onlytable_protected.fodt");
+
+ uno::Reference<text::XTextTablesSupplier> const xTextTablesSupplier(mxComponent,
+ uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> const xTables(xTextTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
+
+ uno::Reference<text::XTextSectionsSupplier> const xTextSectionsSupplier(mxComponent,
+ uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> const xSections(
+ xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
+
+ uno::Reference<text::XTextContent> const xSection(xSections->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> const xAnchor(xSection->getAnchor());
+ CPPUNIT_ASSERT_EQUAL(OUString("baz" SAL_NEWLINE_STRING), xAnchor->getString());
+
+ // copy the content of the section to a clipboard document
+ uno::Reference<datatransfer::XTransferableSupplier> const xTS(
+ uno::Reference<frame::XModel>(mxComponent, uno::UNO_QUERY_THROW)->getCurrentController(),
+ uno::UNO_QUERY);
+ uno::Reference<datatransfer::XTransferableTextSupplier> const xTTS(xTS, uno::UNO_QUERY);
+ uno::Reference<datatransfer::XTransferable> const xTransferable(
+ xTTS->getTransferableForTextRange(xAnchor));
+
+ // check this doesn't throw
+ CPPUNIT_ASSERT(xAnchor->getStart().is());
+ CPPUNIT_ASSERT(xAnchor->getEnd().is());
+
+ // replace section content
+ xAnchor->setString("quux");
+
+ // table in section was deleted, but not section itself
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("\""
+ "quux" /*SAL_NEWLINE_STRING*/ "\""),
+ OUString("\"" + xAnchor->getString() + "\""));
+
+ // now paste it
+ uno::Reference<text::XTextViewCursorSupplier> const xTVCS(xTS, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursor> const xCursor(xTVCS->getViewCursor());
+ xCursor->gotoEnd(false);
+ xTS->insertTransferable(xTransferable);
+
+ // table in section was pasted, but not section itself
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
+ xCursor->gotoStart(true);
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("quux" SAL_NEWLINE_STRING "foo" SAL_NEWLINE_STRING "baz" SAL_NEWLINE_STRING),
+ xCursor->getString());
+}
+
CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTextRangeInTable)
{
load(DATA_DIRECTORY, "bookmarkintable.fodt");
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 15a49729ce51..8c733e5f92ab 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1929,22 +1929,28 @@ void SwDoc::DeleteCol( const SwCursor& rCursor )
// Thus delete the Columns
GetIDocumentUndoRedo().StartUndo(SwUndoId::COL_DELETE, nullptr);
- DeleteRowCol( aBoxes, true );
+ DeleteRowCol(aBoxes, SwDoc::RowColMode::DeleteColumn);
GetIDocumentUndoRedo().EndUndo(SwUndoId::COL_DELETE, nullptr);
}
-bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
+bool SwDoc::DeleteRowCol(const SwSelBoxes& rBoxes, RowColMode const eMode)
{
- if( ::HasProtectedCells( rBoxes ))
+ if (!(eMode & SwDoc::RowColMode::DeleteProtected)
+ && ::HasProtectedCells(rBoxes))
+ {
return false;
+ }
OSL_ENSURE( !rBoxes.empty(), "No valid Box list" );
SwTableNode* pTableNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTableNd )
return false;
- if( dynamic_cast<const SwDDETable*>( &pTableNd->GetTable() ) != nullptr)
+ if (!(eMode & SwDoc::RowColMode::DeleteProtected)
+ && dynamic_cast<const SwDDETable*>(&pTableNd->GetTable()) != nullptr)
+ {
return false;
+ }
::ClearFEShellTabCols(*this, nullptr);
SwSelBoxes aSelBoxes( rBoxes );
@@ -1953,7 +1959,7 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
long nMax = 0;
if( rTable.IsNewModel() )
{
- if( bColumn )
+ if (eMode & SwDoc::RowColMode::DeleteColumn)
rTable.ExpandColumnSelection( aSelBoxes, nMin, nMax );
else
rTable.FindSuperfluousRows( aSelBoxes );
@@ -2112,7 +2118,7 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
if (rTable.IsNewModel())
{
- if (bColumn)
+ if (eMode & SwDoc::RowColMode::DeleteColumn)
rTable.PrepareDeleteCol( nMin, nMax );
rTable.FindSuperfluousRows( aSelBoxes );
if (pUndo)
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index c2470b997a93..f8bb7b36ff4b 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -686,25 +686,19 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bNestedTable )
OSL_ENSURE( pClpDoc, "no clipboard document" );
// then till end of the nodes array
SwNodeIndex aIdx( pClpDoc->GetNodes().GetEndOfExtras(), 2 );
- SwPaM aCpyPam( aIdx ); //DocStart
+ // select content section, whatever it may contain
+ SwPaM aCpyPam(aIdx, SwNodeIndex(pClpDoc->GetNodes().GetEndOfContent(), -1));
+ if (SwContentNode *const pAtEnd = aCpyPam.GetNode(true).GetContentNode())
+ {
+ pAtEnd->MakeEndIndex(&aCpyPam.GetPoint()->nContent);
+ }
// If there are table formulas in the area, then display the table first
// so that the table formula can calculate a new value first
// (individual boxes in the area are retrieved via the layout)
SwFieldType* pTableFieldTyp = GetDoc()->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::Table );
- SwTableNode *const pSrcNd = aCpyPam.GetNode().GetTableNode();
- if( !pSrcNd ) // table node ?
- { // don't skip !!
- SwContentNode* pCNd = aCpyPam.GetNode().GetContentNode();
- if( pCNd )
- aCpyPam.GetPoint()->nContent.Assign( pCNd, 0 );
- else if( !aCpyPam.Move( fnMoveForward, GoInNode ))
- aCpyPam.Move( fnMoveBackward, GoInNode );
- }
-
- aCpyPam.SetMark();
- aCpyPam.Move( fnMoveForward, GoInDoc );
+ SwTableNode *const pSrcNd = aCpyPam.GetNode(false).GetTableNode();
bool bRet = true;
StartAllAction();
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index a6cd65a55d15..f60c49fb5b6b 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -296,9 +296,8 @@ bool SwFEShell::DeleteCol()
// then delete the column
StartUndo(SwUndoId::COL_DELETE);
- bRet = GetDoc()->DeleteRowCol( aBoxes, true );
+ bRet = GetDoc()->DeleteRowCol(aBoxes, SwDoc::RowColMode::DeleteColumn);
EndUndo(SwUndoId::COL_DELETE);
-
}
else
bRet = false;
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 8e17f700c4d9..e7673186713c 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -829,7 +829,7 @@ static void DeleteTable(SwDoc & rDoc, SwTable& rTable)
}
// note: if the table is the content in the section, this will create
// a new text node - that's desirable here
- rDoc.DeleteRowCol(aSelBoxes);
+ rDoc.DeleteRowCol(aSelBoxes, SwDoc::RowColMode::DeleteProtected);
}
void SwXTextRange::DeleteAndInsert(
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index e2e5e123871e..b80268283d38 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2227,7 +2227,7 @@ void SwXTextTable::dispose()
SwSelBoxes aSelBoxes;
for(auto& rBox : pTable->GetTabSortBoxes() )
aSelBoxes.insert(rBox);
- pFormat->GetDoc()->DeleteRowCol(aSelBoxes);
+ pFormat->GetDoc()->DeleteRowCol(aSelBoxes, SwDoc::RowColMode::DeleteProtected);
}
void SAL_CALL SwXTextTable::addEventListener(
commit 36b58cc7855a5b8e63e064f9315034fe2fc1e175
Author: Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Thu Feb 4 19:19:30 2021 +0100
Commit: Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Feb 4 19:20:04 2021 +0100
avoid -Werror=unused-variable
Change-Id: I5002ca7411d0d9f85b95af864d5cf3dcd201c34c
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 70b63e251495..1fafe8052c05 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -441,15 +441,15 @@ DECLARE_OOXMLEXPORT_TEST(testDrawingmlFlipv, "drawingml-flipv.docx")
DECLARE_OOXMLEXPORT_TEST(testRot90Fliph, "rot90-fliph.docx")
{
+#if 0
// The problem was that a shape rotation of 90° got turned into 270° after roundtrip.
if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
{
-#if 0
assertXPath(pXmlDoc, "//a:xfrm", "flipH", "1");
// This was 16200000 (270 * 60000).
assertXPath(pXmlDoc, "//a:xfrm", "rot", "5400000");
-#endif
}
+#endif
}
DECLARE_OOXMLEXPORT_TEST(testRot180Flipv, "rot180-flipv.docx")
commit 39679b253d09a0137f2ffa822794e43cce2117c2
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Sep 26 11:38:51 2020 +0200
Commit: Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Feb 4 19:20:04 2021 +0100
Avoid -Werror=nonnull with glibc-headers-x86-2.32-1.fc33.noarch
...on Fedora 33:
> ~/lo/core/vcl/unx/generic/app/i18n_cb.cxx: In function ‘void Preedit_InsertText(preedit_text_t*, XIMText*, int)’:
> ~/lo/core/vcl/unx/generic/app/i18n_cb.cxx:149:34: error: argument 1 is null but the corresponding size argument 3 value is 1024 [-Werror=nonnull]
> 149 | size_t nBytes = wcstombs ( nullptr, pWCString, 1024 /* don't care */);
> | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from ~/gcc/trunk/inst/include/c++/11.0.0/cstdlib:75,
> from ~/lo/core/include/sal/log.hxx:15,
> from ~/lo/core/vcl/unx/generic/app/i18n_cb.cxx:25:
> /usr/include/stdlib.h:937:15: note: in a call to function ‘size_t wcstombs(char*, const wchar_t*, size_t)’ declared with attribute ‘access (write_only, 1, 3)’
> 937 | extern size_t wcstombs (char *__restrict __s,
> | ^~~~~~~~
(Allowing the first argument to wcstombs to be null, and in which case the third
argument is ignored, is a POSIX extension.)
Change-Id: Ic078623643010b7539bc5bc1b498f18977ae77ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103473
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
(cherry picked from commit 782d160458d319c6c77fffa4c003c519afffaa17)
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx
index e9861dca51d8..4f05e11a5845 100644
--- a/vcl/unx/generic/app/i18n_cb.cxx
+++ b/vcl/unx/generic/app/i18n_cb.cxx
@@ -142,7 +142,7 @@ Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where)
if (pInsertText->encoding_is_wchar)
{
wchar_t *pWCString = pInsertText->string.wide_char;
- size_t nBytes = wcstombs ( nullptr, pWCString, 1024 /* don't care */);
+ size_t nBytes = wcstombs ( nullptr, pWCString, 0 /* don't care */);
pMBString = static_cast<char*>(alloca( nBytes + 1 ));
nMBLength = wcstombs ( pMBString, pWCString, nBytes + 1);
}
@@ -476,7 +476,7 @@ StatusDrawCallback (XIC, XPointer, XIMStatusDrawCallbackStruct *call_data)
if( call_data->data.text->string.wide_char )
{
wchar_t* pWString = call_data->data.text->string.wide_char;
- size_t nBytes = wcstombs( nullptr, pWString, 1024 );
+ size_t nBytes = wcstombs( nullptr, pWString, 0 /*don't care*/ );
pMBString = static_cast<sal_Char*>(alloca( nBytes+1 ));
nLength = wcstombs( pMBString, pWString, nBytes+1 );
}
More information about the Libreoffice-commits
mailing list