diff options
author | Noel Power <noel.power@suse.com> | 2013-04-15 20:35:47 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-04-15 20:37:19 +0100 |
commit | dd763604784fe10ee06a2f9c1fddf74cdf890bcc (patch) | |
tree | fe601ebfc1259a585b2e041ab3471d3561520ef7 /sc/source/ui/view/viewfunc.cxx | |
parent | 808d14765bcf57870c9306c40a431e525b0eaa71 (diff) |
basic inplace Font preview for calc
Change-Id: Ic1e6c953852a6106ee94f0b577ed398d62aa2285
Diffstat (limited to 'sc/source/ui/view/viewfunc.cxx')
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 8a67e463dece..b17bf6d0f830 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -76,6 +76,7 @@ #include "cellsuno.hxx" #include "tokenarray.hxx" + //================================================================== static void lcl_PostRepaintCondFormat( const ScConditionalFormat *pCondFmt, ScDocShell *pDocSh ) @@ -2896,6 +2897,44 @@ void ScViewFunc::InsertNameList() pDocSh->UpdateOle(GetViewData()); } +void ScViewFunc::UpdateSelectionArea( const ScMarkData& rSel, ScPatternAttr* pAttr ) +{ + ScDocShell* pDocShell = GetViewData()->GetDocShell(); + ScRange aMarkRange; + if (rSel.IsMultiMarked() ) + rSel.GetMultiMarkArea( aMarkRange ); + else + rSel.GetMarkArea( aMarkRange ); + + sal_Bool bSetLines = false; + sal_Bool bSetAlign = false; + if ( pAttr ) + { + const SfxItemSet& rNewSet = pAttr->GetItemSet(); + bSetLines = rNewSet.GetItemState( ATTR_BORDER, sal_True ) == SFX_ITEM_SET || + rNewSet.GetItemState( ATTR_SHADOW, sal_True ) == SFX_ITEM_SET; + bSetAlign = rNewSet.GetItemState( ATTR_HOR_JUSTIFY, sal_True ) == SFX_ITEM_SET; + } + + sal_uInt16 nExtFlags = 0; + if ( bSetLines ) + nExtFlags |= SC_PF_LINES; + if ( bSetAlign ) + nExtFlags |= SC_PF_WHOLEROWS; + + SCCOL nStartCol = aMarkRange.aStart.Col(); + SCROW nStartRow = aMarkRange.aStart.Row(); + SCTAB nStartTab = aMarkRange.aStart.Tab(); + SCCOL nEndCol = aMarkRange.aEnd.Col(); + SCROW nEndRow = aMarkRange.aEnd.Row(); + SCTAB nEndTab = aMarkRange.aEnd.Tab(); + pDocShell->PostPaint( nStartCol, nStartRow, nStartTab, + nEndCol, nEndRow, nEndTab, + PAINT_GRID, nExtFlags | SC_PF_TESTMERGE ); + ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); + pTabViewShell->CellContentChanged(); + pTabViewShell->AdjustBlockHeight(true, const_cast<ScMarkData*>(&rSel)); +} |