unodialog.cxx (c142477c) unodialog.cxx (61161268)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 325 unchanged lines hidden (view full) ---

334 }
335 }
336 catch ( Exception& )
337 {
338 }
339}
340
341// -----------------------------------------------------------------------------
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 325 unchanged lines hidden (view full) ---

334 }
335 }
336 catch ( Exception& )
337 {
338 }
339}
340
341// -----------------------------------------------------------------------------
342#if 0
343void UnoDialog::showMessageBox( const OUString& rTitle, const OUString& rMessage, sal_Bool bErrorBox ) const
344{
345 try
346 {
347 Reference< XMessageBoxFactory > xMessageBoxFactory( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ), mxMSF ), UNO_QUERY_THROW );
348 if ( xMessageBoxFactory.is() )
349 {
350 Rectangle aRectangle( 0, 0, 0, 0 );
351 Reference< XMessageBox > xMessageBox( xMessageBoxFactory->createMessageBox( mxWindowPeer, aRectangle,
352 bErrorBox ? OUString( RTL_CONSTASCII_USTRINGPARAM( "errorbox" ) ) : OUString( RTL_CONSTASCII_USTRINGPARAM( "querybox" ) ), MessageBoxButtons::BUTTONS_OK, rTitle, rMessage ) );
353 Reference< XComponent > xComponent( xMessageBox, UNO_QUERY_THROW );
354 /* sal_Int16 nResult = */ xMessageBox->execute();
355 xComponent->dispose();
356 }
357 }
358 catch ( Exception& )
359 {
360 }
361
342
362/*
363public void showErrorMessageBox(XWindowPeer _xParentWindowPeer, String _sTitle, String _sMessage){
364XComponent xComponent = null;
365try {
366 Object oToolkit = m_xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", m_xContext);
367 XMessageBoxFactory xMessageBoxFactory = (XMessageBoxFactory) UnoRuntime.queryInterface(XMessageBoxFactory.class, oToolkit);
368 // rectangle may be empty if position is in the center of the parent peer
369
370 Rectangle aRectangle = new Rectangle();
371 XMessageBox xMessageBox = xMessageBoxFactory.createMessageBox(_xParentWindowPeer, aRectangle, "errorbox", com.sun.star.awt.MessageBoxButtons.BUTTONS_OK, _sTitle, _sMessage);
372 xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xMessageBox);
373 if (xMessageBox != null){
374 short nResult = xMessageBox.execute();
375 }
376} catch (com.sun.star.uno.Exception ex) {
377 ex.printStackTrace(System.out);
378}
379finally{
380 //make sure always to dispose the component and free the memory!
381 if (xComponent != null){
382 xComponent.dispose();
383 }
384}}
385*/
386}
387
388#endif
389
390// -----------------------------------------------------------------------------
391
392sal_Int32 UnoDialog::getMapsFromPixels( sal_Int32 nPixels ) const
393{
394 double dMaps = 0;
395 try
396 {
397 sal_Int32 nMapWidth = 0;
398 const OUString sWidth( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
399 if ( mxDialogModelPropertySet->getPropertyValue( sWidth ) >>= nMapWidth )

--- 49 unchanged lines hidden ---
343sal_Int32 UnoDialog::getMapsFromPixels( sal_Int32 nPixels ) const
344{
345 double dMaps = 0;
346 try
347 {
348 sal_Int32 nMapWidth = 0;
349 const OUString sWidth( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
350 if ( mxDialogModelPropertySet->getPropertyValue( sWidth ) >>= nMapWidth )

--- 49 unchanged lines hidden ---