/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef _SVDLAYER #include #endif #include #include #include "strings.hrc" #include "glob.hxx" #include "glob.hrc" // STR_BCKGRND, STR_BCKGRNDOBJ #include "app.hrc" // SID_SWITCHPAGE #include "unmodpg.hxx" #include "sdpage.hxx" #include "sdresid.hxx" #include "drawdoc.hxx" TYPEINIT1(ModifyPageUndoAction, SdUndoAction); /************************************************************************* |* |* Konstruktor |* \************************************************************************/ ModifyPageUndoAction::ModifyPageUndoAction( SdDrawDocument* pTheDoc, SdPage* pThePage, String aTheNewName, AutoLayout eTheNewAutoLayout, sal_Bool bTheNewBckgrndVisible, sal_Bool bTheNewBckgrndObjsVisible) : SdUndoAction(pTheDoc) { DBG_ASSERT(pThePage, "Undo ohne Seite ???"); mpPage = pThePage; maNewName = aTheNewName; meNewAutoLayout = eTheNewAutoLayout; mbNewBckgrndVisible = bTheNewBckgrndVisible; mbNewBckgrndObjsVisible = bTheNewBckgrndObjsVisible; meOldAutoLayout = mpPage->GetAutoLayout(); if (!mpPage->IsMasterPage()) { maOldName = mpPage->GetName(); SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False); sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False); SetOfByte aVisibleLayers = mpPage->TRG_GetMasterPageVisibleLayers(); mbOldBckgrndVisible = aVisibleLayers.IsSet(aBckgrnd); mbOldBckgrndObjsVisible = aVisibleLayers.IsSet(aBckgrndObj); } maComment = String(SdResId(STR_UNDO_MODIFY_PAGE)); } /************************************************************************* |* |* Undo() |* \************************************************************************/ #include #include void ModifyPageUndoAction::Undo() { // invalidate Selection, there could be objects deleted in tis UNDO // which are no longer allowed to be selected then. SdrViewIter aIter(mpPage); SdrView* pView = aIter.FirstView(); while(pView) { if(pView->AreObjectsMarked()) pView->UnmarkAll(); pView = aIter.NextView(); } mpPage->SetAutoLayout( meOldAutoLayout ); if (!mpPage->IsMasterPage()) { if (mpPage->GetName() != maOldName) { mpPage->SetName(maOldName); if (mpPage->GetPageKind() == PK_STANDARD) { SdPage* pNotesPage = (SdPage*)mpDoc->GetPage(mpPage->GetPageNum() + 1); pNotesPage->SetName(maOldName); } } SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False); sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False); SetOfByte aVisibleLayers; aVisibleLayers.Set(aBckgrnd, mbOldBckgrndVisible); aVisibleLayers.Set(aBckgrndObj, mbOldBckgrndObjsVisible); mpPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); } // Redisplay SfxViewFrame::Current()->GetDispatcher()->Execute( SID_SWITCHPAGE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); } /************************************************************************* |* |* Redo() |* \************************************************************************/ void ModifyPageUndoAction::Redo() { // invalidate Selection, there could be objects deleted in tis UNDO // which are no longer allowed to be selected then. SdrViewIter aIter(mpPage); SdrView* pView = aIter.FirstView(); while(pView) { if(pView->AreObjectsMarked()) pView->UnmarkAll(); pView = aIter.NextView(); } mpPage->meAutoLayout = meNewAutoLayout; if (!mpPage->IsMasterPage()) { if (mpPage->GetName() != maNewName) { mpPage->SetName(maNewName); if (mpPage->GetPageKind() == PK_STANDARD) { SdPage* pNotesPage = (SdPage*)mpDoc->GetPage(mpPage->GetPageNum() + 1); pNotesPage->SetName(maNewName); } } SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False); sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False); SetOfByte aVisibleLayers; aVisibleLayers.Set(aBckgrnd, mbNewBckgrndVisible); aVisibleLayers.Set(aBckgrndObj, mbNewBckgrndObjsVisible); mpPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); } // Redisplay SfxViewFrame::Current()->GetDispatcher()->Execute( SID_SWITCHPAGE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); } /************************************************************************* |* |* Destruktor |* \************************************************************************/ ModifyPageUndoAction::~ModifyPageUndoAction() { } /************************************************************************* |* |* Kommentar liefern |* \************************************************************************/ rtl::OUString ModifyPageUndoAction::GetComment() const { return maComment; } // -------------------------------------------------------------------- RenameLayoutTemplateUndoAction::RenameLayoutTemplateUndoAction( SdDrawDocument* pDocument, const String& rOldLayoutName, const String& rNewLayoutName ) : SdUndoAction(pDocument) , maOldName( rOldLayoutName ) , maNewName( rNewLayoutName ) , maComment(SdResId(STR_TITLE_RENAMESLIDE)) { sal_uInt16 nPos = maOldName.SearchAscii( SD_LT_SEPARATOR ); if( nPos != (sal_uInt16)-1 ) maOldName.Erase(nPos); } void RenameLayoutTemplateUndoAction::Undo() { String aLayoutName( maNewName ); aLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); aLayoutName.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ; mpDoc->RenameLayoutTemplate( aLayoutName, maOldName ); } void RenameLayoutTemplateUndoAction::Redo() { String aLayoutName( maOldName ); aLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); aLayoutName.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ; mpDoc->RenameLayoutTemplate( aLayoutName, maNewName ); } rtl::OUString RenameLayoutTemplateUndoAction::GetComment() const { return maComment; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ eoffice-7-0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
/commit/icon-themes/sifr_dark_svg/vcl?id=e86d7b19760e47d2b1a707c2085ed56be2afa4ad'>tdf#151071 Revise Sifr
AgeCommit message (Expand)Author
Rizal Muttaqin
2022-06-19elementary Sifr: tdf#144303 Calc cross cursorRizal Muttaqin
2022-02-23Sifr: tdf#144303 Calc's cross cursorRizal Muttaqin
2020-06-10tdf#133819 support for tristate checkboxesRizal Muttaqin
2020-06-09Icon theme: tdf#133582 missing checkbox and radio button in gen envRizal Muttaqin
2020-02-26Breeze & Sifr: Fix for tdf#130939rizmut
2020-01-28Sifr: Added SVG version of the Sifr Dark icon set (tdf#128849).rizmut