/* -*- 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 .
*/
// TECHNICALLY not possible !! #include <beziersh.hxx> #include <drawsh.hxx> #include <drwtxtsh.hxx> #include <annotsh.hxx>
#include <wview.hxx> #include <wdocsh.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of // type void(SfxShell*,SfxRequest&) defined in swslots.hxx #include <sfx2/viewfac.hxx> #define ShellClass_SwWebView #define ShellClass_Text #include <swslots.hxx>
void SwWebView::SelectShell()
{ #if HAVE_FEATURE_DESKTOP // Decision whether UpdateTable must be called bool bUpdateTable = false; const SwFrameFormat* pCurTableFormat = GetWrtShell().GetTableFormat(); if(pCurTableFormat && pCurTableFormat != GetLastTableFrameFormat())
{
bUpdateTable = true; // can only be executed later
}
SetLastTableFrameFormat(pCurTableFormat); //SEL_TBL and SEL_TBL_CELLS can be ored!
SelectionType nNewSelectionType = GetWrtShell().GetSelectionType()
& ~SelectionType::TableCell;
SelectionType _nSelectionType = GetSelectionType(); if ( nNewSelectionType == _nSelectionType )
{
GetViewFrame().GetBindings().InvalidateAll( false ); if ( _nSelectionType & SelectionType::Ole ||
_nSelectionType & SelectionType::Graphic ) //The verb may of course change for graphics and OLE!
ImpSetVerb( nNewSelectionType );
} else
{
SfxDispatcher &rDispatcher = *GetViewFrame().GetDispatcher();
SwToolbarConfigItem* pBarCfg = SwModule::get()->GetWebToolbarConfig();
//Additional to the old selection remember which toolbar was visible.
ToolbarId eId = rDispatcher.GetObjectBarId(SFX_OBJECTBAR_OBJECT); if (eId != ToolbarId::None)
pBarCfg->SetTopToolbar( _nSelectionType, eId );
SfxShell *pSfxShell;
sal_uInt16 i; for ( i = 0; true; ++i )
{
pSfxShell = rDispatcher.GetShell( i ); if ( !( dynamic_cast< const SwBaseShell *>( pSfxShell ) != nullptr || dynamic_cast< const SwDrawTextShell *>( pSfxShell ) || dynamic_cast< const SwAnnotationShell *>( pSfxShell ) != nullptr ) ) break;
} if (i)
{
pSfxShell = rDispatcher.GetShell( --i );
OSL_ENSURE( pSfxShell, "My Shell is lost in space" );
rDispatcher.Pop( *pSfxShell, SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE);
}
}
//Additional to the selection enable the toolbar, which was //activated last time //Before must be a Flush(), but concerns according to MBA not the //user interface and is not a performance issue. // TODO/LATER: maybe now the Flush() command is superfluous?!
rDispatcher.Flush();
Point aPnt = GetEditWin().GetPointerPosPixel();
aPnt = GetEditWin().PixelToLogic(aPnt);
GetEditWin().UpdatePointer(aPnt);
//Opportune time for the communication with OLE objects? if ( GetDocShell()->GetDoc()->IsOLEPrtNotifyPending() )
GetDocShell()->GetDoc()->PrtOLENotify( false );
//now the table update if(bUpdateTable)
GetWrtShell().UpdateTable(); #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.