summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:47:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:47:06 +0000
commit8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59 (patch)
treeca2b0cc4fba88107f5f6e740285184a061011866 /sc
parentAdding debian version 4:24.2.3-2. (diff)
downloadlibreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.tar.xz
libreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.zip
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/Library_vbaobj.mk1
-rw-r--r--sc/Module_sc.mk7
-rw-r--r--sc/inc/column.hxx2
-rw-r--r--sc/inc/interpretercontext.hxx51
-rw-r--r--sc/inc/patattr.hxx2
-rwxr-xr-xsc/qa/uitest/pasteSpecial/tdf160765.py34
-rw-r--r--sc/qa/unit/data/ods/tdf160329_sortWithHiddenRows.odsbin0 -> 16799 bytes
-rw-r--r--sc/qa/unit/scshapetest.cxx37
-rw-r--r--sc/source/core/data/column3.cxx5
-rw-r--r--sc/source/core/data/patattr.cxx11
-rw-r--r--sc/source/core/data/queryevaluator.cxx2
-rw-r--r--sc/source/core/data/table3.cxx78
-rw-r--r--sc/source/core/inc/interpre.hxx6
-rw-r--r--sc/source/core/tool/interpr4.cxx49
-rw-r--r--sc/source/core/tool/interpretercontext.cxx57
-rw-r--r--sc/source/filter/excel/excrecds.cxx5
-rw-r--r--sc/source/filter/html/htmlpars.cxx6
-rw-r--r--sc/source/filter/oox/extlstcontext.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx4
-rw-r--r--sc/source/ui/app/inputwin.cxx19
-rw-r--r--sc/source/ui/app/transobj.cxx31
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx68
-rw-r--r--sc/source/ui/dialogs/searchresults.cxx20
-rw-r--r--sc/source/ui/docshell/docfunc.cxx6
-rw-r--r--sc/source/ui/inc/output.hxx1
-rw-r--r--sc/source/ui/miscdlgs/inscodlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx16
-rw-r--r--sc/source/ui/namedlg/namedefdlg.cxx8
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx4
-rw-r--r--sc/source/ui/navipi/content.cxx2
-rw-r--r--sc/source/ui/undo/undodat.cxx129
-rw-r--r--sc/source/ui/undo/undotab.cxx26
-rw-r--r--sc/source/ui/view/formatsh.cxx2
-rw-r--r--sc/source/ui/view/output.cxx1
-rw-r--r--sc/source/ui/view/output3.cxx8
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx2
-rw-r--r--sc/uiconfig/scalc/ui/conditionalentry.ui343
37 files changed, 690 insertions, 360 deletions
diff --git a/sc/Library_vbaobj.mk b/sc/Library_vbaobj.mk
index 49868d85e9..b35e929b32 100644
--- a/sc/Library_vbaobj.mk
+++ b/sc/Library_vbaobj.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Library_use_libraries,vbaobj,\
cppuhelper \
editeng \
for \
+ i18nlangtag \
msfilter \
sal \
sb \
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 3281184d82..cd64a952ad 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -272,7 +272,6 @@ $(eval $(call gb_Module_add_uicheck_targets,sc,\
UITest_csv_dialog \
UITest_external_links \
UITest_statistics \
- UITest_solver \
UITest_goalSeek \
UITest_protect \
UITest_sc_options \
@@ -294,6 +293,12 @@ $(eval $(call gb_Module_add_uicheck_targets,sc,\
UITest_function_wizard \
UITest_manual_tests \
))
+
+ifneq ($(or $(ENABLE_LPSOLVE),$(ENABLE_COINMP)),)
+$(eval $(call gb_Module_add_uicheck_targets,sc,\
+ UITest_solver \
+))
+endif
endif
# vim: set noet sw=4 ts=4:
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 733923b0f5..69850197bd 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -984,7 +984,7 @@ inline const SfxPoolItem& ScColumnData::GetAttr( SCROW nRow, sal_uInt16 nWhich,
inline sal_uInt32 ScColumnData::GetNumberFormat( const ScInterpreterContext& rContext, SCROW nRow ) const
{
- return pAttrArray->GetPattern( nRow )->GetNumberFormat( rContext.GetFormatTable() );
+ return pAttrArray->GetPattern( nRow )->GetNumberFormat( rContext );
}
inline void ScColumn::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex )
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx
index 39d528cb6c..bc6dcf0f94 100644
--- a/sc/inc/interpretercontext.hxx
+++ b/sc/inc/interpretercontext.hxx
@@ -9,13 +9,16 @@
#pragma once
+#include <array>
#include <vector>
#include <memory>
+#include <i18nlangtag/lang.h>
+#include <svl/numformat.hxx>
#include "types.hxx"
namespace formula
{
-class FormulaToken;
+class FormulaTypedDoubleToken;
}
#define TOKEN_CACHE_SIZE 8
@@ -34,27 +37,13 @@ struct DelayedSetNumberFormat
sal_uInt32 mnNumberFormat;
};
-struct NFIndexAndFmtType
-{
- sal_uInt32 nIndex;
- SvNumFormatType eType : 16;
- bool bIsValid : 1;
-
- NFIndexAndFmtType()
- : nIndex(0)
- , eType(static_cast<SvNumFormatType>(0))
- , bIsValid(false)
- {
- }
-};
-
class ScInterpreterContextPool;
struct ScInterpreterContext
{
const ScDocument* mpDoc;
size_t mnTokenCachePos;
- std::vector<formula::FormulaToken*> maTokens;
+ std::vector<formula::FormulaTypedDoubleToken*> maTokens;
std::vector<DelayedSetNumberFormat> maDelayedSetNumberFormat;
std::unique_ptr<ScLookupCacheMap> mxScLookupCache; // cache for lookups like VLOOKUP and MATCH
// Allocation cache for "aConditions" array in ScInterpreter::IterateParameterIfs()
@@ -77,6 +66,8 @@ struct ScInterpreterContext
SvNumFormatType GetNumberFormatType(sal_uInt32 nFIndex) const;
+ sal_uInt32 GetFormatForLanguageIfBuiltIn(sal_uInt32 nFormat, LanguageType eLnge) const;
+
private:
friend class ScInterpreterContextPool;
void ResetTokens();
@@ -85,7 +76,33 @@ private:
void ClearLookupCache(const ScDocument* pDoc);
void initFormatTable();
SvNumberFormatter* mpFormatter;
- mutable NFIndexAndFmtType maNFTypeCache;
+
+ // Some temp caches of the 4 most recent results from NumberFormatting
+ // lookups.
+ struct NFBuiltIn
+ {
+ sal_uInt64 nKey;
+ sal_uInt32 nFormat;
+ NFBuiltIn()
+ : nKey(SAL_MAX_UINT64)
+ , nFormat(SAL_MAX_UINT32)
+ {
+ }
+ };
+ // from format+lang to builtin format
+ mutable std::array<NFBuiltIn, 4> maNFBuiltInCache;
+ struct NFType
+ {
+ sal_uInt32 nKey;
+ SvNumFormatType eType;
+ NFType()
+ : nKey(SAL_MAX_UINT32)
+ , eType(SvNumFormatType::ALL)
+ {
+ }
+ };
+ // from format index to type
+ mutable std::array<NFType, 4> maNFTypeCache;
};
class ScThreadedInterpreterContextGetterGuard;
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index d6536551f9..e4b149516c 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -31,6 +31,7 @@
namespace vcl { class Font; }
namespace model { class ComplexColor; }
+struct ScInterpreterContext;
class OutputDevice;
class Fraction;
class ScStyleSheet;
@@ -171,6 +172,7 @@ public:
bool IsSymbolFont() const;
sal_uInt32 GetNumberFormat( SvNumberFormatter* ) const;
+ sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext ) const;
sal_uInt32 GetNumberFormat( SvNumberFormatter* pFormatter,
const SfxItemSet* pCondSet ) const;
diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py
index 0b56be4c2d..c0c264432e 100755
--- a/sc/qa/uitest/pasteSpecial/tdf160765.py
+++ b/sc/qa/uitest/pasteSpecial/tdf160765.py
@@ -13,8 +13,42 @@ from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.calc import enter_text_to_cell
from libreoffice.calc.paste_special import reset_default_values
+from uitest.uihelper.common import get_state_as_dict
class tdf160765(UITestCase):
+ def test_tdf160765_paste_special_comments_checked(self):
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+
+ # Insert a comment in cell A1
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A1"}))
+ xArgs = mkPropertyValues({"Text": "Comment 1"})
+ self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
+
+ # Copy cell A1 to clipboard
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ # Paste data using special options (check only comments)
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg:
+ reset_default_values(self, xPasteSpecialDlg)
+ xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime")
+ xDateTimeChkBox.executeAction("CLICK", tuple())
+ xTextChkBox = xPasteSpecialDlg.getChild("text")
+ xTextChkBox.executeAction("CLICK", tuple())
+ xNumbersChkBox = xPasteSpecialDlg.getChild("numbers")
+ xNumbersChkBox.executeAction("CLICK", tuple())
+ xCommentsChkBox = xPasteSpecialDlg.getChild("comments")
+ xCommentsChkBox.executeAction("CLICK", tuple())
+
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg:
+ xCommentsChkBox = xPasteSpecialDlg.getChild("comments")
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'true' != 'false'
+ # i.e., the comments checkbox was not remembered
+ self.assertEqual(get_state_as_dict(xCommentsChkBox)["Selected"], "true")
+
def test_tdf160765_undo_paste_comment(self):
with self.ui_test.create_doc_in_start_center("calc") as document:
xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
diff --git a/sc/qa/unit/data/ods/tdf160329_sortWithHiddenRows.ods b/sc/qa/unit/data/ods/tdf160329_sortWithHiddenRows.ods
new file mode 100644
index 0000000000..5ba746ad7b
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf160329_sortWithHiddenRows.ods
Binary files differ
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index c5b4b098c8..2e9ed6281c 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -66,6 +66,14 @@ static SdrObject* lcl_getSdrObjectWithAssert(ScDocument& rDoc, sal_uInt16 nObjNu
return pObj;
}
+static SdrObject* lcl_getSdrObjectbyName(ScDocument& rDoc, std::u16string_view rName)
+{
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
+ const SdrPage* pPage = pDrawLayer->GetPage(0);
+ SdrObject* pObj = pPage->GetObjByName(rName);
+ return pObj;
+}
+
CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf144242_OpenBezier_noSwapWH)
{
// Shapes, which have rotation incorporated in their points, got erroneously width-height
@@ -1299,6 +1307,35 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160369_groupshape)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aOrigRect, aAfterRect, 1);
}
+CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160329_sortWithHiddenRows)
+{
+ // Load a document, which has images anchored to cell and rows hidden
+ createScDoc("ods/tdf160329_sortWithHiddenRows.ods");
+ ScDocument* pDoc = getScDoc();
+
+ // Sort the rows
+ uno::Sequence<beans::PropertyValue> aArgs1
+ = { comphelper::makePropertyValue("DbName", u"myRange"_ustr) };
+ dispatchCommand(mxComponent, ".uno:SelectDB", aArgs1);
+ uno::Sequence<beans::PropertyValue> aArgs2
+ = { comphelper::makePropertyValue("ByRows", true),
+ comphelper::makePropertyValue("HasHeader", true),
+ comphelper::makePropertyValue("Col1", sal_Int32(1)),
+ comphelper::makePropertyValue("Ascending1", false),
+ comphelper::makePropertyValue("IncludeImages", true) };
+ dispatchCommand(mxComponent, ".uno:DataSort", aArgs2);
+
+ // Make sure objects are on correct position
+ SdrObject* pObj = lcl_getSdrObjectbyName(*pDoc, std::u16string_view(u"ImageD"));
+ Point aPos = pObj->GetSnapRect().TopLeft();
+ // The position was (3000|2899) without fix.
+ CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(3000, 5898), aPos, 1);
+ pObj = lcl_getSdrObjectbyName(*pDoc, std::u16string_view(u"ImageE"));
+ aPos = pObj->GetSnapRect().TopLeft();
+ // The position was (2600|2499) without fix.
+ CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(2600, 4399), aPos, 1);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f0f4cc8326..5a1582e560 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2358,6 +2358,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const OUString& rString,
void ScColumn::SetEditText( SCROW nRow, std::unique_ptr<EditTextObject> pEditText )
{
+ if (!pEditText)
+ {
+ return;
+ }
+
pEditText->NormalizeString(GetDoc().GetSharedStringPool());
std::vector<SCROW> aNewSharedRows;
sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, false);
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 4bb79828da..f5db8533cf 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -1412,6 +1412,17 @@ sal_uInt32 ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter ) const
return nFormat;
}
+sal_uInt32 ScPatternAttr::GetNumberFormat( const ScInterpreterContext& rContext ) const
+{
+ sal_uInt32 nFormat = getNumberFormatKey(GetItemSet());
+ LanguageType eLang = getLanguageType(GetItemSet());
+ if ( nFormat < SV_COUNTRY_LANGUAGE_OFFSET && eLang == LANGUAGE_SYSTEM )
+ ; // it remains as it is
+ else
+ nFormat = rContext.GetFormatForLanguageIfBuiltIn( nFormat, eLang );
+ return nFormat;
+}
+
// the same if conditional formatting is in play:
sal_uInt32 ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter,
diff --git a/sc/source/core/data/queryevaluator.cxx b/sc/source/core/data/queryevaluator.cxx
index a8a08d9edf..174e1e0989 100644
--- a/sc/source/core/data/queryevaluator.cxx
+++ b/sc/source/core/data/queryevaluator.cxx
@@ -244,7 +244,7 @@ std::pair<bool, bool> ScQueryEvaluator::compareByValue(const ScRefCellValue& rCe
nNumFmt = getNumFmt(nCol, nRow);
if (nNumFmt)
{
- SvNumberFormatter* pFormatter
+ const SvNumberFormatter* pFormatter
= mpContext ? mpContext->GetFormatTable() : mrDoc.GetFormatTable();
const SvNumberformat* pEntry = pFormatter->GetEntry(nNumFmt);
if (pEntry)
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 359cc5dcc4..5121296661 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1084,6 +1084,50 @@ void ScTable::SortReorderByColumn(
}
}
+static void backupObjectsVisibility(const std::vector<std::unique_ptr<SortedColumn>>& rSortedCols,
+ std::vector<std::vector<std::vector<bool>>>& rBackup)
+{
+ size_t nSortedCols = rSortedCols.size();
+ for (size_t iCol = 0; iCol < nSortedCols; ++iCol)
+ {
+ std::vector<std::vector<SdrObject*>>& rSingleColCellDrawObjects
+ = rSortedCols[iCol]->maCellDrawObjects;
+ size_t nSingleColCellDrawObjects = rSingleColCellDrawObjects.size();
+ std::vector<std::vector<bool>> aColBackup;
+ for (size_t jRow = 0; jRow < nSingleColCellDrawObjects; ++jRow)
+ {
+ std::vector<SdrObject*>& rCellDrawObjects = rSingleColCellDrawObjects[jRow];
+ std::vector<bool> aCellBackup;
+ for (auto& pObject : rCellDrawObjects)
+ {
+ aCellBackup.push_back(pObject->IsVisible());
+ }
+ aColBackup.push_back(std::move(aCellBackup));
+ }
+ rBackup.push_back(std::move(aColBackup));
+ }
+}
+
+static void restoreObjectsVisibility(std::vector<std::unique_ptr<SortedColumn>>& rSortedCols,
+ const std::vector<std::vector<std::vector<bool>>>& rBackup)
+{
+ size_t nSortedCols = rSortedCols.size();
+ for (size_t iCol = 0; iCol < nSortedCols; ++iCol)
+ {
+ std::vector<std::vector<SdrObject*>>& rSingleColCellDrawObjects
+ = rSortedCols[iCol]->maCellDrawObjects;
+ size_t nSingleColCellDrawObjects = rSingleColCellDrawObjects.size();
+ for (size_t jRow = 0; jRow < nSingleColCellDrawObjects; jRow++)
+ {
+ std::vector<SdrObject*>& rCellDrawObjects = rSingleColCellDrawObjects[jRow];
+ for (size_t kCell = 0; kCell < rCellDrawObjects.size(); ++kCell)
+ {
+ rCellDrawObjects[kCell]->SetVisible(rBackup[iCol][jRow][kCell]);
+ }
+ }
+ }
+}
+
void ScTable::SortReorderByRow( ScSortInfoArray* pArray, SCCOL nCol1, SCCOL nCol2,
ScProgress* pProgress, bool bOnlyDataAreaExtras )
{
@@ -1180,9 +1224,6 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, SCCOL nCol1, SCCOL nCol
aCol[nThisCol].UpdateNoteCaptions(nRow1, nRow2);
}
- // Update draw object positions
- aCol[nThisCol].UpdateDrawObjects(aSortedCols[i]->maCellDrawObjects, nRow1, nRow2);
-
{
// Get all row spans where the pattern is not NULL.
std::vector<PatternSpan> aSpans =
@@ -1210,6 +1251,10 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, SCCOL nCol1, SCCOL nCol
aRowFlags.maRowsHidden.build_tree();
aRowFlags.maRowsFiltered.build_tree();
+ // Backup visibility state of objects. States will be lost when changing the flags below.
+ std::vector<std::vector<std::vector<bool>>> aBackup;
+ backupObjectsVisibility(aSortedCols, aBackup);
+
// Remove all flags in the range first.
SetRowHidden(nRow1, nRow2, false);
SetRowFiltered(nRow1, nRow2, false);
@@ -1224,6 +1269,16 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, SCCOL nCol1, SCCOL nCol
for (const auto& rSpan : aSpans)
SetRowFiltered(rSpan.mnRow1, rSpan.mnRow2, true);
+
+ //Restore visibility state of objects
+ restoreObjectsVisibility(aSortedCols, aBackup);
+ }
+
+ // Update draw object positions
+ for (size_t i = 0, n = aSortedCols.size(); i < n; ++i)
+ {
+ SCCOL nThisCol = i + nCol1;
+ aCol[nThisCol].UpdateDrawObjects(aSortedCols[i]->maCellDrawObjects, nRow1, nRow2);
}
// Notify the cells' listeners to (re-)start listening.
@@ -1381,9 +1436,6 @@ void ScTable::SortReorderByRowRefUpdate(
aCol[nThisCol].UpdateNoteCaptions(nRow1, nRow2);
}
- // Update draw object positions
- aCol[nThisCol].UpdateDrawObjects(aSortedCols[i]->maCellDrawObjects, nRow1, nRow2);
-
{
// Get all row spans where the pattern is not NULL.
std::vector<PatternSpan> aSpans =
@@ -1411,6 +1463,10 @@ void ScTable::SortReorderByRowRefUpdate(
aRowFlags.maRowsHidden.build_tree();
aRowFlags.maRowsFiltered.build_tree();
+ // Backup visibility state of objects. States will be lost when changing the flags below.
+ std::vector<std::vector<std::vector<bool>>> aBackup;
+ backupObjectsVisibility(aSortedCols, aBackup);
+
// Remove all flags in the range first.
SetRowHidden(nRow1, nRow2, false);
SetRowFiltered(nRow1, nRow2, false);
@@ -1425,6 +1481,16 @@ void ScTable::SortReorderByRowRefUpdate(
for (const auto& rSpan : aSpans)
SetRowFiltered(rSpan.mnRow1, rSpan.mnRow2, true);
+
+ //Restore visibility state of objects
+ restoreObjectsVisibility(aSortedCols, aBackup);
+ }
+
+ // Update draw object positions
+ for (size_t i = 0, n = aSortedCols.size(); i < n; ++i)
+ {
+ SCCOL nThisCol = i + nCol1;
+ aCol[nThisCol].UpdateDrawObjects(aSortedCols[i]->maCellDrawObjects, nRow1, nRow2);
}
// Set up row reorder map (for later broadcasting of reference updates).
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 64b9a8ae5b..ab456a4dca 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -131,6 +131,12 @@ struct FormulaTokenRef_less
{
bool operator () ( const formula::FormulaConstTokenRef& r1, const formula::FormulaConstTokenRef& r2 ) const
{ return r1.get() < r2.get(); }
+ // So we don't have to create a FormulaConstTokenRef to search by formula::FormulaToken*
+ using is_transparent = void;
+ bool operator () ( const formula::FormulaToken* p1, const formula::FormulaConstTokenRef& r2 ) const
+ { return p1 < r2.get(); }
+ bool operator () ( const formula::FormulaConstTokenRef& r1, const formula::FormulaToken* p2 ) const
+ { return r1.get() < p2; }
};
typedef ::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less> ScTokenMatrixMap;
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 95dff9f1cc..959b04a70e 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2099,7 +2099,7 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat)
double ScInterpreter::GetDouble()
{
- double nVal(0.0);
+ double nVal;
switch( GetRawStackType() )
{
case svDouble:
@@ -2134,13 +2134,16 @@ double ScInterpreter::GetDouble()
{
ScExternalRefCache::TokenRef pToken;
PopExternalSingleRef(pToken);
- if (nGlobalError == FormulaError::NONE)
+ if (nGlobalError != FormulaError::NONE)
{
- if (pToken->GetType() == svDouble || pToken->GetType() == svEmptyCell)
- nVal = pToken->GetDouble();
- else
- nVal = ConvertStringToValue( pToken->GetString().getString());
+ nVal = 0.0;
+ break;
}
+
+ if (pToken->GetType() == svDouble || pToken->GetType() == svEmptyCell)
+ nVal = pToken->GetDouble();
+ else
+ nVal = ConvertStringToValue( pToken->GetString().getString());
}
break;
case svExternalDoubleRef:
@@ -2148,7 +2151,10 @@ double ScInterpreter::GetDouble()
ScMatrixRef pMat;
PopExternalDoubleRef(pMat);
if (nGlobalError != FormulaError::NONE)
+ {
+ nVal = 0.0;
break;
+ }
nVal = GetDoubleFromMatrix(pMat);
}
@@ -4036,8 +4042,9 @@ StackVar ScInterpreter::Interpret()
(*aTokenMatrixMapIter).second->GetType() != svJumpMatrix)
{
// Path already calculated, reuse result.
- if (sp >= pCur->GetParamCount())
- nStackBase = sp - pCur->GetParamCount();
+ const sal_uInt8 nParamCount = pCur->GetParamCount();
+ if (sp >= nParamCount)
+ nStackBase = sp - nParamCount;
else
{
SAL_WARN("sc.core", "Stack anomaly with calculated path at "
@@ -4045,7 +4052,7 @@ StackVar ScInterpreter::Interpret()
<< " " << aPos.Format(
ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, &mrDoc)
<< " eOp: " << static_cast<int>(eOp)
- << " params: " << static_cast<int>(pCur->GetParamCount())
+ << " params: " << static_cast<int>(nParamCount)
<< " nStackBase: " << nStackBase << " sp: " << sp);
nStackBase = sp;
assert(!"underflow");
@@ -4074,18 +4081,22 @@ StackVar ScInterpreter::Interpret()
eOp = ocNone; // JumpMatrix created
nStackBase = sp;
}
- else if (sp >= pCur->GetParamCount())
- nStackBase = sp - pCur->GetParamCount();
else
{
- SAL_WARN("sc.core", "Stack anomaly at " << aPos.Tab() << "," << aPos.Col() << "," << aPos.Row()
- << " " << aPos.Format(
- ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, &mrDoc)
- << " eOp: " << static_cast<int>(eOp)
- << " params: " << static_cast<int>(pCur->GetParamCount())
- << " nStackBase: " << nStackBase << " sp: " << sp);
- nStackBase = sp;
- assert(!"underflow");
+ const sal_uInt8 nParamCount = pCur->GetParamCount();
+ if (sp >= nParamCount)
+ nStackBase = sp - nParamCount;
+ else
+ {
+ SAL_WARN("sc.core", "Stack anomaly at " << aPos.Tab() << "," << aPos.Col() << "," << aPos.Row()
+ << " " << aPos.Format(
+ ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, &mrDoc)
+ << " eOp: " << static_cast<int>(eOp)
+ << " params: " << static_cast<int>(nParamCount)
+ << " nStackBase: " << nStackBase << " sp: " << sp);
+ nStackBase = sp;
+ assert(!"underflow");
+ }
}
}
diff --git a/sc/source/core/tool/interpretercontext.cxx b/sc/source/core/tool/interpretercontext.cxx
index deb6f6d0ed..235d42d03f 100644
--- a/sc/source/core/tool/interpretercontext.cxx
+++ b/sc/source/core/tool/interpretercontext.cxx
@@ -58,7 +58,14 @@ void ScInterpreterContext::SetDocAndFormatter(const ScDocument& rDoc, SvNumberFo
mxScLookupCache.reset();
mpDoc = &rDoc;
}
- mpFormatter = pFormatter;
+ if (mpFormatter != pFormatter)
+ {
+ mpFormatter = pFormatter;
+
+ // drop cache
+ std::fill(maNFBuiltInCache.begin(), maNFBuiltInCache.end(), NFBuiltIn());
+ std::fill(maNFTypeCache.begin(), maNFTypeCache.end(), NFType());
+ }
}
void ScInterpreterContext::initFormatTable()
@@ -87,15 +94,47 @@ SvNumFormatType ScInterpreterContext::GetNumberFormatType(sal_uInt32 nFIndex) co
return mpFormatter->GetType(nFIndex);
}
- if (maNFTypeCache.bIsValid && maNFTypeCache.nIndex == nFIndex)
- {
- return maNFTypeCache.eType;
- }
+ auto aFind = std::find_if(maNFTypeCache.begin(), maNFTypeCache.end(),
+ [nFIndex](const NFType& e) { return e.nKey == nFIndex; });
+ if (aFind != maNFTypeCache.end())
+ return aFind->eType;
+
+ SvNumFormatType eType = mpFormatter->GetType(nFIndex);
+
+ std::move_backward(maNFTypeCache.begin(),
+ std::next(maNFTypeCache.begin(), maNFTypeCache.size() - 1),
+ maNFTypeCache.end());
+ maNFTypeCache[0].nKey = nFIndex;
+ maNFTypeCache[0].eType = eType;
+
+ return eType;
+}
+
+sal_uInt32 ScInterpreterContext::GetFormatForLanguageIfBuiltIn(sal_uInt32 nFormat,
+ LanguageType eLnge) const
+{
+ if (!mpFormatter)
+ return nFormat;
+
+ if (!mpDoc->IsThreadedGroupCalcInProgress())
+ return mpFormatter->GetFormatForLanguageIfBuiltIn(nFormat, eLnge);
+
+ sal_uInt64 nKey = (static_cast<sal_uInt64>(nFormat) << 32) | eLnge.get();
+
+ auto aFind = std::find_if(maNFBuiltInCache.begin(), maNFBuiltInCache.end(),
+ [nKey](const NFBuiltIn& e) { return e.nKey == nKey; });
+ if (aFind != maNFBuiltInCache.end())
+ return aFind->nFormat;
+
+ nFormat = mpFormatter->GetFormatForLanguageIfBuiltIn(nFormat, eLnge);
+
+ std::move_backward(maNFBuiltInCache.begin(),
+ std::next(maNFBuiltInCache.begin(), maNFBuiltInCache.size() - 1),
+ maNFBuiltInCache.end());
+ maNFBuiltInCache[0].nKey = nKey;
+ maNFBuiltInCache[0].nFormat = nFormat;
- maNFTypeCache.nIndex = nFIndex;
- maNFTypeCache.eType = mpFormatter->GetType(nFIndex);
- maNFTypeCache.bIsValid = true;
- return maNFTypeCache.eType;
+ return nFormat;
}
/* ScInterpreterContextPool */
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 86afa5a6c1..f18e9f829b 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -478,6 +478,9 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->startElement(XML_protectedRanges);
for (const auto& rProt : rProts)
{
+ if (!rProt.maRangeList.is())
+ continue; // Excel refuses to open if sqref is missing from a protectedRange
+
SAL_WARN_IF( rProt.maSecurityDescriptorXML.isEmpty() && !rProt.maSecurityDescriptor.empty(),
"sc.filter", "XclExpSheetProtection::SaveXml: losing BIFF security descriptor");
rWorksheet->singleElement( XML_protectedRange,
@@ -492,7 +495,7 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm )
XML_hashValue, sax_fastparser::UseIf(rProt.maPasswordHash.maHashValue, !rProt.maPasswordHash.maHashValue.isEmpty()),
XML_saltValue, sax_fastparser::UseIf(rProt.maPasswordHash.maSaltValue, !rProt.maPasswordHash.maSaltValue.isEmpty()),
XML_spinCount, sax_fastparser::UseIf(OString::number(rProt.maPasswordHash.mnSpinCount), rProt.maPasswordHash.mnSpinCount != 0),
- XML_sqref, rProt.maRangeList.is() ? XclXmlUtils::ToOString( rStrm.GetRoot().GetDoc(), *rProt.maRangeList).getStr() : nullptr);
+ XML_sqref, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), *rProt.maRangeList).getStr());
}
rWorksheet->endElement( XML_protectedRanges);
}
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index c6507bd54e..ee698a1578 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -894,7 +894,7 @@ void ScHTMLLayoutParser::Colonize( ScEEParseEntry* pE )
{ // Replaced
nCol = pE->nCol - nColCntStart;
SCCOL nCount = static_cast<SCCOL>(xLocalColOffset->size());
- if ( nCol < nCount )
+ if (nCol >= 0 && nCol < nCount)
nColOffset = static_cast<sal_uInt16>((*xLocalColOffset)[nCol]);
else
nColOffset = static_cast<sal_uInt16>((*xLocalColOffset)[nCount - 1]);
@@ -1039,7 +1039,7 @@ void ScHTMLLayoutParser::TableDataOn( HtmlImportInfo* pInfo )
case HtmlOptionId::COLSPAN:
{
sal_Int32 nColOverlap = rOption.GetString().toInt32();
- if (nColOverlap >= 0 && nColOverlap <= SCCOL_MAX)
+ if (nColOverlap >= 0 && nColOverlap <= mpDoc->MaxCol())
mxActEntry->nColOverlap = static_cast<SCCOL>(nColOverlap);
else
SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring colspan: " << nColOverlap);
@@ -1048,7 +1048,7 @@ void ScHTMLLayoutParser::TableDataOn( HtmlImportInfo* pInfo )
case HtmlOptionId::ROWSPAN:
{
sal_Int32 nRowOverlap = rOption.GetString().toInt32();
- if (nRowOverlap >= 0)
+ if (nRowOverlap >= 0 && nRowOverlap <= mpDoc->MaxRow())
mxActEntry->nRowOverlap = static_cast<SCROW>(nRowOverlap);
else
SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring rowspan: " << nRowOverlap);
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx
index 58e4c79317..d6af042405 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -292,7 +292,8 @@ void ExtConditionalFormattingContext::onEndElement()
maModel.eOperator = ScConditionMode::Direct;
}
- getStyles().getExtDxfs().forEachMem( &Dxf::finalizeImport );
+ if (Dxf* pDxf = getStyles().getExtDxfs().get(rStyleIdx).get())
+ pDxf->finalizeImport();
maModel.aStyle = getStyles().createExtDxfStyle(rStyleIdx);
rStyleIdx++;
nFormulaCount = 0;
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 7aaa7237cc..020386a69a 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing()
mpViewShell->RemoveAccessibilityObject(*this);
mpViewShell = nullptr;
}
+
mpAccCell.clear();
+ m_mapSelectionSend.clear();
+ m_mapFormulaSelectionSend.clear();
+ m_pAccFormulaCell.clear();
ScAccessibleTableBase::disposing();
}
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 7f0cf742b0..2b2dcb7ebd 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -799,9 +799,11 @@ void ScInputWindow::MouseButtonDown( const MouseEvent& rMEvt )
// I'd prefer to leave at least a single column header and a
// row but I don't know how to get that value in pixels.
// Use TOOLBOX_WINDOW_HEIGHT for the moment
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- mnMaxY = GetOutputSizePixel().Height() + (pViewSh->GetGridHeight(SC_SPLIT_TOP)
- + pViewSh->GetGridHeight(SC_SPLIT_BOTTOM)) - TOOLBOX_WINDOW_HEIGHT;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ {
+ mnMaxY = GetOutputSizePixel().Height() + (pViewSh->GetGridHeight(SC_SPLIT_TOP)
+ + pViewSh->GetGridHeight(SC_SPLIT_BOTTOM)) - TOOLBOX_WINDOW_HEIGHT;
+ }
}
}
@@ -2663,11 +2665,12 @@ void ScPosWnd::DoEnter()
if (bOpenManageNamesDialog)
{
const sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId();
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- assert(pViewSh);
- SfxViewFrame& rViewFrm = pViewSh->GetViewFrame();
- SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
- SC_MOD()->SetRefDialog( nId, pWnd == nullptr );
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ {
+ SfxViewFrame& rViewFrm = pViewSh->GetViewFrame();
+ SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
+ SC_MOD()->SetRefDialog( nId, pWnd == nullptr );
+ }
}
}
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 5f0599c888..e5ed3b1afe 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -405,11 +405,38 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
aReducedBlock.aEnd.Col(), aReducedBlock.aEnd.Row(),
aReducedBlock.aStart.Tab() );
ScopedVclPtrInstance< VirtualDevice > pVirtDev;
- pVirtDev->SetOutputSizePixel(pVirtDev->LogicToPixel(aMMRect.GetSize(), MapMode(MapUnit::Map100thMM)));
+
+ // tdf#160855 fix crash due to Skia's internal maximum pixel limit
+ // Somewhere in the tens of thousands of selected fill cells,
+ // the size of the VirtualDevice exceeds 1 GB of pixels. But
+ // Skia, at least on macOS, will fail to create a surface.
+ // Even if there is ample free memory, Skia/Raster will fail.
+ // The second problem is that even if you disable Skia, the
+ // crash is just delayed when a BitmapEx is created from the
+ // VirtualDevice and malloc() fails.
+ // Since this data flavor really triggers one or more system
+ // memory limits, lower the resolution of the bitmap by keeping
+ // the VirtualDevice pixel size within an arbitrary number of
+ // pixels.
+ // Note: the artibrary "maximum number of pixels" limit that
+ // that Skia can handle may need to be raised or lowered for
+ // platforms other than macOS.
+ static constexpr tools::Long nCopyToImageMaxPixels = 8192 * 8192;
+ Fraction aScale(1.0);
+ Size aPixelSize = pVirtDev->LogicToPixel(aMMRect.GetSize(), MapMode(MapUnit::Map100thMM));
+ tools::Long nPixels(aPixelSize.Width() * aPixelSize.Height());
+ if (nPixels < 0 || nPixels > nCopyToImageMaxPixels)
+ {
+ aScale = Fraction(nCopyToImageMaxPixels, nPixels);
+ aPixelSize = pVirtDev->LogicToPixel(aMMRect.GetSize(), MapMode(MapUnit::Map100thMM, Point(), aScale, aScale));
+ nPixels = aPixelSize.Width() * aPixelSize.Height();
+ }
+
+ pVirtDev->SetOutputSizePixel(aPixelSize);
PaintToDev( pVirtDev, *m_pDoc, 1.0, aReducedBlock );
- pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel ) );
+ pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel, Point(), aScale, aScale ) );
BitmapEx aBmp = pVirtDev->GetBitmapEx( Point(), pVirtDev->GetOutputSize() );
bOK = SetBitmapEx( aBmp, rFlavor );
}
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index ade0cede7c..171c9ecd13 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -440,43 +440,45 @@ void StyleSelect(weld::Window* pDialogParent, weld::ComboBox& rLbStyle, const Sc
// unlock the dispatcher so SID_STYLE_NEW can be executed
// (SetDispatcherLock would affect all Calc documents)
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- SfxDispatcher* pDisp = pViewShell->GetDispatcher();
- bool bLocked = pDisp->IsLocked();
- if (bLocked)
- pDisp->Lock(false);
-
- // Execute the "new style" slot, complete with undo and all necessary updates.
- // The return value (SfxUInt16Item) is ignored, look for new styles instead.
- pDisp->ExecuteList(SID_STYLE_NEW,
- SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
- { &aFamilyItem, &aRefItem }, { &aDialogParent });
-
- if (bLocked)
- pDisp->Lock(true);
-
- // Find the new style and add it into the style list boxes
- SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SfxStyleFamily::Para );
- bool bFound = false;
- for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle && !bFound; pStyle = aStyleIter.Next() )
+ if (ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell())
{
- const OUString& aName = pStyle->GetName();
- if (rLbStyle.find_text(aName) == -1) // all lists contain the same entries
+ SfxDispatcher* pDisp = pViewShell->GetDispatcher();
+ bool bLocked = pDisp->IsLocked();
+ if (bLocked)
+ pDisp->Lock(false);
+
+ // Execute the "new style" slot, complete with undo and all necessary updates.
+ // The return value (SfxUInt16Item) is ignored, look for new styles instead.
+ pDisp->ExecuteList(SID_STYLE_NEW,
+ SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
+ { &aFamilyItem, &aRefItem }, { &aDialogParent });
+
+ if (bLocked)
+ pDisp->Lock(true);
+
+ // Find the new style and add it into the style list boxes
+ SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SfxStyleFamily::Para );
+ bool bFound = false;
+ for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle && !bFound; pStyle = aStyleIter.Next() )
{
- for( sal_Int32 i = 1, n = rLbStyle.get_count(); i <= n && !bFound; ++i)
+ const OUString& aName = pStyle->GetName();
+ if (rLbStyle.find_text(aName) == -1) // all lists contain the same entries
{
- OUString aStyleName = ScGlobal::getCharClass().uppercase(rLbStyle.get_text(i));
- if( i == n )
+ for( sal_Int32 i = 1, n = rLbStyle.get_count(); i <= n && !bFound; ++i)
{
- rLbStyle.append_text(aName);
- rLbStyle.set_active_text(aName);
- bFound = true;
- }
- else if( aStyleName > ScGlobal::getCharClass().uppercase(aName) )
- {
- rLbStyle.insert_text(i, aName);
- rLbStyle.set_active_text(aName);
- bFound = true;
+ OUString aStyleName = ScGlobal::getCharClass().uppercase(rLbStyle.get_text(i));
+ if( i == n )
+ {
+ rLbStyle.append_text(aName);
+ rLbStyle.set_active_text(aName);
+ bFound = true;
+ }
+ else if( aStyleName > ScGlobal::getCharClass().uppercase(aName) )
+ {
+ rLbStyle.insert_text(i, aName);
+ rLbStyle.set_active_text(aName);
+ bFound = true;
+ }
}
}
}
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index 4ea08c1d49..31444dbb3f 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -249,18 +249,22 @@ IMPL_LINK_NOARG( SearchResultsDlg, ListSelectHdl, weld::TreeView&, void )
return;
// Jump to the cell.
- ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell();
- pScViewShell->SetTabNo(nTab);
- pScViewShell->SetCursor(aPos.Col(), aPos.Row());
- pScViewShell->AlignToCursor(aPos.Col(), aPos.Row(), SC_FOLLOW_JUMP);
+ if (ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell())
+ {
+ pScViewShell->SetTabNo(nTab);
+ pScViewShell->SetCursor(aPos.Col(), aPos.Row());
+ pScViewShell->AlignToCursor(aPos.Col(), aPos.Row(), SC_FOLLOW_JUMP);
+ }
}
IMPL_STATIC_LINK( SearchResultsDlg, OnShowToggled, weld::Toggleable&, rButton, void )
{
- ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell();
- ScViewOptions aViewOpt( pScViewShell->GetViewData().GetOptions() );
- aViewOpt.SetOption( VOPT_SUMMARY, rButton.get_active() );
- pScViewShell->GetViewData().SetOptions( aViewOpt );
+ if (ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell())
+ {
+ ScViewOptions aViewOpt( pScViewShell->GetViewData().GetOptions() );
+ aViewOpt.SetOption( VOPT_SUMMARY, rButton.get_active() );
+ pScViewShell->GetViewData().SetOptions( aViewOpt );
+ }
}
SearchResultsDlgWrapper::SearchResultsDlgWrapper(
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 4c333b0502..d67e6efa66 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5500,11 +5500,11 @@ void ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd
if ( DeleteContents( aMark, InsertDeleteFlags::CONTENTS, true, false/*bApi*/ ) )
{
- // GRAM_API for API compatibility.
- if (!EnterMatrix( aNewRange, &aMark, nullptr, aFormula, false/*bApi*/, false, OUString(), formula::FormulaGrammar::GRAM_API ))
+ // Formula string was obtained in document grammar.
+ if (!EnterMatrix( aNewRange, &aMark, nullptr, aFormula, false/*bApi*/, false, OUString(), rDoc.GetGrammar() ))
{
// try to restore the previous state
- EnterMatrix( rOldRange, &aMark, nullptr, aFormula, false/*bApi*/, false, OUString(), formula::FormulaGrammar::GRAM_API );
+ EnterMatrix( rOldRange, &aMark, nullptr, aFormula, false/*bApi*/, false, OUString(), rDoc.GetGrammar() );
}
}
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index e4763767b7..18d4aa1f2b 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -175,6 +175,7 @@ private:
void adjustForHyperlinkInPDF(Point aURLStart, const OutputDevice* pDev);
};
+ VclPtr<OutputDevice> mpOriginalTargetDevice; // 'unpatched' TargetDevice
VclPtr<OutputDevice> mpDev; // Device
VclPtr<OutputDevice> mpRefDevice; // printer if used for preview
VclPtr<OutputDevice> pFmtDevice; // reference for text formatting
diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index 84292dcd91..378b10f37f 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -231,7 +231,9 @@ void ScInsertContentsDlg::SetInsContentsCmdBits(const InsertDeleteFlags eFlags)
mxBtnInsNumbers->set_active((InsertDeleteFlags::VALUE & eFlags) == InsertDeleteFlags::VALUE);
mxBtnInsDateTime->set_active((InsertDeleteFlags::DATETIME & eFlags) == InsertDeleteFlags::DATETIME);
mxBtnInsStrings->set_active((InsertDeleteFlags::STRING & eFlags) == InsertDeleteFlags::STRING);
- mxBtnInsNotes->set_active((InsertDeleteFlags::NOTE & eFlags) == InsertDeleteFlags::NOTE);
+ // tdf#160765 - additionally check either NOTE or ADDNOTES
+ mxBtnInsNotes->set_active(((InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) & eFlags)
+ != InsertDeleteFlags::NONE);
mxBtnInsFormulas->set_active((InsertDeleteFlags::FORMULA & eFlags) == InsertDeleteFlags::FORMULA);
mxBtnInsAttrs->set_active((InsertDeleteFlags::ATTRIB & eFlags) == InsertDeleteFlags::ATTRIB);
mxBtnInsObjects->set_active((InsertDeleteFlags::OBJECTS & eFlags) == InsertDeleteFlags::OBJECTS);
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index afacdc48b4..fe2b9d2111 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -191,9 +191,9 @@ void ScMoveTableDlg::Init()
m_xEdTabName->connect_changed(LINK(this, ScMoveTableDlg, CheckNameHdl));
// tdf#96854 - remember last used option for copy/move sheet
- const bool bIsCopyActive
- = ScTabViewShell::GetActiveViewShell()->GetViewData().GetOptions().GetOption(
- VOPT_COPY_SHEET);
+ bool bIsCopyActive = false;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ bIsCopyActive = pViewSh->GetViewData().GetOptions().GetOption(VOPT_COPY_SHEET);
m_xBtnMove->set_active(!bIsCopyActive);
m_xBtnCopy->set_active(bIsCopyActive);
m_xEdTabName->set_sensitive(false);
@@ -251,10 +251,12 @@ void ScMoveTableDlg::SetOkBtnLabel()
// tdf#139464 Write "Copy" or "Move" on OK button
m_xBtnOk->set_label(bIsCopyActive ? m_xBtnCopy->get_label() : m_xBtnMove->get_label());
// tdf#96854 - remember last used option for copy/move sheet
- ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell();
- ScViewOptions aViewOpt(pScViewShell->GetViewData().GetOptions());
- aViewOpt.SetOption(VOPT_COPY_SHEET, bIsCopyActive);
- pScViewShell->GetViewData().SetOptions(aViewOpt);
+ if (ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell())
+ {
+ ScViewOptions aViewOpt(pScViewShell->GetViewData().GetOptions());
+ aViewOpt.SetOption(VOPT_COPY_SHEET, bIsCopyActive);
+ pScViewShell->GetViewData().SetOptions(aViewOpt);
+ }
}
// Handler:
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index 3304f4d39b..81139b7766 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -94,8 +94,8 @@ void ScNameDefDlg::CancelPushed()
response(RET_CANCEL);
else
{
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- pViewSh->SwitchBetweenRefDialogs(this);
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ pViewSh->SwitchBetweenRefDialogs(this);
}
}
@@ -254,8 +254,8 @@ void ScNameDefDlg::AddPushed()
{
maName = aName;
maScope = aScope;
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- pViewSh->SwitchBetweenRefDialogs(this);
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ pViewSh->SwitchBetweenRefDialogs(this);
}
}
else
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index a6a182cd82..2501672378 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -306,8 +306,8 @@ void ScNameDlg::ShowOptions(const ScRangeNameLine& rLine)
void ScNameDlg::AddPushed()
{
mbCloseWithoutUndo = true;
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- pViewSh->SwitchBetweenRefDialogs(this);
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ pViewSh->SwitchBetweenRefDialogs(this);
}
void ScNameDlg::SetEntry(const OUString& rName, const OUString& rScope)
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 89d7764255..374ee93438 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1435,7 +1435,7 @@ void ScContentTree::SelectEntryByName(const ScContentId nRoot, std::u16string_vi
{
weld::TreeIter* pParent = m_aRootNodes[nRoot].get();
- if (pParent || !m_xTreeView->iter_has_child(*pParent))
+ if (!pParent || !m_xTreeView->iter_has_child(*pParent))
return;
std::unique_ptr<weld::TreeIter> xEntry(m_xTreeView->make_iterator(pParent));
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 498060839a..f34ebba87d 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -77,10 +77,13 @@ OUString ScUndoDoOutline::GetComment() const
void ScUndoDoOutline::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
// sheet has to be switched over (#46952#)!
@@ -114,9 +117,11 @@ void ScUndoDoOutline::Undo()
void ScUndoDoOutline::Redo()
{
- BeginRedo();
-
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
+ BeginRedo();
// sheet has to be switched over (#46952#)!
@@ -168,10 +173,13 @@ OUString ScUndoMakeOutline::GetComment() const
void ScUndoMakeOutline::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart, aBlockEnd );
@@ -196,10 +204,13 @@ void ScUndoMakeOutline::Undo()
void ScUndoMakeOutline::Redo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginRedo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart, aBlockEnd );
@@ -253,10 +264,13 @@ OUString ScUndoOutlineLevel::GetComment() const
void ScUndoOutlineLevel::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
// Original Outline table
@@ -288,9 +302,11 @@ void ScUndoOutlineLevel::Undo()
void ScUndoOutlineLevel::Redo()
{
- BeginRedo();
-
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
+ BeginRedo();
// sheet has to be switched on or off before this (#46952#) !!!
@@ -337,10 +353,13 @@ OUString ScUndoOutlineBlock::GetComment() const
void ScUndoOutlineBlock::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
// Original Outline table
@@ -387,9 +406,11 @@ void ScUndoOutlineBlock::Undo()
void ScUndoOutlineBlock::Redo()
{
- BeginRedo();
-
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
+ BeginRedo();
ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart, aBlockEnd );
if (bShow)
@@ -437,10 +458,13 @@ OUString ScUndoRemoveAllOutlines::GetComment() const
void ScUndoRemoveAllOutlines::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
// Original Outline table
@@ -477,9 +501,11 @@ void ScUndoRemoveAllOutlines::Undo()
void ScUndoRemoveAllOutlines::Redo()
{
- BeginRedo();
-
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
+ BeginRedo();
// sheet has to be switched over (#46952#)!
@@ -523,10 +549,13 @@ OUString ScUndoAutoOutline::GetComment() const
void ScUndoAutoOutline::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
// Original outline table
@@ -561,19 +590,18 @@ void ScUndoAutoOutline::Undo()
void ScUndoAutoOutline::Redo()
{
- BeginRedo();
-
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
+ BeginRedo();
SCTAB nTab = aBlockStart.Tab();
- if (pViewShell)
- {
- // sheet has to be switched on or off before this (#46952#) !!!
+ // sheet has to be switched on or off before this (#46952#) !!!
- SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
- if ( nVisTab != nTab )
- pViewShell->SetTabNo( nTab );
- }
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
+ if ( nVisTab != nTab )
+ pViewShell->SetTabNo( nTab );
ScRange aRange( aBlockStart.Col(), aBlockStart.Row(), nTab,
aBlockEnd.Col(), aBlockEnd.Row(), nTab );
@@ -584,8 +612,7 @@ void ScUndoAutoOutline::Redo()
// If it was called with a multi selection,
// then this is now the enclosing range...
- if (pViewShell)
- pViewShell->MarkRange( aRange );
+ pViewShell->MarkRange( aRange );
EndRedo();
}
@@ -624,10 +651,13 @@ OUString ScUndoSubTotals::GetComment() const
void ScUndoSubTotals::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (nNewEndRow > aParam.nRow2)
{
@@ -691,9 +721,11 @@ void ScUndoSubTotals::Undo()
void ScUndoSubTotals::Redo()
{
- BeginRedo();
-
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
+ BeginRedo();
SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
@@ -755,6 +787,9 @@ OUString ScUndoQuery::GetComment() const
void ScUndoQuery::Undo()
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
if (ScTabViewShell::isAnyEditViewInRange(pViewShell, /*bColumns*/ false, aQueryParam.nRow1, aQueryParam.nRow2))
return;
@@ -870,9 +905,11 @@ void ScUndoQuery::Undo()
void ScUndoQuery::Redo()
{
- BeginRedo();
-
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
+ BeginRedo();
SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
@@ -1065,10 +1102,13 @@ OUString ScUndoImportData::GetComment() const
void ScUndoImportData::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
ScUndoUtil::MarkSimpleBlock( pDocShell, aImportParam.nCol1,aImportParam.nRow1,nTab,
nEndCol,nEndRow,nTab );
@@ -1150,10 +1190,13 @@ void ScUndoImportData::Undo()
void ScUndoImportData::Redo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginRedo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
ScUndoUtil::MarkSimpleBlock( pDocShell, aImportParam.nCol1,aImportParam.nRow1,nTab,
nEndCol,nEndRow,nTab );
@@ -1274,10 +1317,13 @@ OUString ScUndoRepeatDB::GetComment() const
void ScUndoRepeatDB::Undo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginUndo();
ScDocument& rDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
if (bQuerySize)
@@ -1375,9 +1421,12 @@ void ScUndoRepeatDB::Undo()
void ScUndoRepeatDB::Redo()
{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
BeginRedo();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
@@ -1493,12 +1542,6 @@ void ScUndoDataPilot::Undo()
pDocShell->PostPaint(aOldRange, PaintPartFlags::Grid, SC_PF_LINES);
pDocShell->PostDataChanged();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (pViewShell)
- {
- //! set current sheet
- }
-
if (xNewDPObject)
{
// notify API objects
@@ -1887,7 +1930,7 @@ void ScUndoDataForm::DoChange( const bool bUndo )
aDrawRange.aEnd.SetCol(rDoc.MaxCol());
aDrawRange.aEnd.SetRow(rDoc.MaxRow());
nPaint |= PaintPartFlags::Top | PaintPartFlags::Left;
-/*A*/ if (pViewShell)
+ if (pViewShell)
pViewShell->AdjustBlockHeight(false);
}
else
@@ -1902,7 +1945,7 @@ void ScUndoDataForm::DoChange( const bool bUndo )
nPaint |= PaintPartFlags::Left;
aDrawRange.aEnd.SetRow(rDoc.MaxRow());
}
-/*A*/ if (pViewShell && pViewShell->AdjustBlockHeight(false))
+ if (pViewShell && pViewShell->AdjustBlockHeight(false))
{
aDrawRange.aStart.SetCol(0);
aDrawRange.aStart.SetRow(0);
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 4237aab463..0eacb70d1c 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -105,6 +105,9 @@ void ScUndoInsertTab::SetChangeTrack()
void ScUndoInsertTab::Undo()
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
pViewShell->SetTabNo(nTab);
pDocShell->SetInUndo( true ); //! BeginUndo
@@ -126,6 +129,8 @@ void ScUndoInsertTab::Undo()
void ScUndoInsertTab::Redo()
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
@@ -202,6 +207,9 @@ void ScUndoInsertTables::SetChangeTrack()
void ScUndoInsertTables::Undo()
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
pViewShell->SetTabNo(nTab);
pDocShell->SetInUndo( true ); //! BeginUndo
@@ -225,6 +233,8 @@ void ScUndoInsertTables::Undo()
void ScUndoInsertTables::Redo()
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
@@ -493,9 +503,11 @@ OUString ScUndoMoveTab::GetComment() const
void ScUndoMoveTab::DoChange( bool bUndo ) const
{
- ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+ ScDocument& rDoc = pDocShell->GetDocument();
if (bUndo) // UnDo
{
size_t i = mpNewTabs->size();
@@ -645,8 +657,11 @@ void ScUndoCopyTab::Undo()
void ScUndoCopyTab::Redo()
{
- ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nDestTab = 0;
for (size_t i = 0, n = mpNewTabs->size(); i < n; ++i)
@@ -883,6 +898,9 @@ OUString ScUndoImportTab::GetComment() const
void ScUndoImportTab::DoChange() const
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+
ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTabCount = rDoc.GetTableCount();
if (pViewShell)
@@ -1105,9 +1123,11 @@ ScUndoShowHideTab::~ScUndoShowHideTab()
void ScUndoShowHideTab::DoChange( bool bShowP ) const
{
- ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (!pViewShell)
+ return;
+ ScDocument& rDoc = pDocShell->GetDocument();
for(const SCTAB& nTab : undoTabs)
{
rDoc.SetVisible( nTab, bShowP );
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 93a456e46b..8381209e7c 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1736,7 +1736,7 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
// SvNumFormatType::DEFINED bit.
const SvNumFormatType nType = (eItemState >= SfxItemState::DEFAULT ? pFormatter->GetType( nNumberFormat) :
GetCurrentNumberFormatType());
- NfIndexTableOffset nOffset = pFormatter->GetIndexTableOffset(nNumberFormat);
+ NfIndexTableOffset nOffset = SvNumberFormatter::GetIndexTableOffset(nNumberFormat);
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich = aIter.FirstWhich();
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 9d0fe14305..6f01dc052f 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -144,6 +144,7 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2,
double nPixelPerTwipsX, double nPixelPerTwipsY,
const Fraction* pZoomX, const Fraction* pZoomY ) :
+ mpOriginalTargetDevice( pNewDev ),
mpDev( pNewDev ),
mpRefDevice( pNewDev ), // default is output device
pFmtDevice( pNewDev ), // default is output device
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index bc6efec654..760a62a12d 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -206,7 +206,13 @@ void ScOutputData::DrawSelectiveObjects(SdrLayerID nLayer)
if(pPageView)
{
- if (nullptr != pPageView->FindPageWindow(*mpDev))
+ // tdf#160589 need to check for registered PaintWindow using the
+ // 'original' TragetDevice, mpDev might have been changed by a
+ // call to ::SetContentDevice. That again might patch in a
+ // pre-render device fetched from SdrPaintWindow::GetTargetOutputDevice
+ // and thus the test if target is aregistered PageWindow would fail
+ assert(nullptr != mpOriginalTargetDevice && "mpOriginalTargetDevice *must* be set when constructing ScOutputData (!)");
+ if (nullptr != pPageView->FindPageWindow(*mpOriginalTargetDevice))
{
// Target OutputDevice is registered for this view
// (as it should be), we can just render
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 345a33534d..2daa55be00 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1075,7 +1075,7 @@ void ScTabViewShell::SetDrawTextUndo( SfxUndoManager* pNewUndoMgr )
ScTabViewShell* ScTabViewShell::GetActiveViewShell()
{
- return dynamic_cast< ScTabViewShell *>( Current() );
+ return dynamic_cast< ScTabViewShell *>( SfxViewShell::Current() );
}
SfxPrinter* ScTabViewShell::GetPrinter( bool bCreate )
diff --git a/sc/uiconfig/scalc/ui/conditionalentry.ui b/sc/uiconfig/scalc/ui/conditionalentry.ui
index 1ff40d1046..6e40f6cc6a 100644
--- a/sc/uiconfig/scalc/ui/conditionalentry.ui
+++ b/sc/uiconfig/scalc/ui/conditionalentry.ui
@@ -1,216 +1,217 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="sc">
<requires lib="gtk+" version="3.20"/>
<object class="GtkScrolledWindow" id="border">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">never</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=1 n-rows=3 -->
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
- <property name="border_width">6</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="border-width">6</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
- <property name="column_spacing">12</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="number">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="condition">
- <property name="width_request">10</property>
+ <property name="width-request">10</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="ellipsize">end</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=3 n-rows=8 -->
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
- <property name="column_homogeneous">True</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
+ <property name="column-homogeneous">True</property>
<child>
<object class="GtkLabel" id="styleft">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<property name="label" translatable="yes" context="conditionalentry|styleft">Apply Style:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">style</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">style</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="style">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<items>
<item translatable="yes" context="conditionalentry|style">New Style...</item>
</items>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="valueft">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="width-request">100</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<property name="label" translatable="yes" context="conditionalentry|valueft">Enter a value:</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="edcolscalemin">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="edcolscalemiddle">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="edcolscalemax">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="lbcolmin">
- <property name="can_focus">False</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
<property name="xalign">0</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
<property name="label" translatable="no"></property>
<child>
<placeholder/>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="lbcolmiddle">
- <property name="can_focus">False</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
<property name="xalign">0</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
<property name="label" translatable="no"></property>
<child>
<placeholder/>
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="lbcolmax">
- <property name="can_focus">False</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
<property name="xalign">0</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
<property name="label" translatable="no"></property>
<child>
<placeholder/>
</child>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">5</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkButton" id="options">
<property name="label" translatable="yes" context="conditionalentry|options">More Options...</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">6</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="colscalemin">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<items>
<item id="auto" translatable="yes" context="conditionalentry|colscalemin">Automatic</item>
<item id="min" translatable="yes" context="conditionalentry|colscalemin">Min</item>
@@ -222,14 +223,14 @@
</items>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="colscalemiddle">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<items>
<item id="auto" translatable="yes" context="conditionalentry|colscalemiddle">Automatic</item>
<item id="min" translatable="yes" context="conditionalentry|colscalemiddle">Min</item>
@@ -241,14 +242,14 @@
</items>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="colscalemax">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<items>
<item id="auto" translatable="yes" context="conditionalentry|colscalemax">Automatic</item>
<item id="min" translatable="yes" context="conditionalentry|colscalemax">Min</item>
@@ -260,96 +261,72 @@
</items>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid" id="iconparent">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
+ <property name="can-focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">7</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="Label_minimum">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<property name="label" translatable="yes" context="conditionalentry|Label_minimum">Minimum</property>
- <property name="mnemonic_widget">colscalemin</property>
+ <property name="mnemonic-widget">colscalemin</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="Label_maximum">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="conditionalentry|Label_maximum">Maximum</property>
- <property name="mnemonic_widget">colscalemax</property>
+ <property name="mnemonic-widget">colscalemax</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="previewwin">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">never</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<child>
<object class="GtkDrawingArea" id="preview">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="conditionalentry|preview|tooltip_text">Example</property>
+ <property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes" context="conditionalentry|preview|tooltip_text">Example</property>
</object>
</child>
</object>
</child>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
@@ -363,21 +340,21 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=3 n-rows=4 -->
<object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="column_spacing">12</property>
- <property name="column_homogeneous">True</property>
+ <property name="can-focus">False</property>
+ <property name="column-spacing">12</property>
+ <property name="column-homogeneous">True</property>
<child>
<object class="GtkComboBoxText" id="typeis">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<items>
<item translatable="yes" context="conditionalentry|typeis">is equal to</item>
<item translatable="yes" context="conditionalentry|typeis">is less than</item>
@@ -406,13 +383,13 @@
</items>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="datetype">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<items>
<item translatable="yes" context="conditionalentry|datetype">Today</item>
<item translatable="yes" context="conditionalentry|datetype">Yesterday</item>
@@ -430,13 +407,13 @@
</items>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="colorformat">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<items>
<item translatable="yes" context="conditionalentry|colorformat">Color Scale (2 Entries)</item>
<item translatable="yes" context="conditionalentry|colorformat">Color Scale (3 Entries)</item>
@@ -445,27 +422,27 @@
</items>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="formula">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
- <property name="truncate-multiline">True</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
<property name="hexpand">True</property>
+ <property name="truncate-multiline">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">3</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="type">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<items>
<item translatable="yes" context="conditionalentry|type">All Cells</item>
<item translatable="yes" context="conditionalentry|type">Cell value</item>
@@ -474,54 +451,54 @@
</items>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
<property name="height">4</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
- <property name="column_spacing">6</property>
+ <property name="column-spacing">6</property>
<child>
<object class="GtkEntry" id="val1">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
<property name="hexpand">True</property>
+ <property name="width-chars">5</property>
<property name="truncate-multiline">True</property>
- <property name="width_chars">5</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="val2">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
<property name="hexpand">True</property>
+ <property name="width-chars">5</property>
<property name="truncate-multiline">True</property>
- <property name="width_chars">5</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="iconsettype">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<items>
<item translatable="yes" context="conditionalentry|iconsettype">3 Arrows</item>
<item translatable="yes" context="conditionalentry|iconsettype">3 Gray Arrows</item>
@@ -548,8 +525,8 @@
</items>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
@@ -557,8 +534,8 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
</object>