Kaydet (Commit) 5e69b361 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:flatten in toolkit..writerfilter

Change-Id: I4da2a768b6b55869c3a3d6f8a8d50dc018709acd
Reviewed-on: https://gerrit.libreoffice.org/44865Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 1d097883
......@@ -179,24 +179,25 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const css::container::Conta
SolarMutexGuard aGuard;
VclPtr<TabControl> pTabCtrl = GetAs<TabControl>();
Reference< css::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY);
if ( pTabCtrl && xTabPage.is() )
{
Reference< awt::XControl > xControl(xTabPage,UNO_QUERY );
Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
sal_Int16 nPageID = xP->getTabPageID();
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xControl->getPeer());
TabPage* pPage = static_cast<TabPage*>(pWindow.get());
pTabCtrl->InsertPage(nPageID,pPage->GetText());
pPage->Hide();
pTabCtrl->SetTabPage(nPageID,pPage);
pTabCtrl->SetHelpText(nPageID,xP->getToolTip());
pTabCtrl->SetPageImage(nPageID,TkResMgr::getImageFromURL(xP->getImageURL()));
pTabCtrl->SelectTabPage(nPageID);
pTabCtrl->EnablePage(nPageID,xP->getEnabled());
m_aTabPages.push_back(xTabPage);
}
if ( !pTabCtrl || !xTabPage.is() )
return;
Reference< awt::XControl > xControl(xTabPage,UNO_QUERY );
Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
sal_Int16 nPageID = xP->getTabPageID();
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xControl->getPeer());
TabPage* pPage = static_cast<TabPage*>(pWindow.get());
pTabCtrl->InsertPage(nPageID,pPage->GetText());
pPage->Hide();
pTabCtrl->SetTabPage(nPageID,pPage);
pTabCtrl->SetHelpText(nPageID,xP->getToolTip());
pTabCtrl->SetPageImage(nPageID,TkResMgr::getImageFromURL(xP->getImageURL()));
pTabCtrl->SelectTabPage(nPageID);
pTabCtrl->EnablePage(nPageID,xP->getEnabled());
m_aTabPages.push_back(xTabPage);
}
void SAL_CALL VCLXTabPageContainer::elementRemoved( const css::container::ContainerEvent& Event )
{
......
......@@ -488,65 +488,67 @@ void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e )
{
OutputDevice*pOutDev = Application::GetDefaultDevice();
DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev && !mbSizeModified )
{
// Currentley we are simply using MapUnit::MapAppFont
::Size aAppFontSize( e.Width, e.Height );
if ( !pOutDev || mbSizeModified )
return;
Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
// Currentley we are simply using MapUnit::MapAppFont
::Size aAppFontSize( e.Width, e.Height );
// #i87592 In design mode the drawing layer works with sizes with decoration.
// Therefore we have to subtract them before writing back to the properties (model).
if ( xDialogDevice.is() && mbDesignMode )
{
DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
}
Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
// Remember that changes have been done by listener. No need to
// update the position because of property change event.
mbSizeModified = true;
Sequence< OUString > aProps( 2 );
Sequence< Any > aValues( 2 );
// Properties in a sequence must be sorted!
aProps[0] = "Height";
aProps[1] = "Width";
aValues[0] <<= aAppFontSize.Height();
aValues[1] <<= aAppFontSize.Width();
ImplSetPropertyValues( aProps, aValues, true );
mbSizeModified = false;
// #i87592 In design mode the drawing layer works with sizes with decoration.
// Therefore we have to subtract them before writing back to the properties (model).
if ( xDialogDevice.is() && mbDesignMode )
{
DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
}
aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
// Remember that changes have been done by listener. No need to
// update the position because of property change event.
mbSizeModified = true;
Sequence< OUString > aProps( 2 );
Sequence< Any > aValues( 2 );
// Properties in a sequence must be sorted!
aProps[0] = "Height";
aProps[1] = "Width";
aValues[0] <<= aAppFontSize.Height();
aValues[1] <<= aAppFontSize.Width();
ImplSetPropertyValues( aProps, aValues, true );
mbSizeModified = false;
}
void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e )
{
OutputDevice*pOutDev = Application::GetDefaultDevice();
DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev && !mbPosModified )
{
// Currentley we are simply using MapUnit::MapAppFont
::Size aTmp( e.X, e.Y );
aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
// Remember that changes have been done by listener. No need to
// update the position because of property change event.
mbPosModified = true;
Sequence< OUString > aProps( 2 );
Sequence< Any > aValues( 2 );
aProps[0] = "PositionX";
aProps[1] = "PositionY";
aValues[0] <<= aTmp.Width();
aValues[1] <<= aTmp.Height();
ImplSetPropertyValues( aProps, aValues, true );
mbPosModified = false;
}
if ( !pOutDev || mbPosModified )
return;
// Currentley we are simply using MapUnit::MapAppFont
::Size aTmp( e.X, e.Y );
aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
// Remember that changes have been done by listener. No need to
// update the position because of property change event.
mbPosModified = true;
Sequence< OUString > aProps( 2 );
Sequence< Any > aValues( 2 );
aProps[0] = "PositionX";
aProps[1] = "PositionY";
aValues[0] <<= aTmp.Width();
aValues[1] <<= aTmp.Height();
ImplSetPropertyValues( aProps, aValues, true );
mbPosModified = false;
}
void SAL_CALL UnoDialogControl::windowShown( const EventObject& ) {}
......
......@@ -235,62 +235,64 @@ void SAL_CALL UnoControlTabPage::windowResized( const css::awt::WindowEvent& e )
{
OutputDevice*pOutDev = Application::GetDefaultDevice();
DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev && !mbSizeModified )
{
// Currentley we are simply using MapUnit::MapAppFont
::Size aAppFontSize( e.Width, e.Height );
if ( !pOutDev || mbSizeModified )
return;
Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
if ( xDialogDevice.is() )
{
DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
}
// Currentley we are simply using MapUnit::MapAppFont
::Size aAppFontSize( e.Width, e.Height );
aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
// Remember that changes have been done by listener. No need to
// update the position because of property change event.
mbSizeModified = true;
Sequence< OUString > aProps( 2 );
Sequence< Any > aValues( 2 );
// Properties in a sequence must be sorted!
aProps[0] = "Height";
aProps[1] = "Width";
aValues[0] <<= aAppFontSize.Height();
aValues[1] <<= aAppFontSize.Width();
ImplSetPropertyValues( aProps, aValues, true );
mbSizeModified = false;
Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
if ( xDialogDevice.is() )
{
DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
}
aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
// Remember that changes have been done by listener. No need to
// update the position because of property change event.
mbSizeModified = true;
Sequence< OUString > aProps( 2 );
Sequence< Any > aValues( 2 );
// Properties in a sequence must be sorted!
aProps[0] = "Height";
aProps[1] = "Width";
aValues[0] <<= aAppFontSize.Height();
aValues[1] <<= aAppFontSize.Width();
ImplSetPropertyValues( aProps, aValues, true );
mbSizeModified = false;
}
void SAL_CALL UnoControlTabPage::windowMoved( const css::awt::WindowEvent& e )
{
OutputDevice*pOutDev = Application::GetDefaultDevice();
DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev && !mbPosModified )
{
// Currentley we are simply using MapUnit::MapAppFont
::Size aTmp( e.X, e.Y );
aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
// Remember that changes have been done by listener. No need to
// update the position because of property change event.
mbPosModified = true;
Sequence< OUString > aProps( 2 );
Sequence< Any > aValues( 2 );
aProps[0] = "PositionX";
aProps[1] = "PositionY";
aValues[0] <<= aTmp.Width();
aValues[1] <<= aTmp.Height();
ImplSetPropertyValues( aProps, aValues, true );
mbPosModified = false;
}
if ( !pOutDev || mbPosModified )
return;
// Currentley we are simply using MapUnit::MapAppFont
::Size aTmp( e.X, e.Y );
aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
// Remember that changes have been done by listener. No need to
// update the position because of property change event.
mbPosModified = true;
Sequence< OUString > aProps( 2 );
Sequence< Any > aValues( 2 );
aProps[0] = "PositionX";
aProps[1] = "PositionY";
aValues[0] <<= aTmp.Width();
aValues[1] <<= aTmp.Height();
ImplSetPropertyValues( aProps, aValues, true );
mbPosModified = false;
}
void SAL_CALL UnoControlTabPage::windowShown( const css::lang::EventObject& ) {}
......
......@@ -38,83 +38,84 @@ using namespace tdoc_ucp;
void Uri::init() const
{
// Already inited?
if ( m_eState == UNKNOWN )
if ( m_eState != UNKNOWN )
return;
m_eState = INVALID;
// Check for proper length: must be at least length of <sheme>:/
if ( m_aUri.getLength() < TDOC_URL_SCHEME_LENGTH + 2 )
{
// Invalid length (to short).
return;
}
// Check for proper scheme. (Scheme is case insensitive.)
OUString aScheme
= m_aUri.copy( 0, TDOC_URL_SCHEME_LENGTH ).toAsciiLowerCase();
if ( aScheme != TDOC_URL_SCHEME )
{
// Invalid scheme.
return;
}
// Remember normalized scheme string.
m_aUri = m_aUri.replaceAt( 0, aScheme.getLength(), aScheme );
if ( m_aUri[ TDOC_URL_SCHEME_LENGTH ] != ':' )
{
m_eState = INVALID;
// Check for proper length: must be at least length of <sheme>:/
if ( m_aUri.getLength() < TDOC_URL_SCHEME_LENGTH + 2 )
{
// Invalid length (to short).
return;
}
// Check for proper scheme. (Scheme is case insensitive.)
OUString aScheme
= m_aUri.copy( 0, TDOC_URL_SCHEME_LENGTH ).toAsciiLowerCase();
if ( aScheme != TDOC_URL_SCHEME )
{
// Invalid scheme.
return;
}
// Remember normalized scheme string.
m_aUri = m_aUri.replaceAt( 0, aScheme.getLength(), aScheme );
if ( m_aUri[ TDOC_URL_SCHEME_LENGTH ] != ':' )
{
// Invalid (no ':' after <scheme>).
return;
}
if ( m_aUri[ TDOC_URL_SCHEME_LENGTH + 1 ] != '/' )
{
// Invalid (no '/' after <scheme>:).
return;
}
m_aPath = m_aUri.copy( TDOC_URL_SCHEME_LENGTH + 1 );
// Note: There must be at least one slash; see above.
sal_Int32 nLastSlash = m_aUri.lastIndexOf( '/' );
bool bTrailingSlash = false;
if ( nLastSlash == m_aUri.getLength() - 1 )
{
// ignore trailing slash
bTrailingSlash = true;
nLastSlash = m_aUri.lastIndexOf( '/', nLastSlash );
}
if ( nLastSlash != -1 ) // -1 is valid for the root folder
{
m_aParentUri = m_aUri.copy( 0, nLastSlash + 1 );
if ( bTrailingSlash )
m_aName = m_aUri.copy( nLastSlash + 1,
m_aUri.getLength() - nLastSlash - 2 );
else
m_aName = m_aUri.copy( nLastSlash + 1 );
m_aDecodedName = ::ucb_impl::urihelper::decodeSegment( m_aName );
sal_Int32 nSlash = m_aPath.indexOf( '/', 1 );
if ( nSlash == -1 )
m_aDocId = m_aPath.copy( 1 );
else
m_aDocId = m_aPath.copy( 1, nSlash - 1 );
}
if ( !m_aDocId.isEmpty() )
{
sal_Int32 nSlash = m_aPath.indexOf( '/', 1 );
if ( nSlash != - 1 )
m_aInternalPath = m_aPath.copy( nSlash );
else
m_aInternalPath = "/";
}
m_eState = VALID;
// Invalid (no ':' after <scheme>).
return;
}
if ( m_aUri[ TDOC_URL_SCHEME_LENGTH + 1 ] != '/' )
{
// Invalid (no '/' after <scheme>:).
return;
}
m_aPath = m_aUri.copy( TDOC_URL_SCHEME_LENGTH + 1 );
// Note: There must be at least one slash; see above.
sal_Int32 nLastSlash = m_aUri.lastIndexOf( '/' );
bool bTrailingSlash = false;
if ( nLastSlash == m_aUri.getLength() - 1 )
{
// ignore trailing slash
bTrailingSlash = true;
nLastSlash = m_aUri.lastIndexOf( '/', nLastSlash );
}
if ( nLastSlash != -1 ) // -1 is valid for the root folder
{
m_aParentUri = m_aUri.copy( 0, nLastSlash + 1 );
if ( bTrailingSlash )
m_aName = m_aUri.copy( nLastSlash + 1,
m_aUri.getLength() - nLastSlash - 2 );
else
m_aName = m_aUri.copy( nLastSlash + 1 );
m_aDecodedName = ::ucb_impl::urihelper::decodeSegment( m_aName );
sal_Int32 nSlash = m_aPath.indexOf( '/', 1 );
if ( nSlash == -1 )
m_aDocId = m_aPath.copy( 1 );
else
m_aDocId = m_aPath.copy( 1, nSlash - 1 );
}
if ( !m_aDocId.isEmpty() )
{
sal_Int32 nSlash = m_aPath.indexOf( '/', 1 );
if ( nSlash != - 1 )
m_aInternalPath = m_aPath.copy( nSlash );
else
m_aInternalPath = "/";
}
m_eState = VALID;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -82,30 +82,31 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
if (m_aNodePtr != nullptr)
{
// get current data
std::shared_ptr<xmlChar const> const pContent(
xmlNodeGetContent(m_aNodePtr), xmlFree);
OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8));
if (offset > tmp.getLength() || offset < 0 || count < 0) {
DOMException e;
e.Code = DOMExceptionType_INDEX_SIZE_ERR;
throw e;
}
if ((offset+count) > tmp.getLength())
count = tmp.getLength() - offset;
if (m_aNodePtr == nullptr)
return;
// get current data
std::shared_ptr<xmlChar const> const pContent(
xmlNodeGetContent(m_aNodePtr), xmlFree);
OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8));
if (offset > tmp.getLength() || offset < 0 || count < 0) {
DOMException e;
e.Code = DOMExceptionType_INDEX_SIZE_ERR;
throw e;
}
if ((offset+count) > tmp.getLength())
count = tmp.getLength() - offset;
OUString tmp2 = tmp.copy(0, offset);
tmp2 += tmp.copy(offset+count);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
OUString tmp2 = tmp.copy(0, offset);
tmp2 += tmp.copy(offset+count);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
guard.clear(); // release mutex before calling event handlers
dispatchEvent_Impl(oldValue, newValue);
guard.clear(); // release mutex before calling event handlers
dispatchEvent_Impl(oldValue, newValue);
}
}
......@@ -152,29 +153,30 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
if (m_aNodePtr != nullptr)
{
// get current data
std::shared_ptr<xmlChar const> const pContent(
xmlNodeGetContent(m_aNodePtr), xmlFree);
OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8));
if (offset > tmp.getLength() || offset < 0) {
DOMException e;
e.Code = DOMExceptionType_INDEX_SIZE_ERR;
throw e;
}
if (m_aNodePtr == nullptr)
return;
// get current data
std::shared_ptr<xmlChar const> const pContent(
xmlNodeGetContent(m_aNodePtr), xmlFree);
OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8));
if (offset > tmp.getLength() || offset < 0) {
DOMException e;
e.Code = DOMExceptionType_INDEX_SIZE_ERR;
throw e;
}
OUString tmp2 = tmp.copy(0, offset);
tmp2 += arg;
tmp2 += tmp.copy(offset);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
OUString tmp2 = tmp.copy(0, offset);
tmp2 += arg;
tmp2 += tmp.copy(offset);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
guard.clear(); // release mutex before calling event handlers
dispatchEvent_Impl(oldValue, newValue);
guard.clear(); // release mutex before calling event handlers
dispatchEvent_Impl(oldValue, newValue);
}
}
......@@ -186,31 +188,32 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
if (m_aNodePtr != nullptr)
{
// get current data
std::shared_ptr<xmlChar const> const pContent(
xmlNodeGetContent(m_aNodePtr), xmlFree);
OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8));
if (offset > tmp.getLength() || offset < 0 || count < 0){
DOMException e;
e.Code = DOMExceptionType_INDEX_SIZE_ERR;
throw e;
}
if ((offset+count) > tmp.getLength())
count = tmp.getLength() - offset;
if (m_aNodePtr == nullptr)
return;
// get current data
std::shared_ptr<xmlChar const> const pContent(
xmlNodeGetContent(m_aNodePtr), xmlFree);
OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
OUString tmp(OStringToOUString(aData, RTL_TEXTENCODING_UTF8));
if (offset > tmp.getLength() || offset < 0 || count < 0){
DOMException e;
e.Code = DOMExceptionType_INDEX_SIZE_ERR;
throw e;
}
if ((offset+count) > tmp.getLength())
count = tmp.getLength() - offset;
OUString tmp2 = tmp.copy(0, offset);
tmp2 += arg;
tmp2 += tmp.copy(offset+count);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
OUString tmp2 = tmp.copy(0, offset);
tmp2 += arg;
tmp2 += tmp.copy(offset+count);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
guard.clear(); // release mutex before calling event handlers
dispatchEvent_Impl(oldValue, newValue);
guard.clear(); // release mutex before calling event handlers
dispatchEvent_Impl(oldValue, newValue);
}
}
/**
......
......@@ -362,49 +362,49 @@ void PrintOutHelper( SfxViewShell const * pViewShell, const uno::Any& From, cons
SfxViewFrame* pViewFrame = nullptr;
if ( pViewShell )
pViewFrame = pViewShell->GetViewFrame();
if ( pViewFrame )
{
SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
if ( !pViewFrame )
return;
SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
aArgs.Put( sfxCollate, sfxCollate.Which() );
SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
aArgs.Put( sfxCopies, sfxCopies.Which() );
if ( !sFileName.isEmpty() )
{
SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
aArgs.Put( sfxFileName, sfxFileName.Which() );
SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
}
if ( !sRange.isEmpty() )
{
SfxStringItem sfxRange( SID_PRINT_PAGES, sRange );
aArgs.Put( sfxRange, sfxRange.Which() );
}
SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
aArgs.Put( sfxSelection, sfxSelection.Which() );
SfxBoolItem sfxAsync( SID_ASYNCHRON, false );
aArgs.Put( sfxAsync, sfxAsync.Which() );
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
aArgs.Put( sfxCollate, sfxCollate.Which() );
SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
aArgs.Put( sfxCopies, sfxCopies.Which() );
if ( !sFileName.isEmpty() )
{
SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
aArgs.Put( sfxFileName, sfxFileName.Which() );
if ( pDispatcher )
}
if ( !sRange.isEmpty() )
{
SfxStringItem sfxRange( SID_PRINT_PAGES, sRange );
aArgs.Put( sfxRange, sfxRange.Which() );
}
SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
aArgs.Put( sfxSelection, sfxSelection.Which() );
SfxBoolItem sfxAsync( SID_ASYNCHRON, false );
aArgs.Put( sfxAsync, sfxAsync.Which() );
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
if ( pDispatcher )
{
if ( bPreview )
{
if ( bPreview )
if ( !pViewFrame->GetFrame().IsInPlace() )
{
if ( !pViewFrame->GetFrame().IsInPlace() )
{
// #TODO is this necessary ( calc specific )
// #TODO is this necessary ( calc specific )
// SC_MOD()->InputEnterHandler();
pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SfxCallMode::SYNCHRON );
WaitUntilPreviewIsClosed( pViewFrame );
}
pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SfxCallMode::SYNCHRON );
WaitUntilPreviewIsClosed( pViewFrame );
}
else
pDispatcher->Execute( (sal_uInt16)SID_PRINTDOC, SfxCallMode::SYNCHRON, aArgs );
}
else
pDispatcher->Execute( (sal_uInt16)SID_PRINTDOC, SfxCallMode::SYNCHRON, aArgs );
}
// #FIXME #TODO
// 1 ActivePrinter ( how/can we switch a printer via API? )
// 2 PrintToFile ( ms behaviour if this option is specified but no
......
Markdown is supported
0% or