/* -*- 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 .
*/
if ( !rInfo.aExtraString.isEmpty() )
aWinData += "," + rInfo.aExtraString;
OUString sName(OUString::number(nID)); //Try and save window state per-module, e.g. sidebar on in one application //but off in another if (!rInfo.aModule.isEmpty())
sName = rInfo.aModule + "/" + sName;
SvtViewOptions aWinOpt(EViewType::Window, sName);
aWinOpt.SetWindowState(rInfo.aWinState);
std::optional<SvtViewOptions> xWinOpt; // first see if a module specific id exists if (rInfo.aModule.getLength())
xWinOpt.emplace(EViewType::Window, rInfo.aModule + "/" + OUString::number(nId));
// if not then try the generic id if (!xWinOpt || !xWinOpt->Exists())
xWinOpt.emplace(EViewType::Window, OUString::number(nId));
if (xWinOpt->Exists() && xWinOpt->HasVisible() )
rInfo.bVisible = xWinOpt->IsVisible(); // set state from configuration. Can be overwritten by UserData, see below
// Try to read the alignment string "ALIGN :(...)", but if // it is not present, then use an older version
sal_Int32 n1 = aExtraString.indexOf('(', nPos); if ( n1 != -1 )
{
sal_Int32 n2 = aExtraString.indexOf(')', n1); if ( n2 != -1 )
{ // Cut out Alignment string
aStr = aExtraString.copy(nPos, n2 - nPos + 1);
aStr = aStr.replaceAt(nPos, n1-nPos+1, u"");
}
}
// First extract the Alignment if ( aStr.isEmpty() ) returnfalse; if ( pAlign )
*pAlign = static_cast<SfxChildAlignment>(static_cast<sal_uInt16>(aStr.toInt32()));
// then the LastAlignment
nPos = aStr.indexOf(','); if ( nPos == -1 ) returnfalse;
aStr = aStr.copy(nPos+1);
// Then the splitting information
nPos = aStr.indexOf(','); if ( nPos == -1 ) // No docking in a Splitwindow returntrue;
aStr = aStr.copy(nPos+1);
Point aChildPos;
Size aChildSize; return GetPosSizeFromString( aStr, aChildPos, aChildSize );
}
void SfxChildWindow::Hide()
{ if (xController)
xController->EndDialog(nCloseResponseToJustHide); else
pWindow->Hide();
}
void SfxChildWindow::Show( ShowFlags nFlags )
{ if (xController)
{ if (!xController->getDialog()->get_visible())
{ if (!xController->CloseOnHide())
{ // tdf#155708 - do not run a new (Async) validation window, // because we already have one in sync mode, just show the running one
xController->getDialog()->show();
} else
{
weld::DialogController::runAsync(xController,
[this](sal_Int32 nResult) { if (nResult == nCloseResponseToJustHide) return;
xController->Close();
});
}
}
} else
pWindow->Show(true, nFlags);
}
void SfxChildWindow::SetFrame( const css::uno::Reference< css::frame::XFrame > & rFrame )
{ // Do nothing if nothing will be changed ... if( pImpl->xFrame == rFrame ) return;
// ... but stop listening on old frame, if connection exist! if( pImpl->xFrame.is() )
pImpl->xFrame->removeEventListener( pImpl->xListener );
// If new frame is not NULL -> we must guarantee valid listener for disposing events. // Use already existing or create new one. if( rFrame.is() ) if( !pImpl->xListener.is() )
pImpl->xListener.set( new DisposeListener( this, pImpl.get() ) );
// Set new frame in data container // and build new listener connection, if necessary.
pImpl->xFrame = rFrame; if( pImpl->xFrame.is() )
pImpl->xFrame->addEventListener( pImpl->xListener );
}
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.