/* -*- 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 .
*/
void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEvent& aEvent)
{ // We don't want to do this stuff when being used through LibreOfficeKit if( comphelper::LibreOfficeKit::isActive() ) return;
// frame already gone ? We hold it weak only ... if (!xFrame.is()) return;
// no window -> no position and size available
css::uno::Reference< css::awt::XWindow > xWindow = xFrame->getContainerWindow(); if (!xWindow.is()) return;
// unknown module -> no configuration available!
OUString sModuleName = PersistentWindowState::implst_identifyModule(xContext, xFrame); if (sModuleName.isEmpty()) return;
case css::frame::FrameAction_COMPONENT_REATTACHED :
{ // nothing todo here, because it's not allowed to change position and size // of an already existing frame!
} break;
// SOLAR SAFE -> ------------------------
SolarMutexGuard aSolarGuard;
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWindow); if (!pWindow) return;
// check for system and work window - it's necessary to guarantee correct pointer cast! bool bSystemWindow = pWindow->IsSystemWindow(); bool bWorkWindow = (pWindow->GetType() == WindowType::WORKWINDOW);
// don't save this special state! if (pWorkWindow->IsMinimized()) return;
OUString sOldWindowState = pSystemWindow->GetWindowState(); if ( sOldWindowState != sWindowState )
pSystemWindow->SetWindowState(sWindowState); // <- SOLAR SAFE ------------------------
}
//static void PersistentWindowState::SaveWindowStateToConfig(const css::uno::Reference<css::uno::XComponentContext>& rContext, const css::uno::Reference<css::frame::XFrame>& rFrame)
{ // We don't want to do this stuff when being used through LibreOfficeKit if (comphelper::LibreOfficeKit::isActive()) return;
if (!rFrame.is()) return;
css::uno::Reference<css::awt::XWindow> xWindow = rFrame->getContainerWindow(); if (!xWindow.is()) return;
// unknown module -> no configuration available!
OUString sModuleName = PersistentWindowState::implst_identifyModule(rContext, rFrame); if (sModuleName.isEmpty()) return;
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.