summaryrefslogtreecommitdiff
path: root/extensions/source/scanner
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/scanner')
-rw-r--r--extensions/source/scanner/grid.cxx3
-rw-r--r--extensions/source/scanner/grid.hxx5
-rw-r--r--extensions/source/scanner/makefile.mk8
-rw-r--r--extensions/source/scanner/sane.cxx13
-rw-r--r--extensions/source/scanner/sane.hxx5
-rw-r--r--extensions/source/scanner/sanedlg.cxx90
-rw-r--r--extensions/source/scanner/sanedlg.hxx5
-rw-r--r--extensions/source/scanner/scanner.cxx3
-rw-r--r--extensions/source/scanner/scanner.hxx17
-rw-r--r--extensions/source/scanner/scanunx.cxx49
-rw-r--r--extensions/source/scanner/scanwin.cxx57
-rw-r--r--extensions/source/scanner/scnserv.cxx3
-rw-r--r--extensions/source/scanner/twain.cxx7
-rw-r--r--extensions/source/scanner/twain.hxx7
14 files changed, 117 insertions, 155 deletions
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx
index 6079d153cffc..d0b76ce4c0e6 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -606,3 +607,5 @@ IMPL_LINK( GridWindow, ClickButtonHdl, Button*, pButton )
}
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/grid.hxx b/extensions/source/scanner/grid.hxx
index c5d4a14ed4e9..15ce28430cdc 100644
--- a/extensions/source/scanner/grid.hxx
+++ b/extensions/source/scanner/grid.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#define _EXTENSIONS_SCANNER_GRID_HXX
#include <vcl/window.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/lstbox.hxx>
#include <vcl/dialog.hxx>
@@ -147,3 +146,5 @@ public:
};
#endif // _EXTENSIONS_SCANNER_GRID_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/makefile.mk b/extensions/source/scanner/makefile.mk
index 519be1ff863d..32112ddc8919 100644
--- a/extensions/source/scanner/makefile.mk
+++ b/extensions/source/scanner/makefile.mk
@@ -70,20 +70,16 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(CPPUHELPERLIB) \
$(COMPHELPERLIB) \
- $(VOSLIB) \
$(SALLIB) \
$(ONELIB) \
$(TOOLSLIB) \
$(VCLLIB) \
$(SVTOOLLIB)
-.IF "$(GUI)"=="UNX"
-.IF "$(OS)"!="FREEBSD"
-.IF "$(OS)"!="NETBSD"
+.IF "$(GUI)"=="UNX" && "$(OS)"!="FREEBSD" && \
+ "$(OS)"!="NETBSD" && "$(OS)"!="OPENBSD" && "$(OS)"!="DRAGONFLY"
SHL1STDLIBS+=$(SVTOOLLIB) -ldl
.ENDIF
-.ENDIF
-.ENDIF
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
SHL1IMPLIB=i$(TARGET)
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 0ca6884e8202..8f0be90e00c8 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,6 +39,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sal/config.h>
+#include <sal/macros.h>
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
#include <stdarg.h>
@@ -158,7 +160,6 @@ SANE_Status Sane::ControlOption( int nOption, SANE_Action nAction,
pAction );
}
#endif
-// if( nInfo & ( SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS ) )
if( nInfo & SANE_INFO_RELOAD_OPTIONS )
ReloadOptions();
return nStatus;
@@ -186,17 +187,17 @@ Sane::~Sane()
void Sane::Init()
{
- ::rtl::OUString sSaneLibName( ::rtl::OUString::createFromAscii( "libsane" SAL_DLLEXTENSION ) );
+ ::rtl::OUString sSaneLibName( RTL_CONSTASCII_USTRINGPARAM( "libsane" SAL_DLLEXTENSION ) );
pSaneLib = osl_loadModule( sSaneLibName.pData, SAL_LOADMODULE_LAZY );
if( ! pSaneLib )
{
- sSaneLibName = ::rtl::OUString::createFromAscii( "libsane" SAL_DLLEXTENSION ".1" );
+ sSaneLibName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "libsane" SAL_DLLEXTENSION ".1" ));
pSaneLib = osl_loadModule( sSaneLibName.pData, SAL_LOADMODULE_LAZY );
}
// try reasonable places that might not be in the library search path
if( ! pSaneLib )
{
- ::rtl::OUString sSaneLibSystemPath( ::rtl::OUString::createFromAscii( "/usr/local/lib/libsane" SAL_DLLEXTENSION ) );
+ ::rtl::OUString sSaneLibSystemPath( RTL_CONSTASCII_USTRINGPARAM( "/usr/local/lib/libsane" SAL_DLLEXTENSION ) );
osl_getFileURLFromSystemPath( sSaneLibSystemPath.pData, &sSaneLibName.pData );
pSaneLib = osl_loadModule( sSaneLibName.pData, SAL_LOADMODULE_LAZY );
}
@@ -988,7 +989,7 @@ String Sane::GetOptionUnitName( int n )
String aText;
SANE_Unit nUnit = mppOptions[n]->unit;
size_t nUnitAsSize = (size_t)nUnit;
- if( nUnitAsSize > sizeof( ppUnits )/sizeof( ppUnits[0] ) )
+ if( nUnitAsSize > SAL_N_ELEMENTS( ppUnits ) )
aText = String::CreateFromAscii( "[unknown units]" );
else
aText = String( ppUnits[ nUnit ], gsl_getSystemTextEncoding() );
@@ -1002,3 +1003,5 @@ sal_Bool Sane::ActivateButtonOption( int n )
return sal_False;
return sal_True;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/sane.hxx b/extensions/source/scanner/sane.hxx
index 2b6683477b56..fe5a63477cf2 100644
--- a/extensions/source/scanner/sane.hxx
+++ b/extensions/source/scanner/sane.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@
class BitmapTransporter : public OWeakObject, AWT::XBitmap
{
SvMemoryStream m_aStream;
- vos::OMutex m_aProtector;
+ osl::Mutex m_aProtector;
public:
@@ -198,3 +199,5 @@ inline Link Sane::SetReloadOptionsHdl( const Link& rLink )
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index fc8119c07b4c..f90bb6c20492 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#include <sanedlg.hrc>
#include <grid.hxx>
#include <math.h>
-
-#define USE_SAVE_STATE
-#undef SAVE_ALL_STATES
+#include <sal/macros.h>
ResId SaneResId( sal_uInt32 nID )
{
@@ -132,6 +131,7 @@ SaneDlg::SaneDlg( Window* pParent, Sane& rSane ) :
SaneDlg::~SaneDlg()
{
+ mrSane.SetReloadOptionsHdl( maOldLink );
}
short SaneDlg::Execute()
@@ -222,7 +222,7 @@ void SaneDlg::InitFields()
maReslBox.SetMin( (long)pDouble[0] );
maReslBox.SetMax( (long)pDouble[1] );
maReslBox.InsertValue( (long)pDouble[0] );
- // mh@openoffice.org: issue 68557: Can only select 75 and 2400 dpi in Scanner dialogue
+ // Can only select 75 and 2400 dpi in Scanner dialogue
// scanner allows random setting of dpi resolution, a slider might be useful
// support that
// workaround: offer at least some more standard dpi resolution between
@@ -395,7 +395,7 @@ void SaneDlg::InitFields()
{
sal_Bool bIsSpecial = sal_False;
for( size_t n = 0; !bIsSpecial &&
- n < sizeof(ppSpecialOptions)/sizeof(ppSpecialOptions[0]); n++ )
+ n < SAL_N_ELEMENTS(ppSpecialOptions); n++ )
{
if( aOption.EqualsAscii( ppSpecialOptions[n] ) )
bIsSpecial=sal_True;
@@ -478,14 +478,12 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
{
double fRes = (double)maReslBox.GetValue();
SetAdjustedNumericalValue( "resolution", fRes );
- mrSane.SetReloadOptionsHdl( maOldLink );
UpdateScanArea( sal_True );
SaveState();
EndDialog( mrSane.IsOpen() ? 1 : 0 );
}
else if( pButton == &maCancelButton )
{
- mrSane.SetReloadOptionsHdl( maOldLink );
mrSane.Close();
EndDialog( 0 );
}
@@ -688,9 +686,9 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit )
IMPL_LINK( SaneDlg, ReloadSaneOptionsHdl, Sane*, /*pSane*/ )
{
- mnCurrentOption = -1;
- mnCurrentElement = 0;
- DisableOption();
+ mnCurrentOption = -1;
+ mnCurrentElement = 0;
+ DisableOption();
// #92024# preserve preview rect, should only be set
// initially or in AcquirePreview
Rectangle aPreviewRect = maPreviewRect;
@@ -743,21 +741,23 @@ void SaneDlg::AcquirePreview()
maReslBox.SetValue( (sal_uLong)fResl );
if( mbDragEnable )
+ {
maPreviewRect = Rectangle( maTopLeft,
Size( maBottomRight.X() - maTopLeft.X(),
maBottomRight.Y() - maTopLeft.Y() )
);
+ }
else
{
Size aBMSize( maPreviewBitmap.GetSizePixel() );
- if( aBMSize.Width() > aBMSize.Height() )
+ if( aBMSize.Width() > aBMSize.Height() && aBMSize.Width() )
{
int nVHeight = (maBottomRight.X() - maTopLeft.X()) * aBMSize.Height() / aBMSize.Width();
maPreviewRect = Rectangle( Point( maTopLeft.X(), ( maTopLeft.Y() + maBottomRight.Y() )/2 - nVHeight/2 ),
Size( maBottomRight.X() - maTopLeft.X(),
nVHeight ) );
}
- else
+ else if (aBMSize.Height())
{
int nVWidth = (maBottomRight.Y() - maTopLeft.Y()) * aBMSize.Width() / aBMSize.Height();
maPreviewRect = Rectangle( Point( ( maTopLeft.X() + maBottomRight.X() )/2 - nVWidth/2, maTopLeft.Y() ),
@@ -1168,7 +1168,6 @@ void SaneDlg::UpdateScanArea( sal_Bool bSend )
sal_Bool SaneDlg::LoadState()
{
-#ifdef USE_SAVE_STATE
int i;
if( ! Sane::IsSane() )
@@ -1234,14 +1233,10 @@ sal_Bool SaneDlg::LoadState()
InitFields();
return sal_True;
-#else
- return sal_False;
-#endif
}
void SaneDlg::SaveState()
{
-#ifdef USE_SAVE_STATE
if( ! Sane::IsSane() )
return;
@@ -1254,59 +1249,6 @@ void SaneDlg::SaveState()
aConfig.SetGroup( "SANE" );
aConfig.WriteKey( "SO_LastSANEDevice", ByteString( maDeviceBox.GetSelectEntry(), RTL_TEXTENCODING_UTF8 ) );
-#ifdef SAVE_ALL_STATES
- for( int i = 1; i < mrSane.CountOptions(); i++ )
- {
- String aOption=mrSane.GetOptionName( i );
- SANE_Value_Type nType = mrSane.GetOptionType( i );
- switch( nType )
- {
- case SANE_TYPE_BOOL:
- {
- sal_Bool bValue;
- if( mrSane.GetOptionValue( i, bValue ) )
- {
- ByteString aString( "BOOL=" );
- aString += (sal_uLong)bValue;
- aConfig.WriteKey( aOption, aString );
- }
- }
- break;
- case SANE_TYPE_STRING:
- {
- String aString( "STRING=" );
- String aValue;
- if( mrSane.GetOptionValue( i, aValue ) )
- {
- aString += aValue;
- aConfig.WriteKey( aOption, aString );
- }
- }
- break;
- case SANE_TYPE_FIXED:
- case SANE_TYPE_INT:
- {
- String aString( "NUMERIC=" );
- double fValue;
- char buf[256];
- for( int n = 0; n < mrSane.GetOptionElements( i ); n++ )
- {
- if( ! mrSane.GetOptionValue( i, fValue, n ) )
- break;
- if( n > 0 )
- aString += ":";
- sprintf( buf, "%lg", fValue );
- aString += buf;
- }
- if( n >= mrSane.GetOptionElements( i ) )
- aConfig.WriteKey( aOption, aString );
- }
- break;
- default:
- break;
- }
- }
-#else
static char const* pSaveOptions[] = {
"resolution",
"tl-x",
@@ -1314,9 +1256,7 @@ void SaneDlg::SaveState()
"br-x",
"br-y"
};
- for( size_t i = 0;
- i < (sizeof(pSaveOptions)/sizeof(pSaveOptions[0]));
- i++ )
+ for( size_t i = 0; i < SAL_N_ELEMENTS(pSaveOptions); i++ )
{
ByteString aOption = pSaveOptions[i];
int nOption = mrSane.GetOptionByName( pSaveOptions[i] );
@@ -1373,8 +1313,6 @@ void SaneDlg::SaveState()
}
}
}
-#endif
-#endif
}
sal_Bool SaneDlg::SetAdjustedNumericalValue(
@@ -1429,3 +1367,5 @@ sal_Bool SaneDlg::SetAdjustedNumericalValue(
return sal_True;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx
index 5fc112732ef8..c3f72eafaebe 100644
--- a/extensions/source/scanner/sanedlg.hxx
+++ b/extensions/source/scanner/sanedlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <vcl/dialog.hxx>
#include <tools/config.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
#include <vcl/field.hxx>
@@ -150,3 +149,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/scanner.cxx b/extensions/source/scanner/scanner.cxx
index cc08b5f10c52..e833c4f1d56d 100644
--- a/extensions/source/scanner/scanner.cxx
+++ b/extensions/source/scanner/scanner.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,3 +103,5 @@ SEQ( OUString ) ScannerManager::getSupportedServiceNames_Static() throw ()
return aSNS;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/scanner.hxx b/extensions/source/scanner/scanner.hxx
index 374c2adc3a25..abe2ae3694c8 100644
--- a/extensions/source/scanner/scanner.hxx
+++ b/extensions/source/scanner/scanner.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,30 +30,24 @@
#define _EXT_SCANNER_HXX
#include <tools/stream.hxx>
-#include <vos/mutex.hxx>
-#ifndef __RTL_USTRING_HXX_
+#include <osl/mutex.hxx>
#include <rtl/ustring.hxx>
-#endif
-#include <cppuhelper/weak.hxx>
#include <cppuhelper/weak.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
-#ifndef __COM_SUN_STAR_AWT_XBITMAP_HPP
#include <com/sun/star/awt/XBitmap.hpp>
-#endif
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
-#ifndef __COM_SUN_STAR_LANG_EVENTOBJECT_HPP
#include <com/sun/star/lang/EventObject.hpp>
-#endif
#include <com/sun/star/scanner/XScannerManager.hpp>
#include <com/sun/star/scanner/ScannerException.hpp>
-using namespace rtl;
using namespace cppu;
using namespace com::sun::star::uno;
using namespace com::sun::star::scanner;
+using ::rtl::OUString;
+
// -----------
// - Defines -
// -----------
@@ -70,7 +65,7 @@ class ScannerManager : public OWeakObject, XScannerManager, AWT::XBitmap
{
protected:
- vos::OMutex maProtector;
+ osl::Mutex maProtector;
void* mpData;
void AcquireData();
@@ -114,3 +109,5 @@ public:
REF( XInterface ) SAL_CALL ScannerManager_CreateInstance( const REF( com::sun::star::lang::XMultiServiceFactory )& rxFactory ) throw( Exception );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx
index 5307ac148487..1f481f668a7e 100644
--- a/extensions/source/scanner/scanunx.cxx
+++ b/extensions/source/scanner/scanunx.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,8 +30,8 @@
#include "precompiled_extensions.hxx"
#include <scanner.hxx>
#include <sanedlg.hxx>
-#include <vos/thread.hxx>
-#include <tools/list.hxx>
+#include <osl/thread.hxx>
+#include <boost/shared_ptr.hpp>
#include <boost/shared_ptr.hpp>
#if OSL_DEBUG_LEVEL > 1
@@ -64,7 +65,7 @@ ANY SAL_CALL BitmapTransporter::queryInterface( const Type& rType ) throw( Runti
AWT::Size BitmapTransporter::getSize() throw()
{
- vos::OGuard aGuard( m_aProtector );
+ osl::MutexGuard aGuard( m_aProtector );
int nPreviousPos = m_aStream.Tell();
AWT::Size aRet;
@@ -88,7 +89,7 @@ AWT::Size BitmapTransporter::getSize() throw()
SEQ( sal_Int8 ) BitmapTransporter::getDIB() throw()
{
- vos::OGuard aGuard( m_aProtector );
+ osl::MutexGuard aGuard( m_aProtector );
int nPreviousPos = m_aStream.Tell();
// create return value
@@ -111,7 +112,7 @@ struct SaneHolder
{
Sane m_aSane;
REF( AWT::XBitmap ) m_xBitmap;
- vos::OMutex m_aProtector;
+ osl::Mutex m_aProtector;
ScanError m_nError;
bool m_bBusy;
@@ -146,7 +147,7 @@ namespace
m_aSanes.clear();
}
- struct theSaneProtector : public rtl::Static<vos::OMutex, theSaneProtector> {};
+ struct theSaneProtector : public rtl::Static<osl::Mutex, theSaneProtector> {};
struct theSanes : public rtl::Static<allSanes, theSanes> {};
}
@@ -154,7 +155,7 @@ namespace
// - ScannerThread -
// -----------------
-class ScannerThread : public vos::OThread
+class ScannerThread : public osl::Thread
{
boost::shared_ptr<SaneHolder> m_pHolder;
REF( com::sun::star::lang::XEventListener ) m_xListener;
@@ -192,7 +193,7 @@ ScannerThread::~ScannerThread()
void ScannerThread::run()
{
- vos::OGuard aGuard( m_pHolder->m_aProtector );
+ osl::MutexGuard aGuard( m_pHolder->m_aProtector );
BitmapTransporter* pTransporter = new BitmapTransporter;
REF( XInterface ) aIf( static_cast< OWeakObject* >( pTransporter ) );
@@ -224,13 +225,13 @@ void ScannerThread::run()
void ScannerManager::AcquireData()
{
- vos::OGuard aGuard( theSaneProtector::get() );
+ osl::MutexGuard aGuard( theSaneProtector::get() );
theSanes::get().acquire();
}
void ScannerManager::ReleaseData()
{
- vos::OGuard aGuard( theSaneProtector::get() );
+ osl::MutexGuard aGuard( theSaneProtector::get() );
theSanes::get().release();
}
@@ -254,7 +255,7 @@ SEQ( sal_Int8 ) ScannerManager::getDIB() throw()
SEQ( ScannerContext ) ScannerManager::getAvailableScanners() throw()
{
- vos::OGuard aGuard( theSaneProtector::get() );
+ osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes;
if( rSanes.empty() )
@@ -267,7 +268,7 @@ SEQ( ScannerContext ) ScannerManager::getAvailableScanners() throw()
if( Sane::IsSane() )
{
SEQ( ScannerContext ) aRet(1);
- aRet.getArray()[0].ScannerName = ::rtl::OUString::createFromAscii( "SANE" );
+ aRet.getArray()[0].ScannerName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SANE"));
aRet.getArray()[0].InternalData = 0;
return aRet;
}
@@ -279,7 +280,7 @@ SEQ( ScannerContext ) ScannerManager::getAvailableScanners() throw()
sal_Bool ScannerManager::configureScanner( ScannerContext& scanner_context ) throw( ScannerException )
{
- vos::OGuard aGuard( theSaneProtector::get() );
+ osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes;
#if OSL_DEBUG_LEVEL > 1
@@ -288,7 +289,7 @@ sal_Bool ScannerManager::configureScanner( ScannerContext& scanner_context ) thr
if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() )
throw ScannerException(
- ::rtl::OUString::createFromAscii( "Scanner does not exist" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner does not exist")),
REF( XScannerManager )( this ),
ScanError_InvalidContext
);
@@ -296,7 +297,7 @@ sal_Bool ScannerManager::configureScanner( ScannerContext& scanner_context ) thr
boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData];
if( pHolder->m_bBusy )
throw ScannerException(
- ::rtl::OUString::createFromAscii( "Scanner is busy" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner is busy")),
REF( XScannerManager )( this ),
ScanError_ScanInProgress
);
@@ -314,7 +315,7 @@ sal_Bool ScannerManager::configureScanner( ScannerContext& scanner_context ) thr
void ScannerManager::startScan( const ScannerContext& scanner_context,
const REF( com::sun::star::lang::XEventListener )& listener ) throw( ScannerException )
{
- vos::OGuard aGuard( theSaneProtector::get() );
+ osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes;
#if OSL_DEBUG_LEVEL > 1
@@ -323,14 +324,14 @@ void ScannerManager::startScan( const ScannerContext& scanner_context,
if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() )
throw ScannerException(
- ::rtl::OUString::createFromAscii( "Scanner does not exist" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner does not exist")),
REF( XScannerManager )( this ),
ScanError_InvalidContext
);
boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData];
if( pHolder->m_bBusy )
throw ScannerException(
- ::rtl::OUString::createFromAscii( "Scanner is busy" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner is busy")),
REF( XScannerManager )( this ),
ScanError_ScanInProgress
);
@@ -344,12 +345,12 @@ void ScannerManager::startScan( const ScannerContext& scanner_context,
ScanError ScannerManager::getError( const ScannerContext& scanner_context ) throw( ScannerException )
{
- vos::OGuard aGuard( theSaneProtector::get() );
+ osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes;
if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() )
throw ScannerException(
- ::rtl::OUString::createFromAscii( "Scanner does not exist" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner does not exist")),
REF( XScannerManager )( this ),
ScanError_InvalidContext
);
@@ -363,21 +364,23 @@ ScanError ScannerManager::getError( const ScannerContext& scanner_context ) thro
REF( AWT::XBitmap ) ScannerManager::getBitmap( const ScannerContext& scanner_context ) throw( ScannerException )
{
- vos::OGuard aGuard( theSaneProtector::get() );
+ osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes;
if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() )
throw ScannerException(
- ::rtl::OUString::createFromAscii( "Scanner does not exist" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scanner does not exist")),
REF( XScannerManager )( this ),
ScanError_InvalidContext
);
boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData];
- vos::OGuard aProtGuard( pHolder->m_aProtector );
+ osl::MutexGuard aProtGuard( pHolder->m_aProtector );
REF( AWT::XBitmap ) xRet( pHolder->m_xBitmap );
pHolder->m_xBitmap = REF( AWT::XBitmap )();
return xRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx
index e910da58cc8a..963d89287e2d 100644
--- a/extensions/source/scanner/scanwin.cxx
+++ b/extensions/source/scanner/scanwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,8 +42,8 @@
#include <math.h>
#include <tools/svwin.h>
#include <tools/stream.hxx>
-#include <vos/mutex.hxx>
-#include <vos/module.hxx>
+#include <osl/mutex.hxx>
+#include <osl/module.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/sysdata.hxx>
@@ -106,7 +107,7 @@ class ImpTwain : public ::cppu::WeakImplHelper1< util::XCloseListener >
TW_IDENTITY aSrcIdent;
Link aNotifyLink;
DSMENTRYPROC pDSM;
- vos:: OModule * pMod;
+ osl::Module* pMod;
ULONG nCurState;
HWND hTwainWnd;
HHOOK hTwainHook;
@@ -218,7 +219,7 @@ ImpTwain::ImpTwain( ScannerManager& rMgr, const Link& rNotifyLink ) :
hTwainWnd = CreateWindowEx( WS_EX_TOPMOST, aWc.lpszClassName, "TWAIN", 0, 0, 0, 0, 0, HWND_DESKTOP, NULL, aWc.hInstance, 0 );
hTwainHook = SetWindowsHookEx( WH_GETMESSAGE, &TwainMsgProc, NULL, GetCurrentThreadId() );
- // #107835# block destruction until ImplDestroyHdl is called
+ // block destruction until ImplDestroyHdl is called
mxSelfRef = static_cast< ::cppu::OWeakObject* >( this );
}
@@ -289,7 +290,7 @@ void ImpTwain::ImplOpenSourceManager()
{
if( 1 == nCurState )
{
- pMod = new ::vos::OModule( ::rtl::OUString() );
+ pMod = new ::osl::Module( ::rtl::OUString() );
if( pMod->load( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( TWAIN_LIBNAME ) ) ) )
{
@@ -343,7 +344,7 @@ bool ImpTwain::ImplEnableSource()
aNotifyLink.Call( (void*) TWAIN_EVENT_SCANNING );
nCurState = 5;
- // #107835# register as vetoable close listener, to prevent application to die under us
+ // register as vetoable close listener, to prevent application to die under us
ImplRegisterCloseListener();
if( PFUNC( &aAppIdent, &aSrcIdent, DG_CONTROL, DAT_USERINTERFACE, MSG_ENABLEDS, &aUI ) == TWRC_SUCCESS )
@@ -354,7 +355,7 @@ bool ImpTwain::ImplEnableSource()
{
nCurState = 4;
- // #107835# deregister as vetoable close listener, dialog failed
+ // deregister as vetoable close listener, dialog failed
ImplDeregisterCloseListener();
}
}
@@ -502,7 +503,7 @@ IMPL_LINK( ImpTwain, ImplFallbackHdl, void*, pData )
PFUNC( &aAppIdent, &aSrcIdent, DG_CONTROL, DAT_USERINTERFACE, MSG_DISABLEDS, &aUI );
nCurState = 4;
- // #107835# deregister as vetoable close listener
+ // deregister as vetoable close listener
ImplDeregisterCloseListener();
}
break;
@@ -555,7 +556,7 @@ IMPL_LINK( ImpTwain, ImplDestroyHdl, void*, /*p*/ )
if( hTwainHook )
UnhookWindowsHookEx( hTwainHook );
- // #107835# permit destruction of ourselves (normally, refcount
+ // permit destruction of ourselves (normally, refcount
// should drop to zero exactly here)
mxSelfRef = NULL;
pImpTwainInstance = NULL;
@@ -575,7 +576,7 @@ uno::Reference< frame::XFrame > ImpTwain::ImplGetActiveFrame()
{
// query desktop instance
uno::Reference< frame::XDesktop > xDesktop( xMgr->createInstance(
- OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), uno::UNO_QUERY );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), uno::UNO_QUERY );
if( xDesktop.is() )
{
@@ -589,12 +590,12 @@ uno::Reference< frame::XFrame > ImpTwain::ImplGetActiveFrame()
try
{
aActiveFrame = xDesktopProps->getPropertyValue(
- OUString::createFromAscii( "ActiveFrame" ) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveFrame")) );
}
catch( const beans::UnknownPropertyException& )
{
// property unknown.
- DBG_ERROR("ImpTwain::ImplGetActiveFrame: ActiveFrame property unknown, cannot determine active frame!");
+ OSL_FAIL("ImpTwain::ImplGetActiveFrame: ActiveFrame property unknown, cannot determine active frame!");
return uno::Reference< frame::XFrame >();
}
@@ -613,7 +614,7 @@ uno::Reference< frame::XFrame > ImpTwain::ImplGetActiveFrame()
{
}
- DBG_ERROR("ImpTwain::ImplGetActiveFrame: Could not determine active frame!");
+ OSL_FAIL("ImpTwain::ImplGetActiveFrame: Could not determine active frame!");
return uno::Reference< frame::XFrame >();
}
@@ -629,7 +630,7 @@ uno::Reference< util::XCloseBroadcaster > ImpTwain::ImplGetActiveFrameCloseBroad
{
}
- DBG_ERROR("ImpTwain::ImplGetActiveFrameCloseBroadcaster: Could determine close broadcaster on active frame!");
+ OSL_FAIL("ImpTwain::ImplGetActiveFrameCloseBroadcaster: Could determine close broadcaster on active frame!");
return uno::Reference< util::XCloseBroadcaster >();
}
@@ -649,7 +650,7 @@ void ImpTwain::ImplRegisterCloseListener()
else
{
// interface unknown. don't register, then
- DBG_ERROR("ImpTwain::ImplRegisterCloseListener: XFrame has no XCloseBroadcaster!");
+ OSL_FAIL("ImpTwain::ImplRegisterCloseListener: XFrame has no XCloseBroadcaster!");
return;
}
}
@@ -657,7 +658,7 @@ void ImpTwain::ImplRegisterCloseListener()
{
}
- DBG_ERROR("ImpTwain::ImplRegisterCloseListener: Could not register as close listener!");
+ OSL_FAIL("ImpTwain::ImplRegisterCloseListener: Could not register as close listener!");
}
// -----------------------------------------------------------------------------
@@ -677,7 +678,7 @@ void ImpTwain::ImplDeregisterCloseListener()
else
{
// interface unknown. don't deregister, then
- DBG_ERROR("ImpTwain::ImplDeregisterCloseListener: XFrame has no XCloseBroadcaster!");
+ OSL_FAIL("ImpTwain::ImplDeregisterCloseListener: XFrame has no XCloseBroadcaster!");
return;
}
}
@@ -685,7 +686,7 @@ void ImpTwain::ImplDeregisterCloseListener()
{
}
- DBG_ERROR("ImpTwain::ImplDeregisterCloseListener: Could not deregister as close listener!");
+ OSL_FAIL("ImpTwain::ImplDeregisterCloseListener: Could not deregister as close listener!");
}
// -----------------------------------------------------------------------------
@@ -704,7 +705,7 @@ void SAL_CALL ImpTwain::queryClosing( const lang::EventObject& /*Source*/, sal_B
void SAL_CALL ImpTwain::notifyClosing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException)
{
// should not happen
- DBG_ERROR("ImpTwain::notifyClosing called, but we vetoed the closing before!");
+ OSL_FAIL("ImpTwain::notifyClosing called, but we vetoed the closing before!");
}
// -----------------------------------------------------------------------------
@@ -729,7 +730,7 @@ void ImpTwain::ImplSendCloseEvent()
{
}
- DBG_ERROR("ImpTwain::ImplSendCloseEvent: Could not send required close broadcast!");
+ OSL_FAIL("ImpTwain::ImplSendCloseEvent: Could not send required close broadcast!");
}
@@ -783,7 +784,7 @@ bool Twain::SelectSource( ScannerManager& rMgr )
if( !mpImpTwain )
{
- // #107835# hold reference to ScannerManager, to prevent premature death
+ // hold reference to ScannerManager, to prevent premature death
mxMgr = uno::Reference< scanner::XScannerManager >( static_cast< OWeakObject* >( const_cast< ScannerManager* >( mpCurMgr = &rMgr ) ),
uno::UNO_QUERY ),
@@ -805,7 +806,7 @@ bool Twain::PerformTransfer( ScannerManager& rMgr, const uno::Reference< lang::X
if( !mpImpTwain )
{
- // #107835# hold reference to ScannerManager, to prevent premature death
+ // hold reference to ScannerManager, to prevent premature death
mxMgr = uno::Reference< scanner::XScannerManager >( static_cast< OWeakObject* >( const_cast< ScannerManager* >( mpCurMgr = &rMgr ) ),
uno::UNO_QUERY ),
@@ -990,7 +991,7 @@ SEQ( sal_Int8 ) ScannerManager::getDIB() throw()
SEQ( ScannerContext ) SAL_CALL ScannerManager::getAvailableScanners() throw()
{
- vos::OGuard aGuard( maProtector );
+ osl::MutexGuard aGuard( maProtector );
SEQ( ScannerContext ) aRet( 1 );
aRet.getArray()[0].ScannerName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TWAIN" ) );
@@ -1004,7 +1005,7 @@ SEQ( ScannerContext ) SAL_CALL ScannerManager::getAvailableScanners() throw()
sal_Bool SAL_CALL ScannerManager::configureScanner( ScannerContext& rContext )
throw( ScannerException )
{
- vos::OGuard aGuard( maProtector );
+ osl::MutexGuard aGuard( maProtector );
uno::Reference< XScannerManager > xThis( this );
if( rContext.InternalData != 0 || rContext.ScannerName != ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TWAIN" ) ) )
@@ -1020,7 +1021,7 @@ sal_Bool SAL_CALL ScannerManager::configureScanner( ScannerContext& rContext )
void SAL_CALL ScannerManager::startScan( const ScannerContext& rContext, const uno::Reference< lang::XEventListener >& rxListener )
throw( ScannerException )
{
- vos::OGuard aGuard( maProtector );
+ osl::MutexGuard aGuard( maProtector );
uno::Reference< XScannerManager > xThis( this );
if( rContext.InternalData != 0 || rContext.ScannerName != ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TWAIN" ) ) )
@@ -1035,7 +1036,7 @@ void SAL_CALL ScannerManager::startScan( const ScannerContext& rContext, const u
ScanError SAL_CALL ScannerManager::getError( const ScannerContext& rContext )
throw( ScannerException )
{
- vos::OGuard aGuard( maProtector );
+ osl::MutexGuard aGuard( maProtector );
uno::Reference< XScannerManager > xThis( this );
if( rContext.InternalData != 0 || rContext.ScannerName != ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TWAIN" ) ) )
@@ -1049,6 +1050,8 @@ ScanError SAL_CALL ScannerManager::getError( const ScannerContext& rContext )
uno::Reference< awt::XBitmap > SAL_CALL ScannerManager::getBitmap( const ScannerContext& /*rContext*/ )
throw( ScannerException )
{
- vos::OGuard aGuard( maProtector );
+ osl::MutexGuard aGuard( maProtector );
return uno::Reference< awt::XBitmap >( this );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/scnserv.cxx b/extensions/source/scanner/scnserv.cxx
index e96522002b9a..6f18a8ed607e 100644
--- a/extensions/source/scanner/scnserv.cxx
+++ b/extensions/source/scanner/scnserv.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,5 @@ extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void*
return pRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/twain.cxx b/extensions/source/scanner/twain.cxx
index bd17f1e56117..1bbc9128af3d 100644
--- a/extensions/source/scanner/twain.cxx
+++ b/extensions/source/scanner/twain.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,7 @@
#ifdef OS2
#include <svpm.h>
#endif // OS2
-#include <vos/module.hxx>
+#include <osl/module.hxx>
#include <tools/stream.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
@@ -239,7 +240,7 @@ void ImpTwain::ImplOpenSourceManager()
{
if( 1 == nCurState )
{
- pMod = new vos:: OModule ();
+ pMod = new osl::Module();
if( pMod->load( TWAIN_LIBNAME ) )
{
@@ -527,3 +528,5 @@ IMPL_LINK( ImpTwain, ImplDestroyHdl, void*, p )
return 0L;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/twain.hxx b/extensions/source/scanner/twain.hxx
index bb9fa44b6cf6..95d6c5871bd9 100644
--- a/extensions/source/scanner/twain.hxx
+++ b/extensions/source/scanner/twain.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
#ifndef _TWAIN_HXX
#define _TWAIN_HXX
-#include <vos/module.hxx>
+#include <osl/module.hxx>
#include <vcl/bitmap.hxx>
#include "twain/twain.h"
@@ -57,7 +58,7 @@ class ImpTwain
Link aNotifyLink;
Bitmap aBitmap;
DSMENTRYPROC pDSM;
- vos:: OModule * pMod;
+ osl::Module pMod;
sal_uLong nCurState;
void ImplCreate();
@@ -96,3 +97,5 @@ public:
};
#endif // _TWAIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */