summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcanvas/source/directx/dx_canvashelper_texturefill.cxx2
-rw-r--r--l10ntools/java/jpropex/java/JPropEx.java11
-rw-r--r--l10ntools/java/jpropex/java/SdfData.java2
-rw-r--r--l10ntools/java/jpropex/java/SdfEntity.java1
-rw-r--r--l10ntools/prj/d.lst3
-rwxr-xr-xl10ntools/scripts/localize.pl124
-rw-r--r--l10ntools/scripts/tool/l10ntool.py3
-rw-r--r--l10ntools/scripts/tool/xhtex.py7
-rw-r--r--l10ntools/source/help/HelpLinker.cxx45
-rw-r--r--padmin/source/padialog.src64
-rw-r--r--padmin/source/prtsetup.cxx39
-rw-r--r--padmin/source/prtsetup.hxx3
-rw-r--r--padmin/source/rtsetup.hrc10
-rw-r--r--padmin/source/rtsetup.src52
-rw-r--r--padmin/source/spadmin.sh2
-rw-r--r--rsc/inc/rscdb.hxx1
-rw-r--r--rsc/inc/vclrsc.hxx6
-rw-r--r--rsc/source/parser/rscdb.cxx3
-rw-r--r--rsc/source/parser/rscicpx.cxx10
-rw-r--r--rsc/source/parser/rscinit.cxx2
-rw-r--r--svl/inc/pickerhelper.hxx69
-rw-r--r--svl/source/filepicker/makefile.mk1
-rw-r--r--svl/source/filepicker/pickerhelper.cxx99
-rw-r--r--svtools/bmpmaker/bmp.src8
-rw-r--r--svtools/inc/fileview.hxx4
-rw-r--r--svtools/inc/svtools/filter.hxx56
-rw-r--r--svtools/inc/svtools/headbar.hxx8
-rw-r--r--svtools/inc/svtools/helpid.hrc141
-rw-r--r--svtools/inc/svtools/roadmapwizard.hxx4
-rw-r--r--svtools/inc/svtools/svtdata.hxx1
-rw-r--r--svtools/inc/svtools/toolpanel/toolpanel.hxx3
-rw-r--r--svtools/inc/tabbar.hxx10
-rw-r--r--svtools/inc/taskbar.hxx6
-rw-r--r--svtools/source/contnr/fileview.cxx6
-rw-r--r--svtools/source/contnr/fileview.src4
-rw-r--r--svtools/source/contnr/templwin.src2
-rwxr-xr-x[-rw-r--r--]svtools/source/control/headbar.cxx26
-rwxr-xr-x[-rw-r--r--]svtools/source/control/inettbc.cxx2
-rwxr-xr-xsvtools/source/control/tabbar.cxx25
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskstat.cxx6
-rw-r--r--svtools/source/dialogs/addresstemplate.src4
-rw-r--r--svtools/source/dialogs/colrdlg.src13
-rw-r--r--svtools/source/dialogs/filedlg2.cxx12
-rw-r--r--svtools/source/dialogs/printdlg.cxx8
-rw-r--r--svtools/source/dialogs/printdlg.src16
-rw-r--r--svtools/source/dialogs/prnsetup.src4
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx8
-rw-r--r--svtools/source/dialogs/wizardmachine.cxx4
-rw-r--r--[-rwxr-xr-x]svtools/source/filter.vcl/filter/exportdialog.cxx14
-rw-r--r--[-rwxr-xr-x]svtools/source/filter.vcl/filter/exportdialog.src24
-rw-r--r--svtools/source/filter.vcl/filter/filter.cxx44
-rw-r--r--svtools/source/filter.vcl/filter/filter2.cxx594
-rw-r--r--svtools/source/java/javainteractionhandler.cxx6
-rw-r--r--svtools/source/plugapp/testtool.src7
-rw-r--r--svtools/source/productregistration/registrationdlg.src4
-rw-r--r--svtools/source/toolpanel/drawerlayouter.cxx2
-rw-r--r--svtools/source/toolpanel/dummypanel.cxx4
-rw-r--r--svtools/source/toolpanel/dummypanel.hxx2
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx31
-rw-r--r--svtools/util/hidother.src20
-rwxr-xr-xsvtools/workben/toolpanel/toolpaneltest.cxx6
-rw-r--r--svtools/workben/unodialog/roadmapskeleton.src5
-rw-r--r--toolkit/inc/layout/layout.hxx21
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindows.hxx2
-rw-r--r--toolkit/inc/toolkit/controls/dialogcontrol.hxx2
-rw-r--r--toolkit/source/awt/vclxdialog.cxx4
-rw-r--r--toolkit/source/awt/vclxdialog.hxx2
-rw-r--r--toolkit/source/awt/vclxwindow.cxx31
-rw-r--r--toolkit/source/awt/vclxwindows.cxx4
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx2
-rw-r--r--toolkit/source/layout/core/import.cxx2
-rw-r--r--toolkit/source/layout/vcl/wrapper.cxx44
-rw-r--r--toolkit/workben/layout/sortdlg.src22
-rw-r--r--tools/inc/tools/rc.h1
-rw-r--r--tools/inc/tools/rc.hxx3
-rw-r--r--tools/inc/tools/resmgr.hxx11
-rw-r--r--tools/inc/tools/urlobj.hxx4
-rw-r--r--tools/source/fsys/urlobj.cxx9
-rw-r--r--tools/source/rc/resmgr.cxx198
-rw-r--r--ucbhelper/workben/ucbexplorer/ucbexplorer.src2
-rwxr-xr-xvcl/aqua/inc/salframeview.h4
-rw-r--r--vcl/aqua/source/app/salinst.cxx1
-rw-r--r--vcl/aqua/source/dtrans/aqua_clipboard.cxx30
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx2
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm65
-rw-r--r--vcl/inc/cupsmgr.hxx4
-rw-r--r--vcl/inc/vcl/btndlg.hxx4
-rw-r--r--vcl/inc/vcl/help.hxx11
-rw-r--r--vcl/inc/vcl/jobdata.hxx4
-rw-r--r--vcl/inc/vcl/menu.hxx4
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx27
-rw-r--r--vcl/inc/vcl/print.hxx15
-rw-r--r--vcl/inc/vcl/printerinfomanager.hxx4
-rw-r--r--vcl/inc/vcl/prntypes.hxx1
-rwxr-xr-xvcl/inc/vcl/smartid.hxx87
-rw-r--r--vcl/inc/vcl/status.hxx10
-rw-r--r--vcl/inc/vcl/svdata.hxx1
-rw-r--r--vcl/inc/vcl/tabctrl.hxx11
-rw-r--r--vcl/inc/vcl/toolbox.h2
-rw-r--r--vcl/inc/vcl/toolbox.hxx10
-rw-r--r--vcl/inc/vcl/window.h8
-rw-r--r--vcl/inc/vcl/window.hxx15
-rw-r--r--vcl/prj/d.lst1
-rw-r--r--vcl/source/app/help.cxx13
-rw-r--r--vcl/source/control/ilstbox.cxx16
-rw-r--r--vcl/source/control/tabctrl.cxx47
-rw-r--r--vcl/source/gdi/impprn.cxx584
-rwxr-xr-xvcl/source/gdi/makefile.mk1
-rw-r--r--vcl/source/gdi/metaact.cxx2
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdev2.cxx11
-rw-r--r--vcl/source/gdi/outdev3.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter.cxx7
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx10
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx10
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx1035
-rwxr-xr-xvcl/source/gdi/print3.cxx2
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx1
-rw-r--r--vcl/source/helper/makefile.mk1
-rwxr-xr-xvcl/source/helper/smartid.cxx264
-rw-r--r--vcl/source/src/print.src28
-rw-r--r--vcl/source/window/btndlg.cxx11
-rw-r--r--vcl/source/window/menu.cxx46
-rw-r--r--vcl/source/window/msgbox.cxx7
-rw-r--r--vcl/source/window/printdlg.cxx25
-rw-r--r--vcl/source/window/status.cxx36
-rw-r--r--vcl/source/window/toolbox.cxx14
-rw-r--r--vcl/source/window/toolbox2.cxx29
-rwxr-xr-x[-rw-r--r--]vcl/source/window/window.cxx87
-rw-r--r--vcl/source/window/window2.cxx104
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx25
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx14
-rw-r--r--vcl/unx/inc/salprn.h6
-rw-r--r--vcl/unx/source/fontmanager/fontcache.cxx4
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx91
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx323
-rw-r--r--vcl/unx/source/printer/cupsmgr.cxx42
-rw-r--r--vcl/unx/source/printer/jobdata.cxx41
-rw-r--r--vcl/unx/source/printer/printerinfomanager.cxx14
-rw-r--r--vcl/unx/source/printergfx/printerjob.cxx5
-rw-r--r--vcl/win/source/gdi/winlayout.cxx27
-rwxr-xr-x[-rw-r--r--]vcl/win/source/window/salframe.cxx57
141 files changed, 2969 insertions, 2461 deletions
diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx
index 60d62dad338a..80224aa3d53c 100755
--- a/canvas/source/directx/dx_canvashelper_texturefill.cxx
+++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx
@@ -422,8 +422,6 @@ namespace dxcanvas
}
#if defined(VERBOSE) && defined(DBG_UTIL)
- rGraphics->MultiplyTransform( &aMatrix );
-
Gdiplus::Pen aPen( Gdiplus::Color( 255, 255, 0, 0 ),
0.0001f );
diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java
index f068f93ad18b..9ff8bf96fe44 100644
--- a/l10ntools/java/jpropex/java/JPropEx.java
+++ b/l10ntools/java/jpropex/java/JPropEx.java
@@ -141,9 +141,12 @@ public class JPropEx
private SdfEntity prepareSdfObj( String filename )
{
- String path = makeAbs( filename );
- //String path = makeAbs( inputFileArg );
- path = path.replace( rootArg + "/" , "" );
+ String path = makeAbs( filename ).trim();
+ String myRootArg = makeAbs( rootArg ).trim();
+ myRootArg = myRootArg.replace( "\\","/");
+ myRootArg += "/";
+ path = path.replace("\\","/");
+ path = path.replace( myRootArg, "" );
path = path.replace("/","\\");
// TODO: Make this static
java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -176,7 +179,7 @@ public class JPropEx
{
BufferedReader in = new BufferedReader( new FileReader( filename.substring( 1 ) ) );
while( in.ready() )
- lines.add( in.readLine() );
+ lines.add( in.readLine().trim() );
}
catch( IOException e )
{
diff --git a/l10ntools/java/jpropex/java/SdfData.java b/l10ntools/java/jpropex/java/SdfData.java
index 6f79909df1b2..98eddbeca20f 100644
--- a/l10ntools/java/jpropex/java/SdfData.java
+++ b/l10ntools/java/jpropex/java/SdfData.java
@@ -68,7 +68,7 @@ public class SdfData
BufferedReader in;
try
{
- in = new BufferedReader( new FileReader( filename ) );
+ in = new BufferedReader( new InputStreamReader( new FileInputStream( filename ), "UTF-8" ) );
SdfEntity entity;
while( in.ready() )
{
diff --git a/l10ntools/java/jpropex/java/SdfEntity.java b/l10ntools/java/jpropex/java/SdfEntity.java
index c2f6a5d788b1..7723238815e7 100644
--- a/l10ntools/java/jpropex/java/SdfEntity.java
+++ b/l10ntools/java/jpropex/java/SdfEntity.java
@@ -97,7 +97,6 @@ public class SdfEntity implements Cloneable{
}
public void setProperties( String line ){
-
if( line != null )
{
String[] splitted = line.split("\t",15);
diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst
index 9d493e1e9673..29dd21cee543 100644
--- a/l10ntools/prj/d.lst
+++ b/l10ntools/prj/d.lst
@@ -59,7 +59,8 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help
..\%__SRC%\bin\sdf.pyc %_DEST%\bin%_EXT%\sdf.pyc
..\%__SRC%\bin\xhtex.py %_DEST%\bin%_EXT%\xhtex.py
..\%__SRC%\bin\xtxex.py %_DEST%\bin%_EXT%\xtxex.py
-
+..\%__SRC%\bin\xhtex.pyc %_DEST%\bin%_EXT%\xhtex.pyc
+..\%__SRC%\bin\xtxex.pyc %_DEST%\bin%_EXT%\xtxex.pyc
..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx
..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx
..\inc\l10ntools\file.hxx %_DEST%\inc%_EXT%\l10ntools\file.hxx
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
index 7a9d8beb6f15..230b6d46f395 100755
--- a/l10ntools/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
@@ -87,7 +87,6 @@ my @sdfparticles;
#### main ####
parse_options();
-check_modules_scm();
my $binpath = '';
if( defined $ENV{UPDMINOREXT} )
@@ -159,7 +158,7 @@ sub splitfile{
next if( $prj eq "binfilter" ); # Don't merge strings into binfilter module
chomp( $line );
- if( is_openoffice_module( $prj ) )
+ if( $force_ooo_module )
{
$string_hash_ooo { $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line;
}
@@ -171,97 +170,25 @@ sub splitfile{
}
close( MYFILE );
- if( !defined $ENV{SRC_ROOT} ){
- print "Error, no SRC_ROOT in env found.\n";
+ if( !defined $ENV{SOURCE_ROOT_DIR} ){
+ print "Error, no SOURCE_ROOT_DIR in env found.\n";
exit( -1 );
}
- my $src_root = $ENV{SRC_ROOT};
- my $so_l10n_path = $src_root."/l10n_so/source";
- my $ooo_l10n_path = $src_root."/l10n/source";
+ my $src_root = $ENV{SOURCE_ROOT_DIR};
+ my $so_l10n_path = $src_root."/sun/l10n_so/source";
+ my $ooo_l10n_path = $src_root."/ooo/l10n/source";
#print "$so_l10n_path\n";
#print "$ooo_l10n_path\n";
- write_sdf( \%string_hash_so , $so_l10n_path );
- write_sdf( \%string_hash_ooo , $ooo_l10n_path );
-
-}
-sub check_modules_scm
-{
- #my @ooo_modules;
- #my @so_modules;
- my $src_path = $ENV{ SRC_ROOT } ;
- my $last_dir = getcwd();
- chdir $src_path ;
- my @modules = <*/.svn/entries>;
-
- foreach my $module ( @modules )
+ if( $force_ooo_module )
{
- #print "$module \n";
- if( open ( FILE , "<$module" ) )
- {
- while( <FILE> )
- {
-
- my @path = split ( "/" , $module ) ;
-
- if( /svn.services.openoffice.org/ )
- {
- my $mod = $path[ 0 ];
- #push @ooo_modules , $mod;
- $is_ooo_module{ $mod } = "true";
- # print "$module -> ooo ";
- }
- elsif ( /jumbo2.germany.sun.com/ )
- {
- my $mod = $path[ 0 ];
- #push @so_modules , $mod;
- # print "$module -> so ";
- #$so_lookup_hash{ $mod } = "true";
- }
- #else
- #{
- # print "ERROR: Is $module a SO or OOo module? Can not parese the $module/.svn/entries file ... please check mwsfinnish/merge/splitsdf.pl line 280\n";
- # exit -1;
- #}
- }
- }
+ write_sdf( \%string_hash_ooo , $ooo_l10n_path );
+ }
+ else
+ {
+ write_sdf( \%string_hash_so , $so_l10n_path );
}
- chdir $last_dir ;
- #print "OOO\n";
- #print @ooo_modules;
- #print "\nSO\n";
- #print @so_modules;
-}
-
-
-#sub parse
-#{
-# my $command = "$CVS_BINARY -d:pserver:anoncvs\@anoncvs.services.openoffice.org:/cvs co -c";
-# my $output = `$command`;
-# my $rc = $? << 8;
-# if ( $output eq "" || $rc < 0 ){
-# print STDERR "ERROR: Can not fetch cvs alias list, please login to the cvs server and press at the password prompt just return\ncvs -d:pserver:anoncvs\@anoncvs.services.openoffice.org:/cvs login\n";
-# exit ( -1 );
-# }
-# my @list = split /\n/ , $output ;
-# foreach my $string( @list )
-# {
-#
-# # print "Found '$1'\n" , if( $string =~ /^(\w*)/ && $1 ne "" );
-#
-# $is_ooo_module{ $1 } = "TRUE", if( $string =~ /^(\w*)/ && $1 ne "" );
-# }
-# # foreach my $key( keys( %is_ooo_module ) )
-# #{
-# # print "$key\n";
-# #}
-#}
-sub is_openoffice_module
-{
- my $module = shift;
- return "TRUE", if ( $force_ooo_module || defined $is_ooo_module{ $module } );
- return "";
}
sub write_sdf
@@ -458,16 +385,9 @@ sub collectfiles{
# $| = 1;
STDOUT->autoflush( 1 );
- ### Search sdf particles
- #print STDOUT "### Searching sdf particles\n";
my $working_path = getcwd();
chdir $ENV{SOURCE_ROOT_DIR}, if defined $ENV{SOURCE_ROOT_DIR};
- #chdir $srcpath;
- #find ( { wanted => \&wanted , follow => 1 }, getcwd() );
- #chdir $working_path;
add_paths( $langhash_ref );
- #my $nFound = $#sdfparticles +1;
- #print "\n $nFound files found !\n";
my ( $LOCALIZEPARTICLE , $localizeSDF ) = File::Temp::tempfile();
close( $LOCALIZEPARTICLE );
@@ -591,7 +511,6 @@ sub collectfiles{
}
}
close ALLPARTICLES_MERGED;
-#***************
# Hash of array
my %output;
@@ -1156,22 +1075,3 @@ sub usage{
print STDERR "\nlocalize -m -l cs -f my.sdf\n( Merge cs translation into the sourcecode ) \n";
}
-# my $line = defined $_ ? $_ : '';
-# my $leftpart = defined $2 ? $2 : '';
-# my $prj = defined $3 ? $3 : '';
-# my $file = defined $4 ? $4 : '';
-# my $dummy = defined $5 ? $5 : '';
-# my $type = defined $6 ? $6 : '';
-# my $gid = defined $7 ? $7 : '';
-# my $lid = defined $8 ? $8 : '';
-# my $helpid = defined $9 ? $9 : '';
-# my $plattform = defined $10 ? $10 : '';
-# my $width = defined $11 ? $11 : '';
-# my $lang = defined $12 ? $12 : '';
-# my $rightpart = defined $13 ? $13 : '';
-# my $text = defined $14 ? $14 : '';
-# my $helptext = defined $15 ? $15 : '';
-# my $quickhelptext = defined $16 ? $16 : '';
-# my $title = defined $17 ? $17 : '';
-# my $timestamp = defined $18 ? $18 : '';
-
diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py
index 70d88674f07b..f1630027ccdc 100644
--- a/l10ntools/scripts/tool/l10ntool.py
+++ b/l10ntools/scripts/tool/l10ntool.py
@@ -66,11 +66,10 @@ class AbstractL10nTool:
pass
################################################################################################
-
+
def format_outputfile(self, filename, language):
extension = filename[filename.rfind('.')+1:]
file = filename[:filename.rfind('.')]
-
# Python 2.3.x friendly
return self.get_outputfile_format_str().replace('[', '%(').replace(']',')s') % \
{ 'filename': filename, 'fileNoExt': file, 'language': language, 'extension': extension, 'path_prefix': self._options.path_prefix,
diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py
index ae973aacc555..d916fc675944 100644
--- a/l10ntools/scripts/tool/xhtex.py
+++ b/l10ntools/scripts/tool/xhtex.py
@@ -56,13 +56,14 @@ class Xhtex(AbstractL10nTool):
if elem.childNodes[0].nodeType == elem.TEXT_NODE and elem.getAttribute("id").strip():
obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip())
if sdfdata[obj.get_id()]:
- elem.childNodes[0].data = str(sdfdata[obj.get_id()].text)
+ elem.childNodes[0].data = unicode(str(sdfdata[obj.get_id()].text),"utf8")
+
def merge_title(self, list, sdfdata, lang, inputfilename):
for elem in list:
obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip())
if elem.getAttribute("id").strip() and sdfdata[obj.get_id()]:
- elem.setAttribute("title", str(sdfdata[obj.get_id()].text))
+ elem.setAttribute("title", unicode(str(sdfdata[obj.get_id()].text),"utf8"))
# L10N tool
def __init__(self):
@@ -97,7 +98,7 @@ class Xhtex(AbstractL10nTool):
try:
f = open(outputfilename, "w+")
str = dom.toxml()
- f.write(str)
+ f.write(str.encode("utf-8"))
except IOError:
print "ERROR: Can not write file " + outputfilename
sys.exit(-1)
diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx
index 411859bfe994..8e6976c0efd1 100644
--- a/l10ntools/source/help/HelpLinker.cxx
+++ b/l10ntools/source/help/HelpLinker.cxx
@@ -273,12 +273,10 @@ private:
std::string extdestination;
std::string module;
std::string lang;
- std::string hid;
std::string extensionPath;
std::string extensionDestination;
bool bExtensionMode;
fs::path indexDirName;
- Stringtable hidlistTranslation;
fs::path indexDirParentName;
bool init;
IndexerPreProcessor* m_pIndexerPreProcessor;
@@ -331,13 +329,6 @@ void HelpLinker::addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishi
HCDBG(std::cerr << "HelpLinker::addBookmark " << thishid << " " <<
fileB << " " << anchorB << " " << jarfileB << " " << titleB << std::endl);
- std::string temp = thishid;
- std::transform (temp.begin(), temp.end(), temp.begin(), toupper);
- std::replace(temp.begin(), temp.end(), ':', '_');
- const std::string& translatedHid = hidlistTranslation[temp];
- if (!translatedHid.empty())
- thishid = translatedHid;
-
thishid = URLEncoder::encode(thishid);
DBT key;
@@ -472,20 +463,6 @@ void HelpLinker::link() throw( HelpProcessingException )
try
{
- std::ifstream fileReader(hid.c_str());
- while (fileReader)
- {
- std::string key;
- fileReader >> key;
- std::transform (key.begin(), key.end(), key.begin(), toupper);
- std::replace(key.begin(), key.end(), ':', '_');
- std::string data;
- fileReader >> data;
- if (!key.empty() && !data.empty())
- hidlistTranslation[key] = data;
- }
- fileReader.close();
-
// lastly, initialize the indexBuilder
if ( (!bExtensionMode || bIndexForExtension) && !helpFiles.empty())
initIndexerPreProcessor();
@@ -651,13 +628,6 @@ void HelpLinker::link() throw( HelpProcessingException )
std::string helpTextId = helpTextIter->first;
const std::string& helpTextText = helpTextIter->second;
- std::string temp = helpTextId;
- std::transform (temp.begin(), temp.end(), temp.begin(), toupper);
- std::replace(temp.begin(), temp.end(), ':', '_');
-
- const std::string& tHid = hidlistTranslation[temp];
- if (!tHid.empty())
- helpTextId = tHid;
helpTextId = URLEncoder::encode(helpTextId);
DBT keyDbt;
@@ -912,14 +882,7 @@ void HelpLinker::main( std::vector<std::string> &args,
else if (args[i].compare("-hid") == 0)
{
++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "hid list missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- hid = args[i];
+ throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, "obsolete -hid argument used" );
}
else if (args[i].compare("-add") == 0)
{
@@ -1076,12 +1039,6 @@ void HelpLinker::main( std::vector<std::string> &args,
aStrStream << "language missing" << std::endl;
throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
}
- if (!bExtensionMode && hid.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "hid list missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
link();
}
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index ab09d9155d1b..09ce29a2c682 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -29,6 +29,7 @@
ModalDialog RID_FONTIMPORT_DIALOG
{
+ HelpID = "padmin:ModalDialog:RID_FONTIMPORT_DIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 230 , 185 );
@@ -37,6 +38,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
ListBox RID_FIMP_BOX_NEWFONTS
{
+ HelpID = "padmin:ListBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_NEWFONTS";
Border = TRUE;
Sort=TRUE;
AutoHScroll = TRUE;
@@ -58,18 +60,21 @@ ModalDialog RID_FONTIMPORT_DIALOG
};
Edit RID_FIMP_EDT_FROM
{
+ HelpID = "padmin:Edit:RID_FONTIMPORT_DIALOG:RID_FIMP_EDT_FROM";
Border = TRUE;
Pos = MAP_APPFONT( 10, 97 );
Size = MAP_APPFONT( 130, 12 );
};
PushButton RID_FIMP_BTN_FROM
{
+ HelpID = "padmin:PushButton:RID_FONTIMPORT_DIALOG:RID_FIMP_BTN_FROM";
Pos = MAP_APPFONT( 145, 97 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
};
CheckBox RID_FIMP_BOX_SUBDIRS
{
+ HelpID = "padmin:CheckBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_SUBDIRS";
Pos = MAP_APPFONT( 10, 115 );
Size = MAP_APPFONT( 145, 10 );
Text [ en-US ] = "Sea~rch Subdirectories";
@@ -83,6 +88,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
CheckBox RID_FIMP_BOX_LINKONLY
{
+ HelpID = "padmin:CheckBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_LINKONLY";
Pos = MAP_APPFONT( 10, 140 );
Size = MAP_APPFONT( 145, 10 );
Text [ en-US ] = "Create ~soft links only";
@@ -100,6 +106,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
};
PushButton RID_FIMP_BTN_SELECTALL
{
+ HelpID = "padmin:PushButton:RID_FONTIMPORT_DIALOG:RID_FIMP_BTN_SELECTALL";
Pos = MAP_APPFONT( 175, 44 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Select All";
@@ -146,6 +153,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
ModalDialog RID_PADIALOG
{
+ HelpID = "padmin:ModalDialog:RID_PADIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 198 ) ;
@@ -160,6 +168,7 @@ ModalDialog RID_PADIALOG
};
CheckBox RID_PA_CB_CUPSUSAGE
{
+ HelpID = "padmin:CheckBox:RID_PADIALOG:RID_PA_CB_CUPSUSAGE";
Pos = MAP_APPFONT( 12, 158 );
Size = MAP_APPFONT( 168, 8 );
Text [ en-US ] = "Disable CUPS Support";
@@ -186,6 +195,7 @@ ModalDialog RID_PADIALOG
};
ListBox RID_PA_LB_DEV
{
+ HelpID = "padmin:ListBox:RID_PADIALOG:RID_PA_LB_DEV";
Pos = MAP_APPFONT( 12, 15 );
Size = MAP_APPFONT( 168, 80 );
Border = TRUE;
@@ -237,30 +247,35 @@ ModalDialog RID_PADIALOG
};
PushButton RID_PA_BTN_CONF
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_CONF";
Pos = MAP_APPFONT( 190, 15 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Properties...";
};
PushButton RID_PA_BTN_RENAME
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_RENAME";
Pos = MAP_APPFONT( 190, 32 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "R~ename...";
};
PushButton RID_PA_BTN_STD
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_STD";
Pos = MAP_APPFONT( 190, 49 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "~Default";
};
PushButton RID_PA_BTN_DEL
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_DEL";
Pos = MAP_APPFONT( 190, 66 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Remo~ve...";
};
PushButton RID_PA_TESTPAGE
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_TESTPAGE";
Pos = MAP_APPFONT( 190, 83 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Test ~Page";
@@ -268,12 +283,14 @@ ModalDialog RID_PADIALOG
PushButton RID_PA_BTN_FONTS
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_FONTS";
Pos = MAP_APPFONT( 80, 181 );
Size = MAP_APPFONT( 70, 12 );
Text [ en-US ] = "Fon~ts...";
};
PushButton RID_PA_BTN_ADD
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_ADD";
Pos = MAP_APPFONT( 5, 181 );
Size = MAP_APPFONT( 70, 12 );
Text [ en-US ] = "New Printer...";
@@ -292,6 +309,7 @@ ModalDialog RID_PADIALOG
ModalDialog RID_STRINGQUERYDLG
{
+ HelpID = "padmin:ModalDialog:RID_STRINGQUERYDLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 10 , 10 ) ;
@@ -306,12 +324,14 @@ ModalDialog RID_STRINGQUERYDLG
};
Edit RID_STRQRY_EDT_NEWNAME
{
+ HelpID = "padmin:Edit:RID_STRINGQUERYDLG:RID_STRQRY_EDT_NEWNAME";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 23 ) ;
Size = MAP_APPFONT ( 130 , 12 ) ;
};
ComboBox RID_STRQRY_BOX_NEWNAME
{
+ HelpID = "padmin:ComboBox:RID_STRINGQUERYDLG:RID_STRQRY_BOX_NEWNAME";
Border = TRUE ;
DropDown = TRUE;
Pos = MAP_APPFONT ( 6 , 23 ) ;
@@ -383,6 +403,7 @@ String RID_TXT_TESTPAGE_TIME
ModalDialog RID_FONTNAMEDIALOG
{
+ HelpID = "padmin:ModalDialog:RID_FONTNAMEDIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 255 , 110 ) ;
@@ -397,24 +418,28 @@ ModalDialog RID_FONTNAMEDIALOG
};
PushButton RID_FNTNM_BTN_RENAME
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_RENAME";
Pos = MAP_APPFONT( 196, 31 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "Re~name...";
};
PushButton RID_FNTNM_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_REMOVE";
Pos = MAP_APPFONT ( 196 , 48 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
Text [ en-US ] = "~Remove...";
};
PushButton RID_FNTNM_BTN_IMPORT
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_IMPORT";
Pos = MAP_APPFONT ( 196 , 65 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
Text [ en-US ] = "~Add...";
};
ListBox RID_FNTNM_LB_FONTS
{
+ HelpID = "padmin:ListBox:RID_FONTNAMEDIALOG:RID_FNTNM_LB_FONTS";
Border = TRUE ;
Sort = TRUE ;
AutoHScroll = TRUE;
@@ -541,6 +566,7 @@ String RID_AFMERROR_BOX_TXT
ModelessDialog RID_PROGRESS_DLG
{
+ HelpID = "padmin:ModelessDialog:RID_PROGRESS_DLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 10 , 10 ) ;
@@ -586,6 +612,7 @@ String RID_OPERATION_CONVERTMETRIC
ModalDialog RID_PPDIMPORT_DLG
{
+ HelpID = "padmin:ModalDialog:RID_PPDIMPORT_DLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 265 , 225 ) ;
@@ -606,6 +633,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
ComboBox RID_PPDIMP_LB_PATH
{
+ HelpID = "padmin:ComboBox:RID_PPDIMPORT_DLG:RID_PPDIMP_LB_PATH";
Dropdown = TRUE;
Border = TRUE;
Sort = TRUE;
@@ -615,6 +643,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
PushButton RID_PPDIMP_BTN_SEARCH
{
+ HelpID = "padmin:PushButton:RID_PPDIMPORT_DLG:RID_PPDIMP_BTN_SEARCH";
Pos = MAP_APPFONT( 145, 15 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "Browse...";
@@ -628,6 +657,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
MultiListBox RID_PPDIMP_LB_DRIVER
{
+ HelpID = "padmin:MultiListBox:RID_PPDIMPORT_DLG:RID_PPDIMP_LB_DRIVER";
Border = TRUE;
Sort = TRUE;
SimpleMode = TRUE;
@@ -723,6 +753,7 @@ String RID_TXT_PRINTERADDFAILED
ModalDialog RID_ADD_PRINTER_DIALOG
{
+ HelpID = "padmin:ModalDialog:RID_ADD_PRINTER_DIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 240 , 172 ) ;
@@ -752,12 +783,14 @@ ModalDialog RID_ADD_PRINTER_DIALOG
};
PushButton RID_ADDP_BTN_NEXT
{
+ HelpID = "padmin:PushButton:RID_ADD_PRINTER_DIALOG:RID_ADDP_BTN_NEXT";
Pos = MAP_APPFONT( 130, 155 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Next >>";
};
PushButton RID_ADDP_BTN_PREV
{
+ HelpID = "padmin:PushButton:RID_ADD_PRINTER_DIALOG:RID_ADDP_BTN_PREV";
Pos = MAP_APPFONT( 75, 155 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "<< ~Back";
@@ -767,6 +800,7 @@ ModalDialog RID_ADD_PRINTER_DIALOG
TabPage RID_ADDP_PAGE_CHOOSEDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_CHOOSEDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -782,6 +816,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
};
ListBox RID_ADDP_CHDRV_BOX_DRIVER
{
+ HelpID = "padmin:ListBox:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BOX_DRIVER";
Pos = MAP_APPFONT( 5, 15 );
Size = MAP_APPFONT( 175, 100 );
Border = TRUE;
@@ -789,12 +824,14 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
};
PushButton RID_ADDP_CHDRV_BTN_ADD
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BTN_ADD";
Pos = MAP_APPFONT( 185, 15 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Import...";
};
PushButton RID_ADDP_CHDRV_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BTN_REMOVE";
Pos = MAP_APPFONT( 185, 32 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Delete";
@@ -807,6 +844,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
TabPage RID_ADDP_PAGE_CHOOSEDEV
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_CHOOSEDEV";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -822,24 +860,28 @@ TabPage RID_ADDP_PAGE_CHOOSEDEV
};
RadioButton RID_ADDP_CHDEV_BTN_PRINTER
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_PRINTER";
Pos = MAP_APPFONT ( 40, 40 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Add a ~printer";
};
RadioButton RID_ADDP_CHDEV_BTN_FAX
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_FAX";
Pos = MAP_APPFONT ( 40, 50 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Connect a fa~x device";
};
RadioButton RID_ADDP_CHDEV_BTN_PDF
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_PDF";
Pos = MAP_APPFONT ( 40, 60 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Connect a P~DF converter";
};
RadioButton RID_ADDP_CHDEV_BTN_OLD
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_OLD";
Pos = MAP_APPFONT ( 40, 70 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "~Import printers from a StarOffice installation";
@@ -848,6 +890,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDEV
TabPage RID_ADDP_PAGE_NAME
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_NAME";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -875,12 +918,14 @@ TabPage RID_ADDP_PAGE_NAME
};
Edit RID_ADDP_NAME_EDT_NAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_NAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
};
Edit RID_ADDP_NAME_EDT_FAXNAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_FAXNAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
@@ -888,6 +933,7 @@ TabPage RID_ADDP_PAGE_NAME
};
Edit RID_ADDP_NAME_EDT_PDFNAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_PDFNAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
@@ -895,12 +941,14 @@ TabPage RID_ADDP_PAGE_NAME
};
CheckBox RID_ADDP_NAME_BOX_DEFAULT
{
+ HelpID = "padmin:CheckBox:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_BOX_DEFAULT";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160, 12 );
Text [ en-US ] = "~Use as default printer";
};
CheckBox RID_ADDP_NAME_BOX_FAXSWALLOW
{
+ HelpID = "padmin:CheckBox:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_BOX_FAXSWALLOW";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160, 12 );
Text [ en-US ] = "Remo~ve fax number from output";
@@ -909,6 +957,7 @@ TabPage RID_ADDP_PAGE_NAME
TabPage RID_ADDP_PAGE_COMMAND
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_COMMAND";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -925,12 +974,14 @@ TabPage RID_ADDP_PAGE_COMMAND
};
ComboBox RID_ADDP_CMD_BOX_COMMAND
{
+ HelpID = "padmin:ComboBox:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BOX_COMMAND";
Pos = MAP_APPFONT( 10, 30);
Size = MAP_APPFONT( 220, 85 );
Border = TRUE;
};
ComboBox RID_ADDP_CMD_BOX_PDFCOMMAND
{
+ HelpID = "padmin:ComboBox:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BOX_PDFCOMMAND";
Pos = MAP_APPFONT( 10, 30);
Size = MAP_APPFONT( 220, 60 );
Border = TRUE;
@@ -943,18 +994,21 @@ TabPage RID_ADDP_PAGE_COMMAND
};
Edit RID_ADDP_CMD_EDT_PDFDIR
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_EDT_PDFDIR";
Border = TRUE;
Pos = MAP_APPFONT( 10, 104 );
Size = MAP_APPFONT( 190, 12 );
};
PushButton RID_ADDP_CMD_BTN_PDFDIR
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BTN_PDFDIR";
Pos = MAP_APPFONT( 205, 104 );
Size = MAP_APPFONT( 25, 12 );
Text = "~...";
};
PushButton RID_ADDP_CMD_BTN_HELP
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BTN_HELP";
Pos = MAP_APPFONT( 180, 2 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Help";
@@ -971,6 +1025,7 @@ TabPage RID_ADDP_PAGE_COMMAND
TabPage RID_ADDP_PAGE_OLDPRINTERS
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_OLDPRINTERS";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -987,12 +1042,14 @@ TabPage RID_ADDP_PAGE_OLDPRINTERS
};
MultiListBox RID_ADDP_OLD_BOX_PRINTERS
{
+ HelpID = "padmin:MultiListBox:RID_ADDP_PAGE_OLDPRINTERS:RID_ADDP_OLD_BOX_PRINTERS";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 165, 80 );
Border = TRUE;
};
PushButton RID_ADDP_OLD_BTN_SELECTALL
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_OLDPRINTERS:RID_ADDP_OLD_BTN_SELECTALL";
Pos = MAP_APPFONT( 180, 35 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Select All";
@@ -1001,6 +1058,7 @@ TabPage RID_ADDP_PAGE_OLDPRINTERS
TabPage RID_ADDP_PAGE_FAXDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_FAXDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -1017,12 +1075,14 @@ TabPage RID_ADDP_PAGE_FAXDRIVER
};
RadioButton RID_ADDP_FAXDRV_BTN_DEFAULT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_FAXDRIVER:RID_ADDP_FAXDRV_BTN_DEFAULT";
Pos = MAP_APPFONT( 40,40 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "T~he default driver";
};
RadioButton RID_ADDP_FAXDRV_BTN_SELECT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_FAXDRIVER:RID_ADDP_FAXDRV_BTN_SELECT";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160,24 );
Text [ en-US ] = "A speci~fic driver, to adapt the format to another printer";
@@ -1031,6 +1091,7 @@ TabPage RID_ADDP_PAGE_FAXDRIVER
TabPage RID_ADDP_PAGE_PDFDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_PDFDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -1047,18 +1108,21 @@ TabPage RID_ADDP_PAGE_PDFDRIVER
};
RadioButton RID_ADDP_PDFDRV_BTN_DEFAULT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_DEFAULT";
Pos = MAP_APPFONT( 40, 40 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "T~he default driver";
};
RadioButton RID_ADDP_PDFDRV_BTN_DIST
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_DIST";
Pos = MAP_APPFONT( 40,50 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "The Adobe D~istiller(tm) driver";
};
RadioButton RID_ADDP_PDFDRV_BTN_SELECT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_SELECT";
Pos = MAP_APPFONT( 40, 60 );
Size = MAP_APPFONT( 160, 24 );
Text [ en-US ] = "A spec~ific driver, to adapt the format to another printer";
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 17d28515e540..8165b8015403 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -198,6 +198,7 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton )
m_aJobData.m_nColorDepth = m_pDevicePage->getDepth();
m_aJobData.m_nColorDevice = m_pDevicePage->getColorDevice();
m_aJobData.m_nPSLevel = m_pDevicePage->getLevel();
+ m_aJobData.m_nPDFDevice = m_pDevicePage->getPDFDevice();
}
if( m_pOtherPage )
// write other settings
@@ -363,8 +364,8 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
m_aPPDKeyBox( this, PaResId( RID_RTS_DEVICE_PPDKEY_BOX ) ),
m_aPPDValueText( this, PaResId( RID_RTS_DEVICE_PPDVALUE_TXT ) ),
m_aPPDValueBox( this, PaResId( RID_RTS_DEVICE_PPDVALUE_BOX ) ),
- m_aLevelText( this, PaResId( RID_RTS_DEVICE_LEVEL_TXT ) ),
- m_aLevelBox( this, PaResId( RID_RTS_DEVICE_LEVEL_BOX ) ),
+ m_aLevelText( this, PaResId( RID_RTS_DEVICE_PRINTLANG_TXT ) ),
+ m_aLevelBox( this, PaResId( RID_RTS_DEVICE_PRINTLANG_BOX ) ),
m_aSpaceText( this, PaResId( RID_RTS_DEVICE_SPACE_TXT ) ),
m_aSpaceBox( this, PaResId( RID_RTS_DEVICE_SPACE_BOX ) ),
m_aDepthText( this, PaResId( RID_RTS_DEVICE_DEPTH_TXT ) ),
@@ -385,13 +386,19 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
case 1: m_aSpaceBox.SelectEntry( m_aSpaceColor );break;
}
- m_aLevelBox.InsertEntry( m_pParent->m_aFromDriverString );
- m_aLevelBox.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( "1" ) ) );
- m_aLevelBox.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( "2" ) ) );
- if( m_pParent->m_aJobData.m_nPSLevel == 0 )
- m_aLevelBox.SelectEntry( m_pParent->m_aFromDriverString );
+ ULONG nLevelEntryData = 0;
+ if( m_pParent->m_aJobData.m_nPDFDevice > 0 )
+ nLevelEntryData = 10;
else
- m_aLevelBox.SelectEntry( String::CreateFromInt32( m_pParent->m_aJobData.m_nPSLevel ) );
+ nLevelEntryData = m_pParent->m_aJobData.m_nPSLevel+1;
+ for( USHORT i = 0; i < m_aLevelBox.GetEntryCount(); i++ )
+ {
+ if( (ULONG)m_aLevelBox.GetEntryData( i ) == nLevelEntryData )
+ {
+ m_aLevelBox.SelectEntryPos( i );
+ break;
+ }
+ }
m_aDepthBox.SelectEntry( String::CreateFromInt32( m_pParent->m_aJobData.m_nColorDepth ).AppendAscii( " Bit" ) );
@@ -430,6 +437,22 @@ void RTSDevicePage::update()
// ------------------------------------------------------------------
+ULONG RTSDevicePage::getLevel()
+{
+ ULONG nLevel = (ULONG)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() );
+ return nLevel < 10 ? nLevel-1 : 0;
+}
+
+// ------------------------------------------------------------------
+
+ULONG RTSDevicePage::getPDFDevice()
+{
+ ULONG nLevel = (ULONG)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() );
+ return nLevel > 9 ? 1 : 0;
+}
+
+// ------------------------------------------------------------------
+
IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox )
{
if( pBox == &m_aPPDKeyBox )
diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx
index 65288f738482..72e3d81ee8d7 100644
--- a/padmin/source/prtsetup.hxx
+++ b/padmin/source/prtsetup.hxx
@@ -147,7 +147,8 @@ public:
void update();
- ULONG getLevel() { return m_aLevelBox.GetSelectEntry().ToInt32(); }
+ ULONG getLevel();
+ ULONG getPDFDevice();
ULONG getDepth() { return m_aDepthBox.GetSelectEntry().ToInt32(); }
ULONG getColorDevice()
{
diff --git a/padmin/source/rtsetup.hrc b/padmin/source/rtsetup.hrc
index 30439088de8e..7b6677de7ec4 100644
--- a/padmin/source/rtsetup.hrc
+++ b/padmin/source/rtsetup.hrc
@@ -48,13 +48,13 @@
#define RID_RTS_DEVICEPAGE 4003
#define RID_RTS_DEVICE_COLOR_TXT 1
-#define RID_RTS_DEVICE_GRAY_TXT 2
+#define RID_RTS_DEVICE_GRAY_TXT 2
#define RID_RTS_DEVICE_PPDKEY_TXT 3
#define RID_RTS_DEVICE_PPDKEY_BOX 4
-#define RID_RTS_DEVICE_PPDVALUE_TXT 5
-#define RID_RTS_DEVICE_PPDVALUE_BOX 6
-#define RID_RTS_DEVICE_LEVEL_TXT 7
-#define RID_RTS_DEVICE_LEVEL_BOX 8
+#define RID_RTS_DEVICE_PPDVALUE_TXT 5
+#define RID_RTS_DEVICE_PPDVALUE_BOX 6
+#define RID_RTS_DEVICE_PRINTLANG_TXT 7
+#define RID_RTS_DEVICE_PRINTLANG_BOX 8
#define RID_RTS_DEVICE_SPACE_TXT 9
#define RID_RTS_DEVICE_SPACE_BOX 10
#define RID_RTS_DEVICE_DEPTH_TXT 11
diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src
index e04374a72245..38f3bf224a13 100644
--- a/padmin/source/rtsetup.src
+++ b/padmin/source/rtsetup.src
@@ -78,6 +78,7 @@ TabDialog RID_RTS_RTSDIALOG
TabPage RID_RTS_PAPERPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_PAPERPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
FixedText RID_RTS_PAPER_PAPER_TXT
@@ -88,6 +89,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_PAPER_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_PAPER_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 5 );
@@ -101,6 +103,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_ORIENTATION_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_ORIENTATION_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 20 );
@@ -114,6 +117,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_DUPLEX_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_DUPLEX_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 35 );
@@ -127,6 +131,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_SLOT_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_SLOT_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 50 );
@@ -136,6 +141,7 @@ TabPage RID_RTS_PAPERPAGE
TabPage RID_RTS_DEVICEPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_DEVICEPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
@@ -156,6 +162,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_PPDKEY_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_PPDKEY_BOX";
Border = TRUE;
Pos = MAP_APPFONT( 5, 14 );
Size = MAP_APPFONT( 105, 111 );
@@ -168,22 +175,32 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_PPDVALUE_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_PPDVALUE_BOX";
Border = TRUE;
Pos = MAP_APPFONT( 120, 14 );
Size = MAP_APPFONT( 105, 111 );
};
- FixedText RID_RTS_DEVICE_LEVEL_TXT
+ FixedText RID_RTS_DEVICE_PRINTLANG_TXT
{
Pos = MAP_APPFONT( 5, 130 );
Size = MAP_APPFONT( 80, 8 );
- Text [ en-US ] = "PostScript ~Level";
+ Text [ en-US ] = "Printer ~Language type";
};
- ListBox RID_RTS_DEVICE_LEVEL_BOX
+ ListBox RID_RTS_DEVICE_PRINTLANG_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_LEVEL_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 130 );
Size = MAP_APPFONT( 105, 200 );
+ StringList [en-US] =
+ {
+ < "PostScript (Level from driver)" ; 1; > ;
+ < "PostScript Level 1" ; 2; > ;
+ < "PostScript Level 2"; 3; > ;
+ < "PostScript Level 3"; 3; > ;
+ < "PDF"; 10; > ;
+ };
};
FixedText RID_RTS_DEVICE_SPACE_TXT
{
@@ -193,6 +210,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_SPACE_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_SPACE_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 145 );
Size = MAP_APPFONT( 105, 200 );
@@ -205,6 +223,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_DEPTH_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_DEPTH_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 160 );
Size = MAP_APPFONT( 105, 200 );
@@ -218,11 +237,13 @@ TabPage RID_RTS_DEVICEPAGE
TabPage RID_RTS_FONTSUBSTPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_FONTSUBSTPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
CheckBox RID_RTS_FS_ENABLE_BTN
{
+ HelpID = "padmin:CheckBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_ENABLE_BTN";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "~Enable font replacement";
@@ -236,6 +257,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
MultiListBox RID_RTS_FS_SUBST_BOX
{
+ HelpID = "padmin:MultiListBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_SUBST_BOX";
AutoHScroll = TRUE;
Border = TRUE;
Sort = TRUE;
@@ -245,12 +267,14 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
PushButton RID_RTS_FS_ADD_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_ADD_BTN";
Pos = MAP_APPFONT( 5, 125 );
Size = MAP_APPFONT( 107, 12 );
Text [ en-US ] = "~Add";
};
PushButton RID_RTS_FS_REMOVE_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_REMOVE_BTN";
Pos = MAP_APPFONT( 117, 125 );
Size = MAP_APPFONT( 107, 12 );
Text [ en-US ] = "~Remove";
@@ -263,6 +287,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
ComboBox RID_RTS_FS_FROM_BOX
{
+ HelpID = "padmin:ComboBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_FROM_BOX";
Border = TRUE;
DropDown = TRUE;
Sort = TRUE;
@@ -277,6 +302,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
ListBox RID_RTS_FS_TO_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_TO_BOX";
Border = TRUE;
DropDown = TRUE;
Sort = TRUE;
@@ -287,11 +313,13 @@ TabPage RID_RTS_FONTSUBSTPAGE
TabPage RID_RTS_COMMANDPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_COMMANDPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
ComboBox RID_RTS_CMD_CB_COMMANDS
{
+ HelpID = "padmin:ComboBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_CB_COMMANDS";
Border = TRUE ;
Sort = TRUE ;
Dropdown = TRUE;
@@ -300,6 +328,7 @@ TabPage RID_RTS_COMMANDPAGE
};
CheckBox RID_RTS_CMD_CB_EXTERNAL
{
+ HelpID = "padmin:CheckBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_CB_EXTERNAL";
Pos = MAP_APPFONT( 11, 95 );
Size = MAP_APPFONT( 220, 10 );
Text [ en-US ] = "~Use system print dialog, disable %PRODUCTNAME's print dialog";
@@ -313,6 +342,7 @@ TabPage RID_RTS_COMMANDPAGE
};
ComboBox RIT_RTS_CMD_CB_QUICKCMD
{
+ HelpID = "padmin:ComboBox:RID_RTS_COMMANDPAGE:RIT_RTS_CMD_CB_QUICKCMD";
Border = TRUE;
Sort = TRUE;
Dropdown = TRUE;
@@ -340,6 +370,7 @@ TabPage RID_RTS_COMMANDPAGE
ListBox RID_RTS_CMD_LB_CONFIGURE
{
+ HelpID = "padmin:ListBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_LB_CONFIGURE";
DropDown = true;
Border = true;
Pos = MAP_APPFONT( 101, 56 );
@@ -354,6 +385,7 @@ TabPage RID_RTS_COMMANDPAGE
CheckBox RID_RTS_CMD_BOX_SWALLOWFAXNO
{
+ HelpID = "padmin:CheckBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BOX_SWALLOWFAXNO";
Pos = MAP_APPFONT( 11, 146 );
Size = MAP_APPFONT( 130, 8 );
Text [ en-US ] = "~Fax number will be removed from output";
@@ -366,12 +398,14 @@ TabPage RID_RTS_COMMANDPAGE
};
Edit RID_RTS_CMD_EDT_PDFDIR
{
+ HelpID = "padmin:Edit:RID_RTS_COMMANDPAGE:RID_RTS_CMD_EDT_PDFDIR";
Border = TRUE;
Pos = MAP_APPFONT( 11, 155 );
Size = MAP_APPFONT( 130, 12 );
};
PushButton RID_RTS_CMD_BTN_PDFDIR
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_PDFDIR";
Pos = MAP_APPFONT( 146, 155 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
@@ -395,12 +429,14 @@ TabPage RID_RTS_COMMANDPAGE
};
PushButton RID_RTS_CMD_BTN_HELP
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_HELP";
Pos = MAP_APPFONT( 170, 55 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Help";
};
PushButton RID_RTS_CMD_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_REMOVE";
Pos = MAP_APPFONT( 170, 72 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Remove";
@@ -421,6 +457,7 @@ TabPage RID_RTS_COMMANDPAGE
TabPage RID_RTS_OTHERPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_OTHERPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
@@ -432,6 +469,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_LEFTMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_LEFTMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 5 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -448,6 +486,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_TOPMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_TOPMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 20 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -464,6 +503,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_RIGHTMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_RIGHTMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 35 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -480,6 +520,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_BOTTOMMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_BOTTOMMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 50 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -496,12 +537,14 @@ TabPage RID_RTS_OTHERPAGE
};
Edit RID_RTS_OTHER_COMMENT_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_OTHERPAGE:RID_RTS_OTHER_COMMENT_EDT";
Border = TRUE ;
Pos = MAP_APPFONT ( 5 , 75 ) ;
Size = MAP_APPFONT ( 220 , 12 ) ;
};
PushButton RID_RTS_OTHER_DEFAULT_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_OTHERPAGE:RID_RTS_OTHER_DEFAULT_BTN";
Pos = MAP_APPFONT( 175, 5 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Default";
@@ -515,6 +558,7 @@ String RID_TXT_QUERYFAXNUMBER
ModalDialog RID_RTS_PWDIALOG
{
+ HelpID = "padmin:ModalDialog:RID_RTS_PWDIALOG";
Text [ en-US ] = "Authentication request";
OutputSize = TRUE ;
SVLook = TRUE ;
@@ -537,6 +581,7 @@ ModalDialog RID_RTS_PWDIALOG
};
Edit RID_RTS_PWDIALOG_USER_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_PWDIALOG:RID_RTS_PWDIALOG_USER_EDT";
Pos = MAP_APPFONT( 70, 29 );
Size = MAP_APPFONT( 75, 12 );
Border = TRUE;
@@ -549,6 +594,7 @@ ModalDialog RID_RTS_PWDIALOG
};
Edit RID_RTS_PWDIALOG_PASS_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_PWDIALOG:RID_RTS_PWDIALOG_PASS_EDT";
Pos = MAP_APPFONT( 70, 44 );
Size = MAP_APPFONT( 75, 12 );
Border = TRUE;
diff --git a/padmin/source/spadmin.sh b/padmin/source/spadmin.sh
index 31ab4382fe52..c831ab7f0919 100644
--- a/padmin/source/spadmin.sh
+++ b/padmin/source/spadmin.sh
@@ -57,7 +57,7 @@ if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
"-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
if [ -n "$my_path" ] ; then
- LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
+ LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
fi
fi
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 1d5af35de9ff..51461cf356d6 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -285,6 +285,7 @@ public:
RscRange a0to9999Short;
RscIdRange aIdLong;
RscString aString;
+ RscString aStringLiteral;
RscFlag aWinBits;
RscLangEnum aLangType;
RscLangArray aLangString;
diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index 19677171dcb2..d4084f2bc239 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -162,9 +162,11 @@ typedef sal_Int64 WinBits;
// - Help-Types -
// --------------
+#if 0
// from vcl/inc/help.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
+#define OOO_HELP_INDEX ".help:index"
+#define OOO_HELP_HELPONHELP ".help:helponhelp"
+#endif
// --------------
// - FieldTypes -
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 97d23d4e3b53..05f7210fd357 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -81,6 +81,7 @@ RscTypCont :: RscTypCont( RscError * pErrHdl,
a0to9999Short( pHS->getID( "YearShort" ), RSC_NOTYPE ),
aIdLong( pHS->getID( "IDLONG" ), RSC_NOTYPE ),
aString( pHS->getID( "Chars" ), RSC_NOTYPE ),
+ aStringLiteral( pHS->getID( "Chars" ), RSC_NOTYPE ),
aWinBits( pHS->getID( "WinBits" ), RSC_NOTYPE ),
aLangType(),
aLangString( pHS->getID( "Lang_Chars" ), RSC_NOTYPE, &aString, &aLangType ),
@@ -125,7 +126,7 @@ static sal_uInt32 getLangIdAndShortenLocale( RscTypCont* pTypCont,
else
rLang = rtl::OString();
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, " %s (0x%hx)", aL.getStr(), nRet );
+ fprintf( stderr, " %s (0x%hx)", aL.getStr(), (int)nRet );
#endif
return nRet;
}
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 625417769f45..1942711a4a47 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -297,7 +297,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
InsWinBit( pClassWindow, "DialogControl", nTabControlId );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassWindow->SetVariable( nId, &aIdLong );
+ pClassWindow->SetVariable( nId, &aStringLiteral, NULL, 0, WINDOW_HELPID );
nRsc_XYMAPMODEId = nId = aNmTb.Put( "_XYMapMode", VARNAME );
@@ -325,7 +325,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
nId = aNmTb.Put( "ExtraLong", VARNAME );
pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_EXTRALONG );
nId = aNmTb.Put( "UniqueId", VARNAME );
- pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_UNIQUEID );
+ pClassWindow->SetVariable( nId, &aString, NULL, 0, WINDOW_UNIQUEID );
// BorderStyle
RscEnum* pBorderStyleEnum = new RscEnum( pHS->getID( "WindowBorderStyle" ), RSC_NOTYPE );
@@ -1201,7 +1201,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper,
pClassMenuItem->SetVariable( nId, &aLangString, NULL, 0,
RSC_MENUITEM_HELPTEXT );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassMenuItem->SetVariable( nId, &aIdLong, NULL, 0,
+ pClassMenuItem->SetVariable( nId, &aStringLiteral, NULL, 0,
RSC_MENUITEM_HELPID );
nId = aNmTb.Put( "AccelKey", VARNAME );
pClassMenuItem->SetVariable( nId, pClassKeyCode, NULL, 0,
@@ -1276,7 +1276,7 @@ RscTop * RscTypCont::InitClassMessBox( RscTop * pSuper,
nId = aNmTb.Put( "DefButton", VARNAME );
pClassMessBox->SetVariable( nId, pMessDefButton );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassMessBox->SetVariable( nId, &aIdLong );
+ pClassMessBox->SetVariable( nId, &aStringLiteral );
nId = aNmTb.Put( "SysModal", VARNAME );
pClassMessBox->SetVariable( nId, &aBool );
nId = aNmTb.Put( "Title", VARNAME );
@@ -2015,7 +2015,7 @@ RscTop * RscTypCont::InitClassToolBoxItem( RscTop * pSuper,
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
}
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aIdLong, NULL, 0,
+ pClassToolBoxItem->SetVariable( nId, &aStringLiteral, NULL, 0,
RSC_TOOLBOXITEM_HELPID );
nId = aNmTb.Put( "Text", VARNAME );
pClassToolBoxItem->SetVariable( nId, &aLangString, NULL, 0,
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index a763b92f0bb1..54a56a3840d2 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -210,9 +210,11 @@ void RscTypCont::Init()
aNmTb.Put( "TRUE", BOOLEAN, (long)TRUE );
aNmTb.Put( "FALSE", BOOLEAN, (long)FALSE );
+ #if 0
/* Vordefinierte HilfeId's */
aNmTb.Put( "HELP_INDEX", NUMBER, OOO_HELP_INDEX );
aNmTb.Put( "HELP_HELPONHELP", NUMBER, OOO_HELP_HELPONHELP );
+ #endif
aNmTb.Put( "XSCALE", XSCALE , (long)0 );
aNmTb.Put( "YSCALE", YSCALE , (long)0 );
diff --git a/svl/inc/pickerhelper.hxx b/svl/inc/pickerhelper.hxx
deleted file mode 100644
index 307031b578d1..000000000000
--- a/svl/inc/pickerhelper.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _PICKERHELPER_HXX
-#define _PICKERHELPER_HXX
-
-#include "svl/svldllapi.h"
-#include "sal/types.h"
-#include "com/sun/star/uno/Reference.hxx"
-
-namespace com
-{
- namespace sun
- {
- namespace star
- {
- namespace ui
- {
- namespace dialogs
- {
- class XFilePicker;
- class XFolderPicker;
- }
- }
- }
- }
-}
-
-
-namespace svt
-{
-
- SVL_DLLPUBLIC void SetDialogHelpId(
- ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > _mxFileDlg,
- sal_Int32 _nHelpId );
-
- SVL_DLLPUBLIC void SetDialogHelpId(
- ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFolderPicker > _mxFileDlg,
- sal_Int32 _nHelpId );
-
-}
-
-//-----------------------------------------------------------------------------
-
-#endif
diff --git a/svl/source/filepicker/makefile.mk b/svl/source/filepicker/makefile.mk
index a4c97ea41aa1..b3c2a829cf54 100644
--- a/svl/source/filepicker/makefile.mk
+++ b/svl/source/filepicker/makefile.mk
@@ -38,7 +38,6 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------------
SLOFILES =\
- $(SLO)$/pickerhelper.obj \
$(SLO)$/pickerhistory.obj
# --- Targets -------------------------------------------------------
diff --git a/svl/source/filepicker/pickerhelper.cxx b/svl/source/filepicker/pickerhelper.cxx
deleted file mode 100644
index 72096c1bc56a..000000000000
--- a/svl/source/filepicker/pickerhelper.cxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svl.hxx"
-
-#include "pickerhelper.hxx"
-#include "rtl/ustring.hxx"
-#include "com/sun/star/ui/dialogs/XFilePicker.hpp"
-#include "com/sun/star/ui/dialogs/XFolderPicker.hpp"
-#include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/beans/XPropertySetInfo.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "tools/debug.hxx"
-
-namespace css = com::sun::star;
-
-using css::uno::Reference;
-using rtl::OUString;
-
-namespace svt
-{
- void SetDialogHelpId(
- Reference < css::ui::dialogs::XFilePicker > _mxFileDlg, sal_Int32 _nHelpId )
- {
- try
- {
- // does the dialog haver a help URL property?
- Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY );
- Reference< css::beans::XPropertySetInfo > xInfo;
- if( xDialogProps.is() )
- xInfo = xDialogProps->getPropertySetInfo( );
-
- const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) );
-
- if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) )
- { // yep
- OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- sId += OUString::valueOf( _nHelpId );
- xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) );
- }
- }
- catch( const css::uno::Exception& )
- {
- DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" );
- }
- }
-
- void SetDialogHelpId(
- Reference< css::ui::dialogs::XFolderPicker > _mxFileDlg, sal_Int32 _nHelpId )
- {
- try
- {
- // does the dialog haver a help URL property?
- Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY );
- Reference< css::beans::XPropertySetInfo > xInfo;
- if( xDialogProps.is() )
- xInfo = xDialogProps->getPropertySetInfo( );
-
- const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) );
-
- if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) )
- { // yep
- OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- sId += OUString::valueOf( _nHelpId );
- xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) );
- }
- }
- catch( const css::uno::Exception& )
- {
- DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" );
- }
- }
-}
-
diff --git a/svtools/bmpmaker/bmp.src b/svtools/bmpmaker/bmp.src
index 7431d2e335a4..30ff9488a805 100644
--- a/svtools/bmpmaker/bmp.src
+++ b/svtools/bmpmaker/bmp.src
@@ -27,6 +27,7 @@
#include "bmp.hrc"
ModalDialog DLG_PATH {
+ HelpID = "svtools:ModalDialog:DLG_PATH";
OutputSize = TRUE;
SVLook = TRUE;
Size = MAP_APPFONT( 301, 104 );
@@ -54,36 +55,42 @@ ModalDialog DLG_PATH {
Text = "Bitmap-Pfad:";
};
Edit EDT_SRS {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_SRS";
Border = TRUE;
Pos = MAP_APPFONT( 65, 14 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
Edit EDT_RES {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_RES";
Border = TRUE;
Pos = MAP_APPFONT( 65, 29 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
Edit EDT_OUT {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_OUT";
Border = TRUE;
Pos = MAP_APPFONT( 65, 44 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
PushButton BTN_SRS {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_SRS";
Pos = MAP_APPFONT( 228, 14 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
TabStop = TRUE;
};
PushButton BTN_RES {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_RES";
Pos = MAP_APPFONT( 228, 29 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
TabStop = TRUE;
};
PushButton BTN_OUT {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_OUT";
Pos = MAP_APPFONT( 228, 44 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
@@ -106,6 +113,7 @@ ModalDialog DLG_PATH {
Text = "Sprache";
};
ListBox LB_LANG {
+ HelpID = "svtools:ListBox:DLG_PATH:LB_LANG";
Border = TRUE;
Pos = MAP_APPFONT( 12, 76 );
Size = MAP_APPFONT( 231, 70 );
diff --git a/svtools/inc/fileview.hxx b/svtools/inc/fileview.hxx
index 74476541dcd8..db704a0e6784 100644
--- a/svtools/inc/fileview.hxx
+++ b/svtools/inc/fileview.hxx
@@ -104,8 +104,8 @@ public:
sal_Bool GetParentURL( String& _rParentURL ) const;
sal_Bool CreateNewFolder( const String& rNewFolder );
- void SetHelpId( sal_uInt32 nHelpId );
- sal_uInt32 GetHelpId( ) const;
+ void SetHelpId( const rtl::OString& rHelpId );
+ const rtl::OString& GetHelpId( ) const;
void SetSizePixel( const Size& rNewSize );
using Window::SetPosSizePixel;
virtual void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
diff --git a/svtools/inc/svtools/filter.hxx b/svtools/inc/svtools/filter.hxx
index 49ec77adfea5..8c6f014d4219 100644
--- a/svtools/inc/svtools/filter.hxx
+++ b/svtools/inc/svtools/filter.hxx
@@ -134,16 +134,6 @@ class Graphic;
#define GFF_EMF ( (USHORT)0x00f8 )
#define GFF_XXX ( (USHORT)0xffff )
-// ---------------
-// - RequestInfo -
-// ---------------
-
-struct RequestInfo
-{
- BYTE* pBuffer;
- ULONG nRealBufferSize;
-};
-
// ---------------------
// - GraphicDescriptor -
// ---------------------
@@ -151,29 +141,18 @@ struct RequestInfo
class SVT_DLLPUBLIC GraphicDescriptor
{
SvStream* pFileStm;
- Link aReqLink;
+
String aPathExt;
Size aPixSize;
Size aLogSize;
- SvStream* pMemStm;
- SvStream* pBaseStm;
- ULONG nStmPos;
USHORT nBitsPerPixel;
USHORT nPlanes;
USHORT nFormat;
BOOL bCompressed;
- BOOL bDataReady;
- BOOL bLinked;
- BOOL bLinkChanged;
- BOOL bWideSearch;
- BOOL bBaseStm;
- long nExtra1;
- long nExtra2;
+ BOOL bOwnStream;
void ImpConstruct();
-//#if 0 // _SOLAR__PRIVATE
-
BOOL ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo );
BOOL ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo );
BOOL ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo );
@@ -199,27 +178,11 @@ class SVT_DLLPUBLIC GraphicDescriptor
BOOL ImpDetectSGV( SvStream& rStm, BOOL bExtendedInfo );
BOOL ImpDetectEMF( SvStream& rStm, BOOL bExtendedInfo );
-//#endif
-
GraphicDescriptor( const GraphicDescriptor& );
GraphicDescriptor& operator=( const GraphicDescriptor& );
-protected:
-
- BOOL IsDataReady() const;
- BOOL IsWideSearch() const;
- SvStream& GetSearchStream() const;
- const String& GetPathExtension() const;
-
public:
- // Default-Ctor, um anschliessend einen Link zu setzen, mit dem
- // die Daten vom Aufrufer im ::Detect() angefordert werden.
- // da einige Formate ( Mtf's ) keinen eindeutigen Header besitzen,
- // ist es sinnvoll den vollen Filenamen (inkl. Ext. ) mitanzugeben,
- // da so das Format ueber die Extension ermittelt werden kann
- GraphicDescriptor( const String* pPath = NULL );
-
// Ctor, um einen Filenamen zu setzen. Es muss ::Detect() gerufen werden,
// um das File zu identifizieren;
// wenn das File keinen eindeutigen Header besitzt ( Mtf's ) wird das
@@ -261,21 +224,6 @@ public:
// zeigt an, ob das Bild evtl. komprimiert (wie auch immer) ist
BOOL IsCompressed() const { return bCompressed; }
- // setzt den LinkHdl zum Setzen der Bytes;
- // der Handler muss einen Pointer auf die RequestInfo-Struktur
- // zurueckgeben; die Anzahl der minimal zur Verfuegung zu stellenden
- // Daten muss im Handler ueber ::GetRequestedByteCount() erfragt werden;
- // die tatsaechlich zur Verfuegung gestellte BYTE-Anzahl
- // wird in der RequestInfo-Struktur gesetzt
- void SetRequestHdl( const Link& rRequestHdl );
-
- // gibt den LinkHdl zum Setzen der Bytes zurueck
- const Link& GetRequestHdl() const { return aReqLink; }
-
- // muss im ReqHdl gerufen werden, um zu erfahren, wieviele
- // Bytes _mindestens_ bereitgestellt werden muessen
- ULONG GetRequestedByteCount() const;
-
// gibt die Filternummer des Filters zurueck,
// der im GraphicFilter zum Lesen dieses Formats
// benoetigt wird
diff --git a/svtools/inc/svtools/headbar.hxx b/svtools/inc/svtools/headbar.hxx
index 1ef7687cfb1d..c225a95d1f55 100644
--- a/svtools/inc/svtools/headbar.hxx
+++ b/svtools/inc/svtools/headbar.hxx
@@ -360,15 +360,15 @@ public:
void SetHelpText( USHORT nItemId, const XubString& rText );
XubString GetHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& nHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
Size CalcWindowSizePixel() const;
inline void SetHelpText( const String& rText ) { Window::SetHelpText( rText ); }
inline const String& GetHelpText() const { return Window::GetHelpText(); }
- inline void SetHelpId( ULONG nId ) { Window::SetHelpId( nId ); }
- inline ULONG GetHelpId() const { return Window::GetHelpId(); }
+ inline void SetHelpId( const rtl::OString& rId ) { Window::SetHelpId( rId ); }
+ inline const rtl::OString& GetHelpId() const { return Window::GetHelpId(); }
inline void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
inline const Link& GetStartDragHdl() const { return maStartDragHdl; }
diff --git a/svtools/inc/svtools/helpid.hrc b/svtools/inc/svtools/helpid.hrc
index 1ffb7a99fb32..ecf8ba4b1bf7 100644
--- a/svtools/inc/svtools/helpid.hrc
+++ b/svtools/inc/svtools/helpid.hrc
@@ -28,90 +28,103 @@
#ifndef _SVT_HELPID_HRC
#define _SVT_HELPID_HRC
-// include ---------------------------------------------------------------
-
-#include <svl/solar.hrc>
-
-// Help-Ids --------------------------------------------------------------
-
-#define HID_FILEDLG_OPENDLG (HID_SVTOOLS_START + 0)
-#define HID_FILEDLG_PATHDLG (HID_SVTOOLS_START + 1)
-#define HID_FILEDLG_DIR (HID_SVTOOLS_START + 2)
-#define HID_FILEDLG_EDIT (HID_SVTOOLS_START + 3)
-#define HID_FILEDLG_DIRS (HID_SVTOOLS_START + 4)
-#define HID_FILEDLG_DRIVE (HID_SVTOOLS_START + 5)
-#define HID_FILEDLG_DRIVES (HID_SVTOOLS_START + 6)
-#define HID_FILEDLG_NEWDIR (HID_SVTOOLS_START + 7)
-#define HID_FILEDLG_HOME (HID_SVTOOLS_START + 8)
-#define HID_FILEDLG_FILE (HID_SVTOOLS_START + 9)
-#define HID_FILEDLG_FILES (HID_SVTOOLS_START + 10)
-#define HID_FILEDLG_PATH (HID_SVTOOLS_START + 11)
-#define HID_FILEDLG_TYPE (HID_SVTOOLS_START + 12)
-#define HID_FILEDLG_TYPES (HID_SVTOOLS_START + 13)
+#define HID_FILEDLG_OPENDLG "SVT_HID_FILEDLG_OPENDLG"
+#define HID_FILEDLG_PATHDLG "SVT_HID_FILEDLG_PATHDLG"
+#define HID_FILEDLG_DIR "SVT_HID_FILEDLG_DIR"
+#define HID_FILEDLG_EDIT "SVT_HID_FILEDLG_EDIT"
+#define HID_FILEDLG_DIRS "SVT_HID_FILEDLG_DIRS"
+#define HID_FILEDLG_DRIVE "SVT_HID_FILEDLG_DRIVE"
+#define HID_FILEDLG_DRIVES "SVT_HID_FILEDLG_DRIVES"
+#define HID_FILEDLG_NEWDIR "SVT_HID_FILEDLG_NEWDIR"
+#define HID_FILEDLG_HOME "SVT_HID_FILEDLG_HOME"
+#define HID_FILEDLG_FILE "SVT_HID_FILEDLG_FILE"
+#define HID_FILEDLG_FILES "SVT_HID_FILEDLG_FILES"
+#define HID_FILEDLG_PATH "SVT_HID_FILEDLG_PATH"
+#define HID_FILEDLG_TYPE "SVT_HID_FILEDLG_TYPE"
+#define HID_FILEDLG_TYPES "SVT_HID_FILEDLG_TYPES"
+#define HID_FILEDLG_LINK_CB "SVT_HID_FILEDLG_LINK_CB"
+#define HID_FILEDLG_PREVIEW_CB "SVT_HID_FILEDLG_PREVIEW_CB"
+#define HID_FILEDLG_STANDARD "SVT_HID_FILEDLG_STANDARD"
+#define HID_FILEDLG_MANAGER "SVT_HID_FILEDLG_MANAGER"
+#define HID_FILEDLG_URL "SVT_HID_FILEDLG_URL"
+#define HID_FILEDLG_USE_PASSWD "SVT_HID_FILEDLG_USE_PASSWD"
+#define HID_FILEDLG_READ_ONLY "SVT_HID_FILEDLG_READ_ONLY"
+#define HID_FILEDLG_AUTOCOMPLETEBOX "SVT_HID_FILEDLG_AUTOCOMPLETEBOX"
+#define HID_FILEDLG_SAVE_BTN "SVT_HID_FILEDLG_SAVE_BTN"
+#define HID_FILEDLG_SAVE_FILENAME "SVT_HID_FILEDLG_SAVE_FILENAME"
+#define HID_FILEDLG_SAVE_FILETYPE "SVT_HID_FILEDLG_SAVE_FILETYPE"
+#define HID_FILEDLG_INSERT_BTN "SVT_HID_FILEDLG_INSERT_BTN"
+#define HID_FILEDLG_PATH_BTN "SVT_HID_FILEDLG_PATH_BTN"
+#define HID_FILEDLG_PATH_FILENAME "SVT_HID_FILEDLG_PATH_FILENAME"
+#define HID_FILEDLG_FOLDER_BTN "SVT_HID_FILEDLG_FOLDER_BTN"
+#define HID_FILEDLG_FOLDER_FILENAME "SVT_HID_FILEDLG_FOLDER_FILENAME"
+#define HID_FILEDLG_SRCHFOLDER_BTN "SVT_HID_FILEDLG_SRCHFOLDER_BTN"
+#define HID_FILEDLG_EDIT_FAVORITES "SVT_HID_FILEDLG_EDIT_FAVORITES"
+#define HID_FILEDLG_NEW_FAVORITE "SVT_HID_FILEDLG_NEW_FAVORITE"
+#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX "SVT_HID_FILEDLG_EDIT_FAVORITES_LISTBOX"
+#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR "SVT_HID_FILEDLG_EDIT_FAVORITES_HEADERBAR"
+#define HID_FILEDLG_EXPORTASPDF "SVT_HID_FILEDLG_EXPORTASPDF"
// HelpID's fuer die Textkomponente
-#define HID_TEXTCPNT_OPEN_LINK (HID_SVTOOLS_START + 14)
-#define HID_TEXTCPNT_OPEN_LINK_NEW (HID_SVTOOLS_START + 15)
-#define HID_TEXTCPNT_DOWNLOAD (HID_SVTOOLS_START + 16)
-#define HID_TEXTCPNT_ADD_BOOKMARK (HID_SVTOOLS_START + 17)
-#define HID_TEXTCPNT_COPY_LINK (HID_SVTOOLS_START + 18)
+#define HID_TEXTCPNT_OPEN_LINK "SVT_HID_TEXTCPNT_OPEN_LINK"
+#define HID_TEXTCPNT_OPEN_LINK_NEW "SVT_HID_TEXTCPNT_OPEN_LINK_NEW"
+#define HID_TEXTCPNT_DOWNLOAD "SVT_HID_TEXTCPNT_DOWNLOAD"
+#define HID_TEXTCPNT_ADD_BOOKMARK "SVT_HID_TEXTCPNT_ADD_BOOKMARK"
+#define HID_TEXTCPNT_COPY_LINK "SVT_HID_TEXTCPNT_COPY_LINK"
// HelpID's fuer RegisterDialog
-#define HID_LIMITED_DIALOG (HID_SVTOOLS_START + 20)
+#define HID_LIMITED_DIALOG "SVT_HID_LIMITED_DIALOG"
// Help ids of template dialog
-#define HID_TEMPLATEDLG_DIALOG (HID_SVTOOLS_START + 21)
-#define HID_TEMPLATEDLG_ICONCTRL (HID_SVTOOLS_START + 22)
-#define HID_TEMPLATEDLG_FILEVIEW (HID_SVTOOLS_START + 23)
-#define HID_TEMPLATEDLG_TB_BACK (HID_SVTOOLS_START + 24)
-#define HID_TEMPLATEDLG_TB_PREV (HID_SVTOOLS_START + 25)
-#define HID_TEMPLATEDLG_TB_PRINT (HID_SVTOOLS_START + 26)
-#define HID_TEMPLATEDLG_TB_DOCINFO (HID_SVTOOLS_START + 27)
-#define HID_TEMPLATEDLG_TB_PREVIEW (HID_SVTOOLS_START + 28)
+#define HID_TEMPLATEDLG_DIALOG "SVT_HID_TEMPLATEDLG_DIALOG"
+#define HID_TEMPLATEDLG_ICONCTRL "SVT_HID_TEMPLATEDLG_ICONCTRL"
+#define HID_TEMPLATEDLG_FILEVIEW "SVT_HID_TEMPLATEDLG_FILEVIEW"
+#define HID_TEMPLATEDLG_TB_BACK "SVT_HID_TEMPLATEDLG_TB_BACK"
+#define HID_TEMPLATEDLG_TB_PREV "SVT_HID_TEMPLATEDLG_TB_PREV"
+#define HID_TEMPLATEDLG_TB_PRINT "SVT_HID_TEMPLATEDLG_TB_PRINT"
+#define HID_TEMPLATEDLG_TB_DOCINFO "SVT_HID_TEMPLATEDLG_TB_DOCINFO"
+#define HID_TEMPLATEDLG_TB_PREVIEW "SVT_HID_TEMPLATEDLG_TB_PREVIEW"
-#define HID_ADDRTEMPL_FIELD_ASSIGNMENT (HID_SVTOOLS_START + 29)
+#define HID_ADDRTEMPL_FIELD_ASSIGNMENT "SVT_HID_ADDRTEMPL_FIELD_ASSIGNMENT"
// Help ids for the filepicker dialogs
-#define HID_EXPLORERDLG_FILE (HID_SVTOOLS_START + 30)
+#define HID_EXPLORERDLG_FILE "SVT_HID_EXPLORERDLG_FILE"
// help ids for fileview contextmenu
-#define HID_FILEVIEW_MENU_DELETE (HID_SVTOOLS_START + 31)
-#define HID_FILEVIEW_MENU_RENAME (HID_SVTOOLS_START + 32)
+#define HID_FILEVIEW_MENU_DELETE "SVT_HID_FILEVIEW_MENU_DELETE"
+#define HID_FILEVIEW_MENU_RENAME "SVT_HID_FILEVIEW_MENU_RENAME"
// help ids for the different modi of the file picker dialog
// FREE
-#define HID_FILESAVE_LEVELUP (HID_SVTOOLS_START + 34)
-#define HID_FILESAVE_CREATEDIRECTORY (HID_SVTOOLS_START + 35)
-#define HID_FILESAVE_DEFAULTDIRECTORY (HID_SVTOOLS_START + 36)
-#define HID_FILESAVE_FILEVIEW (HID_SVTOOLS_START + 37)
-#define HID_FILESAVE_TEMPLATE (HID_SVTOOLS_START + 38)
-#define HID_FILESAVE_FILEURL (HID_SVTOOLS_START + 39)
-#define HID_FILESAVE_FILETYPE (HID_SVTOOLS_START + 40)
-#define HID_FILESAVE_DOSAVE (HID_SVTOOLS_START + 41)
-#define HID_FILESAVE_AUTOEXTENSION (HID_SVTOOLS_START + 42)
-#define HID_FILESAVE_SAVEWITHPASSWORD (HID_SVTOOLS_START + 43)
-#define HID_FILESAVE_CUSTOMIZEFILTER (HID_SVTOOLS_START + 44)
-#define HID_FILESAVE_SELECTION (HID_SVTOOLS_START + 45)
-#define HID_FILESAVE_DIALOG (HID_SVTOOLS_START + 46)
-#define HID_FILESAVE_DOPLAY (HID_SVTOOLS_START + 47)
-
-#define HID_FILEOPEN_READONLY (HID_SVTOOLS_START + 48)
-#define HID_FILEOPEN_VERSION (HID_SVTOOLS_START + 49)
-#define HID_FILEOPEN_IMAGE_TEMPLATE (HID_SVTOOLS_START + 50)
-
-#define HID_FILEDLG_LINK_CB (HID_SFX_START + 276)
-#define HID_FILEDLG_PREVIEW_CB (HID_SFX_START + 277)
+#define HID_FILESAVE_LEVELUP "SVT_HID_FILESAVE_LEVELUP"
+#define HID_FILESAVE_CREATEDIRECTORY "SVT_HID_FILESAVE_CREATEDIRECTORY"
+#define HID_FILESAVE_DEFAULTDIRECTORY "SVT_HID_FILESAVE_DEFAULTDIRECTORY"
+#define HID_FILESAVE_FILEVIEW "SVT_HID_FILESAVE_FILEVIEW"
+#define HID_FILESAVE_TEMPLATE "SVT_HID_FILESAVE_TEMPLATE"
+#define HID_FILESAVE_FILEURL "SVT_HID_FILESAVE_FILEURL"
+#define HID_FILESAVE_FILETYPE "SVT_HID_FILESAVE_FILETYPE"
+#define HID_FILESAVE_DOSAVE "SVT_HID_FILESAVE_DOSAVE"
+#define HID_FILESAVE_AUTOEXTENSION "SVT_HID_FILESAVE_AUTOEXTENSION"
+#define HID_FILESAVE_SAVEWITHPASSWORD "SVT_HID_FILESAVE_SAVEWITHPASSWORD"
+#define HID_FILESAVE_CUSTOMIZEFILTER "SVT_HID_FILESAVE_CUSTOMIZEFILTER"
+#define HID_FILESAVE_SELECTION "SVT_HID_FILESAVE_SELECTION"
+#define HID_FILESAVE_DIALOG "SVT_HID_FILESAVE_DIALOG"
+#define HID_FILESAVE_DOPLAY "SVT_HID_FILESAVE_DOPLAY"
+
+#define HID_FILEOPEN_READONLY "SVT_HID_FILEOPEN_READONLY"
+#define HID_FILEOPEN_VERSION "SVT_HID_FILEOPEN_VERSION"
+#define HID_FILEOPEN_IMAGE_TEMPLATE "SVT_HID_FILEOPEN_IMAGE_TEMPLATE"
// uniqueid for the helpagent window (testtool)
-#define HID_HELPAGENT_WINDOW (HID_SVTOOLS_START + 51)
+#define HID_HELPAGENT_WINDOW "SVT_HID_HELPAGENT_WINDOW"
// registration dialog
-#define HID_REGISTRATION_DIALOG (HID_SVTOOLS_START + 52)
+#define HID_REGISTRATION_DIALOG "SVT_HID_REGISTRATION_DIALOG"
-#define HID_PRINTDIALOG_TOFILE (HID_SVTOOLS_START + 53)
+#define HID_PRINTDIALOG_TOFILE "SVT_HID_PRINTDIALOG_TOFILE"
-#define HID_WIZARD_NEXT (HID_SVTOOLS_START + 54)
-#define HID_WIZARD_PREVIOUS (HID_SVTOOLS_START + 55)
+#define HID_WIZARD_NEXT "SVT_HID_WIZARD_NEXT"
+#define HID_WIZARD_PREVIOUS "SVT_HID_WIZARD_PREVIOUS"
#endif
diff --git a/svtools/inc/svtools/roadmapwizard.hxx b/svtools/inc/svtools/roadmapwizard.hxx
index 5d8e0d9b01bb..25d983c85a90 100644
--- a/svtools/inc/svtools/roadmapwizard.hxx
+++ b/svtools/inc/svtools/roadmapwizard.hxx
@@ -90,8 +90,8 @@ namespace svt
void SetRoadmapBitmap( const BitmapEx& _rBitmap );
const BitmapEx& GetRoadmapBitmap( ) const;
- void SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode = SMART_SET_SMART );
- SmartId GetRoadmapSmartHelpId() const;
+ void SetRoadmapHelpId( const rtl::OString& _rId );
+ const rtl::OString& GetRoadmapHelpId() const;
void SetRoadmapInteractive( sal_Bool _bInteractive );
sal_Bool IsRoadmapInteractive();
diff --git a/svtools/inc/svtools/svtdata.hxx b/svtools/inc/svtools/svtdata.hxx
index 1501afbb6157..eb5c5dad1b75 100644
--- a/svtools/inc/svtools/svtdata.hxx
+++ b/svtools/inc/svtools/svtdata.hxx
@@ -56,7 +56,6 @@ public:
};
//============================================================================
-
class SvtResId: public ResId
{
public:
diff --git a/svtools/inc/svtools/toolpanel/toolpanel.hxx b/svtools/inc/svtools/toolpanel/toolpanel.hxx
index 432dea64e8b5..d38d8e7d257d 100644
--- a/svtools/inc/svtools/toolpanel/toolpanel.hxx
+++ b/svtools/inc/svtools/toolpanel/toolpanel.hxx
@@ -32,7 +32,6 @@
#include <rtl/ustring.hxx>
#include <vcl/image.hxx>
-#include <vcl/smartid.hxx>
#include <boost/noncopyable.hpp>
@@ -62,7 +61,7 @@ namespace svt
virtual Image GetImage() const = 0;
/// retrieves the help ID associated with the panel, if any.
- virtual SmartId GetHelpID() const = 0;
+ virtual rtl::OString GetHelpID() const = 0;
/** activates the panel
diff --git a/svtools/inc/tabbar.hxx b/svtools/inc/tabbar.hxx
index e036f4c2f045..2757811ba34e 100644
--- a/svtools/inc/tabbar.hxx
+++ b/svtools/inc/tabbar.hxx
@@ -516,8 +516,8 @@ public:
XubString GetPageText( USHORT nPageId ) const;
void SetHelpText( USHORT nPageId, const XubString& rText );
XubString GetHelpText( USHORT nPageId ) const;
- void SetHelpId( USHORT nPageId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nPageId ) const;
+ void SetHelpId( USHORT nPageId, const rtl::OString& nHelpId );
+ rtl::OString GetHelpId( USHORT nPageId ) const;
long GetSplitSize() const { return mnSplitSize; }
long GetMinSize() const;
@@ -526,9 +526,9 @@ public:
{ Window::SetHelpText( rText ); }
XubString GetHelpText() const
{ return Window::GetHelpText(); };
- void SetHelpId( ULONG nId )
- { Window::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Window::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Window::GetHelpId(); }
void SetStyle( WinBits nStyle );
diff --git a/svtools/inc/taskbar.hxx b/svtools/inc/taskbar.hxx
index 46853fa07c03..d4a6699e2d5e 100644
--- a/svtools/inc/taskbar.hxx
+++ b/svtools/inc/taskbar.hxx
@@ -268,7 +268,7 @@ private:
Image maImage;
XubString maQuickHelpText;
XubString maHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
USHORT mnFlags;
public:
@@ -289,8 +289,8 @@ public:
const XubString& GetQuickHelpText() const { return maQuickHelpText; }
void SetHelpText( const XubString& rStr ) { maHelpText = rStr; }
const XubString& GetHelpText() const { return maHelpText; }
- void SetHelpId( ULONG nHelpId ) { mnHelpId = nHelpId; }
- ULONG GetHelpId() const { return mnHelpId; }
+ void SetHelpId( const rtl::OString& rHelpId ) { maHelpId = rHelpId; }
+ const rtl::OString& GetHelpId() const { return maHelpId; }
void SetFlags( USHORT nFlags ) { mnFlags = nFlags; }
USHORT GetFlags() const { return mnFlags; }
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index af19379d8b8f..7c1dd8362e86 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1443,16 +1443,16 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const
// -----------------------------------------------------------------------
-sal_uInt32 SvtFileView::GetHelpId( ) const
+const rtl::OString& SvtFileView::GetHelpId( ) const
{
return mpImp->mpView->GetHelpId( );
}
// -----------------------------------------------------------------------
-void SvtFileView::SetHelpId( sal_uInt32 nHelpId )
+void SvtFileView::SetHelpId( const rtl::OString& rHelpId )
{
- mpImp->mpView->SetHelpId( nHelpId );
+ mpImp->mpView->SetHelpId( rHelpId );
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index f40530c10347..bcb282f44615 100644
--- a/svtools/source/contnr/fileview.src
+++ b/svtools/source/contnr/fileview.src
@@ -110,6 +110,7 @@ Menu RID_FILEVIEW_CONTEXTMENU
ModalDialog DLG_SVT_QUERYDELETE
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_QUERYDELETE";
SVLook = TRUE ;
OutputSize = TRUE ;
Moveable = TRUE ;
@@ -142,6 +143,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_YES
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_YES";
Pos = MAP_APPFONT ( 6 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -151,6 +153,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_ALL
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_ALL";
Pos = MAP_APPFONT ( 59 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -160,6 +163,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_NO
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_NO";
Pos = MAP_APPFONT ( 112 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
diff --git a/svtools/source/contnr/templwin.src b/svtools/source/contnr/templwin.src
index 048d052c18d8..45f9803539a1 100644
--- a/svtools/source/contnr/templwin.src
+++ b/svtools/source/contnr/templwin.src
@@ -289,12 +289,14 @@ ModalDialog DLG_DOCTEMPLATE
};
PushButton BTN_DOCTEMPLATE_MANAGE
{
+ HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_MANAGE";
Pos = MAP_APPFONT( 6, 230 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "Organi~ze...";
};
PushButton BTN_DOCTEMPLATE_EDIT
{
+ HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_EDIT";
Pos = MAP_APPFONT( 59, 230 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "~Edit";
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 1ae223bebf06..7b1f2ad87108 100644..100755
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -53,7 +53,7 @@ struct ImplHeadItem
USHORT mnId;
HeaderBarItemBits mnBits;
long mnSize;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Image maImage;
XubString maOutText;
XubString maText;
@@ -1132,13 +1132,13 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1266,7 +1266,6 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
pItem->mnId = nItemId;
pItem->mnBits = nBits;
pItem->mnSize = nSize;
- pItem->mnHelpId = 0;
pItem->maText = rText;
pItem->mpUserData = 0;
mpItemList->Insert( pItem, nPos );
@@ -1291,7 +1290,6 @@ void HeaderBar::InsertItem( USHORT nItemId,
pItem->mnId = nItemId;
pItem->mnBits = nBits;
pItem->mnSize = nSize;
- pItem->mnHelpId = 0;
pItem->maImage = rImage;
pItem->maText = rText;
pItem->mpUserData = 0;
@@ -1563,11 +1561,11 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
ImplHeadItem* pItem = mpItemList->GetObject( nPos );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -1578,22 +1576,22 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void HeaderBar::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
USHORT nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
- mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+ mpItemList->GetObject( nPos )->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG HeaderBar::GetHelpId( USHORT nItemId ) const
+rtl::OString HeaderBar::GetHelpId( USHORT nItemId ) const
{
USHORT nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mnHelpId;
- else
- return 0;
+ aRet = mpItemList->GetObject( nPos )->maHelpId;
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 02a578629039..6781efc070fe 100644..100755
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -858,7 +858,7 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart
void SvtURLBox::ImplInit()
{
pImp = new SvtURLBox_Impl();
- SetHelpId( SID_OPENURL );
+ SetHelpId( ".uno:OpenURL" );
EnableAutocomplete( FALSE );
SetText( String() );
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 2ad81da40716..315e432edd60 100755
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -60,7 +60,7 @@ struct ImplTabBarItem
XubString maHelpText;
Rectangle maRect;
long mnWidth;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
BOOL mbShort;
BOOL mbSelect;
BOOL mbEnable;
@@ -76,7 +76,6 @@ struct ImplTabBarItem
mnId = nItemId;
mnBits = nPageBits;
mnWidth = 0;
- mnHelpId = 0;
mbShort = FALSE;
mbSelect = FALSE;
mbEnable = TRUE;
@@ -1394,13 +1393,13 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -2400,11 +2399,11 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const
if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -2415,22 +2414,22 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabBar::SetHelpId( USHORT nPageId, const rtl::OString& rHelpId )
{
USHORT nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+ mpItemList->GetObject( nPos )->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabBar::GetHelpId( USHORT nPageId ) const
+rtl::OString TabBar::GetHelpId( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
+ rtl::OString aRet;
if ( nPos != PAGE_NOT_FOUND )
- return mpItemList->GetObject( nPos )->mnHelpId;
- else
- return 0;
+ aRet = mpItemList->GetObject( nPos )->maHelpId;
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx
index 2fdab63be37f..ba5e8d53b8b2 100644..100755
--- a/svtools/source/control/taskstat.cxx
+++ b/svtools/source/control/taskstat.cxx
@@ -517,13 +517,13 @@ void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( pItem )
{
- ULONG nHelpId = pItem->maItem.GetHelpId();
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( pItem->maItem.GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
diff --git a/svtools/source/dialogs/addresstemplate.src b/svtools/source/dialogs/addresstemplate.src
index 0652dfb9d0f5..990dfc98f89b 100644
--- a/svtools/source/dialogs/addresstemplate.src
+++ b/svtools/source/dialogs/addresstemplate.src
@@ -39,6 +39,7 @@
ModalDialog DLG_ADDRESSBOOKSOURCE
{
+ HelpID = "svtools:ModalDialog:DLG_ADDRESSBOOKSOURCE";
SVLook = TRUE ;
OutputSize = TRUE ;
Size = MAP_APPFONT ( 300 , 88 + FIELD_ROW_HEIGHT * FIELD_PAIRS_VISIBLE ) ;
@@ -64,6 +65,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
ComboBox CB_DATASOURCE
{
+ HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_DATASOURCE";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 105, 13 ) ;
Size = MAP_APPFONT ( 96, 55 ) ;
@@ -73,6 +75,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
PushButton PB_ADMINISTATE_DATASOURCES
{
+ HelpID = "svtools:PushButton:DLG_ADDRESSBOOKSOURCE:PB_ADMINISTATE_DATASOURCES";
Text [ en-US ] = "~Address Data Source...";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 204, 13 ) ;
@@ -90,6 +93,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
ComboBox CB_TABLE
{
+ HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_TABLE";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 105, 30 ) ;
Size = MAP_APPFONT ( 96, 55 ) ;
diff --git a/svtools/source/dialogs/colrdlg.src b/svtools/source/dialogs/colrdlg.src
index ad9a5c1aa015..a93642b0bd05 100644
--- a/svtools/source/dialogs/colrdlg.src
+++ b/svtools/source/dialogs/colrdlg.src
@@ -29,6 +29,7 @@
#define DIFF 3
ModalDialog DLG_COLOR
{
+ HelpID = "svtools:ModalDialog:DLG_COLOR";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 165 + DIFF ) ;
@@ -93,6 +94,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_CYAN
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_CYAN";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 109 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -106,6 +108,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_MAGENTA
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_MAGENTA";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -119,6 +122,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_YELLOW
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_YELLOW";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -132,6 +136,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_KEY
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_KEY";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -163,6 +168,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_RED
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_RED";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -174,6 +180,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_GREEN
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_GREEN";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -185,6 +192,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_BLUE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_BLUE";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -202,6 +210,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_HUE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_HUE";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -219,6 +228,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_SATURATION
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_SATURATION";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -236,6 +246,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_LUMINANCE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_LUMINANCE";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -247,6 +258,7 @@ ModalDialog DLG_COLOR
};
PushButton BTN_1
{
+ HelpID = "svtools:PushButton:DLG_COLOR:BTN_1";
Pos = MAP_APPFONT ( 80 , 109 ) ;
Size = MAP_APPFONT ( 17 , 12 ) ;
Text = "~<--" ;
@@ -254,6 +266,7 @@ ModalDialog DLG_COLOR
};
PushButton BTN_2
{
+ HelpID = "svtools:PushButton:DLG_COLOR:BTN_2";
Pos = MAP_APPFONT ( 100 , 109 ) ;
Size = MAP_APPFONT ( 17 , 12 ) ;
Text = "--~>" ;
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx
index 798ff87e02ac..67262ba72c1a 100644
--- a/svtools/source/dialogs/filedlg2.cxx
+++ b/svtools/source/dialogs/filedlg2.cxx
@@ -68,9 +68,9 @@ DECLARE_LIST( UniStringList, UniString* )
// #define STD_BTN_WIDTH 90
// #define STD_BTN_HEIGHT 35
-#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, nHelpId ) \
+#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, rHelpId ) \
p = new ControlClass( GetPathDialog(), WinBits( nBits ) ); \
- p->SetHelpId( nHelpId ); \
+ p->SetHelpId( rHelpId ); \
p->SetPosSizePixel( aPos, aSize ); \
p->SetText( aTitel ); \
p->Show();
@@ -226,10 +226,10 @@ void ImpPathDialog::InitControls()
aPnt.X() = 2 * a6Siz.Width() + aEDSiz.Width();
aPnt.Y() = a6Siz.Height();
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
- aPnt, aBtnSiz, aOkStr, 0 );
+ aPnt, aBtnSiz, aOkStr, "" );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pCancelBtn, CancelButton, 0,
- aPnt, aBtnSiz, aCancelStr, 0 );
+ aPnt, aBtnSiz, aCancelStr, "" );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pNewDirBtn, PushButton, WB_DEFBUTTON,
aPnt, aBtnSiz, aNewDirStr, HID_FILEDLG_NEWDIR );
@@ -782,10 +782,10 @@ void ImpFileDialog::InitControls()
const long nButtonStartX = 2*nW+20+15;
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
Point(nButtonStartX, 10), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
- Button::GetStandardText( BUTTON_OK ), 0 );
+ Button::GetStandardText( BUTTON_OK ), "" );
INITCONTROL( pCancelBtn, CancelButton, 0,
Point(nButtonStartX, 45 ), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
- Button::GetStandardText( BUTTON_CANCEL ), 0 );
+ Button::GetStandardText( BUTTON_CANCEL ), "" );
pLoadBtn = 0;
diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx
index 532fd3f61bb2..dba5ed627952 100644
--- a/svtools/source/dialogs/printdlg.cxx
+++ b/svtools/source/dialogs/printdlg.cxx
@@ -28,26 +28,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#include <tools/debug.hxx>
-#ifndef _SV_APP_HXX
#include <vcl/svapp.hxx>
-#endif
-#ifndef _VCL_PRINT_HXX
#include <vcl/print.hxx>
-#endif
#include <vcl/msgbox.hxx>
#include <vcl/jobset.hxx>
#include <tools/urlobj.hxx>
-
#include "printdlg.hrc"
#include "controldims.hrc"
#include <svtools/prnsetup.hxx>
#include <svtools/printdlg.hxx>
#include <svtools/svtdata.hxx>
#include <filedlg.hxx>
-#include "svl/pickerhelper.hxx"
-#ifndef _SVT_HELPID_HRC
#include <svtools/helpid.hrc>
-#endif
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
diff --git a/svtools/source/dialogs/printdlg.src b/svtools/source/dialogs/printdlg.src
index 405accc63344..80c6e465d49a 100644
--- a/svtools/source/dialogs/printdlg.src
+++ b/svtools/source/dialogs/printdlg.src
@@ -31,6 +31,7 @@
ModalDialog DLG_SVT_PRNDLG_PRINTDLG
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRINTDLG";
SVLook = TRUE ;
OutputSize = TRUE ;
Moveable = TRUE ;
@@ -50,6 +51,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
ListBox LB_NAMES
{
+ HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRINTDLG:LB_NAMES";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 13 ) ;
Size = MAP_APPFONT ( 130 , 80 ) ;
@@ -58,6 +60,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
PushButton BTN_PROPERTIES
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_PROPERTIES";
Pos = MAP_APPFONT ( 193 , 12 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "Propert~ies..." ;
@@ -114,12 +117,14 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
Edit EDT_FAXNO
{
+ HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_FAXNO";
Border = TRUE;
Pos = MAP_APPFONT ( 60 , 73 );
Size = MAP_APPFONT ( 188 , 12 );
};
CheckBox CBX_FILEPRINT
{
+ HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_FILEPRINT";
Pos = MAP_APPFONT ( 12 , 73 ) ;
Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "Print to file" ;
@@ -132,6 +137,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
/*!!!
PushButton BTN_BROWSE
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_BROWSE";
Pos = MAP_APPFONT ( 234 , 75 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Text = "~..." ;
@@ -146,18 +152,21 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
RadioButton RBT_ALL_SHEETS
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL_SHEETS";
Pos = MAP_APPFONT ( 12 , 102 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "All sheets" ;
};
RadioButton RBT_SELECTED_SHEETS
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_SHEETS";
Pos = MAP_APPFONT ( 12 , 115 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Selected sheets" ;
};
RadioButton RBT_SELECTED_CELLS
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_CELLS";
Pos = MAP_APPFONT ( 12 , 128 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Selected cells" ;
@@ -170,24 +179,28 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
RadioButton RBT_ALL
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL";
Pos = MAP_APPFONT ( 12 , 152 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "All pages" ;
};
RadioButton RBT_PAGES
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_PAGES";
Pos = MAP_APPFONT ( 12 , 165 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
Text [ en-US ] = "Pages" ;
};
Edit EDT_PAGES
{
+ HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_PAGES";
Border = TRUE ;
Pos = MAP_APPFONT ( 65 , 164 ) ;
Size = MAP_APPFONT ( 52 , 12 ) ;
};
RadioButton RBT_SELECTION
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTION";
Hide = TRUE ;
Pos = MAP_APPFONT ( 12 , 179 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
@@ -213,6 +226,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
NumericField NUM_COPIES
{
+ HelpID = "svtools:NumericField:DLG_SVT_PRNDLG_PRINTDLG:NUM_COPIES";
Border = TRUE ;
Pos = MAP_APPFONT ( 201 , 102 ) ;
Size = MAP_APPFONT ( 33 , 12 ) ;
@@ -226,6 +240,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
CheckBox CBX_COLLATE
{
+ HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_COLLATE";
Pos = MAP_APPFONT ( 201 , 123 ) ;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "Co~llate" ;
@@ -249,6 +264,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
PushButton BTN_OPTIONS
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_OPTIONS";
Hide = TRUE ;
Pos = MAP_APPFONT ( 6 , 190 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
diff --git a/svtools/source/dialogs/prnsetup.src b/svtools/source/dialogs/prnsetup.src
index 1443a35e0f39..afdf7d56864e 100644
--- a/svtools/source/dialogs/prnsetup.src
+++ b/svtools/source/dialogs/prnsetup.src
@@ -138,6 +138,7 @@ String STR_SVT_PRNDLG_JOBCOUNT
ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRNSETUPDLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
@@ -157,6 +158,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
ListBox LB_NAMES
{
+ HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRNSETUPDLG:LB_NAMES";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 12 ) ;
Size = MAP_APPFONT ( 125 , 80 ) ;
@@ -165,6 +167,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
PushButton BTN_PROPERTIES
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_PROPERTIES";
Pos = MAP_APPFONT ( 188 , 12 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "Propert~ies..." ;
@@ -220,6 +223,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
PushButton BTN_OPTIONS
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_OPTIONS";
Pos = MAP_APPFONT ( 5 , 84 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Options..." ;
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index c28cfe1d4b18..43b9fcddf91d 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -239,15 +239,15 @@ namespace svt
}
//--------------------------------------------------------------------
- void RoadmapWizard::SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode )
+ void RoadmapWizard::SetRoadmapHelpId( const rtl::OString& _rId )
{
- m_pImpl->pRoadmap->SetSmartHelpId( _rId, _aMode );
+ m_pImpl->pRoadmap->SetHelpId( _rId );
}
//--------------------------------------------------------------------
- SmartId RoadmapWizard::GetRoadmapSmartHelpId() const
+ const rtl::OString& RoadmapWizard::GetRoadmapHelpId() const
{
- return m_pImpl->pRoadmap->GetSmartHelpId();
+ return m_pImpl->pRoadmap->GetHelpId();
}
//--------------------------------------------------------------------
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index 2053da80019d..41e759eda43b 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -197,7 +197,7 @@ namespace svt
if (_nButtonFlags & WZB_PREVIOUS)
{
m_pPrevPage = new PushButton(this, WB_TABSTOP);
- m_pPrevPage->SetSmartHelpId( SmartId(HID_WIZARD_PREVIOUS) );
+ m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS );
m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pPrevPage->SetText(String(SvtResId(STR_WIZDLG_PREVIOUS)));
m_pPrevPage->Show();
@@ -214,7 +214,7 @@ namespace svt
if (_nButtonFlags & WZB_NEXT)
{
m_pNextPage = new PushButton(this, WB_TABSTOP);
- m_pNextPage->SetSmartHelpId( SmartId(HID_WIZARD_NEXT) );
+ m_pNextPage->SetHelpId( HID_WIZARD_NEXT );
m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pNextPage->SetText(String(SvtResId(STR_WIZDLG_NEXT)));
m_pNextPage->Show();
diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx
index c04b587b6278..20cc46a30ab5 100755..100644
--- a/svtools/source/filter.vcl/filter/exportdialog.cxx
+++ b/svtools/source/filter.vcl/filter/exportdialog.cxx
@@ -396,7 +396,7 @@ awt::Size ExportDialog::GetOriginalSize()
}
}
}
- return awt::Size( aShapesRange.getWidth(), aShapesRange.getHeight() );
+ return awt::Size( static_cast<sal_Int32>(aShapesRange.getWidth()), static_cast<sal_Int32>(aShapesRange.getHeight()) );
}
void ExportDialog::GetGraphicSource()
@@ -1227,23 +1227,23 @@ void ExportDialog::updatePreview()
if ( fXRatio > 1.0 )
{
aSize.Width() = maSize.Width > aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
- aSize.Width() /= fXRatio;
+ aSize.Width() /= static_cast<long int>(fXRatio);
}
else
{
aSize.Width() = maSize.Width < aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
- aSize.Width() /= fXRatio;
+ aSize.Width() /= static_cast<long int>(fXRatio);
}
if ( fYRatio > 1.0 )
{
aSize.Height() = maSize.Height > aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
- aSize.Height() /= fYRatio;
+ aSize.Height() /= static_cast<long int>(fYRatio);
}
else
{
aSize.Height() = maSize.Height < aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
- aSize.Height() /= fYRatio;
+ aSize.Height() /= static_cast<long int>(fYRatio);
}
if ( aSize.Width() < maSize.Width )
@@ -1260,7 +1260,7 @@ void ExportDialog::updatePreview()
Bitmap aCroppedBitmap( maBitmap );
aCroppedBitmap.Crop( Rectangle( aPos, aSize ) );
aSize = aCroppedBitmap.GetSizePixel();
- aSize = Size( aSize.Width() * fXRatio, aSize.Height() * fYRatio );
+ aSize = Size( static_cast<long int>(aSize.Width() * fXRatio), static_cast<long int>(aSize.Height() * fYRatio) );
aCroppedBitmap.Scale( aSize );
if ( aSize.Width() > aFixedBitmapSize.Width() )
@@ -1347,7 +1347,7 @@ void ExportDialog::updateControls()
case 0 : nResolution = maResolution.Width / 100; break; // pixels / cm
case 2 : nResolution = maResolution.Width; break; // pixels / meter
default:
- case 1 : nResolution = maResolution.Width * 0.0254; break; // pixels / inch
+ case 1 : nResolution = static_cast< sal_Int32 >(maResolution.Width * 0.0254); break; // pixels / inch
}
maNfResolution.SetValue( nResolution );
diff --git a/svtools/source/filter.vcl/filter/exportdialog.src b/svtools/source/filter.vcl/filter/exportdialog.src
index 065fcee6ba18..c9e87989a314 100755..100644
--- a/svtools/source/filter.vcl/filter/exportdialog.src
+++ b/svtools/source/filter.vcl/filter/exportdialog.src
@@ -34,6 +34,7 @@ String DLG_EXPORT_TITLE
ModalDialog DLG_EXPORT
{
+ HelpID = "svtools:ModalDialog:DLG_EXPORT";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 178 , 135 ) ;
@@ -54,6 +55,7 @@ ModalDialog DLG_EXPORT
};
MetricField MF_SIZEX
{
+ HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEX";
Hide = TRUE;
Border = TRUE;
Size = MAP_APPFONT ( 30, 12 ) ;
@@ -68,6 +70,7 @@ ModalDialog DLG_EXPORT
};
ListBox LB_SIZEX
{
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEX";
Hide = TRUE;
Border = TRUE ;
Size = MAP_APPFONT ( 60, 80 ) ;
@@ -90,6 +93,7 @@ ModalDialog DLG_EXPORT
};
MetricField MF_SIZEY
{
+ HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEY";
Hide = TRUE;
Border = TRUE;
Size = MAP_APPFONT ( 30, 12 );
@@ -104,6 +108,7 @@ ModalDialog DLG_EXPORT
};
ListBox LB_SIZEY
{
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEY";
Hide = TRUE;
Border = TRUE ;
Size = MAP_APPFONT ( 60, 80 ) ;
@@ -126,6 +131,7 @@ ModalDialog DLG_EXPORT
};
NumericField NF_RESOLUTION
{
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_RESOLUTION";
Hide = TRUE;
Border = TRUE ;
Size = MAP_APPFONT ( 30, 12 ) ;
@@ -137,6 +143,7 @@ ModalDialog DLG_EXPORT
};
ListBox LB_RESOLUTION
{
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_RESOLUTION";
Hide = TRUE;
Border = TRUE ;
Size = MAP_APPFONT ( 60, 80 ) ;
@@ -157,6 +164,7 @@ ModalDialog DLG_EXPORT
};
ListBox LB_COLOR_DEPTH
{
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_COLOR_DEPTH";
Hide = TRUE;
Border = TRUE ;
Size = MAP_APPFONT ( 60, 80 ) ;
@@ -225,6 +233,7 @@ ModalDialog DLG_EXPORT
};
NumericField NF_COMPRESSION
{
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_COMPRESSION";
Hide = TRUE;
Border = TRUE ;
Size = MAP_APPFONT ( 30, 12 ) ;
@@ -260,18 +269,21 @@ ModalDialog DLG_EXPORT
};
CheckBox CB_JPG_PREVIEW
{
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_JPG_PREVIEW";
Hide = TRUE;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "Preview" ;
};
CheckBox CB_INTERLACED
{
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_INTERLACED";
Hide = TRUE;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "Interlaced" ;
};
CheckBox CB_RLE_ENCODING
{
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_RLE_ENCODING";
Hide = TRUE;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "RLE encoding" ;
@@ -284,18 +296,21 @@ ModalDialog DLG_EXPORT
};
CheckBox CB_SAVE_TRANSPARENCY
{
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_SAVE_TRANSPARENCY";
Hide = TRUE;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "Save transparency" ;
};
RadioButton RB_BINARY
{
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_BINARY";
Hide = TRUE;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Binary" ;
};
RadioButton RB_TEXT
{
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_TEXT";
Hide = TRUE;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Text" ;
@@ -308,12 +323,14 @@ ModalDialog DLG_EXPORT
};
CheckBox CB_EPS_PREVIEW_TIFF
{
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_TIFF";
Hide = TRUE;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "Image Preview (TIFF)" ;
};
CheckBox CB_EPS_PREVIEW_EPSI
{
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_EPSI";
Hide = TRUE;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "Interchange (EPSI)" ;
@@ -326,12 +343,14 @@ ModalDialog DLG_EXPORT
};
RadioButton RB_EPS_LEVEL1
{
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL1";
Hide = TRUE;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Level 1" ;
};
RadioButton RB_EPS_LEVEL2
{
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL2";
Hide = TRUE;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Level 2" ;
@@ -344,24 +363,28 @@ ModalDialog DLG_EXPORT
};
RadioButton RB_EPS_COLOR_FORMAT1
{
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT1";
Hide = TRUE;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Color" ;
};
RadioButton RB_EPS_COLOR_FORMAT2
{
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT2";
Hide = TRUE;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Grayscale" ;
};
RadioButton RB_EPS_COMPRESSION_LZW
{
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_LZW";
Hide = TRUE;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "LZW encoding" ;
};
RadioButton RB_EPS_COMPRESSION_NONE
{
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_NONE";
Hide = TRUE;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "None" ;
@@ -413,6 +436,7 @@ ModalDialog DLG_EXPORT
};
NumericField NF_ZOOM
{
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_ZOOM";
Hide = TRUE;
Border = TRUE ;
Size = MAP_APPFONT ( 30, 12 ) ;
diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx
index 65f51ce212f4..9c754a947fcd 100644
--- a/svtools/source/filter.vcl/filter/filter.cxx
+++ b/svtools/source/filter.vcl/filter/filter.cxx
@@ -552,16 +552,48 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) )
{
bSomethingTested = TRUE;
- BYTE sBuf[4];
+ BYTE sBuf[3];
+ // store number format
+ sal_uInt16 oldNumberFormat = rStream.GetNumberFormatInt();
sal_uInt32 nOffset; // in ms documents the pict format is used without the first 512 bytes
- for ( nOffset = 10; ( nOffset <= 522 ) && ( ( nStreamPos + nOffset + 3 ) <= nStreamLen ); nOffset += 512 )
+ for ( nOffset = 0; ( nOffset <= 512 ) && ( ( nStreamPos + nOffset + 14 ) <= nStreamLen ); nOffset += 512 )
{
- rStream.Seek( nStreamPos + nOffset );
+ short y1,x1,y2,x2;
+ bool bdBoxOk = true;
+
+ rStream.Seek( nStreamPos + nOffset);
+ // size of the pict in version 1 pict ( 2bytes) : ignored
+ rStream.SeekRel(2);
+ // bounding box (bytes 2 -> 9)
+ rStream.SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
+ rStream >> y1 >> x1 >> y2 >> x2;
+ rStream.SetNumberFormatInt(oldNumberFormat); // reset format
+
+ if (x1 > x2 || y1 > y2 || // bad bdbox
+ (x1 == x2 && y1 == y2) || // 1 pixel picture
+ x2-x1 > 2048 || y2-y1 > 2048 ) // picture anormaly big
+ bdBoxOk = false;
+
+ // read version op
rStream.Read( sBuf,3 );
- if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) )
+ // see http://developer.apple.com/legacy/mac/library/documentation/mac/pdf/Imaging_With_QuickDraw/Appendix_A.pdf
+ // normal version 2 - page A23 and A24
+ if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x02)
{
- rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
- return TRUE;
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return TRUE;
+ }
+ // normal version 1 - page A25
+ else if (sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 && bdBoxOk) {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return TRUE;
+ }
+ // previous code kept in order to do not break any compatibility
+ // probably eroneous
+ else if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x01 && bdBoxOk)
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return TRUE;
}
}
}
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx
index 6abab2626516..d91ec1a19772 100644
--- a/svtools/source/filter.vcl/filter/filter2.cxx
+++ b/svtools/source/filter.vcl/filter/filter2.cxx
@@ -42,29 +42,6 @@
BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG );
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-GraphicDescriptor::GraphicDescriptor( const String* pPath ) :
- pFileStm ( NULL )
-{
- ImpConstruct();
-
- if ( pPath )
- {
- INetURLObject aURL( *pPath, INET_PROT_FILE );
- aPathExt = aURL.GetFileExtension().toAsciiLowerCase();
- }
- bLinked = TRUE;
- bLinkChanged = FALSE;
- bWideSearch = FALSE;
-}
-
-
/*************************************************************************
|*
|*
@@ -73,19 +50,10 @@ GraphicDescriptor::GraphicDescriptor( const String* pPath ) :
GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ) ),
- aPathExt( rPath.GetFileExtension().toAsciiLowerCase() )
+ aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ),
+ bOwnStream( TRUE )
{
- if ( pFileStm )
- {
- nStmPos = 0;
- pFileStm->Seek( nStmPos );
- bDataReady = TRUE;
- }
-
ImpConstruct();
-
- if ( pFileStm && !pFileStm->GetError() )
- bDataReady = TRUE;
}
/*************************************************************************
@@ -95,7 +63,8 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
\************************************************************************/
GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) :
- pFileStm ( NULL )
+ pFileStm ( &rInStream ),
+ bOwnStream ( FALSE )
{
ImpConstruct();
@@ -104,15 +73,8 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
INetURLObject aURL( *pPath );
aPathExt = aURL.GetFileExtension().toAsciiLowerCase();
}
- nStmPos = rInStream.Tell();
- pBaseStm = &rInStream;
- bBaseStm = TRUE;
-
- if ( !pBaseStm->GetError() )
- bDataReady = TRUE;
}
-
/*************************************************************************
|*
|*
@@ -121,10 +83,10 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
GraphicDescriptor::~GraphicDescriptor()
{
- delete pFileStm;
+ if ( bOwnStream )
+ delete pFileStm;
}
-
/*************************************************************************
|*
|*
@@ -134,22 +96,9 @@ GraphicDescriptor::~GraphicDescriptor()
BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo )
{
BOOL bRet = FALSE;
-
- // Link-Status ueberpruefen
- if ( bLinked && bLinkChanged )
- {
- DBG_ASSERT( aReqLink.IsSet(), "Wo ist der RequestHandler???" );
- pMemStm = (SvStream*) aReqLink.Call( this );
- if ( pMemStm )
- {
- nStmPos = pMemStm->Tell();
- bDataReady = TRUE;
- }
- }
-
- if ( bDataReady )
+ if ( pFileStm && !pFileStm->GetError() )
{
- SvStream& rStm = GetSearchStream();
+ SvStream& rStm = *pFileStm;
UINT16 nOldFormat = rStm.GetNumberFormatInt();
if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = TRUE;
@@ -175,96 +124,13 @@ BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo )
else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = TRUE;
-
- // diese Formate lassen sich nur bei WideSearch im gesamten
- // Stream ermitteln
- else if ( bWideSearch )
- {
- if ( ImpDetectPCD( rStm, bExtendedInfo ) )
- bRet = TRUE;
- }
+ else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = TRUE;
rStm.SetNumberFormatInt( nOldFormat );
- rStm.Seek( nStmPos );
}
-
return bRet;
}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-BOOL GraphicDescriptor::IsDataReady() const
-{
- return bDataReady;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-BOOL GraphicDescriptor::IsWideSearch() const
-{
- return bWideSearch;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-SvStream& GraphicDescriptor::GetSearchStream() const
-{
- DBG_ASSERT( bDataReady, "Was laeuft hier falsch???" );
-
- if ( bLinked )
- return *pMemStm;
- else if ( bBaseStm )
- return *pBaseStm;
- else
- return *pFileStm;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void GraphicDescriptor::SetRequestHdl( const Link& rRequestLink )
-{
- aReqLink = rRequestLink;
- bLinkChanged = TRUE;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-ULONG GraphicDescriptor::GetRequestedByteCount() const
-{
- return DATA_SIZE;
-}
-
-
-/******************************************************************************/
-/* IMP-Methoden */
-/* */
-
-
/*************************************************************************
|*
|*
@@ -273,17 +139,10 @@ ULONG GraphicDescriptor::GetRequestedByteCount() const
void GraphicDescriptor::ImpConstruct()
{
- if ( !pFileStm )
- pFileStm = new SvStream();
nFormat = GFF_NOT;
nBitsPerPixel = 0;
nPlanes = 0;
bCompressed = FALSE;
- bDataReady = FALSE;
- bLinked = FALSE;
- bWideSearch = TRUE;
- bBaseStm = FALSE;
- pMemStm = NULL;
}
@@ -297,10 +156,9 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
{
UINT16 nTemp16;
BOOL bRet = FALSE;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> nTemp16;
// OS/2-BitmapArray
@@ -364,7 +222,7 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -382,10 +240,10 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
BOOL bRet = FALSE;
BYTE cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> n32;
+
if ( n32 == 0x38464947 )
{
rStm >> n16;
@@ -412,7 +270,7 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -423,125 +281,188 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
+// returns the next jpeg marker, a return value of 0 represents an error
+sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm )
+{
+ sal_uInt8 nByte;
+ do
+ {
+ do
+ {
+ rStm >> nByte;
+ if ( rStm.IsEof() || rStm.GetError() ) // as 0 is not allowed as marker,
+ return 0; // we can use it as errorcode
+ }
+ while ( nByte != 0xff );
+ do
+ {
+ rStm >> nByte;
+ if ( rStm.IsEof() || rStm.GetError() )
+ return 0;
+ }
+ while( nByte == 0xff );
+ }
+ while( nByte == 0 ); // 0xff00 represents 0xff and not a marker,
+ // the marker detection has to be restartet.
+ return nByte;
+}
+
BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
{
UINT32 nTemp32;
BOOL bRet = FALSE;
- BYTE cByte = 0;
- BOOL bM_COM;
- rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nTemp32;
- // compare upper 28 bits
+ // compare upper 24 bits
if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) )
{
nFormat = GFF_JPG;
- return TRUE;
- }
-
- bM_COM = ( nTemp32 == 0xffd8fffe );
- if ( ( nTemp32 == 0xffd8ffe0 ) || bM_COM )
- {
- if( !bM_COM )
- {
- rStm.SeekRel( 2 );
- rStm >> nTemp32;
- }
+ bRet = TRUE;
- if( bM_COM || ( nTemp32 == 0x4a464946 ) )
+ if ( bExtendedInfo )
{
- nFormat = GFF_JPG;
- bRet = TRUE;
+ rStm.SeekRel( -2 );
- if( bExtendedInfo )
- {
- MapMode aMap;
- UINT16 nTemp16;
- ULONG nCount = 9;
- ULONG nMax;
- ULONG nResX;
- ULONG nResY;
- BYTE cUnit;
-
- // Groesse des verbleibenden Puffers ermitteln
- if ( bLinked )
- nMax = static_cast< SvMemoryStream& >(rStm).GetEndOfData()
- - 16;
- else
- nMax = DATA_SIZE - 16;
-
- // max. 8K
- nMax = Min( nMax, (ULONG) 8192 );
+ sal_uInt32 nError( rStm.GetError() );
- // Res-Unit ermitteln
- rStm.SeekRel( 3 );
- rStm >> cUnit;
-
- // ResX ermitteln
- rStm >> nTemp16;
- nResX = nTemp16;
+ sal_Bool bScanFailure = sal_False;
+ sal_Bool bScanFinished = sal_False;
- // ResY ermitteln
- rStm >> nTemp16;
- nResY = nTemp16;
-
- // SOF0/1-Marker finden, aber dabei
- // nicht mehr als DATA_SIZE Pixel lesen, falls
- // kein WideSearch
- do
+ while( !bScanFailure && !bScanFinished && !rStm.IsEof() && !rStm.GetError() )
+ {
+ sal_uInt8 nMarker = ImpDetectJPG_GetNextMarker( rStm );
+ switch( nMarker )
{
- while ( ( cByte != 0xff ) &&
- ( bWideSearch || ( nCount++ < nMax ) ) )
+ // fixed size marker, not having a two byte length parameter
+ case 0xd0 : // RST0
+ case 0xd1 :
+ case 0xd2 :
+ case 0xd3 :
+ case 0xd4 :
+ case 0xd5 :
+ case 0xd6 :
+ case 0xd7 : // RST7
+ case 0x01 : // TEM
+ break;
+
+ case 0xd8 : // SOI (has already been checked, there should not be a second one)
+ case 0x00 : // marker is invalid, we should stop now
+ bScanFailure = sal_True;
+ break;
+
+ case 0xd9 : // EOI
+ bScanFinished = sal_True;
+ break;
+
+ // per default we assume marker segments conaining a length parameter
+ default :
{
- rStm >> cByte;
- }
-
- while ( ( cByte == 0xff ) &&
- ( bWideSearch || ( nCount++ < nMax ) ) )
- {
- rStm >> cByte;
- }
- }
- while ( ( cByte != 0xc0 ) &&
- ( cByte != 0xc1 ) &&
- ( bWideSearch || ( nCount < nMax ) ) );
-
- // wir haben den SOF0/1-Marker
- if ( ( cByte == 0xc0 ) || ( cByte == 0xc1 ) )
- {
- // Hoehe einlesen
- rStm.SeekRel( 3 );
- rStm >> nTemp16;
- aPixSize.Height() = nTemp16;
+ sal_uInt16 nLength;
+ rStm >> nLength;
- // Breite einlesen
- rStm >> nTemp16;
- aPixSize.Width() = nTemp16;
-
- // Bit/Pixel einlesen
- rStm >> cByte;
- nBitsPerPixel = ( cByte == 3 ? 24 : cByte == 1 ? 8 : 0 );
+ if ( nLength < 2 )
+ bScanFailure = sal_True;
+ else
+ {
+ sal_uInt32 nNextMarkerPos = rStm.Tell() + nLength - 2;
+ switch( nMarker )
+ {
+ case 0xe0 : // APP0 Marker
+ {
+ if ( nLength == 16 )
+ {
+ sal_Int32 nIdentifier;
+ rStm >> nIdentifier;
+ if ( nIdentifier == 0x4a464946 ) // JFIF Identifier
+ {
+ sal_uInt8 nStringTerminator;
+ sal_uInt8 nMajorRevision;
+ sal_uInt8 nMinorRevision;
+ sal_uInt8 nUnits;
+ sal_uInt16 nHorizontalResolution;
+ sal_uInt16 nVerticalResolution;
+ sal_uInt8 nHorzThumbnailPixelCount;
+ sal_uInt8 nVertThumbnailPixelCount;
+
+ rStm >> nStringTerminator
+ >> nMajorRevision
+ >> nMinorRevision
+ >> nUnits
+ >> nHorizontalResolution
+ >> nVerticalResolution
+ >> nHorzThumbnailPixelCount
+ >> nVertThumbnailPixelCount;
+
+ // setting the logical size
+ if ( nUnits && nHorizontalResolution && nVerticalResolution )
+ {
+ MapMode aMap;
+ aMap.SetMapUnit( nUnits == 1 ? MAP_INCH : MAP_CM );
+ aMap.SetScaleX( Fraction( 1, nHorizontalResolution ) );
+ aMap.SetScaleY( Fraction( 1, nVerticalResolution ) );
+ aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, MapMode( MAP_100TH_MM ) );
+ }
+ }
+ }
+ }
+ break;
- // logische Groesse setzen
- if ( cUnit && nResX && nResY )
- {
- aMap.SetMapUnit( cUnit == 1 ? MAP_INCH : MAP_CM );
- aMap.SetScaleX( Fraction( 1, nResX ) );
- aMap.SetScaleY( Fraction( 1, nResY ) );
- aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap,
- MapMode( MAP_100TH_MM ) );
+ // Start of Frame Markers
+ case 0xc0 : // SOF0
+ case 0xc1 : // SOF1
+ case 0xc2 : // SOF2
+ case 0xc3 : // SOF3
+ case 0xc5 : // SOF5
+ case 0xc6 : // SOF6
+ case 0xc7 : // SOF7
+ case 0xc9 : // SOF9
+ case 0xca : // SOF10
+ case 0xcb : // SOF11
+ case 0xcd : // SOF13
+ case 0xce : // SOF14
+ case 0xcf : // SOF15
+ {
+ sal_uInt8 nSamplePrecision;
+ sal_uInt16 nNumberOfLines;
+ sal_uInt16 nSamplesPerLine;
+ sal_uInt8 nNumberOfImageComponents;
+ sal_uInt8 nComponentsIdentifier;
+ sal_uInt8 nHorizontalSamplingFactor;
+ sal_uInt8 nVerticalSamplingFactor;
+ sal_uInt8 nQuantizationTableDestinationSelector;
+ rStm >> nSamplePrecision
+ >> nNumberOfLines
+ >> nSamplesPerLine
+ >> nNumberOfImageComponents
+ >> nComponentsIdentifier
+ >> nHorizontalSamplingFactor
+ >> nQuantizationTableDestinationSelector;
+ nVerticalSamplingFactor = nHorizontalSamplingFactor & 0xf;
+ nHorizontalSamplingFactor >>= 4;
+
+ aPixSize.Height() = nNumberOfLines;
+ aPixSize.Width() = nSamplesPerLine;
+ nBitsPerPixel = ( nNumberOfImageComponents == 3 ? 24 : nNumberOfImageComponents == 1 ? 8 : 0 );
+ nPlanes = 1;
+
+ bScanFinished = sal_True;
+ }
+ break;
+ }
+ rStm.Seek( nNextMarkerPos );
+ }
}
-
- // Planes immer 1
- nPlanes = 1;
+ break;
}
}
+ rStm.SetError( nError );
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -556,37 +477,26 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL )
{
BOOL bRet = FALSE;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
- if ( bWideSearch )
- {
- UINT32 nTemp32;
- UINT16 nTemp16;
- BYTE cByte;
+ UINT32 nTemp32;
+ UINT16 nTemp16;
+ BYTE cByte;
- rStm.SeekRel( 2048 );
- rStm >> nTemp32;
- rStm >> nTemp16;
- rStm >> cByte;
+ rStm.SeekRel( 2048 );
+ rStm >> nTemp32;
+ rStm >> nTemp16;
+ rStm >> cByte;
- if ( ( nTemp32 == 0x5f444350 ) &&
- ( nTemp16 == 0x5049 ) &&
- ( cByte == 0x49 ) )
- {
- nFormat = GFF_PCD;
- bRet = TRUE;
- }
- }
- else
+ if ( ( nTemp32 == 0x5f444350 ) &&
+ ( nTemp16 == 0x5049 ) &&
+ ( cByte == 0x49 ) )
{
- bRet = aPathExt.CompareToAscii( "pcd", 3 ) == COMPARE_EQUAL;
- if ( bRet )
- {
- nFormat = GFF_PCD;
- }
+ nFormat = GFF_PCD;
+ bRet = TRUE;
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -608,10 +518,10 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
BOOL bRet = FALSE;
BYTE cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> cByte;
+
if ( cByte == 0x0a )
{
nFormat = GFF_PCX;
@@ -675,6 +585,7 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
}
}
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -690,10 +601,10 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
UINT32 nTemp32;
BOOL bRet = FALSE;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> nTemp32;
+
if ( nTemp32 == 0x89504e47 )
{
rStm >> nTemp32;
@@ -726,55 +637,52 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
nPlanes = 1;
bCompressed = TRUE;
- if ( bWideSearch )
- {
- UINT32 nLen32;
+ UINT32 nLen32;
- rStm.SeekRel( 8 );
+ rStm.SeekRel( 8 );
- // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
- // den Anfang der Bilddaten
+ // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
+ // den Anfang der Bilddaten
+ rStm >> nLen32;
+ rStm >> nTemp32;
+ while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
+ {
+ rStm.SeekRel( 4 + nLen32 );
rStm >> nLen32;
rStm >> nTemp32;
- while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
- {
- rStm.SeekRel( 4 + nLen32 );
- rStm >> nLen32;
- rStm >> nTemp32;
- }
+ }
- if ( nTemp32 == 0x70485973 )
- {
- ULONG nXRes;
- ULONG nYRes;
+ if ( nTemp32 == 0x70485973 )
+ {
+ ULONG nXRes;
+ ULONG nYRes;
- // horizontale Aufloesung
- rStm >> nTemp32;
- nXRes = nTemp32;
+ // horizontale Aufloesung
+ rStm >> nTemp32;
+ nXRes = nTemp32;
- // vertikale Aufloesung
- rStm >> nTemp32;
- nYRes = nTemp32;
+ // vertikale Aufloesung
+ rStm >> nTemp32;
+ nYRes = nTemp32;
- // Unit einlesen
- rStm >> cByte;
+ // Unit einlesen
+ rStm >> cByte;
- if ( cByte )
- {
- if ( nXRes )
- aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
- nTemp32;
+ if ( cByte )
+ {
+ if ( nXRes )
+ aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
+ nTemp32;
- if ( nYRes )
- aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
- nTemp32;
- }
+ if ( nYRes )
+ aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
+ nTemp32;
}
}
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -792,7 +700,7 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
BYTE cByte1;
BYTE cByte2;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> cByte1;
rStm >> cByte2;
if ( cByte1 == cByte2 )
@@ -829,14 +737,14 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
rStm >> nTemp32;
rStm.SeekRel( ( nCount = ( nTemp32 + 2 ) ) - 0x08 );
- if ( bWideSearch || ( nCount < nMax ) )
+ if ( nCount < nMax )
{
// Tag's lesen, bis wir auf Tag256 ( Width ) treffen
// nicht mehr Bytes als DATA_SIZE lesen
rStm >> nTemp16;
while ( nTemp16 != 256 )
{
- bOk = bWideSearch || ( nCount < nMax );
+ bOk = nCount < nMax;
if ( !bOk )
{
break;
@@ -912,7 +820,7 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -965,11 +873,12 @@ BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL )
bRet = TRUE;
else
{
+ sal_Int32 nStmPos = rStm.Tell();
BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) )
bRet = TRUE;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -992,11 +901,12 @@ BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL )
bRet = TRUE;
else
{
- BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ BYTE nFirst, nSecond;
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) )
bRet = TRUE;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -1020,10 +930,11 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL )
else
{
BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) )
bRet = TRUE;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -1041,16 +952,17 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL )
BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL )
{
UINT32 nMagicNumber;
- rStm.Seek( nStmPos );
+ BOOL bRet = FALSE;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nMagicNumber;
if ( nMagicNumber == 0x59a66a95 )
{
nFormat = GFF_RAS;
- return TRUE;
+ bRet = TRUE;
}
- else
- return FALSE;
+ rStm.Seek( nStmPos );
+ return bRet;
}
/*************************************************************************
@@ -1079,7 +991,7 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
BOOL bRet = FALSE;
UINT32 nMagicNumber;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nMagicNumber;
if ( nMagicNumber == 0x38425053 )
@@ -1123,6 +1035,7 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
if ( bRet )
nFormat = GFF_PSD;
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -1139,8 +1052,9 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
sal_uInt32 nFirstLong;
sal_uInt8 nFirstBytes[20];
+ BOOL bRet = FALSE;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nFirstLong;
rStm.SeekRel( -4 );
@@ -1151,10 +1065,10 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
&& ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) )
{
nFormat = GFF_EPS;
- return TRUE;
+ bRet = TRUE;
}
- else
- return FALSE;
+ rStm.Seek( nStmPos );
+ return bRet;
}
/*************************************************************************
@@ -1201,9 +1115,11 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
nFormat = GFF_PCT;
else
{
- BYTE sBuf[3]={0};
+ sal_Int32 nStmPos = rStm.Tell();
+
+ BYTE sBuf[4];
- rStm.Seek( nStmPos + 522 );
+ rStm.SeekRel( 522 );
rStm.Read( sBuf, 3 );
if( !rStm.GetError() )
@@ -1215,6 +1131,7 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
nFormat = GFF_PCT;
}
}
+ rStm.Seek( nStmPos );
}
return bRet;
@@ -1230,18 +1147,20 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL )
{
BOOL bRet = FALSE;
-
if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL )
bRet = TRUE;
else
{
+ sal_Int32 nStmPos = rStm.Tell();
+
BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
rStm >> nFirst >> nSecond;
if( nFirst == 'J' && nSecond == 'J' )
bRet = TRUE;
+
+ rStm.Seek( nStmPos );
}
if( bRet )
@@ -1279,9 +1198,8 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
BOOL bRet = FALSE;
BYTE cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> n32;
if ( n32 == 0x44475653 )
{
@@ -1342,7 +1260,7 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -1417,3 +1335,5 @@ String GraphicDescriptor::GetImportFormatShortName( sal_uInt16 nFormat )
return String( aKeyName, RTL_TEXTENCODING_ASCII_US );
}
+
+
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index dc01de750b06..a7420dbc388f 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -149,10 +149,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
m_bJavaNotFound_Handled = true;
WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_JAVANOTFOUND ) );
String aTitle( SvtResId( STR_WARNING_JAVANOTFOUND ) );
-
aWarningBox.SetText( aTitle );
nResult = aWarningBox.Execute();
-
}
else
{
@@ -168,7 +166,6 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
m_bInvalidSettings_Handled = true;
WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_INVALIDJAVASETTINGS ) );
String aTitle( SvtResId(STR_WARNING_INVALIDJAVASETTINGS));
-
aWarningBox.SetText( aTitle );
nResult = aWarningBox.Execute();
}
@@ -186,7 +183,6 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// Java disabled. Give user a chance to enable Java inside Office.
QueryBox aQueryBox( NULL, SvtResId( QBX_JAVADISABLED ) );
String aTitle( SvtResId( STR_QUESTION_JAVADISABLED ) );
-
aQueryBox.SetText( aTitle );
nResult = aQueryBox.Execute();
if ( nResult == RET_YES )
@@ -211,7 +207,6 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
m_bVMCreationFailure_Handled = true;
ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED ) );
String aTitle( SvtResId( STR_ERROR_JVMCREATIONFAILED ) );
-
aErrorBox.SetText( aTitle );
nResult = aErrorBox.Execute();
}
@@ -230,7 +225,6 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
m_bRestartRequired_Handled = true;
ErrorBox aErrorBox(NULL, SvtResId( ERRORBOX_RESTARTREQUIRED ) );
String aTitle( SvtResId( STR_ERROR_RESTARTREQUIRED ) );
-
aErrorBox.SetText( aTitle );
nResult = aErrorBox.Execute();
}
diff --git a/svtools/source/plugapp/testtool.src b/svtools/source/plugapp/testtool.src
index 9cc52c58f013..e456200943f6 100644
--- a/svtools/source/plugapp/testtool.src
+++ b/svtools/source/plugapp/testtool.src
@@ -104,6 +104,7 @@ Bitmap TT_SHOW2 {
};
WorkWindow TT_INLINE_TRANSLATION {
+ HelpID = "svtools:WorkWindow:TT_INLINE_TRANSLATION";
SVLook = TRUE;
Size = MAP_APPFONT( 2*Control_Border + 4*ButtonWidth + 3*Button_Button, 120 );
Moveable = TRUE;
@@ -116,6 +117,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "Translation";
};
Edit TT_E_NEW {
+ HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_NEW";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT( 7, 16 );
@@ -134,6 +136,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "Comment";
};
Edit TT_E_COMMENT {
+ HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_COMMENT";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT( 7, 64 );
@@ -142,12 +145,14 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Comment";
};
PushButton TT_PB_SELECT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_SELECT";
Pos = MAP_APPFONT( Control_Border, 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
TabStop = TRUE;
Text[ en-US ] = "~Select";
};
PushButton TT_PB_RESTORE {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_RESTORE";
Disable = TRUE;
Pos = MAP_APPFONT( Control_Border + ButtonWidth + Button_Button, 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
@@ -155,6 +160,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Restore";
};
PushButton TT_PB_ACCEPT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_ACCEPT";
Disable = TRUE;
Pos = MAP_APPFONT( Control_Border + 2*(ButtonWidth + Button_Button), 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
@@ -162,6 +168,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Accept";
};
PushButton TT_PB_NEXT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_NEXT";
Pos = MAP_APPFONT( Control_Border + 3*(ButtonWidth + Button_Button), 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
TabStop = TRUE;
diff --git a/svtools/source/productregistration/registrationdlg.src b/svtools/source/productregistration/registrationdlg.src
index c4cdcbcbe3ec..64f1063f1ba3 100644
--- a/svtools/source/productregistration/registrationdlg.src
+++ b/svtools/source/productregistration/registrationdlg.src
@@ -72,6 +72,7 @@ ModalDialog DLG_REGISTRATION_REQUEST
RadioButton RB_NOW
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NOW";
Pos = MAP_APPFONT ( 33 , 41 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Register now" ;
@@ -79,18 +80,21 @@ ModalDialog DLG_REGISTRATION_REQUEST
RadioButton RB_LATER
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_LATER";
Pos = MAP_APPFONT ( 33 , 54 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Remind me to register later" ;
};
RadioButton RB_NEVER
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NEVER";
Pos = MAP_APPFONT ( 33 , 67 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Never register" ;
};
RadioButton RB_DONE
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_DONE";
Pos = MAP_APPFONT ( 33 , 80 ) ;
Size = MAP_APPFONT ( 153 , 20 ) ;
WordBreak = TRUE;
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index 040f33045fff..7fc7d05ea0c9 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -165,7 +165,7 @@ namespace svt
OSL_PRECOND( i_nPosition <= m_aDrawers.size(), "DrawerDeckLayouter::PanelInserted: inconsistency!" );
PToolPanelDrawer pDrawer( new ToolPanelDrawer( m_rParentWindow, i_pPanel->GetDisplayName() ) );
- pDrawer->SetSmartHelpId( i_pPanel->GetHelpID() );
+ pDrawer->SetHelpId( i_pPanel->GetHelpID() );
// proper Z-Order
if ( i_nPosition == 0 )
{
diff --git a/svtools/source/toolpanel/dummypanel.cxx b/svtools/source/toolpanel/dummypanel.cxx
index 20f140a6e610..4de38b7f4bb3 100644
--- a/svtools/source/toolpanel/dummypanel.cxx
+++ b/svtools/source/toolpanel/dummypanel.cxx
@@ -80,9 +80,9 @@ namespace svt
}
//--------------------------------------------------------------------
- SmartId DummyPanel::GetHelpID() const
+ rtl::OString DummyPanel::GetHelpID() const
{
- return SmartId();
+ return rtl::OString();
}
//--------------------------------------------------------------------
diff --git a/svtools/source/toolpanel/dummypanel.hxx b/svtools/source/toolpanel/dummypanel.hxx
index adb98e52077e..d2ca4480fce5 100644
--- a/svtools/source/toolpanel/dummypanel.hxx
+++ b/svtools/source/toolpanel/dummypanel.hxx
@@ -49,7 +49,7 @@ namespace svt
// IToolPanel
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual SmartId GetHelpID() const;
+ virtual rtl::OString GetHelpID() const;
virtual void Activate( Window& i_rParentWindow );
virtual void Deactivate();
virtual void SetSizePixel( const Size& i_rPanelWindowSize );
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index 147b11aceb11..ea147c5979d3 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -42,6 +42,7 @@
#include <rtl/strbuf.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <tools/urlobj.hxx>
//......................................................................................................................
namespace svt { namespace uno
@@ -206,11 +207,32 @@ namespace svt { namespace uno
m_bInitialized = true;
}
+ static rtl::OString lcl_getHelpId( const ::rtl::OUString& _rHelpURL )
+ {
+ INetURLObject aHID( _rHelpURL );
+ if ( aHID.GetProtocol() == INET_PROT_HID )
+ return rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 );
+ else
+ return rtl::OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 );
+ }
+
+ //------------------------------------------------------------------------
+ static ::rtl::OUString lcl_getHelpURL( const rtl::OString& sHelpId )
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ ::rtl::OUString aTmp( sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8 );
+ INetURLObject aHID( aTmp );
+ if ( aHID.GetProtocol() == INET_PROT_NOT_VALID )
+ aBuffer.appendAscii( INET_HID_SCHEME );
+ aBuffer.append( aTmp.getStr() );
+ return aBuffer.makeStringAndClear();
+ }
+
//--------------------------------------------------------------------
Dialog* Wizard::createDialog( Window* i_pParent )
{
WizardShell* pDialog( new WizardShell( i_pParent, this, m_xController, m_aWizardSteps ) );
- pDialog->SetSmartHelpId( SmartId( m_sHelpURL ) );
+ pDialog->SetHelpId( lcl_getHelpId( m_sHelpURL ) );
pDialog->setTitleBase( m_sTitle );
return pDialog;
}
@@ -219,7 +241,7 @@ namespace svt { namespace uno
void Wizard::destroyDialog()
{
if ( m_pDialog )
- m_sHelpURL = m_pDialog->GetSmartHelpId().GetStr();
+ m_sHelpURL = lcl_getHelpURL( m_pDialog->GetHelpId() );
Wizard_Base::destroyDialog();
}
@@ -279,8 +301,7 @@ namespace svt { namespace uno
if ( !m_pDialog )
return m_sHelpURL;
- const SmartId aSmartId( m_pDialog->GetSmartHelpId() );
- return aSmartId.GetStr();
+ return lcl_getHelpURL( m_pDialog->GetHelpId() );
}
//------------------------------------------------------------------------------------------------------------------
@@ -292,7 +313,7 @@ namespace svt { namespace uno
if ( !m_pDialog )
m_sHelpURL = i_HelpURL;
else
- m_pDialog->SetSmartHelpId( SmartId( i_HelpURL ) );
+ m_pDialog->SetHelpId( lcl_getHelpId( i_HelpURL ) );
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/svtools/util/hidother.src b/svtools/util/hidother.src
index 77dd98115221..03aea7ebdf7e 100644
--- a/svtools/util/hidother.src
+++ b/svtools/util/hidother.src
@@ -57,3 +57,23 @@ hidspecial HID_PRINTDIALOG_TOFILE { HelpID = HID_PRINTDIALOG_TOFIL
hidspecial HID_WIZARD_NEXT { HelpID = HID_WIZARD_NEXT; };
hidspecial HID_WIZARD_PREVIOUS { HelpID = HID_WIZARD_PREVIOUS; };
+hidspecial HID_FILEDLG_LINK_CB { HelpID = HID_FILEDLG_LINK_CB; };
+hidspecial HID_FILEDLG_PREVIEW_CB { HelpID = HID_FILEDLG_PREVIEW_CB; };
+hidspecial HID_FILEDLG_FILE { HelpID = HID_FILEDLG_FILE; };
+hidspecial HID_FILEDLG_MANAGER { HelpID = HID_FILEDLG_MANAGER; };
+hidspecial HID_FILEDLG_READ_ONLY { HelpID = HID_FILEDLG_READ_ONLY; };
+hidspecial HID_FILEDLG_STANDARD { HelpID = HID_FILEDLG_STANDARD; };
+hidspecial HID_FILEDLG_URL { HelpID = HID_FILEDLG_URL; };
+hidspecial HID_FILEDLG_USE_PASSWD { HelpID = HID_FILEDLG_USE_PASSWD; };
+hidspecial HID_FILEDLG_AUTOCOMPLETEBOX { HelpID = HID_FILEDLG_AUTOCOMPLETEBOX; };
+hidspecial HID_FILEDLG_SAVE_BTN { HelpID = HID_FILEDLG_SAVE_BTN; };
+hidspecial HID_FILEDLG_SAVE_FILENAME { HelpID = HID_FILEDLG_SAVE_FILENAME; };
+hidspecial HID_FILEDLG_SAVE_FILETYPE { HelpID = HID_FILEDLG_SAVE_FILETYPE; };
+hidspecial HID_FILEDLG_INSERT_BTN { HelpID = HID_FILEDLG_INSERT_BTN; };
+hidspecial HID_FILEDLG_PATH_BTN { HelpID = HID_FILEDLG_PATH_BTN; };
+hidspecial HID_FILEDLG_PATH_FILENAME { HelpID = HID_FILEDLG_PATH_FILENAME; };
+hidspecial HID_FILEDLG_FOLDER_BTN { HelpID = HID_FILEDLG_FOLDER_BTN; };
+hidspecial HID_FILEDLG_FOLDER_FILENAME { HelpID = HID_FILEDLG_FOLDER_FILENAME; };
+hidspecial HID_FILEDLG_SRCHFOLDER_BTN { HelpID = HID_FILEDLG_SRCHFOLDER_BTN; };
+hidspecial HID_FILEDLG_EDIT_FAVORITES_LISTBOX { HelpID = HID_FILEDLG_EDIT_FAVORITES_LISTBOX; };
+hidspecial HID_FILEDLG_EDIT_FAVORITES_HEADERBAR { HelpID = HID_FILEDLG_EDIT_FAVORITES_HEADERBAR; };
diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx
index 6d044cee7c93..6542fe826587 100755
--- a/svtools/workben/toolpanel/toolpaneltest.cxx
+++ b/svtools/workben/toolpanel/toolpaneltest.cxx
@@ -145,7 +145,7 @@ public:
// IToolPanel
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual SmartId GetHelpID() const;
+ virtual rtl::OString GetHelpID() const;
virtual void Activate( Window& i_rParentWindow );
virtual void Deactivate();
virtual void SetSizePixel( const Size& i_rPanelWindowSize );
@@ -272,9 +272,9 @@ Image ColoredPanel::GetImage() const
}
//-----------------------------------------------------------------------------
-SmartId ColoredPanel::GetHelpID() const
+rtl::OString ColoredPanel::GetHelpID() const
{
- return SmartId();
+ return rtl::OString();
}
//=============================================================================
diff --git a/svtools/workben/unodialog/roadmapskeleton.src b/svtools/workben/unodialog/roadmapskeleton.src
index 797490273b5f..33728c700df6 100644
--- a/svtools/workben/unodialog/roadmapskeleton.src
+++ b/svtools/workben/unodialog/roadmapskeleton.src
@@ -31,6 +31,7 @@
// -----------------------------------------------------------------------------
ModalDialog DLG_ROADMAP_SKELETON
{
+ HelpID = "svtools:ModalDialog:DLG_ROADMAP_SKELETON";
OutputSize = TRUE ;
Moveable = TRUE;
Closeable = TRUE ;
@@ -61,24 +62,28 @@ ModalDialog DLG_ROADMAP_SKELETON
TabPage TP_WELCOME
{
+ HelpID = "svtools:TabPage:TP_WELCOME";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_PREPARE
{
+ HelpID = "svtools:TabPage:TP_PREPARE";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_SETUP
{
+ HelpID = "svtools:TabPage:TP_SETUP";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_FINISH
{
+ HelpID = "svtools:TabPage:TP_FINISH";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx
index 78c7ea29272a..5d013e8a74c4 100644
--- a/toolkit/inc/layout/layout.hxx
+++ b/toolkit/inc/layout/layout.hxx
@@ -40,7 +40,6 @@
#include <vcl/combobox.h>
#include <vcl/fldunit.hxx>
#include <vcl/lstbox.h>
-#include <vcl/smartid.hxx>
#include <vcl/wintypes.hxx>
class Button;
@@ -162,10 +161,8 @@ public:
String GetText() const;
void SetStyle( WinBits style );
void SetUpdateMode( bool mode );
- void SetHelpId( sal_uIntPtr id );
- sal_uIntPtr GetHelpId() const;
- void SetSmartHelpId( SmartId const&, SmartIdUpdateMode mode=SMART_SET_SMART );
- SmartId GetSmartHelpId() const;
+ void SetHelpId( const rtl::OString& id );
+ const rtl::OString& GetHelpId() const;
void EnterWait ();
void LeaveWait ();
bool IsWait () const;
@@ -582,20 +579,20 @@ public:
#define DECL_MESSAGE_BOX_CTORS(Name)\
public:\
Name##Box (::Window *parent, char const* message,\
- char const* yes=0, char const* no=0, sal_uIntPtr help_id=0,\
+ char const* yes=0, char const* no=0, const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, rtl::OUString const& message,\
rtl::OUString yes=String (),\
rtl::OUString no=String (),\
- sal_uIntPtr help_id=0,\
+ const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, WinBits, char const* message,\
- char const* yes=0, char const* no=0, sal_uIntPtr help_id=0,\
+ char const* yes=0, char const* no=0, const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, WinBits, rtl::OUString const& message,\
rtl::OUString yes=String (),\
rtl::OUString no=String (),\
- sal_uIntPtr help_id=0,\
+ const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box")\
class TOOLKIT_DLLPUBLIC MessageBox : public Dialog
@@ -616,10 +613,10 @@ protected:
YesButton yesButton;
void bits_init (WinBits bits, rtl::OUString const& message,
- rtl::OUString yes, rtl::OUString, sal_uIntPtr help_id);
+ rtl::OUString yes, rtl::OUString, const rtl::OString& help_id);
void init (rtl::OUString const& message,
- rtl::OUString const& yes, rtl::OUString const& no, sal_uIntPtr help_id);
- void init (char const* message, char const* yes, char const* no, sal_uIntPtr help_id);
+ rtl::OUString const& yes, rtl::OUString const& no, const rtl::OString& help_id);
+ void init (char const* message, char const* yes, char const* no, const rtl::OString& help_id);
};
#define CLASS_MESSAGE_BOX(Name)\
diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx
index 0e597779342e..1d3b10120e0c 100644
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@ -395,7 +395,7 @@ public:
// ::com::sun::star::awt::XDialog2
virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::XDialog
void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
index 0c5731d3f923..f6a0f768bc10 100644
--- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
@@ -274,7 +274,7 @@ public:
// ::com::sun::star::awt::XDialog2
virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::XDialog
void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/source/awt/vclxdialog.cxx b/toolkit/source/awt/vclxdialog.cxx
index 43861c3ed347..70ebade69ddc 100644
--- a/toolkit/source/awt/vclxdialog.cxx
+++ b/toolkit/source/awt/vclxdialog.cxx
@@ -206,13 +206,13 @@ void VCLXDialog::setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star
pWindow->SetText( Title );
}
-void VCLXDialog::setHelpId( sal_Int32 id ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXDialog::setHelpId( const rtl::OUString& rId ) throw(::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
Window* pWindow = GetWindow();
if ( pWindow )
- pWindow->SetHelpId( id );
+ pWindow->SetHelpId( rtl::OUStringToOString( rId, RTL_TEXTENCODING_UTF8 ) );
}
::rtl::OUString VCLXDialog::getTitle() throw(::com::sun::star::uno::RuntimeException)
diff --git a/toolkit/source/awt/vclxdialog.hxx b/toolkit/source/awt/vclxdialog.hxx
index 64b2c03f90d5..9d52064c68bf 100644
--- a/toolkit/source/awt/vclxdialog.hxx
+++ b/toolkit/source/awt/vclxdialog.hxx
@@ -98,7 +98,7 @@ public:
// ::com::sun::star::awt::XDialog2
void SAL_CALL endDialog( sal_Int32 nResult ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setHelpId( sal_Int32 id ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setHelpId( const rtl::OUString& id ) throw(::com::sun::star::uno::RuntimeException);
};
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 1022d78a43ed..808f3578ef97 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -67,7 +67,7 @@
#include <comphelper/asyncnotification.hxx>
#include <toolkit/helper/solarrelease.hxx>
#include "stylesettings.hxx"
-
+#include <tools/urlobj.hxx>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <boost/bind.hpp>
@@ -1600,17 +1600,11 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
::rtl::OUString aURL;
if ( Value >>= aURL )
{
- String aHelpURL( aURL );
- String aPattern( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- if ( aHelpURL.CompareIgnoreCaseToAscii( aPattern, aPattern.Len() ) == COMPARE_EQUAL )
- {
- String aID = aHelpURL.Copy( aPattern.Len() );
- pWindow->SetHelpId( aID.ToInt32() );
- }
+ INetURLObject aHelpURL( aURL );
+ if ( aHelpURL.GetProtocol() == INET_PROT_HID )
+ pWindow->SetHelpId( rtl::OUStringToOString( aHelpURL.GetURLPath(), RTL_TEXTENCODING_UTF8 ) );
else
- {
- pWindow->SetSmartHelpId( SmartId( aHelpURL ) );
- }
+ pWindow->SetHelpId( rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ) );
}
}
break;
@@ -2081,19 +2075,8 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
break;
case BASEPROPERTY_HELPURL:
{
- SmartId aSmartId = GetWindow()->GetSmartHelpId();
- if( aSmartId.HasString() )
- {
- String aStrHelpId = aSmartId.GetStr();
- aProp <<= ::rtl::OUString( aStrHelpId );
- }
- else
- {
- ::rtl::OUStringBuffer aURL;
- aURL.appendAscii( "HID:" );
- aURL.append( (sal_Int32) GetWindow()->GetHelpId() );
- aProp <<= aURL.makeStringAndClear();
- }
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetWindow()->GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ aProp <<= ::rtl::OUString( aHelpId );
}
break;
case BASEPROPERTY_FONTDESCRIPTOR:
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index c69e7c550d90..cc247c40b9a1 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2324,13 +2324,13 @@ void SAL_CALL VCLXDialog::endDialog( ::sal_Int32 i_result ) throw (RuntimeExcept
pDialog->EndDialog( i_result );
}
-void SAL_CALL VCLXDialog::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException)
+void SAL_CALL VCLXDialog::setHelpId( const ::rtl::OUString& rId ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
Window* pWindow = GetWindow();
if ( pWindow )
- pWindow->SetHelpId( i_id );
+ pWindow->SetHelpId( rtl::OUStringToOString( rId, RTL_TEXTENCODING_UTF8 ) );
}
void VCLXDialog::setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException)
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index c54549baed5e..ecb4d7765723 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -1990,7 +1990,7 @@ void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (Runtime
xPeerDialog->endDialog( i_result );
}
-void SAL_CALL UnoDialogControl::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException)
+void SAL_CALL UnoDialogControl::setHelpId( const rtl::OUString& i_id ) throw (RuntimeException)
{
Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
if ( xPeerDialog.is() )
diff --git a/toolkit/source/layout/core/import.cxx b/toolkit/source/layout/core/import.cxx
index 6d161cf1b07e..84e46f5b68f1 100644
--- a/toolkit/source/layout/core/import.cxx
+++ b/toolkit/source/layout/core/import.cxx
@@ -101,7 +101,7 @@ SAL_THROW (())
if ( findAndRemove( "help-id", aProps, aHelpId ) )
{
OSL_TRACE("Setting help-id: %s", OUSTRING_CSTR( aHelpId ) );
- xDialog->setHelpId( aHelpId.toInt32 () );
+ xDialog->setHelpId( aHelpId );
}
} // DEBUG:
else if ( pParent == NULL )
diff --git a/toolkit/source/layout/vcl/wrapper.cxx b/toolkit/source/layout/vcl/wrapper.cxx
index a8133250eb58..3b23ee92636b 100644
--- a/toolkit/source/layout/vcl/wrapper.cxx
+++ b/toolkit/source/layout/vcl/wrapper.cxx
@@ -304,13 +304,17 @@ void Window::setRes (ResId const& res)
{
return Resource::ReadStringRes ();
}
+ rtl::OString ReadByteStringRes()
+ {
+ return Resource::ReadByteStringRes();
+ }
};
Resource_open_up r (res);
#endif /* !RESOURCE_PUBLISH_PROTECTED */
- if (sal_uInt32 help_id = (sal_uInt32)r.GetLongRes (static_cast<char *> (r.GetClassRes ()) + 12))
- SetHelpId (help_id);
sal_uInt32 mask = r.ReadLongRes ();
+ if (mask & WINDOW_HELPID)
+ SetHelpId (r.ReadByteStringRes());
if ( mask & WINDOW_TEXT )
SetText( r.ReadStringRes ());
}
@@ -366,26 +370,16 @@ VCLXWindow* Window::GetVCLXWindow() const
return GetWindow()->GetParent();
}
-void Window::SetHelpId( sal_uIntPtr id )
+void Window::SetHelpId( const rtl::OString& id )
{
GetWindow()->SetHelpId( id );
}
-sal_uIntPtr Window::GetHelpId() const
+const rtl::OString& Window::GetHelpId() const
{
return GetWindow()->GetHelpId();
}
-void Window::SetSmartHelpId( SmartId const& id, SmartIdUpdateMode mode )
-{
- GetWindow()->SetSmartHelpId( id, mode );
-}
-
-SmartId Window::GetSmartHelpId() const
-{
- return GetWindow()->GetSmartHelpId();
-}
-
void Window::EnterWait ()
{
GetWindow()->EnterWait ();
@@ -866,7 +860,7 @@ void Dialog::Initialize (SfxChildWinInfo*)
, yesButton (this, "BTN_YES")
MessageBox::MessageBox (::Window *parent, char const* message,
- char const* yes, char const* no, sal_uIntPtr help_id,
+ char const* yes, char const* no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -876,7 +870,7 @@ MessageBox::MessageBox (::Window *parent, char const* message,
}
MessageBox::MessageBox (::Window *parent, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id,
+ OUString yes, OUString no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -890,7 +884,7 @@ MessageBox::MessageBox (::Window *parent, OUString const& message,
#endif /* !__GNUC__ */
MessageBox::MessageBox (::Window *parent, WinBits bits, char const* message,
- char const* yes, char const* no, sal_uIntPtr help_id,
+ char const* yes, char const* no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -903,7 +897,7 @@ MessageBox::MessageBox (::Window *parent, WinBits bits, char const* message,
}
MessageBox::MessageBox (::Window *parent, WinBits bits, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id,
+ OUString yes, OUString no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -916,7 +910,7 @@ MessageBox::MessageBox (::Window *parent, WinBits bits, OUString const& message,
}
void MessageBox::bits_init (WinBits bits, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id)
+ OUString yes, OUString no, const rtl::OString& help_id)
{
if ( bits & ( WB_OK_CANCEL | WB_OK ))
yes = Button::GetStandardText ( BUTTON_OK );
@@ -941,12 +935,12 @@ void MessageBox::bits_init (WinBits bits, OUString const& message,
init (message, yes, no, help_id);
}
-void MessageBox::init (char const* message, char const* yes, char const* no, sal_uIntPtr help_id)
+void MessageBox::init (char const* message, char const* yes, char const* no, const rtl::OString& help_id)
{
init ( OUString::createFromAscii (message), OUString::createFromAscii (yes), OUString::createFromAscii (no), help_id);
}
-void MessageBox::init (OUString const& message, OUString const& yes, OUString const& no, sal_uIntPtr help_id)
+void MessageBox::init (OUString const& message, OUString const& yes, OUString const& no, const rtl::OString& help_id)
{
imageError.Hide ();
imageInfo.Hide ();
@@ -974,28 +968,28 @@ void MessageBox::init (OUString const& message, OUString const& yes, OUString co
#undef MESSAGE_BOX_IMPL
#define MESSAGE_BOX_IMPL(Name)\
Name##Box::Name##Box (::Window *parent, char const* message,\
- char const* yes, char const* no, sal_uIntPtr help_id,\
+ char const* yes, char const* no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, OUString const& message,\
- OUString yes, OUString no, sal_uIntPtr help_id,\
+ OUString yes, OUString no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, WinBits bits, char const* message,\
- char const* yes, char const* no, sal_uIntPtr help_id,\
+ char const* yes, char const* no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, bits, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, WinBits bits, OUString const& message,\
- OUString yes, OUString no, sal_uIntPtr help_id,\
+ OUString yes, OUString no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, bits, message, yes, no, help_id, xml_file, id)\
{\
diff --git a/toolkit/workben/layout/sortdlg.src b/toolkit/workben/layout/sortdlg.src
index 5e855962af96..e9e2b7a0a26b 100644
--- a/toolkit/workben/layout/sortdlg.src
+++ b/toolkit/workben/layout/sortdlg.src
@@ -33,6 +33,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
Size = MAP_APPFONT ( 260 , 185 ) ;
ListBox LB_SORT1
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT1";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 19 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -41,6 +42,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP1
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP1";
Pos = MAP_APPFONT ( 172 , 14 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "~Ascending" ;
@@ -48,6 +50,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN1
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN1";
Pos = MAP_APPFONT ( 172 , 28 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "~Descending" ;
@@ -61,6 +64,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
ListBox LB_SORT2
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT2";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 60 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -69,6 +73,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP2
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP2";
Pos = MAP_APPFONT ( 172 , 55 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "A~scending" ;
@@ -76,6 +81,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN2
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN2";
Pos = MAP_APPFONT ( 172 , 69 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "D~escending" ;
@@ -89,6 +95,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
ListBox LB_SORT3
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT3";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 101 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -97,6 +104,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP3
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP3";
Pos = MAP_APPFONT ( 172 , 96 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "As~cending" ;
@@ -104,6 +112,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN3
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN3";
Pos = MAP_APPFONT ( 172 , 110 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "Desce~nding" ;
@@ -125,6 +134,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
Size = MAP_APPFONT ( 260 , 185 ) ;
CheckBox BTN_CASESENSITIVE
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_CASESENSITIVE";
Pos = MAP_APPFONT ( 12 , 6 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Case ~sensitive" ;
@@ -132,6 +142,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_LABEL
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_LABEL";
Pos = MAP_APPFONT ( 12 , 20 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
TabStop = TRUE ;
@@ -146,6 +157,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_FORMATS
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_FORMATS";
Pos = MAP_APPFONT ( 12 , 34 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Include ~formats" ;
@@ -153,6 +165,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_NATURALSORT
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_NATURALSORT";
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ de ] = "Enable ~natural sort" ;
@@ -164,6 +177,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_COPYRESULT
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT";
Pos = MAP_APPFONT ( 12 , 62 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "~Copy sort results to:" ;
@@ -171,6 +185,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_OUTAREA
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_OUTAREA";
Border = TRUE ;
Pos = MAP_APPFONT ( 20 , 73 ) ;
Size = MAP_APPFONT ( 93 , 90 ) ;
@@ -179,6 +194,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
Edit ED_OUTAREA
{
+ HelpID = "toolkit:Edit:RID_SCPAGE_SORT_OPTIONS:ED_OUTAREA";
Disable = TRUE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 119 , 73 ) ;
@@ -187,6 +203,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_SORT_USER
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_SORT_USER";
Pos = MAP_APPFONT ( 12 , 89 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Custom sort ~order" ;
@@ -194,6 +211,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_SORT_USER
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_SORT_USER";
Disable = TRUE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 20 , 100 ) ;
@@ -209,6 +227,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_LANGUAGE
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_LANGUAGE";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 129 ) ;
Size = MAP_APPFONT ( 101 , 90 ) ;
@@ -224,6 +243,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_ALGORITHM
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_ALGORITHM";
Border = TRUE ;
Pos = MAP_APPFONT ( 119 , 129 ) ;
Size = MAP_APPFONT ( 132 , 90 ) ;
@@ -238,6 +258,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
RadioButton BTN_TOP_DOWN
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_TOP_DOWN";
Pos = MAP_APPFONT ( 12 , 158 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "~Top to bottom (sort rows)" ;
@@ -245,6 +266,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
RadioButton BTN_LEFT_RIGHT
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_LEFT_RIGHT";
Pos = MAP_APPFONT ( 12 , 172 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "L~eft to right (sort columns)" ;
diff --git a/tools/inc/tools/rc.h b/tools/inc/tools/rc.h
index bd499717a3a4..e11aed2937fd 100644
--- a/tools/inc/tools/rc.h
+++ b/tools/inc/tools/rc.h
@@ -50,6 +50,7 @@ typedef short RSWND_STYLE;
#define WINDOW_EXTRALONG 0x0800
#define WINDOW_UNIQUEID 0x1000
#define WINDOW_BORDER_STYLE 0x2000
+#define WINDOW_HELPID 0x4000
// Definition der Struktur die alle "WorkWindow"-Resourcen haben
#define WORKWIN_SHOWNORMAL 0
diff --git a/tools/inc/tools/rc.hxx b/tools/inc/tools/rc.hxx
index 4bf1827a1ab6..15e077c3c62c 100644
--- a/tools/inc/tools/rc.hxx
+++ b/tools/inc/tools/rc.hxx
@@ -87,6 +87,9 @@ class TOOLS_DLLPUBLIC Resource
// read a string from resource data and increment pointer
UniString ReadStringRes()
{ return m_pResMgr->ReadString(); }
+ // read a byte string from resource data and increment pointer
+ rtl::OString ReadByteStringRes()
+ { return m_pResMgr->ReadByteString(); }
// Gibt die Resource frei (this-Zeiger fuer Fehlerueberpruefung)
// free the resource from m_pResMgr's stack (pass this ptr for validation)
diff --git a/tools/inc/tools/resmgr.hxx b/tools/inc/tools/resmgr.hxx
index b19524139078..4b79040921b3 100644
--- a/tools/inc/tools/resmgr.hxx
+++ b/tools/inc/tools/resmgr.hxx
@@ -181,13 +181,15 @@ public:
static sal_uInt32 GetObjSize( RSHEADER_TYPE* pHT )
{ return( pHT->GetGlobOff() ); }
- // Liefert einen String aus der Resource
+ // returns a string and its length out of the resource
static sal_uInt32 GetString( UniString& rStr, const BYTE* pStr );
+ // returns a byte string and its length out of the resource
+ static sal_uInt32 GetByteString( rtl::OString& rStr, const BYTE* pStr );
// Groesse eines Strings in der Resource
static sal_uInt32 GetStringSize( sal_uInt32 nLen )
{ nLen++; return (nLen + nLen%2); }
- static sal_uInt32 GetStringSize( const BYTE* pStr );
+ static sal_uInt32 GetStringSize( const BYTE* pStr, sal_uInt32& nLen );
// return a int64
static sal_uInt64 GetUInt64( void* pDatum );
@@ -209,9 +211,10 @@ public:
INT16 ReadShort();
INT32 ReadLong();
UniString ReadString();
+ rtl::OString ReadByteString();
- // generate auto help id for current resource stack
- ULONG GetAutoHelpId();
+ // generate auto help id for current resource stack
+ rtl::OString GetAutoHelpId();
static void SetReadStringHook( ResHookProc pProc );
static ResHookProc GetReadStringHook();
diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx
index 17d52432e206..cb9c7e407bcc 100644
--- a/tools/inc/tools/urlobj.hxx
+++ b/tools/inc/tools/urlobj.hxx
@@ -81,6 +81,7 @@ namespace com { namespace sun { namespace star { namespace util {
#define INET_DB_SCHEME "db:"
#define INET_BUGID_SCHEME "bugid:"
#define INET_TELNET_SCHEME "telnet://"
+#define INET_HID_SCHEME "hid:"
#define URL_PREFIX_PRIV_SOFFICE "private:"
enum
@@ -139,7 +140,8 @@ enum INetProtocol
INET_PROT_VND_SUN_STAR_TDOC = 29,
INET_PROT_GENERIC = 30,
INET_PROT_SMB = 31,
- INET_PROT_END = 32
+ INET_PROT_HID = 32,
+ INET_PROT_END = 33
};
//============================================================================
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index a6d7bc6fd04e..56e6b8ef47cc 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -424,7 +424,9 @@ static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END]
false, false, false, true, false },
{ "", "", 0, false, false, false, false, true, true, true, false },
{ "smb", "smb://", 139, true, true, false, true, true, true, true,
- true } };
+ true },
+ { "hid", "hid:", 0, false, false, false, false, false, false,
+ false, true } };
// static
inline INetURLObject::SchemeInfo const &
@@ -2094,6 +2096,8 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
{ "db:", "staroffice.db:", INET_PROT_DB, PrefixInfo::INTERNAL },
{ "file:", 0, INET_PROT_FILE, PrefixInfo::OFFICIAL },
{ "ftp:", 0, INET_PROT_FTP, PrefixInfo::OFFICIAL },
+ { "hid:", "staroffice.hid:", INET_PROT_HID,
+ PrefixInfo::INTERNAL },
{ "http:", 0, INET_PROT_HTTP, PrefixInfo::OFFICIAL },
{ "https:", 0, INET_PROT_HTTPS, PrefixInfo::OFFICIAL },
{ "imap:", 0, INET_PROT_IMAP, PrefixInfo::OFFICIAL },
@@ -2129,6 +2133,8 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
INET_PROT_PRIV_SOFFICE, PrefixInfo::EXTERNAL },
{ "staroffice.helpid:", "private:helpid/", INET_PROT_PRIV_SOFFICE,
PrefixInfo::EXTERNAL },
+ { "staroffice.hid:", "hid:", INET_PROT_HID,
+ PrefixInfo::EXTERNAL },
{ "staroffice.java:", "private:java/", INET_PROT_PRIV_SOFFICE,
PrefixInfo::EXTERNAL },
{ "staroffice.macro:", "macro:", INET_PROT_MACRO,
@@ -3120,6 +3126,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
case INET_PROT_PRIV_SOFFICE:
case INET_PROT_SLOT:
+ case INET_PROT_HID:
case INET_PROT_MACRO:
case INET_PROT_UNO:
case INET_PROT_COMPONENT:
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index d05fcac331f2..2e6401f5a19f 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -46,6 +46,7 @@
#include <osl/file.hxx>
#include <osl/mutex.hxx>
#include <rtl/ustrbuf.hxx>
+#include <rtl/strbuf.hxx>
#include <tools/urlobj.hxx>
#include <rtl/instance.hxx>
#include <rtl/bootstrap.hxx>
@@ -1351,7 +1352,8 @@ sal_uInt64 ResMgr::GetUInt64( void* pDatum )
// -----------------------------------------------------------------------
sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const BYTE* pStr )
{
- sal_uInt32 nRet = GetStringSize( pStr );
+ sal_uInt32 nLen=0;
+ sal_uInt32 nRet = GetStringSize( pStr, nLen );
UniString aString( (sal_Char*)pStr, RTL_TEXTENCODING_UTF8,
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |
RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |
@@ -1370,11 +1372,20 @@ sal_uInt32 ResMgr::GetString( UniString& rStr, const BYTE* pStr )
return nRet;
}
+sal_uInt32 ResMgr::GetByteString( rtl::OString& rStr, const BYTE* pStr )
+{
+ sal_uInt32 nLen=0;
+ sal_uInt32 nRet = GetStringSize( pStr, nLen );
+ rStr = rtl::OString( (const sal_Char*)pStr, nLen );
+ return nRet;
+}
+
// ------------------------------------------------------------------
-sal_uInt32 ResMgr::GetStringSize( const BYTE* pStr )
+sal_uInt32 ResMgr::GetStringSize( const BYTE* pStr, sal_uInt32& nLen )
{
- return GetStringSize( strlen( (const char*)pStr ) );
+ nLen = static_cast< sal_uInt32 >( strlen( (const char*)pStr ) );
+ return GetStringSize( nLen );
}
// -----------------------------------------------------------------------
@@ -1765,90 +1776,125 @@ UniString ResMgr::ReadString()
return aRet;
}
+rtl::OString ResMgr::ReadByteString()
+{
+ osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
+
+ if( pFallbackResMgr )
+ return pFallbackResMgr->ReadByteString();
+
+ rtl::OString aRet;
+
+ const ImpRCStack& rTop = aStack[nCurStack];
+ if( (rTop.Flags & RC_NOTFOUND) )
+ {
+ #if OSL_DEBUG_LEVEL > 0
+ aRet = OString( "<resource not found>" );
+ #endif
+ }
+ else
+ Increment( GetByteString( aRet, (const BYTE*)GetClass() ) );
+
+ return aRet;
+}
+
// -----------------------------------------------------------------------
-ULONG ResMgr::GetAutoHelpId()
+rtl::OString ResMgr::GetAutoHelpId()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->GetAutoHelpId();
- DBG_ASSERT( nCurStack, "resource stack empty in Auto help id generation" );
+ OSL_ENSURE( nCurStack, "resource stack empty in Auto help id generation" );
if( nCurStack < 1 || nCurStack > 2 )
- return 0;
-
- const ImpRCStack *pRC = StackTop( nCurStack==1 ? 0 : 1 );
-
- DBG_ASSERT( pRC->pResource, "MM hat gesagt, dass der immer einen hat" );
- ULONG nGID = pRC->pResource->GetId();
-
- if( !nGID || nGID > 32767 )
- return 0;
-
- ULONG nHID = 0;
-
- // GGGg gggg::gggg gggg::ggLL LLLl::llll llll
- switch( pRC->pResource->GetRT() ) { // maximal 7
- case RSC_DOCKINGWINDOW:
- nHID += 0x20000000L;
- case RSC_WORKWIN:
- nHID += 0x20000000L;
- case RSC_MODELESSDIALOG:
- nHID += 0x20000000L;
- case RSC_FLOATINGWINDOW:
- nHID += 0x20000000L;
- case RSC_MODALDIALOG:
- nHID += 0x20000000L;
- case RSC_TABPAGE:
- nHID += 0x20000000L;
-
- if( nCurStack == 2 ) {
- pRC = StackTop();
- ULONG nLID = pRC->pResource->GetId();
-
- if( !nLID || nLID > 511 )
- return 0;
-
- switch( pRC->pResource->GetRT() ) { // maximal 32
- case RSC_TABCONTROL: nHID |= 0x0000; break;
- case RSC_RADIOBUTTON: nHID |= 0x0200; break;
- case RSC_CHECKBOX: nHID |= 0x0400; break;
- case RSC_TRISTATEBOX: nHID |= 0x0600; break;
- case RSC_EDIT: nHID |= 0x0800; break;
- case RSC_MULTILINEEDIT: nHID |= 0x0A00; break;
- case RSC_MULTILISTBOX: nHID |= 0x0C00; break;
- case RSC_LISTBOX: nHID |= 0x0E00; break;
- case RSC_COMBOBOX: nHID |= 0x1000; break;
- case RSC_PUSHBUTTON: nHID |= 0x1200; break;
- case RSC_SPINFIELD: nHID |= 0x1400; break;
- case RSC_PATTERNFIELD: nHID |= 0x1600; break;
- case RSC_NUMERICFIELD: nHID |= 0x1800; break;
- case RSC_METRICFIELD: nHID |= 0x1A00; break;
- case RSC_CURRENCYFIELD: nHID |= 0x1C00; break;
- case RSC_DATEFIELD: nHID |= 0x1E00; break;
- case RSC_TIMEFIELD: nHID |= 0x2000; break;
- case RSC_IMAGERADIOBUTTON: nHID |= 0x2200; break;
- case RSC_NUMERICBOX: nHID |= 0x2400; break;
- case RSC_METRICBOX: nHID |= 0x2600; break;
- case RSC_CURRENCYBOX: nHID |= 0x2800; break;
- case RSC_DATEBOX: nHID |= 0x2A00; break;
- case RSC_TIMEBOX: nHID |= 0x2C00; break;
- case RSC_IMAGEBUTTON: nHID |= 0x2E00; break;
- case RSC_MENUBUTTON: nHID |= 0x3000; break;
- case RSC_MOREBUTTON: nHID |= 0x3200; break;
+ return rtl::OString();
+
+ // prepare HID, start with resource prefix
+ rtl::OStringBuffer aHID( 32 );
+ aHID.append( rtl::OUStringToOString( pImpRes->aPrefix, RTL_TEXTENCODING_UTF8 ) );
+ aHID.append( '.' );
+
+ // append type
+ const ImpRCStack *pRC = StackTop();
+ OSL_ENSURE( pRC, "missing resource stack level" );
+
+ if ( nCurStack == 1 )
+ {
+ // auto help ids for top level windows
+ switch( pRC->pResource->GetRT() ) {
+ case RSC_DOCKINGWINDOW: aHID.append( "DockingWindow" ); break;
+ case RSC_WORKWIN: aHID.append( "WorkWindow" ); break;
+ case RSC_MODELESSDIALOG: aHID.append( "ModelessDialog" ); break;
+ case RSC_FLOATINGWINDOW: aHID.append( "FloatingWindow" ); break;
+ case RSC_MODALDIALOG: aHID.append( "ModalDialog" ); break;
+ case RSC_TABPAGE: aHID.append( "TabPage" ); break;
+ default: return rtl::OString();
+ }
+ }
+ else
+ {
+ // only controls with the following parents get auto help ids
+ const ImpRCStack *pRC1 = StackTop(1);
+ switch( pRC1->pResource->GetRT() ) {
+ case RSC_DOCKINGWINDOW:
+ case RSC_WORKWIN:
+ case RSC_MODELESSDIALOG:
+ case RSC_FLOATINGWINDOW:
+ case RSC_MODALDIALOG:
+ case RSC_TABPAGE:
+ // intentionally no breaks!
+ // auto help ids for controls
+ switch( pRC->pResource->GetRT() ) {
+ case RSC_TABCONTROL: aHID.append( "TabControl" ); break;
+ case RSC_RADIOBUTTON: aHID.append( "RadioButton" ); break;
+ case RSC_CHECKBOX: aHID.append( "CheckBox" ); break;
+ case RSC_TRISTATEBOX: aHID.append( "TriStateBox" ); break;
+ case RSC_EDIT: aHID.append( "Edit" ); break;
+ case RSC_MULTILINEEDIT: aHID.append( "MultiLineEdit" ); break;
+ case RSC_MULTILISTBOX: aHID.append( "MultiListBox" ); break;
+ case RSC_LISTBOX: aHID.append( "ListBox" ); break;
+ case RSC_COMBOBOX: aHID.append( "ComboBox" ); break;
+ case RSC_PUSHBUTTON: aHID.append( "PushButton" ); break;
+ case RSC_SPINFIELD: aHID.append( "SpinField" ); break;
+ case RSC_PATTERNFIELD: aHID.append( "PatternField" ); break;
+ case RSC_NUMERICFIELD: aHID.append( "NumericField" ); break;
+ case RSC_METRICFIELD: aHID.append( "MetricField" ); break;
+ case RSC_CURRENCYFIELD: aHID.append( "CurrencyField" ); break;
+ case RSC_DATEFIELD: aHID.append( "DateField" ); break;
+ case RSC_TIMEFIELD: aHID.append( "TimeField" ); break;
+ case RSC_IMAGERADIOBUTTON: aHID.append( "ImageRadioButton" ); break;
+ case RSC_NUMERICBOX: aHID.append( "NumericBox" ); break;
+ case RSC_METRICBOX: aHID.append( "MetricBox" ); break;
+ case RSC_CURRENCYBOX: aHID.append( "CurrencyBox" ); break;
+ case RSC_DATEBOX: aHID.append( "DateBox" ); break;
+ case RSC_TIMEBOX: aHID.append( "TimeBox" ); break;
+ case RSC_IMAGEBUTTON: aHID.append( "ImageButton" ); break;
+ case RSC_MENUBUTTON: aHID.append( "MenuButton" ); break;
+ case RSC_MOREBUTTON: aHID.append( "MoreButton" ); break;
default:
- return 0;
- } // of switch
- nHID |= nLID;
- } // of if
- break;
- default:
- return 0;
- } // of switch
- nHID |= nGID << 14;
+ // no type, no auto HID
+ return rtl::OString();
+ }
+ break;
+ default:
+ return rtl::OString();
+ }
+ }
+
+ // append resource id hierarchy
+ for( int nOff = nCurStack-1; nOff >= 0; nOff-- )
+ {
+ aHID.append( '.' );
+ pRC = StackTop( nOff );
+
+ OSL_ENSURE( pRC->pResource, "missing resource in resource stack level !" );
+ if( pRC->pResource )
+ aHID.append( sal_Int32( pRC->pResource->GetId() ) );
+ }
- return nHID;
+ return aHID.makeStringAndClear();
}
// -----------------------------------------------------------------------
diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.src b/ucbhelper/workben/ucbexplorer/ucbexplorer.src
index 4bee5900eaaf..523813324710 100644
--- a/ucbhelper/workben/ucbexplorer/ucbexplorer.src
+++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.src
@@ -100,6 +100,7 @@ Bitmap BMP_LINK
ModalDialog DLG_STRINGINPUT
{
+ HelpID = "ucbhelper:ModalDialog:DLG_STRINGINPUT";
Border = TRUE ;
Moveable = TRUE ;
OutputSize = TRUE ;
@@ -113,6 +114,7 @@ ModalDialog DLG_STRINGINPUT
};
Edit ED_STRINGINPUT_DLG_NAME
{
+ HelpID = "ucbhelper:Edit:DLG_STRINGINPUT:ED_STRINGINPUT_DLG_NAME";
Pos = MAP_APPFONT ( 40 , 16 ) ;
Size = MAP_APPFONT ( 110 , 12 ) ;
Border = TRUE ;
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index 996ca54cdfce..e7d9a14b52aa 100755
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -78,6 +78,10 @@
id mpMouseEventListener;
id mDraggingDestinationHandler;
NSEvent* mpLastSuperEvent;
+
+ // #i102807# used by magnify event handler
+ NSTimeInterval mfLastMagnifyTime;
+ float mfMagnifyDeltaSum;
}
+(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index cce018ac6229..2ebb24437c24 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -450,7 +450,6 @@ SalInstance* CreateSalInstance()
ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true;
ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10;
- ImplGetSVData()->maGDIData.mbPrinterPullModel = true;
ImplGetSVData()->maGDIData.mbNoXORClipping = true;
ImplGetSVData()->maWinData.mbNoSaveBackground = true;
diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.cxx b/vcl/aqua/source/dtrans/aqua_clipboard.cxx
index 52fb13e1e11f..abffeebcb6c1 100644
--- a/vcl/aqua/source/dtrans/aqua_clipboard.cxx
+++ b/vcl/aqua/source/dtrans/aqua_clipboard.cxx
@@ -322,14 +322,17 @@ void AquaClipboard::fireLostClipboardOwnershipEvent(Reference<XClipboardOwner> o
void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type)
{
- DataProviderPtr_t dp = mpDataFlavorMapper->getDataProvider(type, mXClipboardContent);
- NSData* pBoardData = NULL;
-
- if (dp.get() != NULL)
- {
- pBoardData = (NSData*)dp->getSystemData();
- [sender setData: pBoardData forType: type];
- }
+ if( mXClipboardContent.is() )
+ {
+ DataProviderPtr_t dp = mpDataFlavorMapper->getDataProvider(type, mXClipboardContent);
+ NSData* pBoardData = NULL;
+
+ if (dp.get() != NULL)
+ {
+ pBoardData = (NSData*)dp->getSystemData();
+ [sender setData: pBoardData forType: type];
+ }
+ }
}
@@ -340,20 +343,21 @@ void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type)
void SAL_CALL AquaClipboard::flushClipboard()
throw(RuntimeException)
{
- if (mXClipboardContent.is())
+ if (mXClipboardContent.is())
{
Sequence<DataFlavor> flavorList = mXClipboardContent->getTransferDataFlavors();
sal_uInt32 nFlavors = flavorList.getLength();
for (sal_uInt32 i = 0; i < nFlavors; i++)
- {
+ {
NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i]);
if (sysType != NULL)
- {
+ {
provideDataForType(mPasteboard, sysType);
- }
- }
+ }
+ }
+ mXClipboardContent.clear();
}
}
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index ff4edcbf83f9..c79add81d791 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -460,6 +460,8 @@ ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USH
return getUseNativeDialog() ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
return 1;
+ case PRINTER_CAPABILITIES_USEPULLMODEL:
+ return 1;
default: break;
};
return 0;
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 935c987f65cc..240a915e4e12 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -392,6 +392,7 @@ static AquaSalFrame* getMouseContainerFrame()
mpLastSuperEvent = nil;
}
+ mfLastMagnifyTime = 0.0;
return self;
}
@@ -657,21 +658,40 @@ private:
// TODO: ?? -(float)magnification;
if( AquaSalFrame::isAlive( mpFrame ) )
- {
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ {
+ const NSTimeInterval fMagnifyTime = [pEvent timestamp];
+ mpFrame->mnLastEventTime = static_cast<ULONG>( fMagnifyTime * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
-
- float dZ = 0.0;
- for(;;)
+
+ // check if this is a new series of magnify events
+ static const NSTimeInterval fMaxDiffTime = 0.3;
+ const bool bNewSeries = (fMagnifyTime - mfLastMagnifyTime > fMaxDiffTime);
+
+ if( bNewSeries )
+ mfMagnifyDeltaSum = 0.0;
+ mfMagnifyDeltaSum += [pEvent deltaZ];
+
+ mfLastMagnifyTime = [pEvent timestamp];
+ // TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control
+ static const float fMagnifyFactor = 0.25;
+ static const float fMinMagnifyStep = 15.0 / fMagnifyFactor;
+ if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep )
+ return;
+
+ // adapt NSEvent-sensitivity to application expectations
+ // TODO: rather make COMMAND_WHEEL_ZOOM handlers smarter
+ const float fDeltaZ = mfMagnifyDeltaSum * fMagnifyFactor;
+ int nDeltaZ = FRound( fDeltaZ );
+ if( !nDeltaZ )
{
- dZ += [pEvent deltaZ];
- NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask
- untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ];
- if( !pNextEvent )
- break;
- pEvent = pNextEvent;
+ // handle new series immediately
+ if( !bNewSeries )
+ return;
+ nDeltaZ = (fDeltaZ >= 0.0) ? +1 : -1;
}
-
+ // eventually give credit for delta sum
+ mfMagnifyDeltaSum -= nDeltaZ / fMagnifyFactor;
+
NSPoint aPt = [NSEvent mouseLocation];
mpFrame->CocoaToVCL( aPt );
@@ -687,18 +707,15 @@ private:
if( Application::GetSettings().GetLayoutRTL() )
aEvent.mnX = mpFrame->maGeometry.nWidth-1-aEvent.mnX;
- if( dZ != 0.0 )
- {
- aEvent.mnDelta = static_cast<long>(floor(dZ));
- aEvent.mnNotchDelta = dZ < 0 ? -1 : 1;
- if( aEvent.mnDelta == 0 )
- aEvent.mnDelta = aEvent.mnNotchDelta;
- aEvent.mbHorz = FALSE;
- aEvent.mnScrollLines = dZ > 0 ? dZ/WHEEL_EVENT_FACTOR : -dZ/WHEEL_EVENT_FACTOR;
- if( aEvent.mnScrollLines == 0 )
- aEvent.mnScrollLines = 1;
- mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
- }
+ aEvent.mnDelta = nDeltaZ;
+ aEvent.mnNotchDelta = (nDeltaZ >= 0) ? +1 : -1;
+ if( aEvent.mnDelta == 0 )
+ aEvent.mnDelta = aEvent.mnNotchDelta;
+ aEvent.mbHorz = FALSE;
+ aEvent.mnScrollLines = nDeltaZ;
+ if( aEvent.mnScrollLines == 0 )
+ aEvent.mnScrollLines = 1;
+ mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
}
}
diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx
index b413184f477f..0250cece817e 100644
--- a/vcl/inc/cupsmgr.hxx
+++ b/vcl/inc/cupsmgr.hxx
@@ -70,7 +70,7 @@ class CUPSManager : public PrinterInfoManager
virtual void initialize();
- void getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const;
+ void getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const;
void runDests();
public:
// public for stub
@@ -84,7 +84,7 @@ public:
const char* authenticateUser( const char* );
virtual FILE* startSpool( const rtl::OUString& rPrinterName, bool bQuickCommand );
- virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
virtual void setupJobContextData( JobData& rData );
// changes the info about a named printer
diff --git a/vcl/inc/vcl/btndlg.hxx b/vcl/inc/vcl/btndlg.hxx
index dbeb8350a0d4..3186ba5f6399 100644
--- a/vcl/inc/vcl/btndlg.hxx
+++ b/vcl/inc/vcl/btndlg.hxx
@@ -104,8 +104,8 @@ public:
XubString GetButtonText( USHORT nId ) const;
void SetButtonHelpText( USHORT nId, const XubString& rText );
XubString GetButtonHelpText( USHORT nId ) const;
- void SetButtonHelpId( USHORT nId, ULONG nHelpId );
- ULONG GetButtonHelpId( USHORT nId ) const;
+ void SetButtonHelpId( USHORT nId, const rtl::OString& rHelpId );
+ rtl::OString GetButtonHelpId( USHORT nId ) const;
void SetFocusButton( USHORT nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
USHORT GetFocusButton() const { return mnFocusButtonId; }
diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx
index 30308aa8a723..1f4ba36d8f43 100644
--- a/vcl/inc/vcl/help.hxx
+++ b/vcl/inc/vcl/help.hxx
@@ -52,8 +52,8 @@ class Window;
#define QUICKHELP_BIDI_RTL ((USHORT)0x8000)
// By changes you must also change: rsc/vclrsc.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
+#define OOO_HELP_INDEX ".help:index"
+#define OOO_HELP_HELPONHELP ".help:helponhelp"
// --------
// - Help -
@@ -71,10 +71,9 @@ public:
void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
const String& GetHelpFile() const { return maHelpFile; }
- virtual BOOL Start( ULONG nHelpId, const Window* pWindow );
- virtual BOOL Start( const XubString& rKeyWord, const Window* pWindow );
- virtual void OpenHelpAgent( ULONG nHelpId );
- virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow );
+ virtual BOOL Start( const XubString& rHelpId, const Window* pWindow );
+ virtual BOOL SearchKeyword( const XubString& rKeyWord );
+ virtual void OpenHelpAgent( const rtl::OString& rHelpId );
virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow );
static void EnableContextHelp();
diff --git a/vcl/inc/vcl/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx
index f576b816dab0..18330ae3508d 100644
--- a/vcl/inc/vcl/jobdata.hxx
+++ b/vcl/inc/vcl/jobdata.hxx
@@ -50,6 +50,7 @@ struct JobData
int m_nColorDepth;
int m_nPSLevel; // 0: no override, else languaglevel to use
int m_nColorDevice; // 0: no override, -1 grey scale, +1 color
+ int m_nPDFDevice; // 0: PostScript, 1: PDF
orientation::type m_eOrientation;
::rtl::OUString m_aPrinterName;
const PPDParser* m_pParser;
@@ -64,6 +65,7 @@ struct JobData
m_nColorDepth( 24 ),
m_nPSLevel( 0 ),
m_nColorDevice( 0 ),
+ m_nPDFDevice( 0 ),
m_eOrientation( orientation::Portrait ),
m_pParser( NULL ) {}
@@ -72,6 +74,8 @@ struct JobData
JobData( const JobData& rData ) { *this = rData; }
void setCollate( bool bCollate );
+ bool setPaper( int nWidth, int nHeight ); // dimensions in pt
+ bool setPaperBin( int nPaperBin ); // dimensions in pt
// creates a new buffer using new
// it is up to the user to delete it again
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 908f3e30319c..d57fdeb7cfd3 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -304,8 +304,8 @@ public:
void SetHelpCommand( USHORT nItemId, const XubString& rString );
const XubString& GetHelpCommand( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
const Link& GetActivateHdl() const { return aActivateHdl; }
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index 419814e5ce97..27dbbfc80c72 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -47,6 +47,7 @@
class Font;
class Point;
class OutputDevice;
+class GDIMetaFile;
class MapMode;
class Polygon;
class LineInfo;
@@ -61,6 +62,8 @@ class Wallpaper;
namespace vcl
{
+class PDFExtOutDevData;
+
struct PDFDocInfo
{
String Title; // document title
@@ -578,6 +581,8 @@ The following structure describes the permissions used in PDF security
rtl::OUString UserPassword; // user password for PDF, in clear text
com::sun::star::lang::Locale DocumentLocale; // defines the document default language
+ sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
+ // 0 here specifies a default handling
PDFWriterContext() :
RelFsys( false ), //i56629, i49415?, i64585?
@@ -606,7 +611,9 @@ The following structure describes the permissions used in PDF security
OpenBookmarkLevels( -1 ),
AccessPermissions( ),
Encrypt( false ),
- Security128bit( true )
+ Security128bit( true ),
+ DPIx( 0 ),
+ DPIy( 0 )
{}
};
@@ -635,6 +642,24 @@ The following structure describes the permissions used in PDF security
returns the page id of the new page
*/
sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
+ /** Play a metafile like an outputdevice would do
+ */
+ struct PlayMetafileContext
+ {
+ int m_nMaxImageResolution;
+ bool m_bOnlyLosslessCompression;
+ int m_nJPEGQuality;
+ bool m_bTransparenciesWereRemoved;
+
+ PlayMetafileContext()
+ : m_nMaxImageResolution( 0 )
+ , m_bOnlyLosslessCompression( false )
+ , m_nJPEGQuality( 90 )
+ , m_bTransparenciesWereRemoved( false )
+ {}
+
+ };
+ void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
/*
* set document info; due to the use of document information in building the PDF document ID, must be called before
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index be7633f13d53..c389034d918f 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -514,21 +514,24 @@ public:
bool isDirectPrint() const;
// implementation details, not usable outside vcl
- SAL_DLLPRIVATE int getFilteredPageCount();
+ // don't use outside vcl. Some of these ar exported for
+ // the benefit of vcl's plugins.
+ // Still: DO NOT USE OUTSIDE VCL
+ int getFilteredPageCount();
SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
- SAL_DLLPRIVATE PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
+ PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
SAL_DLLPRIVATE void printFilteredPage( int i_nPage );
SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr<Printer>& );
SAL_DLLPRIVATE void setOptionChangeHdl( const Link& );
- SAL_DLLPRIVATE void createProgressDialog();
- SAL_DLLPRIVATE bool isProgressCanceled() const;
+ void createProgressDialog();
+ bool isProgressCanceled() const;
SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const;
- SAL_DLLPRIVATE void setLastPage( sal_Bool i_bLastPage );
+ void setLastPage( sal_Bool i_bLastPage );
SAL_DLLPRIVATE void setReversePrint( sal_Bool i_bReverse );
SAL_DLLPRIVATE bool getReversePrint() const;
SAL_DLLPRIVATE void pushPropertiesToPrinter();
- SAL_DLLPRIVATE void setJobState( com::sun::star::view::PrintableState );
+ void setJobState( com::sun::star::view::PrintableState );
SAL_DLLPRIVATE bool setupPrinter( Window* i_pDlgParent );
SAL_DLLPRIVATE int getPageCountProtected() const;
diff --git a/vcl/inc/vcl/printerinfomanager.hxx b/vcl/inc/vcl/printerinfomanager.hxx
index f03234db3268..5e94ed919a4e 100644
--- a/vcl/inc/vcl/printerinfomanager.hxx
+++ b/vcl/inc/vcl/printerinfomanager.hxx
@@ -219,8 +219,10 @@ public:
// this may either be a regular file or the result of popen()
virtual FILE* startSpool( const rtl::OUString& rPrinterName, bool bQuickCommand );
// close the FILE* returned by startSpool and does the actual spooling
+ // set bBanner to "false" will attempt to suppress banner printing
+ // set bBanner to "true" will rely on the system default
// returns a numerical job id
- virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
// for spadmin: whether adding or removing a printer is possible
virtual bool addOrRemovePossible() const;
diff --git a/vcl/inc/vcl/prntypes.hxx b/vcl/inc/vcl/prntypes.hxx
index 6b2af991f2dd..244154360f3b 100644
--- a/vcl/inc/vcl/prntypes.hxx
+++ b/vcl/inc/vcl/prntypes.hxx
@@ -91,5 +91,6 @@ enum Orientation { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE };
#define PRINTER_CAPABILITIES_PDF ((USHORT)9)
#define PRINTER_CAPABILITIES_EXTERNALDIALOG ((USHORT)10)
#define PRINTER_CAPABILITIES_SETDUPLEX ((USHORT)11)
+#define PRINTER_CAPABILITIES_USEPULLMODEL ((USHORT)12)
#endif // _SV_PRNTYPES_HXX
diff --git a/vcl/inc/vcl/smartid.hxx b/vcl/inc/vcl/smartid.hxx
deleted file mode 100755
index 2cc5f347b2cb..000000000000
--- a/vcl/inc/vcl/smartid.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SMARTID_HXX_
-#define _SMARTID_HXX_
-
-#include <tools/string.hxx>
-#include <vcl/dllapi.h>
-
-/// SMART_SET_SMART only sets the Ids that are defined in the SmartId
-/// the other types set whatever is given. This can also be used to reset an Id
-enum SmartIdUpdateMode { SMART_SET_SMART, SMART_SET_NUM, SMART_SET_STR, SMART_SET_ALL };
-
-struct ImplSmartIdData;
-
-/*
-
-SmartId is a substitute for Numeric HelpIds. They can handle Numeric and String HelpIds and offer commonly needed operators.
-
-Matching Ids:
-if part of an Id is not set (HasNumeric HasString is False) then this part will never match to anything. Not even unset values
-
-*/
-class VCL_DLLPUBLIC SmartId
-{
-private:
- ImplSmartIdData* mpData;
- SAL_DLLPRIVATE ImplSmartIdData* GetSmartIdData();
-
-public:
- explicit SmartId( const String& rId );
- explicit SmartId( ULONG nId );
- SmartId( const String& rId, ULONG nId );
-
- SmartId();
-
- SmartId( const SmartId& rId );
- SmartId& operator = ( const SmartId& rId );
-
- ~SmartId();
-
- void UpdateId( const SmartId& rId, SmartIdUpdateMode aMode = SMART_SET_SMART );
-
- BOOL HasNumeric() const;
- BOOL HasString() const;
- BOOL HasAny() const;
- ULONG GetNum() const;
- String GetStr() const;
-
- String GetText() const; /// return String for UI usage
-
- BOOL Matches( const String &rId )const;
- BOOL Matches( const ULONG nId ) const;
-/// In case both Ids have both values set only the StringId is used for Matching
- BOOL Matches( const SmartId &rId ) const;
-
- BOOL Equals( const SmartId &rId ) const;
-
- BOOL operator == ( const SmartId& rRight ) const;
- BOOL operator < ( const SmartId& rRight ) const;
-};
-
-#endif
diff --git a/vcl/inc/vcl/status.hxx b/vcl/inc/vcl/status.hxx
index 810ecf230960..907d08272cbb 100644
--- a/vcl/inc/vcl/status.hxx
+++ b/vcl/inc/vcl/status.hxx
@@ -183,8 +183,8 @@ public:
using Window::GetQuickHelpText;
const XubString& GetQuickHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
void SetBottomBorder( BOOL bBottomBorder = TRUE );
BOOL IsBottomBorder() const { return mbBottomBorder; }
@@ -205,9 +205,9 @@ public:
const XubString& GetHelpText() const
{ return Window::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Window::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Window::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Window::GetHelpId(); }
Size CalcWindowSizePixel() const;
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index fe69b0c0b4d4..0d54a82a1937 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -208,7 +208,6 @@ struct ImplSVGDIData
BOOL mbFontSubChanged; // TRUE: FontSubstitution wurde zwischen Begin/End geaendert
utl::DefaultFontConfiguration* mpDefaultFontConfiguration;
utl::FontSubstConfiguration* mpFontSubstConfiguration;
- bool mbPrinterPullModel; // true: use pull model instead of normal push model when printing
bool mbNativeFontConfig; // true: do not override UI font
bool mbNoXORClipping; // true: do not use XOR to achieve clipping effects
};
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index 4c63b12f15fe..ad702ac4dc54 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -70,7 +70,6 @@ private:
BOOL mbRestoreUnqId;
BOOL mbSingleLine;
BOOL mbScroll;
- BOOL mbRestoreSmartId;
BOOL mbSmallInvalidate;
BOOL mbExtraSpace;
Link maActivateHdl;
@@ -177,8 +176,8 @@ public:
void SetHelpText( USHORT nPageId, const XubString& rText );
const XubString& GetHelpText( USHORT nPageId ) const;
- void SetHelpId( USHORT nPageId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nPageId ) const;
+ void SetHelpId( USHORT nPageId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nPageId ) const;
void SetPageImage( USHORT nPageId, const Image& rImage );
const Image* GetPageImage( USHORT nPageId ) const;
@@ -188,9 +187,9 @@ public:
const XubString& GetHelpText() const
{ return Control::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Control::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Control::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Control::GetHelpId(); }
void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
diff --git a/vcl/inc/vcl/toolbox.h b/vcl/inc/vcl/toolbox.h
index 33e4e8d2e013..7cdeb0b17a5a 100644
--- a/vcl/inc/vcl/toolbox.h
+++ b/vcl/inc/vcl/toolbox.h
@@ -68,7 +68,7 @@ struct ImplToolItem
XubString maQuickHelpText;
XubString maHelpText;
String maCommandStr;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
Rectangle maCalcRect;
// the overall horizontal item size, including one or more of [image size + textlength + dropdown arrow]
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index 5cc102842dc3..aa7ddd886bbb 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -511,8 +511,8 @@ public:
void SetHelpText( USHORT nItemId, const XubString& rText );
const XubString& GetHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
// window size according to current alignment, floating state and number of lines
Size CalcWindowSizePixel() const;
@@ -569,9 +569,9 @@ public:
const XubString& GetHelpText() const
{ return DockingWindow::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { DockingWindow::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { DockingWindow::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return DockingWindow::GetHelpId(); }
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index 691c3ed18421..ff76874de11a 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -56,7 +56,7 @@ class VirtualDevice;
class Cursor;
class ImplDevFontList;
class ImplFontCache;
-class SmartId;
+class SalControlHandle;
class VCLXWindow;
class SalFrame;
class SalObject;
@@ -120,8 +120,6 @@ struct ImplWinData
USHORT mnIsTopWindow;
BOOL mbMouseOver; // tracks mouse over for native widget paint effect
BOOL mbEnableNativeWidget; // toggle native widget rendering
- SmartId* mpSmartHelpId;
- SmartId* mpSmartUniqueId;
::std::list< Window* >
maTopWindowChildren;
};
@@ -254,8 +252,8 @@ public:
long mnY;
long mnAbsScreenX;
Point maPos;
- ULONG mnHelpId;
- ULONG mnUniqId;
+ rtl::OString maHelpId;
+ rtl::OString maUniqId;
XubString maHelpText;
XubString maQuickHelpText;
InputContext maInputContext;
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 5e581f4e933b..d209becfb4ae 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -50,7 +50,6 @@
#include <rtl/ustring.hxx>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#include <vcl/smartid.hxx>
class VirtualDevice;
struct ImplDelData;
@@ -954,16 +953,12 @@ public:
void SetQuickHelpText( const XubString& rHelpText );
const XubString& GetQuickHelpText() const;
- void SetHelpId( ULONG nHelpId ); /// deprecated
- ULONG GetHelpId() const; /// deprecated
- void SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartHelpId() const;
+ void SetHelpId( const rtl::OString& );
+ const rtl::OString& GetHelpId() const;
- void SetUniqueId( ULONG nUniqueId ); /// deprecated
- ULONG GetUniqueId() const; /// deprecated
- void SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartUniqueId() const;
- SmartId GetSmartUniqueOrHelpId() const;
+ void SetUniqueId( const rtl::OString& );
+ const rtl::OString& GetUniqueId() const;
+ const rtl::OString& GetUniqueOrHelpId() const;
Window* FindWindow( const Point& rPos ) const;
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 6af056eec45b..0023604109c8 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -146,7 +146,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\pdfextoutdevdata.hxx %_DEST%\inc%_EXT%\vcl\pdfextoutdevdata.hxx
..\inc\vcl\pngread.hxx %_DEST%\inc%_EXT%\vcl\pngread.hxx
..\inc\vcl\pngwrite.hxx %_DEST%\inc%_EXT%\vcl\pngwrite.hxx
-..\inc\vcl\smartid.hxx %_DEST%\inc%_EXT%\vcl\smartid.hxx
..\inc\vcl\configsettings.hxx %_DEST%\inc%_EXT%\vcl\configsettings.hxx
..\inc\vcl\ImageListProvider.hxx %_DEST%\inc%_EXT%\vcl\ImageListProvider.hxx
..\inc\vcl\fontmanager.hxx %_DEST%\inc%_EXT%\vcl\fontmanager.hxx
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 1f9efa7b6e65..2c7ad2fa9c3e 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -62,12 +62,7 @@ Help::~Help()
// -----------------------------------------------------------------------
-BOOL Help::Start( ULONG, const Window* )
-{
- return FALSE;
-}
-
-void Help::OpenHelpAgent( ULONG )
+void Help::OpenHelpAgent( const rtl::OString& )
{
}
@@ -78,11 +73,9 @@ BOOL Help::Start( const XubString&, const Window* )
return FALSE;
}
-// -----------------------------------------------------------------------
-
-XubString Help::GetHelpText( ULONG, const Window* )
+BOOL Help::SearchKeyword( const XubString& )
{
- return ImplGetSVEmptyStr();
+ return FALSE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 3aea77bbbc66..bd0179ffe454 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2381,7 +2381,11 @@ IMPL_LINK( ImplListBox, MRUChanged, void*, EMPTYARG )
IMPL_LINK( ImplListBox, LBWindowScrolled, void*, EMPTYARG )
{
+ long nSet = GetTopEntry();
+ if( nSet > mpVScrollBar->GetRangeMax() )
+ mpVScrollBar->SetRangeMax( GetEntryList()->GetEntryCount() );
mpVScrollBar->SetThumbPos( GetTopEntry() );
+
mpHScrollBar->SetThumbPos( GetLeftIndent() );
maScrollHdl.Call( this );
@@ -2420,7 +2424,11 @@ void ImplListBox::ImplCheckScrollBars()
mbVScroll = TRUE;
// Ueberpruefung des rausgescrollten Bereichs
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ if( GetEntryList()->GetSelectEntryCount() == 1 &&
+ GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+ ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+ else
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
else
{
@@ -2453,7 +2461,11 @@ void ImplListBox::ImplCheckScrollBars()
mbVScroll = TRUE;
// Ueberpruefung des rausgescrollten Bereichs
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ if( GetEntryList()->GetSelectEntryCount() == 1 &&
+ GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+ ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+ else
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
}
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index c892b32534ec..e9696aa8c492 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -42,7 +42,6 @@
#include "vcl/controldata.hxx"
#include "vcl/sound.hxx"
#include "vcl/lstbox.hxx"
-#include "vcl/smartid.hxx"
#include "vcl/window.h"
@@ -59,7 +58,7 @@ struct ImplTabItem
String maText;
String maFormatText;
String maHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
USHORT mnLine;
bool mbFullVisible;
@@ -67,7 +66,7 @@ struct ImplTabItem
Image maTabImage;
ImplTabItem()
- : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ), mnHelpId( 0 ),
+ : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ),
mnLine( 0 ), mbFullVisible( FALSE ), mbEnabled( true )
{}
};
@@ -151,7 +150,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
mbRestoreUnqId = FALSE;
mbSingleLine = FALSE;
mbScroll = FALSE;
- mbRestoreSmartId = FALSE;
mbSmallInvalidate = FALSE;
mbExtraSpace = FALSE;
mpTabCtrlData = new ImplTabCtrlData;
@@ -705,11 +703,9 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
if ( pOldPage )
{
if ( mbRestoreHelpId )
- pCtrlParent->SetHelpId( 0 );
+ pCtrlParent->SetHelpId( rtl::OString() );
if ( mbRestoreUnqId )
- pCtrlParent->SetUniqueId( 0 );
- if( mbRestoreSmartId )
- pCtrlParent->SetSmartHelpId( SmartId() );
+ pCtrlParent->SetUniqueId( rtl::OString() );
pOldPage->DeactivatePage();
}
@@ -719,21 +715,16 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
// activate page here so the conbtrols can be switched
// also set the help id of the parent window to that of the tab page
- if ( !GetHelpId() )
+ if ( !GetHelpId().getLength() )
{
mbRestoreHelpId = TRUE;
pCtrlParent->SetHelpId( pPage->GetHelpId() );
}
- if ( !pCtrlParent->GetUniqueId() )
+ if ( !pCtrlParent->GetUniqueId().getLength() )
{
mbRestoreUnqId = TRUE;
pCtrlParent->SetUniqueId( pPage->GetUniqueId() );
}
- if( ! GetSmartHelpId().HasAny() )
- {
- mbRestoreSmartId = TRUE;
- pCtrlParent->SetSmartHelpId( pPage->GetSmartHelpId() );
- }
pPage->ActivatePage();
@@ -1486,13 +1477,13 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1574,7 +1565,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
aMenu.InsertItem( it->mnId, it->maText, MIB_CHECKABLE | MIB_RADIOCHECK );
if ( it->mnId == mnCurPageId )
aMenu.CheckItem( it->mnId );
- aMenu.SetHelpId( it->mnId, it->mnHelpId );
+ aMenu.SetHelpId( it->mnId, it->maHelpId );
}
USHORT nId = aMenu.Execute( this, aMenuPos );
@@ -1826,7 +1817,6 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
pItem->mnId = nPageId;
pItem->mpTabPage = NULL;
pItem->mnTabPageResId = 0;
- pItem->mnHelpId = 0;
pItem->maText = rText;
pItem->mbFullVisible = FALSE;
@@ -2154,11 +2144,11 @@ const XubString& TabControl::GetHelpText( USHORT nPageId ) const
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -2169,24 +2159,25 @@ const XubString& TabControl::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabControl::SetHelpId( USHORT nPageId, const rtl::OString& rHelpId )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabControl::GetHelpId( USHORT nPageId ) const
+rtl::OString TabControl::GetHelpId( USHORT nPageId ) const
{
+ rtl::OString aRet;
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ aRet = pItem->maHelpId;
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/impprn.cxx b/vcl/source/gdi/impprn.cxx
deleted file mode 100644
index 5224286cdad1..000000000000
--- a/vcl/source/gdi/impprn.cxx
+++ /dev/null
@@ -1,584 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-
-#define _SPOOLPRINTER_EXT
-#include "tools/queue.hxx"
-#include "vcl/svapp.hxx"
-#include "vcl/metaact.hxx"
-#include "vcl/gdimtf.hxx"
-#include "vcl/timer.hxx"
-#include "vcl/impprn.hxx"
-#include "vcl/jobset.h"
-
-#include "vcl/svdata.hxx"
-#include "vcl/salprn.hxx"
-
-// -----------
-// - Defines -
-// -----------
-
-#define OPTIMAL_BMP_RESOLUTION 300
-#define NORMAL_BMP_RESOLUTION 200
-
-// =======================================================================
-
-struct QueuePage
-{
- GDIMetaFile* mpMtf;
- JobSetup* mpSetup;
- USHORT mnPage;
- BOOL mbEndJob;
-
- QueuePage() { mpMtf = NULL; mpSetup = NULL; }
- ~QueuePage() { delete mpMtf; if ( mpSetup ) delete mpSetup; }
-};
-
-// =======================================================================
-
-ImplQPrinter::ImplQPrinter( Printer* pParent ) :
- Printer( pParent->GetName() ),
- mpParent( pParent ),
- mbAborted( false ),
- mbUserCopy( false ),
- mbDestroyAllowed( true ),
- mbDestroyed( false ),
- mnMaxBmpDPIX( mnDPIX ),
- mnMaxBmpDPIY( mnDPIY ),
- mnCurCopyCount( 0 )
-{
- SetSelfAsQueuePrinter( TRUE );
- SetPrinterProps( pParent );
- SetPageQueueSize( 0 );
- mnCopyCount = pParent->mnCopyCount;
- mbCollateCopy = pParent->mbCollateCopy;
-}
-
-// -----------------------------------------------------------------------
-
-ImplQPrinter::~ImplQPrinter()
-{
- for( std::vector< QueuePage* >::iterator it = maQueue.begin();
- it != maQueue.end(); ++it )
- delete (*it);
-}
-
-// -----------------------------------------------------------------------------
-
-void ImplQPrinter::Destroy()
-{
- if( mbDestroyAllowed )
- delete this;
- else
- mbDestroyed = TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::ImplPrintMtf( GDIMetaFile& rPrtMtf, long nMaxBmpDPIX, long nMaxBmpDPIY )
-{
- for( MetaAction* pAct = rPrtMtf.FirstAction(); pAct && !mbAborted; pAct = rPrtMtf.NextAction() )
- {
- const ULONG nType = pAct->GetType();
- sal_Bool bExecuted = sal_False;
-
- if( nType == META_COMMENT_ACTION )
- {
- // search for special comments ( ..._BEGIN/..._END )
- MetaCommentAction* pComment = (MetaCommentAction*) pAct;
-
- if( pComment->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
- {
- pAct = rPrtMtf.NextAction();
-
- // if next action is a GradientEx action, execute this and
- // skip actions until a XGRAD_SEQ_END comment is found
- if( pAct && ( pAct->GetType() == META_GRADIENTEX_ACTION ) )
- {
- MetaGradientExAction* pGradientExAction = (MetaGradientExAction*) pAct;
- DrawGradientEx( this, pGradientExAction->GetPolyPolygon(), pGradientExAction->GetGradient() );
-
- // seek to end of this comment
- do
- {
- pAct = rPrtMtf.NextAction();
- }
- while( pAct &&
- ( ( pAct->GetType() != META_COMMENT_ACTION ) ||
- ( ( (MetaCommentAction*) pAct )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) != COMPARE_EQUAL ) ) );
-
- bExecuted = sal_True;
- }
- }
- else if( pComment->GetComment().CompareIgnoreCaseToAscii( "PRNSPOOL_TRANSPARENTBITMAP_BEGIN" ) == COMPARE_EQUAL )
- {
- pAct = rPrtMtf.NextAction();
-
- if( pAct && ( pAct->GetType() == META_BMPSCALE_ACTION ) )
- {
- // execute action here to avoid DPI processing of bitmap;
- pAct->Execute( this );
-
-#ifdef VERBOSE_DEBUG
- Push();
- SetLineColor(COL_RED);
- SetFillColor();
- DrawRect( Rectangle(
- static_cast<MetaBmpScaleAction*>(pAct)->GetPoint(),
- static_cast<MetaBmpScaleAction*>(pAct)->GetSize()) );
- Pop();
-#endif
-
- // seek to end of this comment
- do
- {
- pAct = rPrtMtf.NextAction();
- }
- while( pAct &&
- ( ( pAct->GetType() != META_COMMENT_ACTION ) ||
- ( ( (MetaCommentAction*) pAct )->GetComment().CompareIgnoreCaseToAscii( "PRNSPOOL_TRANSPARENTBITMAP_END" ) != COMPARE_EQUAL ) ) );
-
- bExecuted = sal_True;
- }
- }
- }
- else if( nType == META_GRADIENT_ACTION )
- {
- MetaGradientAction* pGradientAction = (MetaGradientAction*) pAct;
- DrawGradientEx( this, pGradientAction->GetRect(), pGradientAction->GetGradient() );
- bExecuted = sal_True;
- }
- else if( nType == META_BMPSCALE_ACTION )
- {
- MetaBmpScaleAction* pBmpScaleAction = (MetaBmpScaleAction*) pAct;
- const Bitmap& rBmp = pBmpScaleAction->GetBitmap();
-
- DrawBitmap( pBmpScaleAction->GetPoint(), pBmpScaleAction->GetSize(),
- GetDownsampledBitmap( pBmpScaleAction->GetSize(),
- Point(), rBmp.GetSizePixel(),
- rBmp, nMaxBmpDPIX, nMaxBmpDPIY ) );
-
- bExecuted = sal_True;
- }
- else if( nType == META_BMPSCALEPART_ACTION )
- {
- MetaBmpScalePartAction* pBmpScalePartAction = (MetaBmpScalePartAction*) pAct;
- const Bitmap& rBmp = pBmpScalePartAction->GetBitmap();
-
- DrawBitmap( pBmpScalePartAction->GetDestPoint(), pBmpScalePartAction->GetDestSize(),
- GetDownsampledBitmap( pBmpScalePartAction->GetDestSize(),
- pBmpScalePartAction->GetSrcPoint(), pBmpScalePartAction->GetSrcSize(),
- rBmp, nMaxBmpDPIX, nMaxBmpDPIY ) );
-
- bExecuted = sal_True;
- }
- else if( nType == META_BMPEXSCALE_ACTION )
- {
- MetaBmpExScaleAction* pBmpExScaleAction = (MetaBmpExScaleAction*) pAct;
- const BitmapEx& rBmpEx = pBmpExScaleAction->GetBitmapEx();
-
- DrawBitmapEx( pBmpExScaleAction->GetPoint(), pBmpExScaleAction->GetSize(),
- GetDownsampledBitmapEx( pBmpExScaleAction->GetSize(),
- Point(), rBmpEx.GetSizePixel(),
- rBmpEx, nMaxBmpDPIX, nMaxBmpDPIY ) );
-
- bExecuted = sal_True;
- }
- else if( nType == META_BMPEXSCALEPART_ACTION )
- {
- MetaBmpExScalePartAction* pBmpExScalePartAction = (MetaBmpExScalePartAction*) pAct;
- const BitmapEx& rBmpEx = pBmpExScalePartAction->GetBitmapEx();
-
- DrawBitmapEx( pBmpExScalePartAction->GetDestPoint(), pBmpExScalePartAction->GetDestSize(),
- GetDownsampledBitmapEx( pBmpExScalePartAction->GetDestSize(),
- pBmpExScalePartAction->GetSrcPoint(), pBmpExScalePartAction->GetSrcSize(),
- rBmpEx, nMaxBmpDPIX, nMaxBmpDPIY ) );
-
- bExecuted = sal_True;
- }
- else if( nType == META_TRANSPARENT_ACTION )
- {
- MetaTransparentAction* pTransAct = static_cast<MetaTransparentAction*>(pAct);
- USHORT nTransparency( pTransAct->GetTransparence() );
-
- // #i10613# Respect transparency for draw color
- if( nTransparency )
- {
- Push( PUSH_LINECOLOR|PUSH_FILLCOLOR );
-
- // assume white background for alpha blending
- Color aLineColor( GetLineColor() );
- aLineColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetRed()) / 100L ) );
- aLineColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetGreen()) / 100L ) );
- aLineColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetBlue()) / 100L ) );
- SetLineColor( aLineColor );
-
- Color aFillColor( GetFillColor() );
- aFillColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetRed()) / 100L ) );
- aFillColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetGreen()) / 100L ) );
- aFillColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetBlue()) / 100L ) );
- SetFillColor( aFillColor );
- }
-
- DrawPolyPolygon( pTransAct->GetPolyPolygon() );
-
- if( nTransparency )
- Pop();
-
- bExecuted = sal_True;
- }
- else if( nType == META_FLOATTRANSPARENT_ACTION )
- {
- MetaFloatTransparentAction* pFloatAction = (MetaFloatTransparentAction*) pAct;
- GDIMetaFile& rMtf = (GDIMetaFile&) pFloatAction->GetGDIMetaFile();
- MapMode aDrawMap( rMtf.GetPrefMapMode() );
- Point aDestPoint( LogicToPixel( pFloatAction->GetPoint() ) );
- Size aDestSize( LogicToPixel( pFloatAction->GetSize() ) );
-
- if( aDestSize.Width() && aDestSize.Height() )
- {
- Size aTmpPrefSize( LogicToPixel( rMtf.GetPrefSize(), aDrawMap ) );
-
- if( !aTmpPrefSize.Width() )
- aTmpPrefSize.Width() = aDestSize.Width();
-
- if( !aTmpPrefSize.Height() )
- aTmpPrefSize.Height() = aDestSize.Height();
-
- Fraction aScaleX( aDestSize.Width(), aTmpPrefSize.Width() );
- Fraction aScaleY( aDestSize.Height(), aTmpPrefSize.Height() );
-
- aDrawMap.SetScaleX( aScaleX *= aDrawMap.GetScaleX() );
- aDrawMap.SetScaleY( aScaleY *= aDrawMap.GetScaleY() );
- aDrawMap.SetOrigin( PixelToLogic( aDestPoint, aDrawMap ) );
-
- Push();
- SetMapMode( aDrawMap );
- ImplPrintMtf( rMtf, nMaxBmpDPIX, nMaxBmpDPIY );
- Pop();
- }
-
- bExecuted = sal_True;
- }
-
- if( !bExecuted && pAct )
- pAct->Execute( this );
-
- if( ! ImplGetSVData()->maGDIData.mbPrinterPullModel )
- Application::Reschedule();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::PrePrintPage( QueuePage* pPage )
-{
- mnRestoreDrawMode = GetDrawMode();
- mnMaxBmpDPIX = mnDPIX;
- mnMaxBmpDPIY = mnDPIY;
-
- const PrinterOptions& rPrinterOptions = GetPrinterOptions();
-
- if( rPrinterOptions.IsReduceBitmaps() )
- {
- // calculate maximum resolution for bitmap graphics
- if( PRINTER_BITMAP_OPTIMAL == rPrinterOptions.GetReducedBitmapMode() )
- {
- mnMaxBmpDPIX = Min( (long) OPTIMAL_BMP_RESOLUTION, mnMaxBmpDPIX );
- mnMaxBmpDPIY = Min( (long) OPTIMAL_BMP_RESOLUTION, mnMaxBmpDPIY );
- }
- else if( PRINTER_BITMAP_NORMAL == rPrinterOptions.GetReducedBitmapMode() )
- {
- mnMaxBmpDPIX = Min( (long) NORMAL_BMP_RESOLUTION, mnMaxBmpDPIX );
- mnMaxBmpDPIY = Min( (long) NORMAL_BMP_RESOLUTION, mnMaxBmpDPIY );
- }
- else
- {
- mnMaxBmpDPIX = Min( (long) rPrinterOptions.GetReducedBitmapResolution(), mnMaxBmpDPIX );
- mnMaxBmpDPIY = Min( (long) rPrinterOptions.GetReducedBitmapResolution(), mnMaxBmpDPIY );
- }
- }
-
- // convert to greysacles
- if( rPrinterOptions.IsConvertToGreyscales() )
- {
- SetDrawMode( GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
- DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
- }
-
- // disable transparency output
- if( rPrinterOptions.IsReduceTransparency() && ( PRINTER_TRANSPARENCY_NONE == rPrinterOptions.GetReducedTransparencyMode() ) )
- {
- SetDrawMode( GetDrawMode() | DRAWMODE_NOTRANSPARENCY );
- }
-
- maCurPageMetaFile = GDIMetaFile();
- RemoveTransparenciesFromMetaFile( *pPage->mpMtf, maCurPageMetaFile, mnMaxBmpDPIX, mnMaxBmpDPIY,
- rPrinterOptions.IsReduceTransparency(),
- rPrinterOptions.GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO,
- rPrinterOptions.IsReduceBitmaps() && rPrinterOptions.IsReducedBitmapIncludesTransparency()
- );
-}
-
-void ImplQPrinter::PostPrintPage()
-{
- SetDrawMode( mnRestoreDrawMode );
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::PrintPage( unsigned int nPage )
-{
- if( nPage >= maQueue.size() )
- return;
- mnCurCopyCount = (mbUserCopy && !mbCollateCopy) ? mnCopyCount : 1;
- QueuePage* pActPage = maQueue[nPage];
- PrePrintPage( pActPage );
- if ( pActPage->mpSetup )
- SetJobSetup( *pActPage->mpSetup );
-
- StartPage();
- ImplPrintMtf( maCurPageMetaFile, mnMaxBmpDPIX, mnMaxBmpDPIY );
- EndPage();
-
- mnCurCopyCount--;
- if( mnCurCopyCount == 0 )
- PostPrintPage();
-}
-
-// -----------------------------------------------------------------------
-
-ImplJobSetup* ImplQPrinter::GetPageSetup( unsigned int nPage ) const
-{
- return nPage >= maQueue.size() ? NULL :
- ( maQueue[nPage]->mpSetup ? maQueue[nPage]->mpSetup->ImplGetData() : NULL );
-}
-
-// -----------------------------------------------------------------------
-ULONG ImplQPrinter::GetPrintPageCount() const
-{
- ULONG nPageCount = maQueue.size() * ((mbUserCopy && !mbCollateCopy) ? mnCopyCount : 1);
- return nPageCount;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( ImplQPrinter, ImplPrintHdl, Timer*, EMPTYARG )
-{
- // Ist Drucken abgebrochen wurden?
- if( !IsPrinting() || ( mpParent->IsJobActive() && ( maQueue.size() < (ULONG)mpParent->GetPageQueueSize() ) ) )
- return 0;
-
- // Druck-Job zuende?
- QueuePage* pActPage = maQueue.front();
- maQueue.erase( maQueue.begin() );
-
-
- vcl::DeletionListener aDel( this );
- if ( pActPage->mbEndJob )
- {
- maTimer.Stop();
- delete pActPage;
- if( ! EndJob() )
- mpParent->Error();
- if( ! aDel.isDeleted() )
- mpParent->ImplEndPrint();
- }
- else
- {
- mbDestroyAllowed = FALSE;
-
- PrePrintPage( pActPage );
-
- USHORT nCopyCount = 1;
- if( mbUserCopy && !mbCollateCopy )
- nCopyCount = mnCopyCount;
-
- for ( USHORT i = 0; i < nCopyCount; i++ )
- {
- if ( pActPage->mpSetup )
- {
- SetJobSetup( *pActPage->mpSetup );
- if ( mbAborted )
- break;
- }
-
- StartPage();
-
- if ( mbAborted )
- break;
-
- ImplPrintMtf( maCurPageMetaFile, mnMaxBmpDPIX, mnMaxBmpDPIY );
-
- if( !mbAborted )
- EndPage();
- else
- break;
- }
-
- PostPrintPage();
-
- delete pActPage;
- mbDestroyAllowed = TRUE;
-
- if( mbDestroyed )
- Destroy();
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::StartQueuePrint()
-{
- if( ! ImplGetSVData()->maGDIData.mbPrinterPullModel )
- {
- maTimer.SetTimeout( 50 );
- maTimer.SetTimeoutHdl( LINK( this, ImplQPrinter, ImplPrintHdl ) );
- maTimer.Start();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::EndQueuePrint()
-{
- if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
- {
- DBG_ASSERT( mpPrinter, "no SalPrinter in ImplQPrinter" );
- if( mpPrinter )
- {
- #if 0
- mpPrinter->StartJob( mbPrintFile ? &maPrintFile : NULL,
- Application::GetDisplayName(),
- maJobSetup.ImplGetConstData(),
- this );
- #endif
- EndJob();
- mpParent->ImplEndPrint();
- }
- }
- else
- {
- QueuePage* pQueuePage = new QueuePage;
- pQueuePage->mbEndJob = TRUE;
- maQueue.push_back( pQueuePage );
- }
-}
-
-// -----------------------------------------------------------------------
-
-bool ImplQPrinter::GetPaperRanges( std::vector< ULONG >& o_rRanges, bool i_bIncludeOrientationChanges ) const
-{
- bool bRet = false;
-
- if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
- {
- bRet = true;
- o_rRanges.clear();
-
- if( ! maQueue.empty() )
- {
- ULONG nCurPage = 0;
-
- // get first job data
- const ImplJobSetup* pLastFormat = NULL;
- if( maQueue.front()->mpSetup )
- pLastFormat = maQueue.front()->mpSetup->ImplGetConstData();
-
- // begin first range
- o_rRanges.push_back( 0 );
- for( std::vector< QueuePage* >::const_iterator it = maQueue.begin();
- it != maQueue.end(); ++it, ++nCurPage )
- {
- const ImplJobSetup* pNewSetup = (*it)->mpSetup ? (*it)->mpSetup->ImplGetConstData() : NULL;
- if( pNewSetup && pNewSetup != pLastFormat )
- {
- bool bChange = false;
- if( pLastFormat == NULL )
- {
- bChange = true;
- }
- else if( ! i_bIncludeOrientationChanges &&
- pNewSetup->meOrientation != pLastFormat->meOrientation )
- {
- bChange = true;
- }
- else if( pNewSetup->mePaperFormat != pLastFormat->mePaperFormat ||
- ( pNewSetup->mePaperFormat == PAPER_USER &&
- ( pNewSetup->mnPaperWidth != pLastFormat->mnPaperWidth ||
- pNewSetup->mnPaperHeight != pLastFormat->mnPaperHeight ) ) )
- {
- bChange = true;
- }
- else if( pNewSetup->mnPaperBin != pLastFormat->mnPaperBin )
- {
- bChange = true;
- }
- if( bChange )
- {
- o_rRanges.push_back( nCurPage );
- pLastFormat = pNewSetup;
- }
- }
- }
-
- o_rRanges.push_back( nCurPage );
- }
- }
-
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::AbortQueuePrint()
-{
- maTimer.Stop();
- mbAborted = TRUE;
- AbortJob();
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::AddQueuePage( GDIMetaFile* pPage, USHORT nPage, BOOL bNewJobSetup )
-{
- QueuePage* pQueuePage = new QueuePage;
- pQueuePage->mpMtf = pPage;
- pQueuePage->mnPage = nPage;
- pQueuePage->mbEndJob = FALSE;
- // ensure that the first page has a valid setup, this is needed
- // in GetPaperRanges (used in pullmodel)
- // caution: this depends on mnCurPage in Printer being
- // 0: not printing 1: after StartJob, 2 after first EndPage, 3+ at following EndPage calls
- if ( bNewJobSetup || (nPage == 2 && ImplGetSVData()->maGDIData.mbPrinterPullModel) )
- pQueuePage->mpSetup = new JobSetup( mpParent->GetJobSetup() );
- maQueue.push_back( pQueuePage );
-}
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index 77df20976c73..ac2e586a41cb 100755
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -63,6 +63,7 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/impgraph.obj \
$(SLO)$/metric.obj \
$(SLO)$/pdfwriter_impl.obj \
+ $(SLO)$/pdfwriter_impl2.obj \
$(SLO)$/pdffontcache.obj\
$(SLO)$/bmpconv.obj \
$(SLO)$/pdfextoutdevdata.obj \
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 94f07b8f17d1..8c1545758c3b 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -3793,7 +3793,6 @@ MetaAction* MetaFloatTransparentAction::Clone()
void MetaFloatTransparentAction::Move( long nHorzMove, long nVertMove )
{
maPoint.Move( nHorzMove, nVertMove );
- maMtf.Move(nHorzMove, nVertMove);
}
// ------------------------------------------------------------------------
@@ -3804,7 +3803,6 @@ void MetaFloatTransparentAction::Scale( double fScaleX, double fScaleY )
ImplScaleRect( aRectangle, fScaleX, fScaleY );
maPoint = aRectangle.TopLeft();
maSize = aRectangle.GetSize();
- maMtf.Scale(fScaleX, fScaleY);
}
// ------------------------------------------------------------------------
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index bea307a4c38d..06dcd73cc3d4 100644..100755
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1988,7 +1988,15 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
const long nSrcWidth = aBmpRect.GetWidth(), nSrcHeight = aBmpRect.GetHeight();
const long nDstWidth = aDstRect.GetWidth(), nDstHeight = aDstRect.GetHeight();
const long nOutWidth = aOutSz.Width(), nOutHeight = aOutSz.Height();
- const long nOffX = aDstRect.Left() - aOutPt.X(), nOffY = aDstRect.Top() - aOutPt.Y();
+ // calculate offset in original bitmap
+ // in RTL case this is a little more complicated since the contents of the
+ // bitmap is not mirrored (it never is), however the paint region and bmp region
+ // are in mirrored coordinates, so the intersection of (aOutPt,aOutSz) with these
+ // is content wise somewhere else and needs to take mirroring into account
+ const long nOffX = IsRTLEnabled()
+ ? aOutSz.Width() - aDstRect.GetWidth() - (aDstRect.Left() - aOutPt.X())
+ : aDstRect.Left() - aOutPt.X(),
+ nOffY = aDstRect.Top() - aOutPt.Y();
long nX, nOutX, nY, nOutY;
long nMirrOffX = 0;
long nMirrOffY = 0;
@@ -2002,7 +2010,6 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
for( nX = 0L, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
{
pMapX[ nX ] = aBmpRect.Left() + nOutX * nSrcWidth / nOutWidth;
-
if( bHMirr )
pMapX[ nX ] = nMirrOffX - pMapX[ nX ];
}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 34d86b842ba2..8eb4dec3c92a 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -1531,7 +1531,7 @@ void ImplDevFontList::Add( ImplFontData* pNewData )
// add font alias if available
// a font alias should never win against an original font with similar quality
- if( aMapNames.Len() >= nMapNameIndex )
+ if( aMapNames.Len() <= nMapNameIndex )
break;
if( bKeepNewData ) // try to recycle obsoleted object
pNewData = pNewData->CreateAlias();
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 5dcce25a0315..969bc51b3cac 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -40,7 +40,7 @@ PDFWriter::AnyWidget::~AnyWidget()
PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext )
:
- pImplementation( new PDFWriterImpl( rContext ) )
+ pImplementation( new PDFWriterImpl( rContext, *this ) )
{
}
@@ -569,3 +569,8 @@ std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
{
return ((PDFWriterImpl*)pImplementation)->getErrors();
}
+
+void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
+{
+ ((PDFWriterImpl*)pImplementation)->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
+}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 7e023297fa74..5d75c829da8a 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1693,7 +1693,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
* class PDFWriterImpl
*/
-PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
+PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, PDFWriter& i_rOuterFace )
:
m_pReferenceDevice( NULL ),
m_aMapMode( MAP_POINT, Point(), Fraction( 1L, pointToPixel(1) ), Fraction( 1L, pointToPixel(1) ) ),
@@ -1719,7 +1719,8 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
m_aCreationMetaDateString( 64 ),
m_pEncryptionBuffer( NULL ),
m_nEncryptionBufferSize( 0 ),
- m_bIsPDF_A1( false )
+ m_bIsPDF_A1( false ),
+ m_rOuterFace( i_rOuterFace )
{
#ifdef DO_TEST_PDF
static bool bOnce = true;
@@ -2138,7 +2139,10 @@ OutputDevice* PDFWriterImpl::getReferenceDevice()
m_pReferenceDevice = pVDev;
- pVDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
+ if( m_aContext.DPIx == 0 || m_aContext.DPIy == 0 )
+ pVDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
+ else
+ pVDev->SetReferenceDevice( m_aContext.DPIx, m_aContext.DPIy );
pVDev->SetOutputSizePixel( Size( 640, 480 ) );
pVDev->SetMapMode( MAP_MM );
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 2eacdc215dd8..9457aea5f0c2 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -1095,6 +1095,7 @@ i12626
/* true if PDF/A-1a or PDF/A-1b is output */
sal_Bool m_bIsPDF_A1;
+ PDFWriter& m_rOuterFace;
/*
i12626
@@ -1109,8 +1110,14 @@ methods for PDF security
/* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
void computeUDictionaryValue();
+ // helper for playMetafile
+ void implWriteGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient,
+ VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
+ void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx,
+ VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
+
public:
- PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext );
+ PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, PDFWriter& );
~PDFWriterImpl();
/* for OutputDevice so the reference device can have a list
@@ -1134,6 +1141,7 @@ public:
bool emit();
std::set< PDFWriter::ErrorCode > getErrors();
void insertError( PDFWriter::ErrorCode eErr ) { m_aErrors.insert( eErr ); }
+ void playMetafile( const GDIMetaFile&, vcl::PDFExtOutDevData*, const vcl::PDFWriter::PlayMetafileContext&, VirtualDevice* pDummyDev = NULL );
Size getCurPageSize() const
{
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
new file mode 100644
index 000000000000..c01b8a9771d8
--- /dev/null
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -0,0 +1,1035 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "pdfwriter_impl.hxx"
+#include "vcl/pdfextoutdevdata.hxx"
+#include "vcl/virdev.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/graph.hxx"
+#include "vcl/svdata.hxx"
+#include "unotools/streamwrap.hxx"
+#include "unotools/processfactory.hxx"
+
+#include "comphelper/processfactory.hxx"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/io/XSeekable.hpp"
+#include "com/sun/star/graphic/XGraphicProvider.hpp"
+
+using namespace vcl;
+using namespace rtl;
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::beans;
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::implWriteGradient( const PolyPolygon& i_rPolyPoly, const Gradient& i_rGradient,
+ VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
+{
+ GDIMetaFile aTmpMtf;
+
+ i_pDummyVDev->AddGradientActions( i_rPolyPoly.GetBoundRect(), i_rGradient, aTmpMtf );
+
+ m_rOuterFace.Push();
+ m_rOuterFace.IntersectClipRegion( i_rPolyPoly.getB2DPolyPolygon() );
+ playMetafile( aTmpMtf, NULL, i_rContext, i_pDummyVDev );
+ m_rOuterFace.Pop();
+}
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSize, const BitmapEx& i_rBitmapEx,
+ VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
+{
+ if ( !i_rBitmapEx.IsEmpty() && i_rSize.Width() && i_rSize.Height() )
+ {
+ BitmapEx aBitmapEx( i_rBitmapEx );
+ Point aPoint( i_rPoint );
+ Size aSize( i_rSize );
+
+ // #i19065# Negative sizes have mirror semantics on
+ // OutputDevice. BitmapEx and co. have no idea about that, so
+ // perform that _before_ doing anything with aBitmapEx.
+ ULONG nMirrorFlags(BMP_MIRROR_NONE);
+ if( aSize.Width() < 0 )
+ {
+ aSize.Width() *= -1;
+ aPoint.X() -= aSize.Width();
+ nMirrorFlags |= BMP_MIRROR_HORZ;
+ }
+ if( aSize.Height() < 0 )
+ {
+ aSize.Height() *= -1;
+ aPoint.Y() -= aSize.Height();
+ nMirrorFlags |= BMP_MIRROR_VERT;
+ }
+
+ if( nMirrorFlags != BMP_MIRROR_NONE )
+ {
+ aBitmapEx.Mirror( nMirrorFlags );
+ }
+ if( i_rContext.m_nMaxImageResolution > 50 )
+ {
+ // do downsampling if neccessary
+ const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MAP_TWIP ) );
+ const Size aBmpSize( aBitmapEx.GetSizePixel() );
+ const double fBmpPixelX = aBmpSize.Width();
+ const double fBmpPixelY = aBmpSize.Height();
+ const double fMaxPixelX = aDstSizeTwip.Width() * i_rContext.m_nMaxImageResolution / 1440.0;
+ const double fMaxPixelY = aDstSizeTwip.Height() * i_rContext.m_nMaxImageResolution / 1440.0;
+
+ // check, if the bitmap DPI exceeds the maximum DPI (allow 4 pixel rounding tolerance)
+ if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
+ ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
+ ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
+ {
+ // do scaling
+ Size aNewBmpSize;
+ const double fBmpWH = fBmpPixelX / fBmpPixelY;
+ const double fMaxWH = fMaxPixelX / fMaxPixelY;
+
+ if( fBmpWH < fMaxWH )
+ {
+ aNewBmpSize.Width() = FRound( fMaxPixelY * fBmpWH );
+ aNewBmpSize.Height() = FRound( fMaxPixelY );
+ }
+ else if( fBmpWH > 0.0 )
+ {
+ aNewBmpSize.Width() = FRound( fMaxPixelX );
+ aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH);
+ }
+ if( aNewBmpSize.Width() && aNewBmpSize.Height() )
+ aBitmapEx.Scale( aNewBmpSize );
+ else
+ aBitmapEx.SetEmpty();
+ }
+ }
+
+ const Size aSizePixel( aBitmapEx.GetSizePixel() );
+ if ( aSizePixel.Width() && aSizePixel.Height() )
+ {
+ sal_Bool bUseJPGCompression = !i_rContext.m_bOnlyLosslessCompression;
+ if ( ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) )
+ bUseJPGCompression = sal_False;
+
+ SvMemoryStream aStrm;
+ Bitmap aMask;
+
+ bool bTrueColorJPG = true;
+ if ( bUseJPGCompression )
+ {
+ sal_uInt32 nZippedFileSize; // sj: we will calculate the filesize of a zipped bitmap
+ { // to determine if jpeg compression is usefull
+ SvMemoryStream aTemp;
+ aTemp.SetCompressMode( aTemp.GetCompressMode() | COMPRESSMODE_ZBITMAP );
+ aTemp.SetVersion( SOFFICE_FILEFORMAT_40 ); // sj: up from version 40 our bitmap stream operator
+ aTemp << aBitmapEx; // is capable of zlib stream compression
+ aTemp.Seek( STREAM_SEEK_TO_END );
+ nZippedFileSize = aTemp.Tell();
+ }
+ if ( aBitmapEx.IsTransparent() )
+ {
+ if ( aBitmapEx.IsAlpha() )
+ aMask = aBitmapEx.GetAlpha().GetBitmap();
+ else
+ aMask = aBitmapEx.GetMask();
+ }
+ Graphic aGraphic( aBitmapEx.GetBitmap() );
+ sal_Int32 nColorMode = 0;
+
+ Sequence< PropertyValue > aFilterData( 2 );
+ aFilterData[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) );
+ aFilterData[ 0 ].Value <<= sal_Int32(i_rContext.m_nJPEGQuality);
+ aFilterData[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) );
+ aFilterData[ 1 ].Value <<= nColorMode;
+
+ try
+ {
+ uno::Reference < io::XStream > xStream = new utl::OStreamWrapper( aStrm );
+ Reference< io::XSeekable > xSeekable( xStream, UNO_QUERY_THROW );
+ Reference< graphic::XGraphicProvider > xGraphicProvider( ImplGetSVData()->maAppData.mxMSF->createInstance(
+ OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY );
+ if ( xGraphicProvider.is() )
+ {
+ Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() );
+ Reference < io::XOutputStream > xOut( xStream->getOutputStream() );
+ rtl::OUString aMimeType( ::rtl::OUString::createFromAscii( "image/jpeg" ) );
+ uno::Sequence< beans::PropertyValue > aOutMediaProperties( 3 );
+ aOutMediaProperties[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" );
+ aOutMediaProperties[0].Value <<= xOut;
+ aOutMediaProperties[1].Name = ::rtl::OUString::createFromAscii( "MimeType" );
+ aOutMediaProperties[1].Value <<= aMimeType;
+ aOutMediaProperties[2].Name = ::rtl::OUString::createFromAscii( "FilterData" );
+ aOutMediaProperties[2].Value <<= aFilterData;
+ xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties );
+ xOut->flush();
+ if ( xSeekable->getLength() > nZippedFileSize )
+ {
+ bUseJPGCompression = sal_False;
+ }
+ else
+ {
+ aStrm.Seek( STREAM_SEEK_TO_END );
+
+ xSeekable->seek( 0 );
+ Sequence< PropertyValue > aArgs( 1 );
+ aArgs[ 0 ].Name = ::rtl::OUString::createFromAscii( "InputStream" );
+ aArgs[ 0 ].Value <<= xStream;
+ Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) );
+ if ( xPropSet.is() )
+ {
+ sal_Int16 nBitsPerPixel = 24;
+ if ( xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii( "BitsPerPixel" ) ) >>= nBitsPerPixel )
+ {
+ bTrueColorJPG = nBitsPerPixel != 8;
+ }
+ }
+ }
+ }
+ else
+ bUseJPGCompression = sal_False;
+ }
+ catch( uno::Exception& )
+ {
+ bUseJPGCompression = sal_False;
+ }
+ }
+ if ( bUseJPGCompression )
+ m_rOuterFace.DrawJPGBitmap( aStrm, bTrueColorJPG, aSizePixel, Rectangle( aPoint, aSize ), aMask );
+ else if ( aBitmapEx.IsTransparent() )
+ m_rOuterFace.DrawBitmapEx( aPoint, aSize, aBitmapEx );
+ else
+ m_rOuterFace.DrawBitmap( aPoint, aSize, aBitmapEx.GetBitmap() );
+ }
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevData* i_pOutDevData, const vcl::PDFWriter::PlayMetafileContext& i_rContext, VirtualDevice* pDummyVDev )
+{
+ bool bAssertionFired( false );
+
+ VirtualDevice* pPrivateDevice = NULL;
+ if( ! pDummyVDev )
+ {
+ pPrivateDevice = pDummyVDev = new VirtualDevice();
+ pDummyVDev->EnableOutput( sal_False );
+ pDummyVDev->SetMapMode( i_rMtf.GetPrefMapMode() );
+ }
+ GDIMetaFile aMtf( i_rMtf );
+
+ for( sal_uInt32 i = 0, nCount = aMtf.GetActionCount(); i < nCount; )
+ {
+ if ( !i_pOutDevData || !i_pOutDevData->PlaySyncPageAct( m_rOuterFace, i ) )
+ {
+ const MetaAction* pAction = aMtf.GetAction( i );
+ const USHORT nType = pAction->GetType();
+
+ switch( nType )
+ {
+ case( META_PIXEL_ACTION ):
+ {
+ const MetaPixelAction* pA = (const MetaPixelAction*) pAction;
+ m_rOuterFace.DrawPixel( pA->GetPoint(), pA->GetColor() );
+ }
+ break;
+
+ case( META_POINT_ACTION ):
+ {
+ const MetaPointAction* pA = (const MetaPointAction*) pAction;
+ m_rOuterFace.DrawPixel( pA->GetPoint() );
+ }
+ break;
+
+ case( META_LINE_ACTION ):
+ {
+ const MetaLineAction* pA = (const MetaLineAction*) pAction;
+ if ( pA->GetLineInfo().IsDefault() )
+ m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint() );
+ else
+ m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint(), pA->GetLineInfo() );
+ }
+ break;
+
+ case( META_RECT_ACTION ):
+ {
+ const MetaRectAction* pA = (const MetaRectAction*) pAction;
+ m_rOuterFace.DrawRect( pA->GetRect() );
+ }
+ break;
+
+ case( META_ROUNDRECT_ACTION ):
+ {
+ const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction;
+ m_rOuterFace.DrawRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
+ }
+ break;
+
+ case( META_ELLIPSE_ACTION ):
+ {
+ const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction;
+ m_rOuterFace.DrawEllipse( pA->GetRect() );
+ }
+ break;
+
+ case( META_ARC_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ m_rOuterFace.DrawArc( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_PIE_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ m_rOuterFace.DrawPie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_CHORD_ACTION ):
+ {
+ const MetaChordAction* pA = (const MetaChordAction*) pAction;
+ m_rOuterFace.DrawChord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_POLYGON_ACTION ):
+ {
+ const MetaPolygonAction* pA = (const MetaPolygonAction*) pAction;
+ m_rOuterFace.DrawPolygon( pA->GetPolygon() );
+ }
+ break;
+
+ case( META_POLYLINE_ACTION ):
+ {
+ const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction;
+ if ( pA->GetLineInfo().IsDefault() )
+ m_rOuterFace.DrawPolyLine( pA->GetPolygon() );
+ else
+ m_rOuterFace.DrawPolyLine( pA->GetPolygon(), pA->GetLineInfo() );
+ }
+ break;
+
+ case( META_POLYPOLYGON_ACTION ):
+ {
+ const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pAction;
+ m_rOuterFace.DrawPolyPolygon( pA->GetPolyPolygon() );
+ }
+ break;
+
+ case( META_GRADIENT_ACTION ):
+ {
+ const MetaGradientAction* pA = (const MetaGradientAction*) pAction;
+ const PolyPolygon aPolyPoly( pA->GetRect() );
+
+ implWriteGradient( aPolyPoly, pA->GetGradient(), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_GRADIENTEX_ACTION ):
+ {
+ const MetaGradientExAction* pA = (const MetaGradientExAction*) pAction;
+ implWriteGradient( pA->GetPolyPolygon(), pA->GetGradient(), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case META_HATCH_ACTION:
+ {
+ const MetaHatchAction* pA = (const MetaHatchAction*) pAction;
+ m_rOuterFace.DrawHatch( pA->GetPolyPolygon(), pA->GetHatch() );
+ }
+ break;
+
+ case( META_TRANSPARENT_ACTION ):
+ {
+ const MetaTransparentAction* pA = (const MetaTransparentAction*) pAction;
+ m_rOuterFace.DrawTransparent( pA->GetPolyPolygon(), pA->GetTransparence() );
+ }
+ break;
+
+ case( META_FLOATTRANSPARENT_ACTION ):
+ {
+ const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction;
+
+ GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() );
+ const Point& rPos = pA->GetPoint();
+ const Size& rSize= pA->GetSize();
+ const Gradient& rTransparenceGradient = pA->GetGradient();
+
+ // special case constant alpha value
+ if( rTransparenceGradient.GetStartColor() == rTransparenceGradient.GetEndColor() )
+ {
+ const Color aTransCol( rTransparenceGradient.GetStartColor() );
+ const USHORT nTransPercent = aTransCol.GetLuminance() * 100 / 255;
+ m_rOuterFace.BeginTransparencyGroup();
+ playMetafile( aTmpMtf, NULL, i_rContext, pDummyVDev );
+ m_rOuterFace.EndTransparencyGroup( Rectangle( rPos, rSize ), nTransPercent );
+ }
+ else
+ {
+ const Size aDstSizeTwip( pDummyVDev->PixelToLogic( pDummyVDev->LogicToPixel( rSize ), MAP_TWIP ) );
+ sal_Int32 nMaxBmpDPI = i_rContext.m_bOnlyLosslessCompression ? 300 : 72;
+ if( i_rContext.m_nMaxImageResolution > 50 )
+ {
+ if ( nMaxBmpDPI > i_rContext.m_nMaxImageResolution )
+ nMaxBmpDPI = i_rContext.m_nMaxImageResolution;
+ }
+ const sal_Int32 nPixelX = (sal_Int32)((double)aDstSizeTwip.Width() * (double)nMaxBmpDPI / 1440.0);
+ const sal_Int32 nPixelY = (sal_Int32)((double)aDstSizeTwip.Height() * (double)nMaxBmpDPI / 1440.0);
+ if ( nPixelX && nPixelY )
+ {
+ Size aDstSizePixel( nPixelX, nPixelY );
+ VirtualDevice* pVDev = new VirtualDevice;
+ if( pVDev->SetOutputSizePixel( aDstSizePixel ) )
+ {
+ Bitmap aPaint, aMask;
+ AlphaMask aAlpha;
+ Point aPoint;
+
+ MapMode aMapMode( pDummyVDev->GetMapMode() );
+ aMapMode.SetOrigin( aPoint );
+ pVDev->SetMapMode( aMapMode );
+ Size aDstSize( pVDev->PixelToLogic( aDstSizePixel ) );
+
+ Point aMtfOrigin( aTmpMtf.GetPrefMapMode().GetOrigin() );
+ if ( aMtfOrigin.X() || aMtfOrigin.Y() )
+ aTmpMtf.Move( -aMtfOrigin.X(), -aMtfOrigin.Y() );
+ double fScaleX = (double)aDstSize.Width() / (double)aTmpMtf.GetPrefSize().Width();
+ double fScaleY = (double)aDstSize.Height() / (double)aTmpMtf.GetPrefSize().Height();
+ if( fScaleX != 1.0 || fScaleY != 1.0 )
+ aTmpMtf.Scale( fScaleX, fScaleY );
+ aTmpMtf.SetPrefMapMode( aMapMode );
+
+ // create paint bitmap
+ aTmpMtf.WindStart();
+ aTmpMtf.Play( pVDev, aPoint, aDstSize );
+ aTmpMtf.WindStart();
+
+ pVDev->EnableMapMode( FALSE );
+ aPaint = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ pVDev->EnableMapMode( TRUE );
+
+ // create mask bitmap
+ pVDev->SetLineColor( COL_BLACK );
+ pVDev->SetFillColor( COL_BLACK );
+ pVDev->DrawRect( Rectangle( aPoint, aDstSize ) );
+ pVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
+ DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
+ aTmpMtf.WindStart();
+ aTmpMtf.Play( pVDev, aPoint, aDstSize );
+ aTmpMtf.WindStart();
+ pVDev->EnableMapMode( FALSE );
+ aMask = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ pVDev->EnableMapMode( TRUE );
+
+ // create alpha mask from gradient
+ pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
+ pVDev->DrawGradient( Rectangle( aPoint, aDstSize ), rTransparenceGradient );
+ pVDev->SetDrawMode( DRAWMODE_DEFAULT );
+ pVDev->EnableMapMode( FALSE );
+ pVDev->DrawMask( aPoint, aDstSizePixel, aMask, Color( COL_WHITE ) );
+ aAlpha = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ implWriteBitmapEx( rPos, rSize, BitmapEx( aPaint, aAlpha ), pDummyVDev, i_rContext );
+ }
+ delete pVDev;
+ }
+ }
+ }
+ break;
+
+ case( META_EPS_ACTION ):
+ {
+ const MetaEPSAction* pA = (const MetaEPSAction*) pAction;
+ const GDIMetaFile aSubstitute( pA->GetSubstitute() );
+
+ m_rOuterFace.Push();
+ pDummyVDev->Push();
+
+ MapMode aMapMode( aSubstitute.GetPrefMapMode() );
+ Size aOutSize( pDummyVDev->LogicToLogic( pA->GetSize(), pDummyVDev->GetMapMode(), aMapMode ) );
+ aMapMode.SetScaleX( Fraction( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) );
+ aMapMode.SetScaleY( Fraction( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) );
+ aMapMode.SetOrigin( pDummyVDev->LogicToLogic( pA->GetPoint(), pDummyVDev->GetMapMode(), aMapMode ) );
+
+ m_rOuterFace.SetMapMode( aMapMode );
+ pDummyVDev->SetMapMode( aMapMode );
+ playMetafile( aSubstitute, NULL, i_rContext, pDummyVDev );
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+ }
+ break;
+
+ case( META_COMMENT_ACTION ):
+ if( ! i_rContext.m_bTransparenciesWereRemoved )
+ {
+ const MetaCommentAction* pA = (const MetaCommentAction*) pAction;
+ String aSkipComment;
+
+ if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
+ {
+ const MetaGradientExAction* pGradAction = NULL;
+ sal_Bool bDone = sal_False;
+
+ while( !bDone && ( ++i < nCount ) )
+ {
+ pAction = aMtf.GetAction( i );
+
+ if( pAction->GetType() == META_GRADIENTEX_ACTION )
+ pGradAction = (const MetaGradientExAction*) pAction;
+ else if( ( pAction->GetType() == META_COMMENT_ACTION ) &&
+ ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) )
+ {
+ bDone = sal_True;
+ }
+ }
+
+ if( pGradAction )
+ implWriteGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), pDummyVDev, i_rContext );
+ }
+ else
+ {
+ const BYTE* pData = pA->GetData();
+ if ( pData )
+ {
+ SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ );
+ sal_Bool bSkipSequence = sal_False;
+ ByteString sSeqEnd;
+
+ if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) )
+ {
+ sSeqEnd = ByteString( "XPATHSTROKE_SEQ_END" );
+ SvtGraphicStroke aStroke;
+ aMemStm >> aStroke;
+
+ Polygon aPath;
+ aStroke.getPath( aPath );
+
+ PolyPolygon aStartArrow;
+ PolyPolygon aEndArrow;
+ double fTransparency( aStroke.getTransparency() );
+ double fStrokeWidth( aStroke.getStrokeWidth() );
+ SvtGraphicStroke::DashArray aDashArray;
+
+ aStroke.getStartArrow( aStartArrow );
+ aStroke.getEndArrow( aEndArrow );
+ aStroke.getDashArray( aDashArray );
+
+ bSkipSequence = sal_True;
+ if ( aStartArrow.Count() || aEndArrow.Count() )
+ bSkipSequence = sal_False;
+ if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) )
+ bSkipSequence = sal_False;
+ if ( bSkipSequence )
+ {
+ PDFWriter::ExtLineInfo aInfo;
+ aInfo.m_fLineWidth = fStrokeWidth;
+ aInfo.m_fTransparency = fTransparency;
+ aInfo.m_fMiterLimit = aStroke.getMiterLimit();
+ switch( aStroke.getCapType() )
+ {
+ default:
+ case SvtGraphicStroke::capButt: aInfo.m_eCap = PDFWriter::capButt;break;
+ case SvtGraphicStroke::capRound: aInfo.m_eCap = PDFWriter::capRound;break;
+ case SvtGraphicStroke::capSquare: aInfo.m_eCap = PDFWriter::capSquare;break;
+ }
+ switch( aStroke.getJoinType() )
+ {
+ default:
+ case SvtGraphicStroke::joinMiter: aInfo.m_eJoin = PDFWriter::joinMiter;break;
+ case SvtGraphicStroke::joinRound: aInfo.m_eJoin = PDFWriter::joinRound;break;
+ case SvtGraphicStroke::joinBevel: aInfo.m_eJoin = PDFWriter::joinBevel;break;
+ case SvtGraphicStroke::joinNone:
+ aInfo.m_eJoin = PDFWriter::joinMiter;
+ aInfo.m_fMiterLimit = 0.0;
+ break;
+ }
+ aInfo.m_aDashArray = aDashArray;
+
+ if(SvtGraphicStroke::joinNone == aStroke.getJoinType()
+ && fStrokeWidth > 0.0)
+ {
+ // emulate no edge rounding by handling single edges
+ const sal_uInt16 nPoints(aPath.GetSize());
+ const bool bCurve(aPath.HasFlags());
+
+ for(sal_uInt16 a(0); a + 1 < nPoints; a++)
+ {
+ if(bCurve
+ && POLY_NORMAL != aPath.GetFlags(a + 1)
+ && a + 2 < nPoints
+ && POLY_NORMAL != aPath.GetFlags(a + 2)
+ && a + 3 < nPoints)
+ {
+ const Polygon aSnippet(4,
+ aPath.GetConstPointAry() + a,
+ aPath.GetConstFlagAry() + a);
+ m_rOuterFace.DrawPolyLine( aSnippet, aInfo );
+ a += 2;
+ }
+ else
+ {
+ const Polygon aSnippet(2,
+ aPath.GetConstPointAry() + a);
+ m_rOuterFace.DrawPolyLine( aSnippet, aInfo );
+ }
+ }
+ }
+ else
+ {
+ m_rOuterFace.DrawPolyLine( aPath, aInfo );
+ }
+ }
+ }
+ else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ {
+ sSeqEnd = ByteString( "XPATHFILL_SEQ_END" );
+ SvtGraphicFill aFill;
+ aMemStm >> aFill;
+
+ if ( ( aFill.getFillType() == SvtGraphicFill::fillSolid ) && ( aFill.getFillRule() == SvtGraphicFill::fillEvenOdd ) )
+ {
+ double fTransparency = aFill.getTransparency();
+ if ( fTransparency == 0.0 )
+ {
+ PolyPolygon aPath;
+ aFill.getPath( aPath );
+
+ bSkipSequence = sal_True;
+ m_rOuterFace.DrawPolyPolygon( aPath );
+ }
+ else if ( fTransparency == 1.0 )
+ bSkipSequence = sal_True;
+ }
+/* #i81548# removing optimization for fill textures, because most of the texture settings are not
+ exported properly. In OpenOffice 3.1 the drawing layer will support graphic primitives, then it
+ will not be a problem to optimize the filltexture export. But for wysiwyg is more important than
+ filesize.
+ else if( aFill.getFillType() == SvtGraphicFill::fillTexture && aFill.isTiling() )
+ {
+ sal_Int32 nPattern = mnCachePatternId;
+ Graphic aPatternGraphic;
+ aFill.getGraphic( aPatternGraphic );
+ bool bUseCache = false;
+ SvtGraphicFill::Transform aPatTransform;
+ aFill.getTransform( aPatTransform );
+
+ if( mnCachePatternId >= 0 )
+ {
+ SvtGraphicFill::Transform aCacheTransform;
+ maCacheFill.getTransform( aCacheTransform );
+ if( aCacheTransform.matrix[0] == aPatTransform.matrix[0] &&
+ aCacheTransform.matrix[1] == aPatTransform.matrix[1] &&
+ aCacheTransform.matrix[2] == aPatTransform.matrix[2] &&
+ aCacheTransform.matrix[3] == aPatTransform.matrix[3] &&
+ aCacheTransform.matrix[4] == aPatTransform.matrix[4] &&
+ aCacheTransform.matrix[5] == aPatTransform.matrix[5]
+ )
+ {
+ Graphic aCacheGraphic;
+ maCacheFill.getGraphic( aCacheGraphic );
+ if( aCacheGraphic == aPatternGraphic )
+ bUseCache = true;
+ }
+ }
+
+ if( ! bUseCache )
+ {
+
+ // paint graphic to metafile
+ GDIMetaFile aPattern;
+ pDummyVDev->SetConnectMetaFile( &aPattern );
+ pDummyVDev->Push();
+ pDummyVDev->SetMapMode( aPatternGraphic.GetPrefMapMode() );
+
+ aPatternGraphic.Draw( &rDummyVDev, Point( 0, 0 ) );
+ pDummyVDev->Pop();
+ pDummyVDev->SetConnectMetaFile( NULL );
+ aPattern.WindStart();
+
+ MapMode aPatternMapMode( aPatternGraphic.GetPrefMapMode() );
+ // prepare pattern from metafile
+ Size aPrefSize( aPatternGraphic.GetPrefSize() );
+ // FIXME: this magic -1 shouldn't be necessary
+ aPrefSize.Width() -= 1;
+ aPrefSize.Height() -= 1;
+ aPrefSize = m_rOuterFace.GetReferenceDevice()->
+ LogicToLogic( aPrefSize,
+ &aPatternMapMode,
+ &m_rOuterFace.GetReferenceDevice()->GetMapMode() );
+ // build bounding rectangle of pattern
+ Rectangle aBound( Point( 0, 0 ), aPrefSize );
+ m_rOuterFace.BeginPattern( aBound );
+ m_rOuterFace.Push();
+ pDummyVDev->Push();
+ m_rOuterFace.SetMapMode( aPatternMapMode );
+ pDummyVDev->SetMapMode( aPatternMapMode );
+ ImplWriteActions( m_rOuterFace, NULL, aPattern, rDummyVDev );
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+
+ nPattern = m_rOuterFace.EndPattern( aPatTransform );
+
+ // try some caching and reuse pattern
+ mnCachePatternId = nPattern;
+ maCacheFill = aFill;
+ }
+
+ // draw polypolygon with pattern fill
+ PolyPolygon aPath;
+ aFill.getPath( aPath );
+ m_rOuterFace.DrawPolyPolygon( aPath, nPattern, aFill.getFillRule() == SvtGraphicFill::fillEvenOdd );
+
+ bSkipSequence = sal_True;
+ }
+*/
+ }
+ if ( bSkipSequence )
+ {
+ while( ++i < nCount )
+ {
+ pAction = aMtf.GetAction( i );
+ if ( pAction->GetType() == META_COMMENT_ACTION )
+ {
+ ByteString sComment( ((MetaCommentAction*)pAction)->GetComment() );
+ if ( sComment.Equals( sSeqEnd ) )
+ break;
+ }
+ // #i44496#
+ // the replacement action for stroke is a filled rectangle
+ // the set fillcolor of the replacement is part of the graphics
+ // state and must not be skipped
+ else if( pAction->GetType() == META_FILLCOLOR_ACTION )
+ {
+ const MetaFillColorAction* pMA = (const MetaFillColorAction*) pAction;
+ if( pMA->IsSetting() )
+ m_rOuterFace.SetFillColor( pMA->GetColor() );
+ else
+ m_rOuterFace.SetFillColor();
+ }
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case( META_BMP_ACTION ):
+ {
+ const MetaBmpAction* pA = (const MetaBmpAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmap() );
+ Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
+ aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+ if( ! ( aSize.Width() && aSize.Height() ) )
+ aSize = pDummyVDev->PixelToLogic( aBitmapEx.GetSizePixel() );
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPSCALE_ACTION ):
+ {
+ const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction;
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPSCALEPART_ACTION ):
+ {
+ const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmap() );
+ aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEX_ACTION ):
+ {
+ const MetaBmpExAction* pA = (const MetaBmpExAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmapEx() );
+ Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
+ aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEXSCALE_ACTION ):
+ {
+ const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction;
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEXSCALEPART_ACTION ):
+ {
+ const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmapEx() );
+ aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_MASK_ACTION ):
+ case( META_MASKSCALE_ACTION ):
+ case( META_MASKSCALEPART_ACTION ):
+ {
+ DBG_ERROR( "MetaMask...Action not supported yet" );
+ }
+ break;
+
+ case( META_TEXT_ACTION ):
+ {
+ const MetaTextAction* pA = (const MetaTextAction*) pAction;
+ m_rOuterFace.DrawText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ) );
+ }
+ break;
+
+ case( META_TEXTRECT_ACTION ):
+ {
+ const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
+ m_rOuterFace.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() );
+ }
+ break;
+
+ case( META_TEXTARRAY_ACTION ):
+ {
+ const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction;
+ m_rOuterFace.DrawTextArray( pA->GetPoint(), pA->GetText(), pA->GetDXArray(), pA->GetIndex(), pA->GetLen() );
+ }
+ break;
+
+ case( META_STRETCHTEXT_ACTION ):
+ {
+ const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction;
+ m_rOuterFace.DrawStretchText( pA->GetPoint(), pA->GetWidth(), pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ }
+ break;
+
+
+ case( META_TEXTLINE_ACTION ):
+ {
+ const MetaTextLineAction* pA = (const MetaTextLineAction*) pAction;
+ m_rOuterFace.DrawTextLine( pA->GetStartPoint(), pA->GetWidth(), pA->GetStrikeout(), pA->GetUnderline(), pA->GetOverline() );
+
+ }
+ break;
+
+ case( META_CLIPREGION_ACTION ):
+ {
+ const MetaClipRegionAction* pA = (const MetaClipRegionAction*) pAction;
+
+ if( pA->IsClipping() )
+ {
+ if( pA->GetRegion().IsEmpty() )
+ m_rOuterFace.SetClipRegion( basegfx::B2DPolyPolygon() );
+ else
+ {
+ Region aReg( pA->GetRegion() );
+ m_rOuterFace.SetClipRegion( aReg.ConvertToB2DPolyPolygon() );
+ }
+ }
+ else
+ m_rOuterFace.SetClipRegion();
+ }
+ break;
+
+ case( META_ISECTRECTCLIPREGION_ACTION ):
+ {
+ const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pAction;
+ m_rOuterFace.IntersectClipRegion( pA->GetRect() );
+ }
+ break;
+
+ case( META_ISECTREGIONCLIPREGION_ACTION ):
+ {
+ const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*) pAction;
+ Region aReg( pA->GetRegion() );
+ m_rOuterFace.IntersectClipRegion( aReg.ConvertToB2DPolyPolygon() );
+ }
+ break;
+
+ case( META_MOVECLIPREGION_ACTION ):
+ {
+ const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*) pAction;
+ m_rOuterFace.MoveClipRegion( pA->GetHorzMove(), pA->GetVertMove() );
+ }
+ break;
+
+ case( META_MAPMODE_ACTION ):
+ {
+ const_cast< MetaAction* >( pAction )->Execute( pDummyVDev );
+ m_rOuterFace.SetMapMode( pDummyVDev->GetMapMode() );
+ }
+ break;
+
+ case( META_LINECOLOR_ACTION ):
+ {
+ const MetaLineColorAction* pA = (const MetaLineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetLineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetLineColor();
+ }
+ break;
+
+ case( META_FILLCOLOR_ACTION ):
+ {
+ const MetaFillColorAction* pA = (const MetaFillColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetFillColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetFillColor();
+ }
+ break;
+
+ case( META_TEXTLINECOLOR_ACTION ):
+ {
+ const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetTextLineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetTextLineColor();
+ }
+ break;
+
+ case( META_OVERLINECOLOR_ACTION ):
+ {
+ const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetOverlineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetOverlineColor();
+ }
+ break;
+
+ case( META_TEXTFILLCOLOR_ACTION ):
+ {
+ const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetTextFillColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetTextFillColor();
+ }
+ break;
+
+ case( META_TEXTCOLOR_ACTION ):
+ {
+ const MetaTextColorAction* pA = (const MetaTextColorAction*) pAction;
+ m_rOuterFace.SetTextColor( pA->GetColor() );
+ }
+ break;
+
+ case( META_TEXTALIGN_ACTION ):
+ {
+ const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pAction;
+ m_rOuterFace.SetTextAlign( pA->GetTextAlign() );
+ }
+ break;
+
+ case( META_FONT_ACTION ):
+ {
+ const MetaFontAction* pA = (const MetaFontAction*) pAction;
+ m_rOuterFace.SetFont( pA->GetFont() );
+ }
+ break;
+
+ case( META_PUSH_ACTION ):
+ {
+ const MetaPushAction* pA = (const MetaPushAction*) pAction;
+
+ pDummyVDev->Push( pA->GetFlags() );
+ m_rOuterFace.Push( pA->GetFlags() );
+ }
+ break;
+
+ case( META_POP_ACTION ):
+ {
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+ }
+ break;
+
+ case( META_LAYOUTMODE_ACTION ):
+ {
+ const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*) pAction;
+ m_rOuterFace.SetLayoutMode( pA->GetLayoutMode() );
+ }
+ break;
+
+ case META_TEXTLANGUAGE_ACTION:
+ {
+ const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*) pAction;
+ m_rOuterFace.SetDigitLanguage( pA->GetTextLanguage() );
+ }
+ break;
+
+ case( META_WALLPAPER_ACTION ):
+ {
+ const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pAction;
+ m_rOuterFace.DrawWallpaper( pA->GetRect(), pA->GetWallpaper() );
+ }
+ break;
+
+ case( META_RASTEROP_ACTION ):
+ {
+ // !!! >>> we don't want to support this actions
+ }
+ break;
+
+ case( META_REFPOINT_ACTION ):
+ {
+ // !!! >>> we don't want to support this actions
+ }
+ break;
+
+ default:
+ // #i24604# Made assertion fire only once per
+ // metafile. The asserted actions here are all
+ // deprecated
+ if( !bAssertionFired )
+ {
+ bAssertionFired = true;
+ DBG_ERROR( "PDFExport::ImplWriteActions: deprecated and unsupported MetaAction encountered" );
+ }
+ break;
+ }
+ i++;
+ }
+ }
+
+ delete pPrivateDevice;
+}
+
+
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index d8581cc3fa7a..9d8f3bf2f9a0 100755
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -558,7 +558,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
mnCurPage = 1;
mnCurPrintPage = 1;
mbPrinting = TRUE;
- if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
+ if( GetCapabilities( PRINTER_CAPABILITIES_USEPULLMODEL ) )
{
mbJobActive = TRUE;
// sallayer does all necessary page printing
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 9d4d2529249d..8a011606ab41 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -1085,6 +1085,7 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
mvCharDxs[i] = FRound( fXFactor * mvCharDxs[i] );
}
}
+ mnWidth = rArgs.mnLayoutWidth;
}
void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDeltaWidth)
diff --git a/vcl/source/helper/makefile.mk b/vcl/source/helper/makefile.mk
index e708bdec9eaa..1a417417dbe4 100644
--- a/vcl/source/helper/makefile.mk
+++ b/vcl/source/helper/makefile.mk
@@ -46,7 +46,6 @@ SLOFILES=\
$(SLO)$/canvastools.obj \
$(SLO)$/xconnection.obj \
$(SLO)$/threadex.obj \
- $(SLO)$/smartid.obj \
$(SLO)$/lazydelete.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/helper/smartid.cxx b/vcl/source/helper/smartid.cxx
deleted file mode 100755
index c367aeb2bce5..000000000000
--- a/vcl/source/helper/smartid.cxx
+++ /dev/null
@@ -1,264 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-#include <vcl/smartid.hxx>
-
-struct ImplSmartIdData
-{
- String aUId;
- ULONG nUId;
- BOOL bHasStringId;
- BOOL bHasNumericId;
-};
-
-
-ImplSmartIdData* SmartId::GetSmartIdData()
-{
- if ( !mpData )
- {
- mpData = new ImplSmartIdData;
-// mpData->aUId = "";
- mpData->nUId = 0;
- mpData->bHasStringId = FALSE;
- mpData->bHasNumericId = FALSE;
- }
- return mpData;
-}
-
-
-SmartId::SmartId( const String& rId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
-}
-
-SmartId::SmartId( ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId( const String& rId, ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId()
-: mpData( NULL )
-{}
-
-SmartId::SmartId( const SmartId& rId )
-: mpData( NULL )
-{
- if ( rId.mpData )
- {
- GetSmartIdData();
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
-}
-
-SmartId& SmartId::operator = ( const SmartId& rId )
-{
- if ( rId.mpData )
- GetSmartIdData();
- else
- {
- delete mpData;
- mpData = NULL;
- }
- if ( mpData && rId.mpData )
- {
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
- return *this;
-}
-
-SmartId::~SmartId()
-{
- if ( mpData )
- delete mpData;
-#ifdef DBG_UTIL
- if ( mpData )
- mpData = (ImplSmartIdData*)0xDeadBeef;
-#endif
-}
-
-void SmartId::UpdateId( const SmartId& rId, SmartIdUpdateMode aMode )
-{
- // Check if ImplData is needed
- if ( aMode != SMART_SET_SMART || ( rId.HasString() || rId.HasNumeric() ) )
- GetSmartIdData();
-
- if ( aMode == SMART_SET_STR || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasString() ) )
- {
- GetSmartIdData()->aUId = rId.GetStr();
- GetSmartIdData()->bHasStringId = rId.HasString();
- }
- if ( aMode == SMART_SET_NUM || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasNumeric() ) )
- {
- GetSmartIdData()->nUId = rId.GetNum();
- GetSmartIdData()->bHasNumericId = rId.HasNumeric();
- }
-
- // remove ImplData when no IDs are set. This is Important because Implementation of Equals() Matches and HasAny relies on it
- if ( mpData && !mpData->bHasStringId && !mpData->bHasNumericId )
- {
- delete mpData;
- mpData = NULL;
- }
-}
-
-BOOL SmartId::HasNumeric() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasNumericId;
-}
-
-BOOL SmartId::HasString() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasStringId;
-}
-
-BOOL SmartId::HasAny() const
-{
- return mpData != NULL;
-}
-
-ULONG SmartId::GetNum() const
-{
- if ( !mpData )
- return 0;
- else
- return mpData->nUId;
-}
-
-String SmartId::GetStr() const
-{
- if ( !mpData )
- return String();
- else
- return mpData->aUId;
-}
-
-
-String SmartId::GetText() const // return String for UI usage
-{
- String aRes;
- if ( HasNumeric() )
- aRes = String::CreateFromInt64( GetNum() );
- if ( HasString() )
- {
- if ( HasNumeric() )
- aRes.AppendAscii( "/" );
- aRes.Append( GetStr() );
- }
- return aRes;
-}
-
-BOOL SmartId::Matches( const String &rId )const
-{
- if ( HasString() )
- return GetStr().EqualsIgnoreCaseAscii( rId );
- else
- return FALSE;
-}
-
-BOOL SmartId::Matches( const ULONG nId ) const
-{
- if ( HasNumeric() )
- return GetNum() == nId;
- else
- return FALSE;
-}
-
-/******************************************************************************
-If Both Ids have nither Strings nor Numbers they don't match
-If both Ids have Strings the result of Matching these is returned.
-Numbers are then Ignored.
-Else Matching Numbers is attempted.
-******************************************************************************/
-BOOL SmartId::Matches( const SmartId &rId ) const
-{
- if ( !mpData || !rId.mpData )
- return FALSE;
- else if ( HasString() && rId.HasString() )
- return Matches( rId.GetStr() );
- else
- return rId.HasNumeric() && Matches( rId.GetNum() );
-}
-
-BOOL SmartId::Equals( const SmartId &rId ) const
-{
- if ( mpData && rId.mpData )
- return mpData->aUId.EqualsIgnoreCaseAscii( rId.mpData->aUId )
- && mpData->bHasStringId == rId.mpData->bHasStringId
- && mpData->nUId == rId.mpData->nUId
- && mpData->bHasNumericId == rId.mpData->bHasNumericId;
- else if ( !mpData && !rId.mpData )
- return TRUE;
- else
- return FALSE;
-}
-
-BOOL SmartId::operator == ( const SmartId& rRight ) const
-{
- return Equals( rRight );
-}
-
-BOOL SmartId::operator < ( const SmartId& rRight ) const
-{
- if ( HasString() && rRight.HasString() && GetStr() != rRight.GetStr() )
- return GetStr() < rRight.GetStr();
- else if ( HasNumeric() && rRight.HasNumeric() && GetNum() != rRight.GetNum() )
- return GetNum() < rRight.GetNum();
- else
- { // Sort Strings to Front
- if ( HasString() )
- return rRight.HasString() && rRight.HasNumeric();
- else
- return rRight.HasString() || (!HasNumeric() && rRight.HasNumeric());
- }
-}
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 010cae338e0e..13ae6b0ead76 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -29,6 +29,7 @@
ModalDialog SV_DLG_PRINT
{
+ HelpID = "vcl:ModalDialog:SV_DLG_PRINT";
Text [en-US] = "Print";
Closeable = TRUE;
Sizeable = TRUE;
@@ -64,6 +65,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PAGE_EDIT
{
+ HelpID = "vcl:NumericField:SV_DLG_PRINT:SV_PRINT_PAGE_EDIT";
Pos = MAP_APPFONT( 5, 140 );
Size = MAP_APPFONT( 30, 12 );
SVLook = TRUE;
@@ -80,18 +82,21 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PAGE_FORWARD
{
+ HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_FORWARD";
Pos = MAP_APPFONT( 95, 140 );
Size = MAP_APPFONT( 15, 12 );
HelpText [en-US] = "Scroll one page forward.";
};
PushButton SV_PRINT_PAGE_BACKWARD
{
+ HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_BACKWARD";
Pos = MAP_APPFONT( 80, 140 );
Size = MAP_APPFONT( 15, 12 );
HelpText [en-US] = "Scroll one page backward.";
};
TabControl SV_PRINT_TABCTRL
{
+ HelpID = "vcl:TabControl:SV_DLG_PRINT:SV_PRINT_TABCTRL";
Pos = MAP_APPFONT( 140, 5 );
Size = MAP_APPFONT( 205, 175 );
};
@@ -123,6 +128,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_NUP
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_NUP";
Text [en-US] = "Page Layout";
Hide = TRUE;
@@ -134,6 +140,7 @@ ModalDialog SV_DLG_PRINT
};
RadioButton SV_PRINT_PRT_NUP_DEFAULT_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_DEFAULT_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "~Default";
@@ -141,12 +148,14 @@ ModalDialog SV_DLG_PRINT
};
RadioButton SV_PRINT_PRT_NUP_BROCHURE_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BROCHURE_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text = "";
};
RadioButton SV_PRINT_PRT_NUP_PAGES_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "Pa~ges per sheet";
@@ -154,6 +163,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_PAGES_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BOX";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 80 );
Border = TRUE;
@@ -180,6 +190,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_COLS_EDT
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_COLS_EDT";
Pos = MAP_APPFONT( 55, 20 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -198,6 +209,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_ROWS_EDT
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ROWS_EDT";
Pos = MAP_APPFONT( 55, 35 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -215,6 +227,7 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT
{
+ HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT";
Pos = MAP_APPFONT( 55, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
@@ -237,6 +250,7 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT
{
+ HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT";
Pos = MAP_APPFONT( 155, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
@@ -259,6 +273,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORIENTATION_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORIENTATION_BOX";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 40 );
Border = TRUE;
@@ -280,6 +295,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORDER_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORDER_BOX";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 20 );
DropDown = TRUE;
@@ -294,6 +310,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_PRT_NUP_BORDER_CB
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BORDER_CB";
Pos = MAP_APPFONT( 10, 65 );
Size = MAP_APPFONT( 150, 12 );
Text [en-US] = "Draw a border around each page";
@@ -303,6 +320,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_JOB
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_JOB";
Text [en-US] = "General";
Hide = TRUE;
@@ -314,6 +332,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRINTERS
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_JOB:SV_PRINT_PRINTERS";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 100, 80 );
Border = TRUE;
@@ -322,6 +341,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_DETAILS_BTN
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_DETAILS_BTN";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 5, 5 );
Text [en-US] = "Details";
@@ -347,6 +367,7 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PRT_SETUP
{
+ HelpID = "vcl:PushButton:SV_PRINT_TAB_JOB:SV_PRINT_PRT_SETUP";
Pos = MAP_APPFONT( 115, 5 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "Properties...";
@@ -366,6 +387,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_COPYCOUNT_FIELD
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_JOB:SV_PRINT_COPYCOUNT_FIELD";
Pos = MAP_APPFONT( 10, 56 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -382,6 +404,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_COLLATE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_COLLATE";
Pos = MAP_APPFONT( 95, 45 );
Size = MAP_APPFONT( 70, 10 );
Text [en-US] = "Collate";
@@ -411,6 +434,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_OPT
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_OPT";
Text [en-US] = "Options";
Hide = TRUE;
@@ -422,6 +446,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_TOFILE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_TOFILE";
Pos = MAP_APPFONT( 10, 20 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print to ~file";
@@ -429,6 +454,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_SINGLEJOBS
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_SINGLEJOBS";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "~Create single print jobs for collated output";
@@ -436,6 +462,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_REVERSE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_REVERSE";
Pos = MAP_APPFONT( 10, 50 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print in ~reverse page order";
@@ -446,6 +473,7 @@ ModalDialog SV_DLG_PRINT
ModelessDialog SV_DLG_PRINT_PROGRESS
{
+ HelpID = "vcl:ModelessDialog:SV_DLG_PRINT_PROGRESS";
Text [en-US] = "Printing";
Closeable = FALSE;
Sizeable = FALSE;
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index e835fe749ed1..9a0452027737 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -530,22 +530,19 @@ XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const
// -----------------------------------------------------------------------
-void ButtonDialog::SetButtonHelpId( USHORT nId, ULONG nHelpId )
+void ButtonDialog::SetButtonHelpId( USHORT nId, const rtl::OString& rHelpId )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
- pItem->mpPushButton->SetHelpId( nHelpId );
+ pItem->mpPushButton->SetHelpId( rHelpId );
}
// -----------------------------------------------------------------------
-ULONG ButtonDialog::GetButtonHelpId( USHORT nId ) const
+rtl::OString ButtonDialog::GetButtonHelpId( USHORT nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
- if ( pItem )
- return pItem->mpPushButton->GetHelpId();
- else
- return 0;
+ return pItem ? rtl::OString( pItem->mpPushButton->GetHelpId() ) : rtl::OString();
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index e77eacb2fddf..b6f80588d776 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -157,7 +157,7 @@ struct MenuItemData
XubString aTipHelpText; // TipHelp-String (eg, expanded filenames)
XubString aCommandStr; // CommandString
XubString aHelpCommandStr; // Help command string (to reference external help)
- ULONG nHelpId; // Help-Id
+ rtl::OString aHelpId; // Help-Id
ULONG nUserValue; // User value
Image aImage; // Image
KeyCode aAccelKey; // Accelerator-Key
@@ -252,7 +252,6 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
pData->nBits = nBits;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
pData->bChecked = FALSE;
pData->bEnabled = TRUE;
@@ -284,7 +283,6 @@ void MenuItemList::InsertSeparator( USHORT nPos )
pData->nBits = 0;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
pData->bChecked = FALSE;
pData->bEnabled = TRUE;
@@ -844,14 +842,14 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl
// Ist eine ID vorhanden, dann Hilfe mit der ID aufrufen, sonst
// den Hilfe-Index
String aCommand = pMenu->GetItemCommand( nId );
- ULONG nHelpId = pMenu->GetHelpId( nId );
+ rtl::OString aHelpId( pMenu->GetHelpId( nId ) );
+ if( ! aHelpId.getLength() )
+ aHelpId = OOO_HELP_INDEX;
if ( aCommand.Len() )
pHelp->Start( aCommand, NULL );
- else if ( nHelpId )
- pHelp->Start( nHelpId, NULL );
else
- pHelp->Start( OOO_HELP_INDEX, NULL );
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
bDone = TRUE;
}
@@ -1330,15 +1328,14 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
SetHelpText( nItemId, aHelpText );
}
- ULONG nHelpId = 0;
if ( nObjMask & RSC_MENUITEM_HELPID )
{
- nHelpId = ReadLongRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
if ( !bSep )
- SetHelpId( nItemId, nHelpId );
+ SetHelpId( nItemId, aHelpId );
}
- if( !bSep /* && SvHelpSettings::HelpText( aHelpText, nHelpId ) */ )
+ if( !bSep )
SetHelpText( nItemId, aHelpText );
if ( nObjMask & RSC_MENUITEM_KEYCODE )
@@ -1463,7 +1460,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
pThis->CheckItem( nId, TRUE );
if ( !rMenu.IsItemEnabled( nId ) )
pThis->EnableItem( nId, FALSE );
- pThis->SetHelpId( nId, pData->nHelpId );
+ pThis->SetHelpId( nId, pData->aHelpId );
pThis->SetHelpText( nId, pData->aHelpText );
pThis->SetAccelKey( nId, pData->aAccelKey );
pThis->SetItemCommand( nId, pData->aCommandStr );
@@ -2039,7 +2036,7 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
if ( pData )
{
if ( !pData->aHelpText.Len() &&
- (( pData->nHelpId ) || ( pData->aCommandStr.Len() )))
+ (( pData->aHelpId.getLength() ) || ( pData->aCommandStr.Len() )))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
@@ -2047,8 +2044,8 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
if ( pData->aCommandStr.Len() )
pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL );
- if( !pData->aHelpText.Len() && pData->nHelpId )
- pData->aHelpText = pHelp->GetHelpText( pData->nHelpId, NULL );
+ if( !pData->aHelpText.Len() && pData->aHelpId.getLength() )
+ pData->aHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
}
@@ -2081,22 +2078,29 @@ const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void Menu::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- pData->nHelpId = nHelpId;
+ pData->aHelpId = rHelpId;
}
-ULONG Menu::GetHelpId( USHORT nItemId ) const
+rtl::OString Menu::GetHelpId( USHORT nItemId ) const
{
+ rtl::OString aRet;
+
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- return pData->nHelpId;
- else
- return 0;
+ {
+ if ( pData->aHelpId.getLength() )
+ aRet = pData->aHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pData->aCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
Menu& Menu::operator=( const Menu& rMenu )
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 7f7a65cd7fb9..d00d569883d5 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -196,10 +196,9 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
USHORT nLoButtons = ReadShortRes();
USHORT nHiDefButton = ReadShortRes();
USHORT nLoDefButton = ReadShortRes();
- USHORT nHiHelpId = ReadShortRes();
- USHORT nLoHelpId = ReadShortRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
/* USHORT bSysModal = */ ReadShortRes();
- SetHelpId( ((ULONG)nHiHelpId << 16) + nLoHelpId );
+ SetHelpId( aHelpId );
WinBits nBits = (((ULONG)nHiButtons << 16) + nLoButtons) |
(((ULONG)nHiDefButton << 16) + nLoDefButton);
ImplInit( pParent, nBits | WB_MOVEABLE | WB_HORZ | WB_CENTER );
@@ -233,7 +232,7 @@ MessBox::~MessBox()
void MessBox::ImplPosControls()
{
- if ( GetHelpId() )
+ if ( GetHelpId().getLength() )
{
if ( !mbHelpBtn )
{
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index a0be94674328..f24ed500b7df 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -46,7 +46,7 @@
#include "unotools/localedatawrapper.hxx"
-#include "rtl/ustrbuf.hxx"
+#include "rtl/strbuf.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
@@ -61,8 +61,8 @@ using namespace com::sun::star::container;
using namespace com::sun::star::beans;
#define HELPID_PREFIX ".HelpId:vcl:PrintDialog"
-#define SMHID2( a, b ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ":" b ) ), HID_PRINTDLG ) )
-#define SMHID1( a ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ) ), HID_PRINTDLG ) )
+#define SMHID2( a, b ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ":" b ) )
+#define SMHID1( a ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ) )
PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId )
: Window( i_pParent, i_rId )
@@ -1127,24 +1127,24 @@ bool PrintDialog::isSingleJobs()
static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() )
{
- rtl::OUStringBuffer aBuf( 256 );
- aBuf.appendAscii( HELPID_PREFIX );
+ rtl::OStringBuffer aBuf( 256 );
+ aBuf.append( HELPID_PREFIX );
if( i_rPropName.getLength() )
{
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.append( i_rPropName );
+ aBuf.append( ':' );
+ aBuf.append( rtl::OUStringToOString( i_rPropName, RTL_TEXTENCODING_UTF8 ) );
}
if( i_pType )
{
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.appendAscii( i_pType );
+ aBuf.append( ':' );
+ aBuf.append( i_pType );
}
if( i_nId >= 0 )
{
- aBuf.append( sal_Unicode( ':' ) );
+ aBuf.append( ':' );
aBuf.append( i_nId );
}
- i_pWindow->SetSmartHelpId( SmartId( aBuf.makeStringAndClear(), HID_PRINTDLG ) );
+ i_pWindow->SetHelpId( aBuf.makeStringAndClear() );
}
static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ )
@@ -2147,7 +2147,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
if( pHelp )
{
// FIXME: find out proper help URL and use here
- pHelp->Start( HID_PRINTDLG, GetParent() );
+ pHelp->Start( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ), GetParent() );
}
}
else if( pButton == &maForwardBtn )
@@ -2575,6 +2575,7 @@ void PrintProgressDialog::tick()
void PrintProgressDialog::reset()
{
+ mbCanceled = false;
setProgress( 0 );
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index ba4ab7984c52..36f27b1ceee7 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -89,7 +89,7 @@ struct ImplStatusItem
XubString maText;
XubString maHelpText;
XubString maQuickHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
void* mpUserData;
BOOL mbVisible;
XubString maAccessibleName;
@@ -906,9 +906,9 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -916,8 +916,8 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
@@ -1033,7 +1033,6 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
pItem->mnBits = nBits;
pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET;
pItem->mnOffset = nOffset;
- pItem->mnHelpId = 0;
pItem->mpUserData = 0;
pItem->mbVisible = TRUE;
@@ -1475,15 +1474,15 @@ const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = mpItemList->GetObject( nPos );
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommand.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommand.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -1520,24 +1519,31 @@ const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void StatusBar::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+ mpItemList->GetObject( nPos )->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG StatusBar::GetHelpId( USHORT nItemId ) const
+rtl::OString StatusBar::GetHelpId( USHORT nItemId ) const
{
USHORT nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mnHelpId;
- else
- return 0;
+ {
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommand, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 4de6c88490f6..b71cf1c13c8d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4820,15 +4820,15 @@ const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommandStr.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommandStr.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommandStr.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -4894,9 +4894,9 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -4904,8 +4904,8 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 334cdd2d0a64..35a39676353a 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -99,7 +99,6 @@ ImplToolItem::ImplToolItem()
mnId = 0;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = 0;
meState = STATE_NOCHECK;
@@ -124,7 +123,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -149,7 +147,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -175,7 +172,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -204,7 +200,7 @@ ImplToolItem::ImplToolItem( const ImplToolItem& rItem ) :
maQuickHelpText ( rItem.maQuickHelpText ),
maHelpText ( rItem.maHelpText ),
maCommandStr ( rItem.maCommandStr ),
- mnHelpId ( rItem.mnHelpId ),
+ maHelpId ( rItem.maHelpId ),
maRect ( rItem.maRect ),
maCalcRect ( rItem.maCalcRect ),
maItemSize ( rItem.maItemSize ),
@@ -243,7 +239,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem )
maQuickHelpText = rItem.maQuickHelpText;
maHelpText = rItem.maHelpText;
maCommandStr = rItem.maCommandStr;
- mnHelpId = rItem.mnHelpId;
+ maHelpId = rItem.maHelpId;
maRect = rItem.maRect;
maCalcRect = rItem.maCalcRect;
mnSepSize = rItem.mnSepSize;
@@ -595,7 +591,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
aItem.mnBits = (ToolBoxItemBits)ReadLongRes();
if( nObjMask & RSC_TOOLBOXITEM_HELPID )
- aItem.mnHelpId = ReadLongRes();
+ aItem.maHelpId = ReadByteStringRes();
if ( nObjMask & RSC_TOOLBOXITEM_TEXT )
{
@@ -1923,24 +1919,31 @@ const XubString& ToolBox::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void ToolBox::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG ToolBox::GetHelpId( USHORT nItemId ) const
+rtl::OString ToolBox::GetHelpId( USHORT nItemId ) const
{
+ rtl::OString aRet;
+
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ {
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 41a2fe6a7ba3..0d668377fade 100644..100755
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -612,8 +612,6 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mnX = 0; // X-Position to Parent
mpWindowImpl->mnY = 0; // Y-Position to Parent
mpWindowImpl->mnAbsScreenX = 0; // absolute X-position on screen, used for RTL window positioning
- mpWindowImpl->mnHelpId = 0; // help id
- mpWindowImpl->mnUniqId = 0; // unique id
mpWindowImpl->mpChildClipRegion = NULL; // Child-Clip-Region when ClipChildren
mpWindowImpl->mpPaintRegion = NULL; // Paint-ClipRegion
mpWindowImpl->mnStyle = 0; // style (init in ImplInitWindow)
@@ -1179,20 +1177,14 @@ void Window::ImplCallMove()
// -----------------------------------------------------------------------
-static ULONG ImplAutoHelpID( ResMgr* pResMgr )
+static rtl::OString ImplAutoHelpID( ResMgr* pResMgr )
{
- if ( !Application::IsAutoHelpIdEnabled() )
- return 0;
-
- ULONG nHID = 0;
+ rtl::OString aRet;
- DBG_ASSERT( pResMgr, "No res mgr for auto help id" );
- if( ! pResMgr )
- return 0;
+ if( pResMgr && Application::IsAutoHelpIdEnabled() )
+ aRet = pResMgr->GetAutoHelpId();
- nHID = pResMgr->GetAutoHelpId();
-
- return nHID;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1212,22 +1204,23 @@ WinBits Window::ImplInitRes( const ResId& rResId )
void Window::ImplLoadRes( const ResId& rResId )
{
- // newer move this line after IncrementRes
- char* pRes = (char*)GetClassRes();
- pRes += 12;
- sal_uInt32 nHelpId = (sal_uInt32)GetLongRes( (void*)pRes );
- if ( !nHelpId )
- nHelpId = ImplAutoHelpID( rResId.GetResMgr() );
- SetHelpId( nHelpId );
-
ULONG nObjMask = ReadLongRes();
+ // we need to calculate auto helpids before the resource gets closed
+ // if the resource only contains flags, it will be closed before we try to read a help id
+ // so we always create an auto help id that might be overwritten later
+ // HelpId
+ rtl::OString aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
+
// ResourceStyle
ULONG nRSStyle = ReadLongRes();
// WinBits
ReadLongRes();
- // HelpId
- ReadLongRes();
+
+ if( nObjMask & WINDOW_HELPID )
+ aHelpId = ReadByteStringRes();
+
+ SetHelpId( aHelpId );
BOOL bPos = FALSE;
BOOL bSize = FALSE;
@@ -1294,7 +1287,7 @@ void Window::ImplLoadRes( const ResId& rResId )
if ( nObjMask & WINDOW_EXTRALONG )
SetData( (void*)ReadLongRes() );
if ( nObjMask & WINDOW_UNIQUEID )
- SetUniqueId( (ULONG)ReadLongRes() );
+ SetUniqueId( ReadByteStringRes() );
if ( nObjMask & WINDOW_BORDER_STYLE )
{
@@ -1322,8 +1315,6 @@ ImplWinData* Window::ImplGetWinData() const
mpWindowImpl->mpWinData->mnIsTopWindow = (USHORT) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
mpWindowImpl->mpWinData->mbMouseOver = FALSE;
mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? FALSE : TRUE; // TRUE: try to draw this control with native theme API
- mpWindowImpl->mpWinData->mpSmartHelpId = NULL;
- mpWindowImpl->mpWinData->mpSmartUniqueId = NULL;
}
return mpWindowImpl->mpWinData;
@@ -4734,10 +4725,6 @@ Window::~Window()
delete mpWindowImpl->mpWinData->mpFocusRect;
if ( mpWindowImpl->mpWinData->mpTrackRect )
delete mpWindowImpl->mpWinData->mpTrackRect;
- if ( mpWindowImpl->mpWinData->mpSmartHelpId )
- delete mpWindowImpl->mpWinData->mpSmartHelpId;
- if ( mpWindowImpl->mpWinData->mpSmartUniqueId )
- delete mpWindowImpl->mpWinData->mpSmartUniqueId;
delete mpWindowImpl->mpWinData;
}
@@ -4985,29 +4972,18 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
-
- if ( !nNumHelpId && aStrHelpId.Len() == 0 && ImplGetParent() )
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aStrHelpId.Len() == 0 && ImplGetParent() )
ImplGetParent()->RequestHelp( rHEvt );
else
{
- if ( !nNumHelpId && aStrHelpId.Len() == 0 )
- nNumHelpId = OOO_HELP_INDEX;
-
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if( aStrHelpId.Len() > 0 )
pHelp->Start( aStrHelpId, this );
else
- pHelp->Start( nNumHelpId, this );
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOO_HELP_INDEX ) ), this );
}
}
}
@@ -8136,32 +8112,22 @@ const XubString& Window::GetHelpText() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
bool bStrHelpId = (aStrHelpId.Len() > 0);
- if ( !mpWindowImpl->maHelpText.Len() && (nNumHelpId || bStrHelpId) )
+ if ( !mpWindowImpl->maHelpText.Len() && bStrHelpId )
{
if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if( bStrHelpId )
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
- else
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( nNumHelpId, this );
+ ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
mpWindowImpl->mbHelpTextDynamic = FALSE;
}
}
}
- else if( mpWindowImpl->mbHelpTextDynamic && (nNumHelpId || bStrHelpId) )
+ else if( mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
{
static const char* pEnv = getenv( "HELP_DEBUG" );
if( pEnv && *pEnv )
@@ -8169,10 +8135,7 @@ const XubString& Window::GetHelpText() const
rtl::OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() );
aTxt.append( mpWindowImpl->maHelpText );
aTxt.appendAscii( "\n------------------\n" );
- if( bStrHelpId )
- aTxt.append( rtl::OUString( aStrHelpId ) );
- else
- aTxt.append( sal_Int32( nNumHelpId ) );
+ aTxt.append( rtl::OUString( aStrHelpId ) );
mpWindowImpl->maHelpText = aTxt.makeStringAndClear();
}
mpWindowImpl->mbHelpTextDynamic = FALSE;
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 02b2713b01cc..e5b58a8b6f3c 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1442,115 +1442,31 @@ Window* Window::ImplGetTopmostFrameWindow()
return pTopmostParent->mpWindowImpl->mpFrameWindow;
}
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnHelpId
-void Window::SetHelpId( ULONG nHelpId )
+void Window::SetHelpId( const rtl::OString& rHelpId )
{
- SetSmartHelpId(SmartId(nHelpId));
+ mpWindowImpl->maHelpId = rHelpId;
}
-ULONG Window::GetHelpId() const
+const rtl::OString& Window::GetHelpId() const
{
- return mpWindowImpl->mnHelpId;
+ return mpWindowImpl->maHelpId;
}
-void Window::SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode )
+void Window::SetUniqueId( const rtl::OString& rUniqueId )
{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- {
- mpWindowImpl->mnHelpId = aId.GetNum();
- }
-}
-
-SmartId Window::GetSmartHelpId() const
-{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- {
- if ( mpWindowImpl->mnHelpId || mpWindowImpl->mpWinData->mpSmartHelpId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartHelpId->UpdateId( SmartId( mpWindowImpl->mnHelpId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartHelpId;
- }
- else
- {
- if ( mpWindowImpl->mnHelpId )
- return SmartId( mpWindowImpl->mnHelpId );
- else
- return SmartId();
- }
-}
-
-
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnUniqId
-void Window::SetUniqueId( ULONG nUniqueId ) { mpWindowImpl->mnUniqId = nUniqueId; }
-ULONG Window::GetUniqueId() const { return mpWindowImpl->mnUniqId; }
-
-
-void Window::SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode )
-{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- mpWindowImpl->mnUniqId = aId.GetNum();
+ mpWindowImpl->maUniqId = rUniqueId;
}
-SmartId Window::GetSmartUniqueId() const
+const rtl::OString& Window::GetUniqueId() const
{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- {
- if ( mpWindowImpl->mnUniqId || mpWindowImpl->mpWinData->mpSmartUniqueId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartUniqueId->UpdateId( SmartId( mpWindowImpl->mnUniqId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartUniqueId;
- }
- else
- {
- if ( mpWindowImpl->mnUniqId )
- return SmartId( mpWindowImpl->mnUniqId );
- else
- return SmartId();
- }
+ return mpWindowImpl->maUniqId;
}
-SmartId Window::GetSmartUniqueOrHelpId() const
+const rtl::OString& Window::GetUniqueOrHelpId() const
{
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId ) || mpWindowImpl->mnHelpId )
- {
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId ) || mpWindowImpl->mnUniqId )
- {
- SmartId aTemp = GetSmartHelpId();
- aTemp.UpdateId( GetSmartUniqueId() );
- return aTemp;
- }
- else
- return GetSmartHelpId();
- }
- else
- return GetSmartUniqueId();
+ return mpWindowImpl->maUniqId.getLength() ? mpWindowImpl->maUniqId : mpWindowImpl->maHelpId;
}
-
-
-
// --------- old inline methods ---------------
Window* Window::ImplGetWindow()
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index faedc7e5e600..2cb92ecd8292 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -39,6 +39,8 @@
#include <rtl/strbuf.hxx>
+#include <rtl/uri.hxx>
+
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -216,9 +218,25 @@ extern "C"
void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
{
+ rtl::OString sGtkURL;
+ rtl_TextEncoding aSystemEnc = osl_getThreadTextEncoding();
+ if ((aSystemEnc == RTL_TEXTENCODING_UTF8) || (rFileUrl.compareToAscii( "file://", 7 ) != 0))
+ sGtkURL = rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8);
+ else
+ {
+ //Non-utf8 locales are a bad idea if trying to work with non-ascii filenames
+ //Decode %XX components
+ rtl::OUString sDecodedUri = Uri::decode(rFileUrl.copy(7), rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
+ //Convert back to system locale encoding
+ rtl::OString sSystemUrl = rtl::OUStringToOString(sDecodedUri, aSystemEnc);
+ //Encode to an escaped ASCII-encoded URI
+ gchar *g_uri = g_filename_to_uri(sSystemUrl.getStr(), NULL, NULL);
+ sGtkURL = rtl::OString(g_uri);
+ g_free(g_uri);
+ }
#if GTK_CHECK_VERSION(2,10,0)
GtkRecentManager *manager = gtk_recent_manager_get_default ();
- gtk_recent_manager_add_item (manager, rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+ gtk_recent_manager_add_item (manager, sGtkURL);
(void)rMimeType;
#else
static getDefaultFnc sym_gtk_recent_manager_get_default =
@@ -227,10 +245,7 @@ void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
static addItemFnc sym_gtk_recent_manager_add_item =
(addItemFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_add_item");
if (sym_gtk_recent_manager_get_default && sym_gtk_recent_manager_add_item)
- {
- sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(),
- rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
- }
+ sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(), sGtkURL);
else
X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType);
#endif
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index e8b55ebfa895..d04d5c0ce684 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1353,11 +1353,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
//
// i.e. having a time < that of the toplevel frame means that the toplevel frame gets unfocused.
// awesome.
- bool bHack =
- getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") ||
- getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz")
- ;
- if( nUserTime == 0 && bHack )
+ if( nUserTime == 0 )
{
/* #i99360# ugly workaround an X11 library bug */
nUserTime= getDisplay()->GetLastUserEventTime( true );
@@ -1365,7 +1361,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime );
- if( bHack && ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
+ if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
m_bSetFocusOnMap = true;
gtk_widget_show( m_pWindow );
@@ -1452,6 +1448,12 @@ void GtkSalFrame::setMinMaxSize()
aHints |= GDK_HINT_MAX_SIZE;
}
}
+ if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() )
+ {
+ aGeo.max_width = m_aMaxSize.Width();
+ aGeo.max_height = m_aMaxSize.Height();
+ aHints |= GDK_HINT_MAX_SIZE;
+ }
if( aHints )
gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow),
NULL,
diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h
index fa68f1b38e73..6e6ca0a2f1cc 100644
--- a/vcl/unx/inc/salprn.h
+++ b/vcl/unx/inc/salprn.h
@@ -71,6 +71,7 @@ public:
bool m_bFax:1;
bool m_bPdf:1;
bool m_bSwallowFaxNo:1;
+ bool m_bIsPDFWriterJob:1;
PspGraphics* m_pGraphics;
psp::PrinterJob m_aPrintJob;
psp::JobData m_aJobData;
@@ -91,6 +92,11 @@ public:
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData );
+ virtual BOOL StartJob( const String*,
+ const String&,
+ const String&,
+ ImplJobSetup*,
+ vcl::PrinterController& i_rController );
virtual BOOL EndJob();
virtual BOOL AbortJob();
virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
diff --git a/vcl/unx/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx
index db4a7d05e5fc..0c43373bfa8e 100644
--- a/vcl/unx/source/fontmanager/fontcache.cxx
+++ b/vcl/unx/source/fontmanager/fontcache.cxx
@@ -373,9 +373,9 @@ void FontCache::read()
xub_StrLen nLastIndex = nIndex+1;
for( nIndex = nLastIndex ; nIndex < nLen && pLine[nIndex] != ';'; nIndex++ )
;
- if( nIndex - nLastIndex > 1 )
+ if( nIndex - nLastIndex )
{
- OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex-1, RTL_TEXTENCODING_UTF8 );
+ OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex, RTL_TEXTENCODING_UTF8 );
pFont->m_aAliases.push_back( pAtoms->getAtom( ATOM_FAMILYNAME, aAlias, sal_True ) );
}
}
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 03816857f27c..434263db352e 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -121,16 +121,20 @@ class FontCfgWrapper
FcResult (*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*);
void (*m_pFcDefaultSubstitute)(FcPattern *);
FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*);
+ FcPattern* (*m_pFcFontMatch)(FcConfig*,FcPattern*,FcResult*);
FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*);
FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*);
FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool);
-
FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
+
+ FcPattern* (*m_pFcPatternDuplicate)(const FcPattern*);
FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int);
FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double);
FcBool (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool);
FcBool (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*);
FcBool (*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
+ FcBool (*m_pFcPatternDel)(FcPattern*,const char*);
+
FT_UInt (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32);
oslGenericFunction loadSymbol( const char* );
@@ -230,8 +234,13 @@ public:
{ m_pFcDefaultSubstitute( pPattern ); }
FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult )
{ return m_pFcFontSetMatch ? m_pFcFontSetMatch( pConfig, ppFontSet, nset, pPattern, pResult ) : 0; }
+ FcPattern* FcFontMatch( FcConfig* pConfig, FcPattern* pPattern, FcResult* pResult )
+ { return m_pFcFontMatch( pConfig, pPattern, pResult ); }
FcBool FcConfigSubstitute( FcConfig* pConfig, FcPattern* pPattern, FcMatchKind eKind )
{ return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); }
+
+ FcPattern* FcPatternDuplicate( const FcPattern* pPattern ) const
+ { return m_pFcPatternDuplicate( pPattern ); }
FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue )
{ return m_pFcPatternAddInteger( pPattern, pObject, nValue ); }
FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue )
@@ -242,6 +251,8 @@ public:
{ return m_pFcPatternAddBool( pPattern, pObject, nValue ); }
FcBool FcPatternAddCharSet(FcPattern* pPattern,const char* pObject,const FcCharSet*pCharSet)
{ return m_pFcPatternAddCharSet(pPattern,pObject,pCharSet); }
+ FcBool FcPatternDel(FcPattern* pPattern, const char* object)
+ { return m_pFcPatternDel( pPattern, object); }
FT_UInt FcFreeTypeCharIndex( FT_Face face, FcChar32 ucs4 )
{ return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; }
@@ -337,8 +348,13 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcDefaultSubstitute" );
m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*))
loadSymbol( "FcFontSetMatch" );
+ m_pFcFontMatch = (FcPattern*(*)(FcConfig*,FcPattern*,FcResult*))
+ loadSymbol( "FcFontMatch" );
m_pFcConfigSubstitute = (FcBool(*)(FcConfig*,FcPattern*,FcMatchKind))
loadSymbol( "FcConfigSubstitute" );
+
+ m_pFcPatternDuplicate = (FcPattern*(*)(const FcPattern*))
+ loadSymbol( "FcPatternDuplicate" );
m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int))
loadSymbol( "FcPatternAddInteger" );
m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double))
@@ -349,6 +365,9 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcPatternAddCharSet" );
m_pFcPatternAddString = (FcBool(*)(FcPattern*,const char*,const FcChar8*))
loadSymbol( "FcPatternAddString" );
+ m_pFcPatternDel = (FcBool(*)(FcPattern*,const char*))
+ loadSymbol( "FcPatternDel" );
+
m_pFcFreeTypeCharIndex = (FT_UInt(*)(FT_Face,FcChar32))
loadSymbol( "FcFreeTypeCharIndex" );
@@ -391,13 +410,16 @@ FontCfgWrapper::FontCfgWrapper()
m_pFcConfigAppFontAddFile &&
m_pFcConfigAppFontAddDir &&
m_pFcConfigParseAndLoad &&
+ m_pFcFontMatch &&
m_pFcDefaultSubstitute &&
m_pFcConfigSubstitute &&
+ m_pFcPatternDuplicate &&
m_pFcPatternAddInteger &&
m_pFcPatternAddDouble &&
m_pFcPatternAddCharSet &&
m_pFcPatternAddBool &&
- m_pFcPatternAddString
+ m_pFcPatternAddString &&
+ m_pFcPatternDel
) )
{
osl_unloadModule( (oslModule)m_pLib );
@@ -428,18 +450,44 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
if( !pOrig )
return;
+ // filter the font sets to remove obsolete or duplicate faces
for( int i = 0; i < pOrig->nfont; ++i )
{
- FcBool outline = false;
- FcPattern *pOutlinePattern = pOrig->fonts[i];
- FcResult eOutRes =
- FcPatternGetBool( pOutlinePattern, FC_OUTLINE, 0, &outline );
- if( (eOutRes != FcResultMatch) || (outline != FcTrue) )
+ FcPattern* pOrigPattern = pOrig->fonts[i];
+ // #i115131# ignore non-outline fonts
+ FcBool bOutline = FcFalse;
+ FcResult eOutRes = FcPatternGetBool( pOrigPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
continue;
- FcPatternReference(pOutlinePattern);
- FcFontSetAdd(m_pOutlineSet, pOutlinePattern);
+ // create a pattern to find eventually better alternatives
+ FcPattern* pBetterPattern = pOrigPattern;
+ if( m_nFcVersion > 20400 ) // #i115204# avoid trouble with old FC versions
+ {
+ FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern );
+ FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue );
+ // TODO: ignore all attributes that are not interesting for finding dupes
+ // e.g. by using pattern->ImplFontAttr->pattern conversion
+ FcPatternDel( pTestPattern, FC_FONTVERSION );
+ FcPatternDel( pTestPattern, FC_CHARSET );
+ FcPatternDel( pTestPattern, FC_FILE );
+ // find the font face for the dupe-search pattern
+ FcResult eFcResult = FcResultMatch;
+ pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult );
+ FcPatternDestroy( pTestPattern );
+ if( eFcResult != FcResultMatch )
+ continue;
+ // #i115131# double check results and eventually ignore them
+ eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
+ continue;
+ }
+ // insert best found pattern for the dupe-search pattern
+ // TODO: skip inserting patterns that are already known in the target fontset
+ FcPatternReference( pBetterPattern );
+ FcFontSetAdd( m_pOutlineSet, pBetterPattern );
}
- // TODO: FcFontSetDestroy( pOrig );
+
+ // TODO?: FcFontSetDestroy( pOrig );
#else
(void)eSetName; // prevent compiler warning about unused parameter
#endif
@@ -509,22 +557,29 @@ namespace
std::vector<lang_and_family>::const_iterator aEnd = families.end();
bool alreadyclosematch = false;
- for (std::vector<lang_and_family>::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter)
+ for( std::vector<lang_and_family>::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter )
{
const char *pLang = (const char*)aIter->first;
- //perfect
- if( rtl_str_compare(pLang,sFullMatch.getStr() ) == 0)
+ if( rtl_str_compare( pLang, sFullMatch.getStr() ) == 0)
{
+ // both language and country match
candidate = aIter->second;
break;
}
- else if( (rtl_str_compare(pLang,sLangMatch.getStr()) == 0) && (!alreadyclosematch))
+ else if( alreadyclosematch )
+ continue;
+ else if( rtl_str_compare( pLang, sLangMatch.getStr()) == 0)
{
+ // just the language matches
candidate = aIter->second;
alreadyclosematch = true;
}
+ else if( rtl_str_compare( pLang, "en") == 0)
+ {
+ // fallback to the english family name
+ candidate = aIter->second;
+ }
}
-
return candidate;
}
}
@@ -701,7 +756,7 @@ int PrintFontManager::countFontconfigFonts( std::hash_map<rtl::OString, int, rtl
);
#endif
- OSL_ASSERT(eOutRes != FcResultMatch || outline);
+// OSL_ASSERT(eOutRes != FcResultMatch || outline);
// only outline fonts are usable to psprint anyway
if( eOutRes == FcResultMatch && ! outline )
@@ -731,7 +786,10 @@ int PrintFontManager::countFontconfigFonts( std::hash_map<rtl::OString, int, rtl
#endif
}
if( aFonts.empty() )
+ {
+ // TODO: remove fonts unusable to psprint from fontset
continue;
+ }
int nFamilyName = m_pAtoms->getAtom( ATOM_FAMILYNAME, OStringToOUString( OString( (sal_Char*)family ), RTL_TEXTENCODING_UTF8 ), sal_True );
PrintFont* pUpdate = aFonts.front();
@@ -1061,6 +1119,7 @@ bool PrintFontManager::getFontOptions(
ImplFontOptions& rOptions) const
{
#ifndef ENABLE_FONTCONFIG
+ (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions;
return false;
#else // ENABLE_FONTCONFIG
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index 8617bc4e5bfa..417704eb3b69 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -54,6 +54,8 @@
#include "vcl/svapp.hxx"
#include "vcl/jobset.h"
#include "vcl/print.h"
+#include "vcl/print.hxx"
+#include "vcl/pdfwriter.hxx"
#include "vcl/salptype.hxx"
#include "vcl/printerinfomanager.hxx"
@@ -63,6 +65,7 @@
using namespace psp;
using namespace rtl;
+using namespace com::sun::star;
/*
* static helpers
@@ -892,9 +895,26 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT
case PRINTER_CAPABILITIES_FAX:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "fax" ) ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
- return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) ? 1 : 0;
+ if( PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) )
+ return 1;
+ else
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ return aData.m_nPDFDevice > 0 ? 1 : 0;
+ }
case PRINTER_CAPABILITIES_EXTERNALDIALOG:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "external_dialog" ) ? 1 : 0;
+ case PRINTER_CAPABILITIES_USEPULLMODEL:
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ return aData.m_nPDFDevice > 0 ? 1 : 0;
+ }
default: break;
};
return 0;
@@ -910,6 +930,7 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT
: m_bFax( false ),
m_bPdf( false ),
m_bSwallowFaxNo( false ),
+ m_bIsPDFWriterJob( false ),
m_pGraphics( NULL ),
m_nCopies( 1 ),
m_bCollate( false ),
@@ -1021,22 +1042,28 @@ BOOL PspSalPrinter::StartJob(
BOOL PspSalPrinter::EndJob()
{
- BOOL bSuccess = m_aPrintJob.EndJob();
-
- if( bSuccess )
+ BOOL bSuccess = FALSE;
+ if( m_bIsPDFWriterJob )
+ bSuccess = TRUE;
+ else
{
- // check for fax
- if( m_bFax )
- {
+ bSuccess = m_aPrintJob.EndJob();
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- // sendAFax removes the file after use
- bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
- }
- else if( m_bPdf )
+ if( bSuccess )
{
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
+ // check for fax
+ if( m_bFax )
+ {
+
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ // sendAFax removes the file after use
+ bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
+ }
+ else if( m_bPdf )
+ {
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
+ }
}
}
vcl_sal::PrinterUpdate::jobEnded();
@@ -1089,6 +1116,274 @@ ULONG PspSalPrinter::GetErrorCode()
return 0;
}
+// -----------------------------------------------------------------------
+
+struct PDFNewJobParameters
+{
+ Size maPageSize;
+ USHORT mnPaperBin;
+
+ PDFNewJobParameters( const Size& i_rSize = Size(),
+ USHORT i_nPaperBin = 0xffff )
+ : maPageSize( i_rSize ), mnPaperBin( i_nPaperBin ) {}
+
+ bool operator!=(const PDFNewJobParameters& rComp ) const
+ {
+ Size aCompLSSize( rComp.maPageSize.Height(), rComp.maPageSize.Width() );
+ return
+ (maPageSize != rComp.maPageSize && maPageSize != aCompLSSize)
+ || mnPaperBin != rComp.mnPaperBin
+ ;
+ }
+
+ bool operator==(const PDFNewJobParameters& rComp) const
+ {
+ return ! this->operator!=(rComp);
+ }
+};
+
+struct PDFPrintFile
+{
+ rtl::OUString maTmpURL;
+ PDFNewJobParameters maParameters;
+
+ PDFPrintFile( const rtl::OUString& i_rURL, const PDFNewJobParameters& i_rNewParameters )
+ : maTmpURL( i_rURL )
+ , maParameters( i_rNewParameters ) {}
+};
+
+BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName,
+ ImplJobSetup* i_pSetupData, vcl::PrinterController& i_rController )
+{
+ OSL_TRACE( "StartJob with controller: pFilename = %s", i_pFileName ? rtl::OUStringToOString( *i_pFileName, RTL_TEXTENCODING_UTF8 ).getStr() : "<nil>" );
+ // mark for endjob
+ m_bIsPDFWriterJob = true;
+ // reset IsLastPage
+ i_rController.setLastPage( sal_False );
+
+ // update job data
+ if( i_pSetupData )
+ JobData::constructFromStreamBuffer( i_pSetupData->mpDriverData, i_pSetupData->mnDriverDataLen, m_aJobData );
+
+ OSL_ASSERT( m_aJobData.m_nPDFDevice > 0 );
+ m_aJobData.m_nPDFDevice = 1;
+
+ // possibly create one job for collated output
+ sal_Bool bSinglePrintJobs = sal_False;
+ beans::PropertyValue* pSingleValue = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) );
+ if( pSingleValue )
+ {
+ pSingleValue->Value >>= bSinglePrintJobs;
+ }
+
+ int nCopies = i_rController.getPrinter()->GetCopyCount();
+ bool bCollate = i_rController.getPrinter()->IsCollateCopy();
+
+ // notify start of real print job
+ i_rController.jobStarted();
+
+ // setup PDFWriter context
+ vcl::PDFWriter::PDFWriterContext aContext;
+ aContext.Version = vcl::PDFWriter::PDF_1_4;
+ aContext.Tagged = false;
+ aContext.EmbedStandardFonts = true;
+ aContext.Encrypt = false;
+ aContext.DocumentLocale = Application::GetSettings().GetLocale();
+
+ // prepare doc info
+ vcl::PDFDocInfo aDocInfo;
+ aDocInfo.Title = i_rJobName;
+ aDocInfo.Creator = i_rAppName;
+ aDocInfo.Producer = i_rAppName;
+
+ // define how we handle metafiles in PDFWriter
+ vcl::PDFWriter::PlayMetafileContext aMtfContext;
+ aMtfContext.m_bOnlyLosslessCompression = true;
+
+ boost::shared_ptr<vcl::PDFWriter> pWriter;
+ std::vector< PDFPrintFile > aPDFFiles;
+ boost::shared_ptr<Printer> pPrinter( i_rController.getPrinter() );
+ int nAllPages = i_rController.getFilteredPageCount();
+ i_rController.createProgressDialog();
+ bool bAborted = false;
+ PDFNewJobParameters aLastParm;
+
+ aContext.DPIx = pPrinter->ImplGetDPIX();
+ aContext.DPIy = pPrinter->ImplGetDPIY();
+ for( int nPage = 0; nPage < nAllPages && ! bAborted; nPage++ )
+ {
+ if( nPage == nAllPages-1 )
+ i_rController.setLastPage( sal_True );
+
+ // get the page's metafile
+ GDIMetaFile aPageFile;
+ vcl::PrinterController::PageSize aPageSize = i_rController.getFilteredPageFile( nPage, aPageFile );
+ if( i_rController.isProgressCanceled() )
+ {
+ bAborted = true;
+ if( nPage != nAllPages-1 )
+ {
+ i_rController.createProgressDialog();
+ i_rController.setLastPage( sal_True );
+ i_rController.getFilteredPageFile( nPage, aPageFile );
+ }
+ }
+ else
+ {
+ pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ pPrinter->SetPaperSizeUser( aPageSize.aSize, true );
+ PDFNewJobParameters aNewParm( pPrinter->GetPaperSize(), pPrinter->GetPaperBin() );
+
+ // create PDF writer on demand
+ // either on first page
+ // or on paper format change - cups does not support multiple paper formats per job (yet?)
+ // so we need to start a new job to get a new paper format from the printer
+ // orientation switches (that is switch of height and width) is handled transparently by CUPS
+ if( ! pWriter ||
+ (aNewParm != aLastParm && ! i_pFileName ) )
+ {
+ if( pWriter )
+ {
+ pWriter->Emit();
+ }
+ // produce PDF file
+ OUString aPDFUrl;
+ if( i_pFileName )
+ aPDFUrl = *i_pFileName;
+ else
+ osl_createTempFile( NULL, NULL, &aPDFUrl.pData );
+ // normalize to file URL
+ if( aPDFUrl.compareToAscii( "file:", 5 ) != 0 )
+ {
+ // this is not a file URL, but it should
+ // form it into a osl friendly file URL
+ rtl::OUString aTmp;
+ osl_getFileURLFromSystemPath( aPDFUrl.pData, &aTmp.pData );
+ aPDFUrl = aTmp;
+ }
+ // save current file and paper format
+ aLastParm = aNewParm;
+ aPDFFiles.push_back( PDFPrintFile( aPDFUrl, aNewParm ) );
+ // update context
+ aContext.URL = aPDFUrl;
+
+ // create and initialize PDFWriter
+ #if defined __SUNPRO_CC
+ #pragma disable_warn
+ #endif
+ pWriter.reset( new vcl::PDFWriter( aContext ) );
+ #if defined __SUNPRO_CC
+ #pragma enable_warn
+ #endif
+ pWriter->SetDocInfo( aDocInfo );
+ }
+
+ pWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ),
+ TenMuToPt( aNewParm.maPageSize.Height() ),
+ vcl::PDFWriter::Portrait );
+
+ pWriter->PlayMetafile( aPageFile, aMtfContext, NULL );
+ }
+ }
+
+ // emit the last file
+ if( pWriter )
+ pWriter->Emit();
+
+ // handle collate, copy count and multiple jobs correctly
+ int nOuterJobs = 1;
+ if( bSinglePrintJobs )
+ {
+ nOuterJobs = nCopies;
+ m_aJobData.m_nCopies = 1;
+ }
+ else
+ {
+ if( bCollate )
+ {
+ if( aPDFFiles.size() == 1 && pPrinter->HasSupport( SUPPORT_COLLATECOPY ) )
+ {
+ m_aJobData.setCollate( true );
+ m_aJobData.m_nCopies = nCopies;
+ }
+ else
+ {
+ nOuterJobs = nCopies;
+ m_aJobData.m_nCopies = 1;
+ }
+ }
+ else
+ {
+ m_aJobData.setCollate( false );
+ m_aJobData.m_nCopies = nCopies;
+ }
+ }
+
+ // spool files
+ if( ! i_pFileName && ! bAborted )
+ {
+ bool bFirstJob = true;
+ for( int nCurJob = 0; nCurJob < nOuterJobs; nCurJob++ )
+ {
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ {
+ oslFileHandle pFile = NULL;
+ osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read );
+ if( pFile )
+ {
+ osl_setFilePos( pFile, osl_Pos_Absolut, 0 );
+ std::vector< char > buffer( 0x10000, 0 );
+ // update job data with current page size
+ Size aPageSize( aPDFFiles[i].maParameters.maPageSize );
+ m_aJobData.setPaper( TenMuToPt( aPageSize.Width() ), TenMuToPt( aPageSize.Height() ) );
+ // update job data with current paperbin
+ m_aJobData.setPaperBin( aPDFFiles[i].maParameters.mnPaperBin );
+
+ // spool current file
+ FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() );
+ if( fp )
+ {
+ sal_uInt64 nBytesRead = 0;
+ do
+ {
+ osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead );
+ if( nBytesRead > 0 )
+ fwrite( &buffer[0], 1, nBytesRead, fp );
+ } while( nBytesRead == buffer.size() );
+ rtl::OUStringBuffer aBuf( i_rJobName.Len() + 8 );
+ aBuf.append( i_rJobName );
+ if( i > 0 || nCurJob > 0 )
+ {
+ aBuf.append( sal_Unicode(' ') );
+ aBuf.append( sal_Int32( i + nCurJob * aPDFFiles.size() ) );
+ }
+ PrinterInfoManager::get().endSpool( pPrinter->GetName(), aBuf.makeStringAndClear(), fp, m_aJobData, bFirstJob );
+ bFirstJob = false;
+ }
+ }
+ osl_closeFile( pFile );
+ }
+ }
+ }
+
+ // job has been spooled
+ i_rController.setJobState( bAborted ? view::PrintableState_JOB_ABORTED : view::PrintableState_JOB_SPOOLED );
+
+ // clean up the temporary PDF files
+ if( ! i_pFileName || bAborted )
+ {
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ {
+ osl_removeFile( aPDFFiles[i].maTmpURL.pData );
+ OSL_TRACE( "removed print PDF file %s\n", rtl::OUStringToOString( aPDFFiles[i].maTmpURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
+
+ return TRUE;
+}
+
+
+
/*
* vcl::PrinterUpdate
*/
diff --git a/vcl/unx/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx
index e245b2548c79..caf3249b5f46 100644
--- a/vcl/unx/source/printer/cupsmgr.cxx
+++ b/vcl/unx/source/printer/cupsmgr.cxx
@@ -524,12 +524,18 @@ void CUPSManager::initialize()
// introduced in dests with 1.2
// this is needed to check for %%IncludeFeature support
// (#i65684#, #i65491#)
+ bool bUsePDF = false;
cups_dest_t* pDest = ((cups_dest_t*)m_pDests);
const char* pOpt = m_pCUPSWrapper->cupsGetOption( "printer-info",
pDest->num_options,
pDest->options );
if( pOpt )
+ {
m_bUseIncludeFeature = true;
+ bUsePDF = true;
+ if( m_aGlobalDefaults.m_nPSLevel == 0 && m_aGlobalDefaults.m_nPDFDevice == 0 )
+ m_aGlobalDefaults.m_nPDFDevice = 1;
+ }
// do not send include JobPatch; CUPS will insert that itself
// TODO: currently unknwon which versions of CUPS insert JobPatches
// so currently it is assumed CUPS = don't insert JobPatch files
@@ -593,6 +599,8 @@ void CUPSManager::initialize()
aPrinter.m_aInfo.m_pParser = c_it->second.getParser();
aPrinter.m_aInfo.m_aContext = c_it->second;
}
+ if( bUsePDF && aPrinter.m_aInfo.m_nPSLevel == 0 && aPrinter.m_aInfo.m_nPDFDevice == 0 )
+ aPrinter.m_aInfo.m_nPDFDevice = 1;
aPrinter.m_aInfo.m_aDriverName = aBuf.makeStringAndClear();
aPrinter.m_bModified = false;
@@ -826,8 +834,15 @@ void CUPSManager::setupJobContextData(
FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand )
{
+ OSL_TRACE( "endSpool: %s, %s",
+ rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+ bQuickCommand ? "true" : "false" );
+
if( m_aCUPSDestMap.find( rPrintername ) == m_aCUPSDestMap.end() )
+ {
+ OSL_TRACE( "defer to PrinterInfoManager::startSpool" );
return PrinterInfoManager::startSpool( rPrintername, bQuickCommand );
+ }
#ifdef ENABLE_CUPS
OUString aTmpURL, aTmpFile;
@@ -850,7 +865,7 @@ struct less_ppd_key : public ::std::binary_function<double, double, bool>
{ return left->getOrderDependency() < right->getOrderDependency(); }
};
-void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const
+void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const
{
rNumOptions = 0;
*rOptions = NULL;
@@ -880,10 +895,26 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOpt
}
}
}
+
+ if( rJob.m_nPDFDevice > 0 && rJob.m_nCopies > 1 )
+ {
+ rtl::OString aVal( rtl::OString::valueOf( sal_Int32( rJob.m_nCopies ) ) );
+ rNumOptions = m_pCUPSWrapper->cupsAddOption( "copies", aVal.getStr(), rNumOptions, (cups_option_t**)rOptions );
+ }
+ if( ! bBanner )
+ {
+ rNumOptions = m_pCUPSWrapper->cupsAddOption( "job-sheets", "none", rNumOptions, (cups_option_t**)rOptions );
+ }
}
-int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData )
+int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
{
+ OSL_TRACE( "endSpool: %s, %s, copy count = %d",
+ rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+ rtl::OUStringToOString( rJobTitle, RTL_TEXTENCODING_UTF8 ).getStr(),
+ rDocumentJobData.m_nCopies
+ );
+
int nJobID = 0;
osl::MutexGuard aGuard( m_aCUPSMutex );
@@ -891,7 +922,10 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
std::hash_map< OUString, int, OUStringHash >::iterator dest_it =
m_aCUPSDestMap.find( rPrintername );
if( dest_it == m_aCUPSDestMap.end() )
- return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData );
+ {
+ OSL_TRACE( "defer to PrinterInfoManager::endSpool" );
+ return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner );
+ }
#ifdef ENABLE_CUPS
std::hash_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile );
@@ -903,7 +937,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
// setup cups options
int nNumOptions = 0;
cups_option_t* pOptions = NULL;
- getOptionsFromDocumentSetup( rDocumentJobData, nNumOptions, (void**)&pOptions );
+ getOptionsFromDocumentSetup( rDocumentJobData, bBanner, nNumOptions, (void**)&pOptions );
cups_dest_t* pDest = ((cups_dest_t*)m_pDests) + dest_it->second;
nJobID = m_pCUPSWrapper->cupsPrintFile( pDest->name,
diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx
index a1bca9441f77..d4211eae31df 100644
--- a/vcl/unx/source/printer/jobdata.cxx
+++ b/vcl/unx/source/printer/jobdata.cxx
@@ -51,6 +51,7 @@ JobData& JobData::operator=(const JobData& rRight)
m_pParser = rRight.m_pParser;
m_aContext = rRight.m_aContext;
m_nPSLevel = rRight.m_nPSLevel;
+ m_nPDFDevice = rRight.m_nPDFDevice;
m_nColorDevice = rRight.m_nColorDevice;
if( ! m_pParser && m_aPrinterName.getLength() )
@@ -83,6 +84,34 @@ void JobData::setCollate( bool bCollate )
}
}
+bool JobData::setPaper( int i_nWidth, int i_nHeight )
+{
+ bool bSuccess = false;
+ if( m_pParser )
+ {
+ rtl::OUString aPaper( m_pParser->matchPaper( i_nWidth, i_nHeight ) );
+
+ const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ const PPDValue* pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL;
+
+ bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
+ }
+ return bSuccess;
+}
+
+bool JobData::setPaperBin( int i_nPaperBin )
+{
+ bool bSuccess = false;
+ if( m_pParser )
+ {
+ const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
+ const PPDValue* pValue = pKey ? pKey->getValue( i_nPaperBin ) : NULL;
+
+ bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
+ }
+ return bSuccess;
+}
+
bool JobData::getStreamBuffer( void*& pData, int& bytes )
{
// consistency checks
@@ -128,6 +157,10 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes )
aLine += ByteString::CreateFromInt32( m_nPSLevel );
aStream.WriteLine( aLine );
+ aLine = "pdfdevice=";
+ aLine += ByteString::CreateFromInt32( m_nPDFDevice );
+ aStream.WriteLine( aLine );
+
aLine = "colordevice=";
aLine += ByteString::CreateFromInt32( m_nColorDevice );
aStream.WriteLine( aLine );
@@ -158,6 +191,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
bool bColorDepth = false;
bool bColorDevice = false;
bool bPSLevel = false;
+ bool bPDFDevice = false;
while( ! aStream.IsEof() )
{
aStream.ReadLine( aLine );
@@ -202,6 +236,11 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
bPSLevel = true;
rJobData.m_nPSLevel = aLine.Copy( 8 ).ToInt32();
}
+ else if( aLine.CompareTo( "pdfdevice=", 10 ) == COMPARE_EQUAL )
+ {
+ bPDFDevice = true;
+ rJobData.m_nPDFDevice = aLine.Copy( 10 ).ToInt32();
+ }
else if( aLine.Equals( "PPDContexData" ) )
{
if( bPrinter )
@@ -222,5 +261,5 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
}
}
- return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bColorDevice && bColorDepth;
+ return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
}
diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx
index c534461ea95c..bd6ce761e989 100644
--- a/vcl/unx/source/printer/printerinfomanager.cxx
+++ b/vcl/unx/source/printer/printerinfomanager.cxx
@@ -293,6 +293,10 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
m_aGlobalDefaults.m_nPSLevel = aValue.ToInt32();
+ aValue = aConfig.ReadKey( "PDFDevice" );
+ if( aValue.Len() )
+ m_aGlobalDefaults.m_nPDFDevice = aValue.ToInt32();
+
aValue = aConfig.ReadKey( "PerformFontSubstitution" );
if( aValue.Len() )
{
@@ -504,6 +508,10 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
aPrinter.m_aInfo.m_nPSLevel = aValue.ToInt32();
+ aValue = aConfig.ReadKey( "PDFDevice" );
+ if( aValue.Len() )
+ aPrinter.m_aInfo.m_nPDFDevice = aValue.ToInt32();
+
aValue = aConfig.ReadKey( "PerformFontSubstitution" );
if( ! aValue.Equals( "0" ) && ! aValue.EqualsIgnoreCaseAscii( "false" ) )
aPrinter.m_aInfo.m_bPerformFontSubstitution = true;
@@ -768,6 +776,7 @@ bool PrinterInfoManager::writePrinterConfig()
pConfig->WriteKey( "Copies", ByteString::CreateFromInt32( it->second.m_aInfo.m_nCopies ) );
pConfig->WriteKey( "Orientation", it->second.m_aInfo.m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait" );
pConfig->WriteKey( "PSLevel", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPSLevel ) );
+ pConfig->WriteKey( "PDFDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPDFDevice ) );
pConfig->WriteKey( "ColorDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDevice ) );
pConfig->WriteKey( "ColorDepth", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDepth ) );
aValue = ByteString::CreateFromInt32( it->second.m_aInfo.m_nLeftMarginAdjust );
@@ -855,9 +864,10 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin
m_aPrinters[ rPrinterName ] = aPrinter;
bSuccess = true;
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "new printer %s, level = %d, colordevice = %d, depth = %d\n",
+ fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n",
OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(),
m_aPrinters[rPrinterName].m_aInfo.m_nPSLevel,
+ m_aPrinters[rPrinterName].m_aInfo.m_nPDFDevice,
m_aPrinters[rPrinterName].m_aInfo.m_nColorDevice,
m_aPrinters[rPrinterName].m_aInfo.m_nColorDepth );
#endif
@@ -1105,7 +1115,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
return popen (aShellCommand.getStr(), "w");
}
-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/ )
+int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
{
return (0 == pclose( pFile ));
}
diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx
index 5e18849b8dfe..26a1d75f68c2 100644
--- a/vcl/unx/source/printergfx/printerjob.cxx
+++ b/vcl/unx/source/printergfx/printerjob.cxx
@@ -341,7 +341,8 @@ PrinterJob::~PrinterJob ()
delete mpJobTrailer;
// XXX should really call osl::remove routines
- removeSpoolDir (maSpoolDirName);
+ if( maSpoolDirName.getLength() )
+ removeSpoolDir (maSpoolDirName);
// osl::Directory::remove (maSpoolDirName);
}
@@ -610,7 +611,7 @@ PrinterJob::EndJob ()
{
PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
- maJobTitle, pDestFILE, m_aDocumentJobData ))
+ maJobTitle, pDestFILE, m_aDocumentJobData, true ))
{
bSuccess = sal_False;
}
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index bc80cbf94fb8..82fa9bb4b5e1 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -2076,6 +2076,13 @@ void UniscribeLayout::MoveGlyph( int nStartx8, long nNewXPos )
// move the visual item by having an offset
pVI->mnXOffset += nDelta;
}
+ // move subsequent items - this often isn't necessary because subsequent
+ // moves will correct subsequent items. However, if there is a contiguous
+ // range not involving fallback which spans items, this will be needed
+ while (++pVI - mpVisualItems < mnItemCount)
+ {
+ pVI->mnXOffset += nDelta;
+ }
}
// -----------------------------------------------------------------------
@@ -2364,6 +2371,10 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
if( rVisualItem.IsEmpty() )
continue;
+ if (mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK)
+ {
+ nXPos = rVisualItem.mnXOffset;
+ }
// get glyph positions
// TODO: handle when rVisualItem's glyph range is only partially used
for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i )
@@ -2397,13 +2408,17 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
}
}
- // fixup unknown character positions to neighbor
- for( i = 0; i < nMaxIdx; ++i )
+ if (!(mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK))
{
- if( pCaretXArray[ i ] >= 0 )
- nXPos = pCaretXArray[ i ];
- else
- pCaretXArray[ i ] = nXPos;
+ nXPos = 0;
+ // fixup unknown character positions to neighbor
+ for( i = 0; i < nMaxIdx; ++i )
+ {
+ if( pCaretXArray[ i ] >= 0 )
+ nXPos = pCaretXArray[ i ];
+ else
+ pCaretXArray[ i ] = nXPos;
+ }
}
}
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 7314fd2b6164..f0ca1d68ef41 100644..100755
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -161,7 +161,7 @@ BOOL WinSalFrame::mbInReparent = FALSE;
// =======================================================================
static void UpdateFrameGeometry( HWND hWnd, WinSalFrame* pFrame );
-static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame );
+static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame, RECT* pParentRect = NULL );
static void ImplSaveFrameState( WinSalFrame* pFrame )
{
@@ -182,6 +182,25 @@ static void ImplSaveFrameState( WinSalFrame* pFrame )
if ( bVisible )
pFrame->mnShowState = SW_SHOWMAXIMIZED;
pFrame->mbRestoreMaximize = TRUE;
+
+ WINDOWPLACEMENT aPlacement;
+ aPlacement.length = sizeof(aPlacement);
+ if( GetWindowPlacement( pFrame->mhWnd, &aPlacement ) )
+ {
+ RECT aRect = aPlacement.rcNormalPosition;
+ RECT aRect2 = aRect;
+ AdjustWindowRectEx( &aRect2, GetWindowStyle( pFrame->mhWnd ),
+ FALSE, GetWindowExStyle( pFrame->mhWnd ) );
+ long nTopDeco = abs( aRect.top - aRect2.top );
+ long nLeftDeco = abs( aRect.left - aRect2.left );
+ long nBottomDeco = abs( aRect.bottom - aRect2.bottom );
+ long nRightDeco = abs( aRect.right - aRect2.right );
+
+ pFrame->maState.mnX = aRect.left + nLeftDeco;
+ pFrame->maState.mnY = aRect.top + nTopDeco;
+ pFrame->maState.mnWidth = aRect.right - aRect.left - nLeftDeco - nRightDeco;
+ pFrame->maState.mnHeight = aRect.bottom - aRect.top - nTopDeco - nBottomDeco;
+ }
}
else
{
@@ -1934,17 +1953,25 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
}
}
- // Wenn Fenster nicht minimiert/maximiert ist oder nicht optisch
- // umgesetzt werden muss, dann SetWindowPos() benutzen, da
- // SetWindowPlacement() die TaskBar mit einrechnet
+ // if a window is neither minimized nor maximized or need not be
+ // positioned visibly (that is in visible state), do not use
+ // SetWindowPlacement since it calculates including the TaskBar
if ( !IsIconic( mhWnd ) && !IsZoomed( mhWnd ) &&
(!bVisible || (aPlacement.showCmd == SW_RESTORE)) )
{
if( bUpdateHiddenFramePos )
{
+ RECT aStateRect;
+ aStateRect.left = nX;
+ aStateRect.top = nY;
+ aStateRect.right = nX+nWidth;
+ aStateRect.bottom = nY+nHeight;
// #96084 set a useful internal window size because
// the window will not be maximized (and the size updated) before show()
- SetMaximizedFrameGeometry( mhWnd, this );
+ SetMaximizedFrameGeometry( mhWnd, this, &aStateRect );
+ SetWindowPos( mhWnd, 0,
+ maGeometry.nX, maGeometry.nY, maGeometry.nWidth, maGeometry.nHeight,
+ SWP_NOZORDER | SWP_NOACTIVATE | nPosSize );
}
else
SetWindowPos( mhWnd, 0,
@@ -4197,23 +4224,27 @@ static void ImplHandlePaintMsg2( HWND hWnd, RECT* pRect )
// -----------------------------------------------------------------------
-static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame )
+static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame, RECT* pParentRect )
{
// calculate and set frame geometry of a maximized window - useful if the window is still hidden
// dualmonitor support:
// Get screensize of the monitor whith the mouse pointer
- POINT pt;
- GetCursorPos( &pt );
RECT aRectMouse;
- aRectMouse.left = pt.x;
- aRectMouse.top = pt.y;
- aRectMouse.right = pt.x+2;
- aRectMouse.bottom = pt.y+2;
+ if( ! pParentRect )
+ {
+ POINT pt;
+ GetCursorPos( &pt );
+ aRectMouse.left = pt.x;
+ aRectMouse.top = pt.y;
+ aRectMouse.right = pt.x+2;
+ aRectMouse.bottom = pt.y+2;
+ pParentRect = &aRectMouse;
+ }
RECT aRect;
- ImplSalGetWorkArea( hWnd, &aRect, &aRectMouse );
+ ImplSalGetWorkArea( hWnd, &aRect, pParentRect );
// a maximized window has no other borders than the caption
pFrame->maGeometry.nLeftDecoration = pFrame->maGeometry.nRightDecoration = pFrame->maGeometry.nBottomDecoration = 0;