summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/docuno.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/unoobj/docuno.cxx')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx88
1 files changed, 59 insertions, 29 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 06e8f47a6b9c..3b8927d84d11 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -503,7 +503,7 @@ void ScModelObj::RepaintRange( const ScRangeList& rRange )
pDocShell->PostPaint(rRange, PaintPartFlags::Grid, SC_PF_TESTMERGE);
}
-static OString getTabViewRenderState(ScTabViewShell& rTabViewShell)
+static OString getTabViewRenderState(const ScTabViewShell& rTabViewShell)
{
OStringBuffer aState;
const ScViewRenderingOptions& rViewRenderingOptions = rTabViewShell.GetViewRenderingData();
@@ -1103,8 +1103,11 @@ void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int
pHdl->SetRefScale(pViewData->GetZoomX(), pViewData->GetZoomY());
// refresh our view's take on other view's cursors & selections
- pViewData->GetActiveWin()->updateKitOtherCursors();
- pViewData->GetActiveWin()->updateOtherKitSelections();
+ ScGridWindow* pGridWindow = pViewData->GetActiveWin();
+ pGridWindow->UpdateEditViewPos();
+ pGridWindow->updateKitOtherCursors();
+ pGridWindow->updateOtherKitSelections();
+ pGridWindow->resetCachedViewGridOffsets();
if (ScDrawView* pDrawView = pViewData->GetScDrawView())
pDrawView->resetGridOffsetsForAllSdrPageViews();
@@ -1527,6 +1530,11 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
uno::Reference<sheet::XSpreadsheets> SAL_CALL ScModelObj::getSheets()
{
+ return getScSheets();
+}
+
+rtl::Reference<ScTableSheetsObj> ScModelObj::getScSheets()
+{
SolarMutexGuard aGuard;
if (pDocShell)
return new ScTableSheetsObj(pDocShell);
@@ -1862,7 +1870,6 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const uno::Any& aSelection,
return 0;
Size aPrintPageSize;
- bool bPrintAreaReset = false;
bool bPrintPageLandscape = false;
bool bUsePrintDialogSetting = false;
Printer* pPrinter = lcl_GetPrinter(rOptions);
@@ -1874,16 +1881,13 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const uno::Any& aSelection,
bPrintPageLandscape = (pPrinter->GetOrientation() == Orientation::Landscape);
aPrintPageSize = lcl_GetPrintPageSize(pPrinter->GetPrintPageSize());
}
- else // reset the print area created by the Print Dialog to the page style's print area.
- bPrintAreaReset = pPrinter->IsPrintAreaReset();
}
// The same ScPrintFuncCache object in pPrintFuncCache is used as long as
// the same selection is used (aStatus) and the document isn't changed
// (pPrintFuncCache is cleared in Notify handler)
- if (!pPrintFuncCache || !pPrintFuncCache->IsSameSelection(aStatus) || bUsePrintDialogSetting
- || bPrintAreaReset)
+ if (!pPrintFuncCache || !pPrintFuncCache->IsSameSelection(aStatus) || bUsePrintDialogSetting)
{
pPrintFuncCache.reset(new ScPrintFuncCache(pDocShell, aMark, std::move(aStatus), aPrintPageSize,
bPrintPageLandscape, bUsePrintDialogSetting));
@@ -2371,7 +2375,7 @@ static void lcl_PDFExportBookmarkHelper(OutputDevice* pDev, ScDocument& rDoc,
}
static void lcl_SetMediaScreen(const uno::Reference<drawing::XShape>& xMediaShape,
- const OutputDevice* pDev, tools::Rectangle& aRect,
+ const OutputDevice* pDev, const tools::Rectangle& aRect,
sal_Int32 nPageNumb)
{
OUString sMediaURL;
@@ -2685,7 +2689,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
// The bMetaFile argument maybe could be
// pDev->GetConnectMetaFile() != nullptr
// but for some yet unknown reason does not draw cell content if true.
- ScPrintFunc::DrawToDev( rDoc, pDev, nPrintFactor, aBound, &aViewData, false /*bMetaFile*/ );
+ ScPrintFunc::DrawToDev( rDoc, pDev, nPrintFactor, aBound, aViewData, false /*bMetaFile*/ );
return;
}
@@ -2783,6 +2787,19 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
(void)pPrintFunc->DoPrint( aPage, nTabStart, nDisplayStart, true, nullptr );
+ if (pPrinter)
+ {
+ // reset the print area created by the Print Dialog to the page style's print area
+ if (pPrinter->IsUsePrintDialogSetting())
+ {
+ bUsePrintDialogSetting = false;
+ if (m_pPrintState && m_pPrintState->nPrintTab == nTab && !pSelRange)
+ pPrintFunc.reset(new ScPrintFunc(pDev, pDocShell, *m_pPrintState,
+ &aStatus.GetOptions(), aPrintPageSize,
+ bPrintPageLandscape, bUsePrintDialogSetting));
+ }
+ }
+
vcl::PDFExtOutDevData* pPDFData = dynamic_cast<vcl::PDFExtOutDevData*>(pDev->GetExtOutDevData());
if (pPDFData && pPDFData->GetIsExportTaggedPDF() && bIsLastPage)
{
@@ -4173,7 +4190,7 @@ void ScTableSheetsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
// XSpreadsheets
-rtl::Reference<ScTableSheetObj> ScTableSheetsObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const
+rtl::Reference<ScTableSheetObj> ScTableSheetsObj::GetSheetByIndex(sal_Int32 nIndex) const
{
if ( pDocShell && nIndex >= 0 && nIndex < pDocShell->GetDocument().GetTableCount() )
return new ScTableSheetObj( pDocShell, static_cast<SCTAB>(nIndex) );
@@ -4392,7 +4409,7 @@ sal_Int32 ScTableSheetsObj::importSheet(
uno::Reference< table::XCell > SAL_CALL ScTableSheetsObj::getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet )
{
SolarMutexGuard aGuard;
- rtl::Reference<ScTableSheetObj> xSheet = GetObjectByIndex_Impl(static_cast<sal_uInt16>(nSheet));
+ rtl::Reference<ScTableSheetObj> xSheet = GetSheetByIndex(static_cast<sal_uInt16>(nSheet));
if (! xSheet.is())
throw lang::IndexOutOfBoundsException();
@@ -4402,7 +4419,7 @@ uno::Reference< table::XCell > SAL_CALL ScTableSheetsObj::getCellByPosition( sal
uno::Reference< table::XCellRange > SAL_CALL ScTableSheetsObj::getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet )
{
SolarMutexGuard aGuard;
- rtl::Reference<ScTableSheetObj> xSheet = GetObjectByIndex_Impl(static_cast<sal_uInt16>(nSheet));
+ rtl::Reference<ScTableSheetObj> xSheet = GetSheetByIndex(static_cast<sal_uInt16>(nSheet));
if (! xSheet.is())
throw lang::IndexOutOfBoundsException();
@@ -4455,11 +4472,11 @@ sal_Int32 SAL_CALL ScTableSheetsObj::getCount()
uno::Any SAL_CALL ScTableSheetsObj::getByIndex( sal_Int32 nIndex )
{
SolarMutexGuard aGuard;
- uno::Reference<sheet::XSpreadsheet> xSheet(GetObjectByIndex_Impl(nIndex));
+ rtl::Reference<ScTableSheetObj> xSheet(GetSheetByIndex(nIndex));
if (!xSheet.is())
throw lang::IndexOutOfBoundsException();
- return uno::Any(xSheet);
+ return uno::Any(uno::Reference<sheet::XSpreadsheet>(xSheet));
// return uno::Any();
}
@@ -4480,11 +4497,11 @@ sal_Bool SAL_CALL ScTableSheetsObj::hasElements()
uno::Any SAL_CALL ScTableSheetsObj::getByName( const OUString& aName )
{
SolarMutexGuard aGuard;
- uno::Reference<sheet::XSpreadsheet> xSheet(GetObjectByName_Impl(aName));
+ rtl::Reference<ScTableSheetObj> xSheet(GetObjectByName_Impl(aName));
if (!xSheet.is())
throw container::NoSuchElementException();
- return uno::Any(xSheet);
+ return uno::Any(uno::Reference<sheet::XSpreadsheet>(xSheet));
}
uno::Sequence<OUString> SAL_CALL ScTableSheetsObj::getElementNames()
@@ -4626,11 +4643,11 @@ sal_Int32 SAL_CALL ScTableColumnsObj::getCount()
uno::Any SAL_CALL ScTableColumnsObj::getByIndex( sal_Int32 nIndex )
{
SolarMutexGuard aGuard;
- uno::Reference<table::XCellRange> xColumn(GetObjectByIndex_Impl(nIndex));
+ rtl::Reference<ScTableColumnObj> xColumn(GetObjectByIndex_Impl(nIndex));
if (!xColumn.is())
throw lang::IndexOutOfBoundsException();
- return uno::Any(xColumn);
+ return uno::Any(uno::Reference<table::XCellRange>(xColumn));
}
@@ -4648,11 +4665,11 @@ sal_Bool SAL_CALL ScTableColumnsObj::hasElements()
uno::Any SAL_CALL ScTableColumnsObj::getByName( const OUString& aName )
{
SolarMutexGuard aGuard;
- uno::Reference<table::XCellRange> xColumn(GetObjectByName_Impl(aName));
+ rtl::Reference<ScTableColumnObj> xColumn(GetObjectByName_Impl(aName));
if (!xColumn.is())
throw container::NoSuchElementException();
- return uno::Any(xColumn);
+ return uno::Any(uno::Reference<table::XCellRange>(xColumn));
}
uno::Sequence<OUString> SAL_CALL ScTableColumnsObj::getElementNames()
@@ -4868,11 +4885,11 @@ sal_Int32 SAL_CALL ScTableRowsObj::getCount()
uno::Any SAL_CALL ScTableRowsObj::getByIndex( sal_Int32 nIndex )
{
SolarMutexGuard aGuard;
- uno::Reference<table::XCellRange> xRow(GetObjectByIndex_Impl(nIndex));
+ rtl::Reference<ScTableRowObj> xRow(GetObjectByIndex_Impl(nIndex));
if (!xRow.is())
throw lang::IndexOutOfBoundsException();
- return uno::Any(xRow);
+ return uno::Any(uno::Reference<table::XCellRange>(xRow));
}
uno::Type SAL_CALL ScTableRowsObj::getElementType()
@@ -4991,6 +5008,13 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
}
}
+void ScTableRowsObj::setPropertyValueIsFiltered(SolarMutexGuard& /*rGuard*/, bool b )
+{
+ ScDocument& rDoc = pDocShell->GetDocument();
+ //! undo etc.
+ rDoc.SetRowFiltered(nStartRow, nEndRow, nTab, b);
+}
+
uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyName )
{
SolarMutexGuard aGuard;
@@ -5047,6 +5071,12 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyNam
return aAny;
}
+bool ScTableRowsObj::getPropertyValueOHeight( SolarMutexGuard& /*rGuard*/ )
+{
+ ScDocument& rDoc = pDocShell->GetDocument();
+ return !(rDoc.GetRowFlags( nStartRow, nTab ) & CRFlags::ManualSize);
+}
+
SC_IMPL_DUMMY_PROPERTY_LISTENER( ScTableRowsObj )
ScSpreadsheetSettingsObj::~ScSpreadsheetSettingsObj()
@@ -5177,11 +5207,11 @@ sal_Int32 SAL_CALL ScAnnotationsObj::getCount()
uno::Any SAL_CALL ScAnnotationsObj::getByIndex( sal_Int32 nIndex )
{
SolarMutexGuard aGuard;
- uno::Reference<sheet::XSheetAnnotation> xAnnotation(GetObjectByIndex_Impl(nIndex));
+ rtl::Reference<ScAnnotationObj> xAnnotation(GetObjectByIndex_Impl(nIndex));
if (!xAnnotation.is())
throw lang::IndexOutOfBoundsException();
- return uno::Any(xAnnotation);
+ return uno::Any(uno::Reference<sheet::XSheetAnnotation>(xAnnotation));
}
uno::Type SAL_CALL ScAnnotationsObj::getElementType()
@@ -5331,11 +5361,11 @@ sal_Int32 SAL_CALL ScScenariosObj::getCount()
uno::Any SAL_CALL ScScenariosObj::getByIndex( sal_Int32 nIndex )
{
SolarMutexGuard aGuard;
- uno::Reference<sheet::XScenario> xScen(GetObjectByIndex_Impl(nIndex));
+ rtl::Reference<ScTableSheetObj> xScen(GetObjectByIndex_Impl(nIndex));
if (!xScen.is())
throw lang::IndexOutOfBoundsException();
- return uno::Any(xScen);
+ return uno::Any(uno::Reference<sheet::XScenario>(xScen));
}
uno::Type SAL_CALL ScScenariosObj::getElementType()
@@ -5352,11 +5382,11 @@ sal_Bool SAL_CALL ScScenariosObj::hasElements()
uno::Any SAL_CALL ScScenariosObj::getByName( const OUString& aName )
{
SolarMutexGuard aGuard;
- uno::Reference<sheet::XScenario> xScen(GetObjectByName_Impl(aName));
+ rtl::Reference<ScTableSheetObj> xScen(GetObjectByName_Impl(aName));
if (!xScen.is())
throw container::NoSuchElementException();
- return uno::Any(xScen);
+ return uno::Any(uno::Reference<sheet::XScenario>(xScen));
}
uno::Sequence<OUString> SAL_CALL ScScenariosObj::getElementNames()