Kaydet (Commit) 82275ecb authored tarafından Eike Rathke's avatar Eike Rathke

eliminated cause of "SelectionPattern Null" dbgutil warning

No mark at all happens when creating a new document, in which
case the selection pattern is empty (created of GetPool())
anyway (hence there was a debug warning "SelectionPattern Null"
from ScDocument::CreateSelectionPattern()) and nothing needs to
be applied.

Change-Id: I9df338063baf27581f258f6c2fd0737b95804509
üst 4219195d
......@@ -314,18 +314,25 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
}
else
{
ScPatternAttr aAttr( *pDoc->GetSelectionPattern( pDoc->GetPreviewSelection() ) );
if ( ScStyleSheet* pPreviewStyle = pDoc->GetPreviewCellStyle() )
aAttr.SetStyleSheet( pPreviewStyle );
pDoc->SetPreviewCellStyle(NULL);
// No mark at all happens when creating a new document, in which
// case the selection pattern obtained would be empty (created of
// GetPool()) anyway and nothing needs to be applied.
ScMarkData aPreviewMark( pDoc->GetPreviewSelection());
if (aPreviewMark.IsMarked() || aPreviewMark.IsMultiMarked())
{
ScPatternAttr aAttr( *pDoc->GetSelectionPattern( aPreviewMark ) );
if ( ScStyleSheet* pPreviewStyle = pDoc->GetPreviewCellStyle() )
aAttr.SetStyleSheet( pPreviewStyle );
pDoc->SetPreviewCellStyle(NULL);
SfxItemSet aItemSet( GetPool() );
SfxItemSet aItemSet( GetPool() );
ScPatternAttr aNewAttrs( GetViewData()->GetDocument()->GetPool() );
SfxItemSet& rNewSet = aNewAttrs.GetItemSet();
rNewSet.Put( aItemSet, false );
pDoc->ApplySelectionPattern( aNewAttrs, pDoc->GetPreviewSelection() );
pTabViewShell->UpdateSelectionArea( pDoc->GetPreviewSelection(), &aAttr );
ScPatternAttr aNewAttrs( GetViewData()->GetDocument()->GetPool() );
SfxItemSet& rNewSet = aNewAttrs.GetItemSet();
rNewSet.Put( aItemSet, false );
pDoc->ApplySelectionPattern( aNewAttrs, aPreviewMark );
pTabViewShell->UpdateSelectionArea( aPreviewMark, &aAttr );
}
}
}
else if ( (nSlotId == SID_STYLE_NEW)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment