Kaydet (Commit) 8aa3d121 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS impressodf12 (1.62.4); FILE MERGED

2008/05/30 14:09:18 cl 1.62.4.4: #i75927# fixed send to outliner after bullet rework
2008/05/26 12:25:03 cl 1.62.4.3: #i35937# code cleanup after bullet rework
2008/04/25 08:49:36 cl 1.62.4.2: RESYNC: (1.62-1.64); FILE MERGED
2008/04/10 17:07:47 cl 1.62.4.1: #i35937# allow paragraph depth of -1 to switch of numbering
üst 4f060fc4
......@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: sdview.cxx,v $
* $Revision: 1.64 $
* $Revision: 1.65 $
*
* This file is part of OpenOffice.org.
*
......@@ -682,7 +682,6 @@ sal_Bool View::SdrBeginTextEdit(
// make draw&impress specific initialisations
if( pOutl )
{
pOutl->SetMinDepth(0);
pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mpDoc->GetStyleSheetPool());
pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
ULONG nCntrl = pOutl->GetControlWord();
......@@ -708,11 +707,6 @@ sal_Bool View::SdrBeginTextEdit(
pOutl->SetHyphenator( xHyphenator );
pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguage() );
// in einem Gliederungstext darf nicht auf die 0-te
// Ebene ausgerueckt werden
if (pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
pOutl->SetMinDepth(1);
}
sal_Bool bReturn = FmFormView::SdrBeginTextEdit(
......@@ -769,7 +763,11 @@ SdrEndTextEditKind View::SdrEndTextEdit(BOOL bDontDeleteReally )
{
SdrTextObj* pObj = dynamic_cast< SdrTextObj* >( xObj.get() );
if( pObj && pObj->HasText() )
pObj->SetEmptyPresObj( FALSE );
{
SdrPage* pPage = pObj->GetPage();
if( !pPage || !pPage->IsMasterPage() )
pObj->SetEmptyPresObj( FALSE );
}
}
GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent(sd::tools::EventMultiplexerEvent::EID_END_TEXT_EDIT, (void*)xObj.get() );
......@@ -1267,4 +1265,63 @@ void View::CheckPossibilities()
maSmartTags.CheckPossibilities();
}
void View::OnBeginPasteOrDrop( PasteOrDropInfos* /*pInfos*/ )
{
}
/** this is called after a paste or drop operation, make sure that the newly inserted paragraphs
get the correct style sheet. */
void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
{
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( GetTextEditObject() );
SdrOutliner* pOutliner = GetTextEditOutliner();
if( pOutliner && pTextObj && pTextObj->GetPage() )
{
SdPage* pPage = static_cast< SdPage* >( pTextObj->GetPage() );
SfxStyleSheet* pStyleSheet = 0;
const PresObjKind eKind = pPage->GetPresObjKind(pTextObj);
if( eKind != PRESOBJ_NONE )
pStyleSheet = pPage->GetStyleSheetForPresObj(eKind);
else
pStyleSheet = pTextObj->GetStyleSheet();
if( eKind == PRESOBJ_OUTLINE )
{
// for outline shapes, set the correct outline style sheet for each
// new paragraph, depending on the paragraph depth
SfxStyleSheetBasePool* pStylePool = GetDoc()->GetStyleSheetPool();
for ( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
{
sal_Int16 nDepth = pOutliner->GetDepth( nPara );
SfxStyleSheet* pStyle = 0;
if( nDepth > 0 )
{
String aStyleSheetName( pStyleSheet->GetName() );
aStyleSheetName.Erase( aStyleSheetName.Len() - 1, 1 );
aStyleSheetName += String::CreateFromInt32( nDepth );
pStyle = static_cast<SfxStyleSheet*>( pStylePool->Find( aStyleSheetName, pStyleSheet->GetFamily() ) );
DBG_ASSERT( pStyle, "sd::View::OnEndPasteOrDrop(), Style not found!" );
}
if( !pStyle )
pStyle = pStyleSheet;
pOutliner->SetStyleSheet( nPara, pStyle );
}
}
else
{
// just put the object style on each new paragraph
for ( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
{
pOutliner->SetStyleSheet( nPara, pStyleSheet );
}
}
}
}
} // end of namespace sd
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